Filesystem(s) on luks on lvm not mounting despite /etc confs

Issues related to hardware problems
Post Reply
testcore
Posts: 15
Joined: 2013/12/18 07:11:01

Filesystem(s) on luks on lvm not mounting despite /etc confs

Post by testcore » 2015/02/06 07:44:16

Hiya CentOS board - I've just gotten around to moving to CentOS7, and used the opportunity to reconfigure my disk layout on my home server (think frankenstein desktop - but with known good h/w).

Installed COS7 to a brand new SSD, and am now repurposing the older drives for storage partitions. I have two 75GB HDDs that I figure will be perfect as PVs for encrypted volumes.

So I added both HDDs as PVs, created a VG and added the HDDs, and then created the necessary LVs. On top of one LV, I've created a LUKS device. On the LUKS device, I created a 0x83 partition, then an xfs filesystem. Then I added the necessary values to /etc/crypttab and /etc/fstab to mount the filesystem at boot (given the correct LUKS password).

Problem is that the filesystem does not auto-mount at boot given the correct LUKS password.

Through testing, I've discovered that everything that should happen at boot, happens, but that for whatever reason the xfs filesystem is not seen by the kernel. I observed this by running 'lsblk -f' after boot, and the xfs filesystem is not listed. Then, I run 'partprobe', followed by 'lsblk -f', and the xfs filesystem is visible. And if the xfs filesystem is listed in /etc/fstab, it does in fact auto-mount upon 'partprobe' completing.

Why isn't the OS seeing the xfs partition at boot time to mount it? Why does manually running 'partprobe' after boot "fix" the issue? Is this a timing issue - noting that {b/r}oot are on an SSD and the LUKS drive is on HDD?

TL;DR: It seems like the kernel finishes booting before a LUKS-on-LVM-on-HDDs xfs partition can identify itself to an SDD-based kernel... what to do?

User avatar
TrevorH
Forum Moderator
Posts: 29471
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Filesystem(s) on luks on lvm not mounting despite /etc c

Post by TrevorH » 2015/02/06 08:00:26

I am confused by "On the LUKS device, I created a 0x83 partition, then an xfs filesystem". That doesn't sound correct. You shouldn't have a partition on top of the encrypted device and if you have then that sounds like the source of your problem. It should be PV->VG->LV->LUKS->filesystem.
CentOS 6 will die in November 2020 - migrate sooner rather than later!
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 is dead, do not use it.
Full time Geek, part time moderator. Use the FAQ Luke

testcore
Posts: 15
Joined: 2013/12/18 07:11:01

Re: Filesystem(s) on luks on lvm not mounting despite /etc c

Post by testcore » 2015/02/06 09:17:00

That was exactly it.

Although, looking through my history, I did try to create the FS first after creating the LUKS device. For whatever lost reason, that had failed...

Post Reply

Return to “CentOS 7 - Hardware Support”