losetup problems

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
Report Content as Inappropriate

losetup problems

Mister Dobalina
Hi everyone, have been having problems detaching
loop/cryptsetup/devmapper devices recently, wondering
if anyone can help.

I use an encrypted swapfile activated using the
following script:

losetup $SWAPLOOPDEVICE /var/swap.file
cryptsetup --key-file /dev/urandom --cipher aes create
mkswap /dev/mapper/swapfile
swapon /dev/mapper/swapfile

Deactivating the swap:

swapoff /dev/mapper/swapfile
cryptsetup remove swapfile

Recently I've been occaisionally getting

ioctl: LOOP_CLR_FD: Device or resource busy

after the losetup -d command, even though the swapoff
and cryptsetup remove commands succeed. Then on
shutdown, /var can't be unmounted and I'm worried
about filesystem corruption.

lsof and fuser don't show anything using either
/var/swap.file or the /dev/loop/X device.

I tried recompiling the util-linux package (it's a
year old) against the most recent glibc/kernel-headers
combination, but it craps out with a compile error.

Any help would be appreciated, thanks!

Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around

arch mailing list
[hidden email]