Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
No pvscan results in working lvm on luks setup
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
b52_
n00b
n00b


Joined: 14 Nov 2003
Posts: 50
Location: Germany

PostPosted: Fri Nov 20, 2015 12:01 am    Post subject: No pvscan results in working lvm on luks setup Reply with quote

Hi folks,

I am happy to be back to gentoo after all this time :) I setup a gentoo with "lvm on luks" full disk encryption.
The system is able to bootload, decrypt, mount and boot up into a fully running state, but pvscan is not able to see/find my PV after bootup. These are the layers:
Code:
sda2 -> /boot
sda3 -> luks -> lvm -> (/, swap)

I compiled all needed modules into the kernel 4.1.12 and created a initramfs to interact ( luks passphrase, lvmscan, mount root)
Code:
genkernel --no-ramdisk-modules --lvm --luks --install initramfs

And added these kernelparameters to grub.cfg
Code:
 linux   /vmlinuz-4.1.12-gentoo root=/dev/mapper/idefix-root ro crypt_root=/dev/sda3 dolvm rootfstype=ext4 real_root=/dev/mapper/idefix-root resume=swap:/dev/mapper/idefix-swap
 initrd  /initramfs-genkernel-x86_64-4.1.12-gentoo

The system boots fully up with all partitions mounted, but pvscan shows:
Code:
No matching physical volumes found

The PV is still there, it is just not recognised
Code:
# ls -al /dev/mapper/root
brw------- 1 root root 253, 0 19. Nov 23:10 /dev/mapper/root
# file -s /dev/mapper/root
/dev/mapper/root: LVM2 PV (Linux Logical Volume Manager), UUID: LAnlkb-TC6g-izXg-KS1g-nR4k-SaKw-5iUP9r, size: 499833135104

Thus after some research I started to play with filter and type in lvm.conf
Code:
    filter = [ "r|/dev/nbd.*|", "a|/dev/mapper/root|", "a/.*/" ]
    types = [ "device-mapper", 253 ]

Code:
 # grep device-mapper /proc/devices
253 device-mapper

