I recently replaced cryptsetup with cryptsetup-luks-1.0.3-r2 (the only modification to config necessary was to change mount= to target=). The existing loopback files 'mounted' properly but on shutdown they could not be taken down, with the following message (from memory, so is not cut-and-paste accurate): ioctl: LOOP_CLA_FD. Device or resource busy. I upgraded my kernel to the latest 2.6.18-gentoo-r6 and updated the system to the latest packages in portage. Replacing cryptsetup-luks with cryptsetup-0.1-r3 fixed the problem. Encrypted swap went down ok. My /etc/conf.d/cryptfs (for cryptsetup-luks) was as follows: [begin /etc/conf.d/cryptfs] swap=crypt-swap source='/dev/sda7' # dm-crypt target='crypt-tmp' source='/dev/loop0' loop_file='/tmp.img' options='-d /dev/urandom' pre_mount='/sbin/mkreiserfs -f -f ${dev}' post_mount='chown root:root ${mount_point}; chmod 1777 ${mount_point}' # Loopback files target='crypt-bn' source='/dev/loop1' options='-c serpent -s 256' loop_file='/home/bn.img' target='crypt-steph' source='/dev/loop2' options='-c serpent -s 256' loop_file='/home/steph.img' [end] Reproducible: Always Steps to Reproduce: 1. Replace cryptsetup with cryptsetup-luks-1.0.3-r2 2. Change mount= to target= in /etc/conf.d/cryptfs. 3. Reboot. 4. Shutdown. Actual Results: dm-crypt loop devices could not be taken down, with the following message: ioctl: LOOP_CLA_FD. Device or resource busy. Expected Results: dm-crypt loop devices are taken down with no errors or warnings.
I just want to make clear that when I said "I upgraded my kernel to the latest 2.6.18-gentoo-r6 and updated the system to the latest packages in portage" I meant before I installed cryptsetup-luks.
Created attachment 123890 [details, diff] patch to remove "source" mappings
I missed the added target for loop... the conf needs an update.