Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

My setup is currently raid1 + luks on each md partition and lvm on top to stripe between the arrays. There is only one volume group with one logical volume currently.

sdc                             8:32   0   1.8T  0 disk
└─sdc1                          8:33   0   1.8T  0 part
  └─md127                       9:127  0   1.8T  0 raid1
    └─data-crypt0 (dm-3)      252:3    0   1.8T  0 crypt
      └─data_raid-data (dm-5) 252:5    0   2.7T  0 lvm   /mnt/data
sdd                             8:48   0 931.5G  0 disk
└─sdd1                          8:49   0 931.5G  0 part
  └─md126                       9:126  0 931.4G  0 raid1
    └─data-crypt1 (dm-4)      252:4    0 931.4G  0 crypt
      └─data_raid-data (dm-5) 252:5    0   2.7T  0 lvm   /mnt/data

I'm able to startup the device via

cryptsetup luksOpen /dev/md/data:0 data-crypt0     # decrypt
cryptsetup luksOpen /dev/md/data:1 data-crypt1     # decrypt
vgchange -ay /dev/data_raid                        # turn on lvm
mount /dev/data_raid/data /mnt/data                # mount

Unfortunately I'm unable to go the opposite direction and turn the thing off.

umount /mnt/data            # ok
vgchange -an /dev/data_raid # ok
cryptsetup luksClose data-crypt0 # fail

For some reason I see the following, several times, and the device does not shut down.

device-mapper: remove ioctl on data-crypt0 failed: Device or resource busy

This is after a reboot and all I have done is the commands I've shown without ever using any of the data on the partition. I'd like some suggestions if anyone has something on either the setup or how to get it to shutdown.

share|improve this question

1 Answer 1

up vote 4 down vote accepted

I had a similar issue while installing Ubuntu 13.04. For some reason (possibly a bug), vgchange -a n does not remove the device mappings. As a result, the LVM physical volume (i.e. the LUKS container) is still considered in use, and can not be luksClose'd.

Check if you have the same issue using dmsetup ls. If it lists any of your data_raid Logical Volumes, and they persist even after vgchange -a n, you may remove them using dmsetup remove NAME.

Once all device mappings have been removed, you should be able to luksClose.

share|improve this answer
    
This works, despite being super annoying. =/ But thanks! –  Michael Merickel Jun 24 '13 at 1:42
    
In a similar setup on 14.04, vgchange -a n cleanly closes everything, and cryptsetup luksClose works. –  krlmlr Oct 23 at 8:25

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.