But no luck with this..
Code:
idefix ~ # pvscan -vvvv
#lvmcmdline.c:1411         DEGRADED MODE. Incomplete RAID LVs will be processed.
#libdm-config.c:997       Setting activation/monitoring to 1
#lvmcmdline.c:1417         Processing: pvscan -vvvv
#lvmcmdline.c:1420         O_DIRECT will be used
#libdm-config.c:933       Setting global/locking_type to 1
#libdm-config.c:997       Setting global/wait_for_locks to 1
#locking/locking.c:128       File-based locking selected.
#libdm-config.c:997       Setting global/prioritise_write_locks to 1
#libdm-config.c:902       Setting global/locking_dir to /run/lock/lvm
#misc/lvm-flock.c:200       Locking /run/lock/lvm/P_global WB
#misc/lvm-flock.c:101         _do_flock /run/lock/lvm/P_global:aux WB
#misc/lvm-flock.c:101         _do_flock /run/lock/lvm/P_global WB
#misc/lvm-flock.c:48         _undo_flock /run/lock/lvm/P_global:aux
#filters/filter-persistent.c:51     Wiping cache of LVM-capable devices
#device/dev-cache.c:338         /dev/sda: Added to device cache
#device/dev-cache.c:335         /dev/disk/by-id/ata-ST500LM000-SSHD-8GB_W7653B8W: Aliased to /dev/sda in device cache
#device/dev-cache.c:335         /dev/disk/by-id/wwn-0x5000c5008a5bbdfc: Aliased to /dev/sda in device cache
#device/dev-cache.c:338         /dev/sda1: Added to device cache
#device/dev-cache.c:335         /dev/disk/by-id/ata-ST500LM000-SSHD-8GB_W7653B8W-part1: Aliased to /dev/sda1 in device cache
#device/dev-cache.c:335         /dev/disk/by-id/wwn-0x5000c5008a5bbdfc-part1: Aliased to /dev/sda1 in device cache
#device/dev-cache.c:335         /dev/disk/by-partlabel/grub: Aliased to /dev/sda1 in device cache
#device/dev-cache.c:335         /dev/disk/by-partuuid/b6cb856e-baff-4d84-bd21-e395a15f01a1: Aliased to /dev/sda1 in device cache
#device/dev-cache.c:338         /dev/sda2: Added to device cache
#device/dev-cache.c:335         /dev/disk/by-id/ata-ST500LM000-SSHD-8GB_W7653B8W-part2: Aliased to /dev/sda2 in device cache
#device/dev-cache.c:335         /dev/disk/by-id/wwn-0x5000c5008a5bbdfc-part2: Aliased to /dev/sda2 in device cache
#device/dev-cache.c:335         /dev/disk/by-partlabel/boot: Aliased to /dev/sda2 in device cache
#device/dev-cache.c:335         /dev/disk/by-partuuid/24ef536d-a0df-425c-a8fb-20a3305429ac: Aliased to /dev/sda2 in device cache
#device/dev-cache.c:335         /dev/disk/by-uuid/422ce14c-057b-48e8-8855-a7fb04ef3fc2: Aliased to /dev/sda2 in device cache
#device/dev-cache.c:338         /dev/sda3: Added to device cache
#device/dev-cache.c:335         /dev/disk/by-id/ata-ST500LM000-SSHD-8GB_W7653B8W-part3: Aliased to /dev/sda3 in device cache
#device/dev-cache.c:335         /dev/disk/by-id/wwn-0x5000c5008a5bbdfc-part3: Aliased to /dev/sda3 in device cache
#device/dev-cache.c:335         /dev/disk/by-partlabel/crypted: Aliased to /dev/sda3 in device cache
#device/dev-cache.c:335         /dev/disk/by-partuuid/9d9df5bd-8dc1-40f7-be8e-cfdd6429973b: Aliased to /dev/sda3 in device cache
#device/dev-cache.c:335         /dev/disk/by-uuid/79554a33-35e8-41ca-bfe9-379858065155: Aliased to /dev/sda3 in device cache
#device/dev-cache.c:338         /dev/loop0: Added to device cache
#device/dev-cache.c:338         /dev/loop1: Added to device cache
#device/dev-cache.c:338         /dev/loop2: Added to device cache
#device/dev-cache.c:338         /dev/loop3: Added to device cache
#device/dev-cache.c:338         /dev/loop4: Added to device cache
#device/dev-cache.c:338         /dev/loop5: Added to device cache
#device/dev-cache.c:338         /dev/loop6: Added to device cache
#device/dev-cache.c:338         /dev/loop7: Added to device cache
#device/dev-cache.c:338         /dev/ram0: Added to device cache
#device/dev-cache.c:338         /dev/ram1: Added to device cache
#device/dev-cache.c:338         /dev/ram10: Added to device cache
#device/dev-cache.c:338         /dev/ram11: Added to device cache
#device/dev-cache.c:338         /dev/ram12: Added to device cache
#device/dev-cache.c:338         /dev/ram13: Added to device cache
#device/dev-cache.c:338         /dev/ram14: Added to device cache
#device/dev-cache.c:338         /dev/ram15: Added to device cache
#device/dev-cache.c:338         /dev/ram2: Added to device cache
#device/dev-cache.c:338         /dev/ram3: Added to device cache
#device/dev-cache.c:338         /dev/ram4: Added to device cache
#device/dev-cache.c:338         /dev/ram5: Added to device cache
#device/dev-cache.c:338         /dev/ram6: Added to device cache
#device/dev-cache.c:338         /dev/ram7: Added to device cache
#device/dev-cache.c:338         /dev/ram8: Added to device cache
#device/dev-cache.c:338         /dev/ram9: Added to device cache
#device/dev-cache.c:606       /dev/dm-0: stat failed: No such file or directory
#device/dev-cache.c:338         /dev/dm-1: Added to device cache
#device/dev-cache.c:335         /dev/root: Aliased to /dev/dm-1 in device cache (preferred name)
#device/dev-cache.c:338         /dev/dm-2: Added to device cache
#device/dev-cache.c:338         /dev/dm-3: Added to device cache
#device/dev-cache.c:338         /dev/dm-4: Added to device cache
#device/dev-cache.c:338         /dev/dm-5: Added to device cache
#device/dev-cache.c:338         /dev/dm-6: Added to device cache
#device/dev-cache.c:574         /dev: Failed to insert devices from udev-managed directory to device cache fully
#cache/lvmcache.c:1661     Wiping internal VG cache
#cache/lvmcache.c:450         Metadata cache has no info for vgname: "#orphans_pool"
#cache/lvmcache.c:450         Metadata cache has no info for vgname: "#orphans_pool"
#cache/lvmcache.c:1366         lvmcache: initialised VG #orphans_pool
#cache/lvmcache.c:450         Metadata cache has no info for vgname: "#orphans_lvm2"
#cache/lvmcache.c:450         Metadata cache has no info for vgname: "#orphans_lvm2"
#cache/lvmcache.c:1366         lvmcache: initialised VG #orphans_lvm2
#cache/lvmetad.c:653         Asking lvmetad for complete list of known VGs
#libdm-config.c:902       Setting response to OK
#libdm-config.c:902       Setting response to OK
#pvscan.c:380     Walking through all physical volumes
#cache/lvmetad.c:626         Asking lvmetad for complete list of known PVs
#libdm-config.c:902       Setting response to OK
#libdm-config.c:902       Setting response to OK
#pvscan.c:438   No matching physical volumes found
#misc/lvm-flock.c:71       Unlocking /run/lock/lvm/P_global
#misc/lvm-flock.c:48         _undo_flock /run/lock/lvm/P_global
#lvmcmdline.c:1478         Completed: pvscan -vvvv

Any Ideas how to get pvscan to recognise /dev/mapper/root? I guess this device is created by initramfs. Maybe it has something todo with the dm-0 stat error above..

Thank you,
b52
_________________
May the source be with you!
Back to top
View user's profile Send private message
b52_
n00b
n00b


Joined: 14 Nov 2003
Posts: 50
Location: Germany

PostPosted: Fri Nov 20, 2015 11:00 pm    Post subject: Reply with quote

Interesting, after I compiled "AHCI SATA" as a module and created a new initramfs with genkernel my lvm volume is recognised again 8O All other kernel options I need to boot this luks+lvm system are still compiled into the kernel.. pvdisplay and vgdisplay work again.
BTW: I use genkernel only for the initramfs, the kernel is build manually.

In order to prove I reverted it. I compiled AHCI into the kernel, build the initramfs without modules and pvdisplay didn't show up anything?! Looks like bug.

Any idea how to debug this?

Thanks,
b52
_________________
May the source be with you!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum