You are not logged in.
Pages: 1
Hi!
I have a LVM on LUKS on a RAID1 array I can't close
~ $ cryptsetup luksOpen /dev/md0 raid
~ $ cryptsetup luksClose /dev/mapper/raid
Command failed with code -5 (device already exists or device is busy).
Device /dev/mapper/raid is still in use.
Any ideas?
~ $ vgscan
Found volume group "vg_raid" using metadata type lvm2
~ $ lsblk -f
NAME FSTYPE LABEL UUID MOUNTPOINT
sdb
└─sdb1 linux_ computername:0
f3fb52fb-652a-a001-d15f-8312d2a5c63e
└─md0 crypto 2747c137-bc5f-4c92-95ed-3c4e9b56cf3b
└─raid
LVM2_m LcWNL6-Dgv1-W4FO-Ujvf-4gaI-KpRE-Naj49g
├─vg_raid-lv00_personal
│ ext4 3d1b71ca-4666-4b63-8c8b-9465ffb94d6a
└─vg_raid-lv01_public
ext4 d0971bdd-07ff-499d-9582-55093d2c88ba
sdc
└─sdc1 linux_ computername:0
f3fb52fb-652a-a001-d15f-8312d2a5c63e
└─md0 crypto 2747c137-bc5f-4c92-95ed-3c4e9b56cf3b
└─raid
LVM2_m LcWNL6-Dgv1-W4FO-Ujvf-4gaI-KpRE-Naj49g
├─vg_raid-lv00_personal
│ ext4 3d1b71ca-4666-4b63-8c8b-9465ffb94d6a
└─vg_raid-lv01_public
ext4 d0971bdd-07ff-499d-9582-55093d2c88ba
Last edited by smoneck (2018-02-08 13:04:41)
Offline
So - can you close it after a `vgchange -a n`?
Why is LVM enabled in the first place? If you haven't done it yourself, well, with udev unfortunately there are magic events happening in the background. They activate and sometimes even mount stuff without you knowing. So raid may magically assemble itself, lvm activate itself, filesystems mount themselves, ...
It's possible to disable some of these - but other programs may depend on them to work.
For example I don't like /lib/udev/rules.d/64-md-raid-assembly.rules so I disabled them by creating empty file /etc/udev/rules.d/64-md-raid-assembly.rules - but doing such things isn't recommended unless you know what these rules do and what might expect them to work and break if they don't.
Offline
So - can you close it after a `vgchange -a n`?
All right!
vgchange -a n vg_raid
did it! I knew there was some magical command I couldn't remember (and couldn't dig up).
Why is LVM enabled in the first place?
Yes, this must be udev-magic. Thanks for the tip but I just use vgchange then. I spend the last full three days fiddling around with fiddly software that tends to break in unforeseen circumstances -- Das udev-Fass lass ich zu.
Offline
Pages: 1