UUID in /etc/fstab for luks partition
hey,
I'm using CentOS and I'm banging my head on the wall as to how to get the luks partition to mount on boot while using the UUID of the device. It is working with using the /dev/mapper/cryptPart. here is /etc/fstab right now Code:
# Code:
# Code:
cryptPart /dev/vda4 Code:
cryptPart UUID=713450fb-0c30-4ff6-a3a7-e88d4638c621 Code:
luks-713450fb-0c30-4ff6-a3a7-e88d4638c621 UUID=713450fb-0c30-4ff6-a3a7-e88d4638c621 Code:
fsck.ext4: Device or resource busy while trying to open /dev/vda4 Code:
UUID=713450fb-0c30-4ff6-a3a7-e88d4638c621 |
bump
|
I do not have experience with luks, but my wild guess would be to try the following entry in fstab...
Code:
UUID=luks-713450fb-0c30-4ff6-a3a7-e88d4638c621 /cryptDir ext4 defaults 1 2 |
You still need /dev/mapper/ in your fstab.
What happens when you try: /etc/fstab Quote:
Quote:
|
michaelk is on to something here. I would do it his way.
In addition to avoid being prompted for passphrase on boot I would use a key file as a slot cd /root dd if=/dev/urandom of=.keyfile bs=1024 count=4 chmod 400 .keyfile chattr +i .keyfile (Makes the file immutable to prevent accidential deletion) cryptsetup luksAddKey /dev/vda4 /root/.keyfile /etc/crypttab cryptPart UUID=713450fb-0c30-4ff6-a3a7-e88d4638c621 /root/.keyfile luks |
VDP76- tried what you suggested and it doesn't work for me
michaelk- i tried what you suggested and it works. However, the reason I'm trying to get this to work is for the RHCSA exam I'm taking on Monday this is about the only thing i don't know how to do on their list of Exam objectives Quote:
as you can see from my /etc/fstab everything else is using the UUID, do you think I'll be fine or am i overthinking this? |
You will be fine. You also need /dev/mapper for mounting logical volumes. Have you tried LVM yet?
|
Apologies for posting on a old thread but I was stuck on this issue studying for the RHCSA. I tried everything and know that the luks was working as I could mount it manually but not through /etc/fstab. I found that my fsck selection was too low, which I think caused some issues checking the mount before checking the passphrase.
All I did to this fix this was change the last /etc/fstab setting from 4 to 2. Below is the current setting which works, but when I had the fsck setting to 4 (the last column), I got the prompt to enter the passphrase, but right after that it reverts to maintenance mode. Code:
UUID=83a523b1-71b5-4e59-926e-126086d47a9b / ext4 defaults 1 1 Code:
#mount -o remount,rw / Thanks, Rob |
All times are GMT -5. The time now is 01:34 AM. |