You are not logged in.

#1 2017-08-21 17:21:55

Markus.N2
Member
From: Germany
Registered: 2013-08-22
Posts: 99

[Solved] After close/reopen cryptdev, LVM can't find vol til reboot

Hi,

I have a big mdraid, with a LUKS cryptdevice on top of it and one LVM physical volume on top of the cryptdevice. When I need to stop the mdraid, I can not use the volume group until reboot. The other volume group you'll see in the following code is on my SSD. For writing this post, I omitted stopping and starting the mdraid, as the problem also occurs witout doing that. I also tested omitting the luksClose / luksOpen, but then it did not occur. And I normally don't do a pvscan after every command smile

But here's what I just did a few minutes ago for writing this post and re-testing after today's upgrades:

root@ArchLinux:~# pvscan
  PV /dev/mapper/bigraidlvm   VG BigRaidGroup    lvm2 [14,55 TiB / 0    free]
  PV /dev/mapper/ssdlvm       VG SystemGroup     lvm2 [472,93 GiB / 152,93 GiB free]
  Total: 2 [<15,02 TiB] / in use: 2 [<15,02 TiB] / in no VG: 0 [0   ]
root@ArchLinux:~# umount all filesystems on the raid
root@ArchLinux:~# vgchange -a n BigRaidGroup
  0 logical volume(s) in volume group "BigRaidGroup" now active
root@ArchLinux:~# pvscan
  PV /dev/mapper/bigraidlvm   VG BigRaidGroup    lvm2 [14,55 TiB / 0    free]
  PV /dev/mapper/ssdlvm       VG SystemGroup     lvm2 [472,93 GiB / 152,93 GiB free]
  Total: 2 [<15,02 TiB] / in use: 2 [<15,02 TiB] / in no VG: 0 [0   ]
root@ArchLinux:~# cryptsetup luksClose bigraidlvm
root@ArchLinux:~# pvscan
  PV /dev/mapper/ssdlvm   VG SystemGroup     lvm2 [472,93 GiB / 152,93 GiB free]
  Total: 1 [472,93 GiB] / in use: 1 [472,93 GiB] / in no VG: 0 [0   ]

Up to now, everything is as expected. But after reopening the cryptdevice, pvscan fails to find the PV, although the cryptdevice itself exists.

root@ArchLinux:~# cryptsetup luksOpen --key-file=/path/to/my/keyfile /dev/md0p1 bigraidlvm
root@ArchLinux:~# ls -la /dev/mapper/bigraidlvm
  lrwxrwxrwx 1 root root 7 21. Aug 18:39 /dev/mapper/bigraidlvm -> ../dm-6
root@ArchLinux:~# pvscan
  PV /dev/mapper/ssdlvm   VG SystemGroup     lvm2 [472,93 GiB / 152,93 GiB free]
  Total: 1 [472,93 GiB] / in use: 1 [472,93 GiB] / in no VG: 0 [0   ]

Up to a few weeks ago, the described procedure worked well. After the luksOpen command, everything was found automatically. Even all of my filesystems were mounted automatically.

I suspect the problem being caused by this upgrade (from pacman.log)

[2017-08-02 19:21] [ALPM] upgraded lvm2 (2.02.172-2 -> 2.02.173-1)

Well ... as you may guess, my heart nearly stopped when the issue occurred the first time. And I was heavily relieved when the reboot helped.

Thanks and Regards,
Markus

Last edited by Markus.N2 (2017-08-21 17:22:13)

Offline

#2 2017-09-22 19:16:29

Markus.N2
Member
From: Germany
Registered: 2013-08-22
Posts: 99

Re: [Solved] After close/reopen cryptdev, LVM can't find vol til reboot

Tested again after today's lvm update ... unfortunately no success.

Does anybody know a tool for examining the lvm header of a device ?

I'm still suspecting lvm to be the culprit, but of course I can not be 100% sure. So I would like to chevk the lvm header of my cryptdevice.

Offline

#3 2017-09-22 20:34:24

loqs
Member
Registered: 2014-03-06
Posts: 17,321

Re: [Solved] After close/reopen cryptdev, LVM can't find vol til reboot

Markus.N2 wrote:

I suspect the problem being caused by this upgrade (from pacman.log)

[2017-08-02 19:21] [ALPM] upgraded lvm2 (2.02.172-2 -> 2.02.173-1)

Did you test this hypothesis by downgrading lvm2 to 2.02.172-2 and testing if the issue persisted?

Offline

#4 2017-10-13 23:47:39

Markus.N2
Member
From: Germany
Registered: 2013-08-22
Posts: 99

Re: [Solved] After close/reopen cryptdev, LVM can't find vol til reboot

Solved with today's update.

I verified it by closing / reopening the cryptdevice three times in a row and LVM found the volume every time.

Last edited by Markus.N2 (2017-10-13 23:50:47)

Offline

#5 2017-10-13 23:50:16

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: [Solved] After close/reopen cryptdev, LVM can't find vol til reboot

Please remember to mark your thread as [Solved] by editing your first post and prepending it to the title.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#6 2017-10-13 23:53:32

Markus.N2
Member
From: Germany
Registered: 2013-08-22
Posts: 99

Re: [Solved] After close/reopen cryptdev, LVM can't find vol til reboot

I would like to ... but the title is already (almost) at the maximum allowed length.
So if I prepend [Solved], I would need do remove another word. And I don't know which one I can remove without making the title less descriptive.

Last edited by Markus.N2 (2017-10-13 23:58:32)

Offline

#7 2017-10-13 23:58:16

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: [Solved] After close/reopen cryptdev, LVM can't find vol til reboot

Solved smile


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

Board footer

Powered by FluxBB