/etc/cryptab is precenting my Linux from boot
-
- Posts: 12
- Joined: 2014/07/21 15:01:48
/etc/cryptab is precenting my Linux from boot
Hey guys
I'm trying to encrypt a drive on my CentoOS7, this is in lab so far
I can encrypt the drive and mount it and it works fine. but as soon as I added into my /etc/crypttab and reboot the system, the server get stuck on the booting process.
below is what I'm adding to /etc/cryptab
safe /dev/sdb1 none
the process I'm following are:
modprobe md-crpt ---> to load the driver
also I'm making sure this module get stated during boot
by creating a dm-crypt.modules file in /etc/sysconfig/modules.d/
inside my file dm-crypt.modules I have
#!/bin/sh
exec /sbin/modprobe dm-crpt >/dev/null 2>&1
I'm also preparing the drive by using
dd if=/dev/urandom of=/dev/sdb1
cryptsetup luksFormat /dev/sdb1
crypsetup luksOpen /dev/sdb1 safe
mkfs -t ext4 /dev/mapper/safe
mkdir /safe
mount -t /dev/mapper/safe /safe
restorecon -r /safe
I'm able to verify this by using cryptsetup status
I'm trying to encrypt a drive on my CentoOS7, this is in lab so far
I can encrypt the drive and mount it and it works fine. but as soon as I added into my /etc/crypttab and reboot the system, the server get stuck on the booting process.
below is what I'm adding to /etc/cryptab
safe /dev/sdb1 none
the process I'm following are:
modprobe md-crpt ---> to load the driver
also I'm making sure this module get stated during boot
by creating a dm-crypt.modules file in /etc/sysconfig/modules.d/
inside my file dm-crypt.modules I have
#!/bin/sh
exec /sbin/modprobe dm-crpt >/dev/null 2>&1
I'm also preparing the drive by using
dd if=/dev/urandom of=/dev/sdb1
cryptsetup luksFormat /dev/sdb1
crypsetup luksOpen /dev/sdb1 safe
mkfs -t ext4 /dev/mapper/safe
mkdir /safe
mount -t /dev/mapper/safe /safe
restorecon -r /safe
I'm able to verify this by using cryptsetup status
Re: /etc/cryptab is precenting my Linux from boot
I've not used luks on el7 yet but you shouldn't need to do all those things. Once you've set the device up and made a filesystem on it and made sure it works then the only other things you need to alter are /etc/crypttab and /etc/fstab. You shouldn't need to tell it to load modules, all that should be be automatic.
If you set it up with a password field of "none" then you will be prompted for the passphrase during boot. I believe there is at least one bug report open about not receiving the prompt and the current solution i to remove 'rhgb quiet' from the kernel command line so that you can see the prompt when it appears. Do you think that might be your situation? I believe the current bug is specific to vmware and/or virtualbox installs but might be more widespread than that.
If you set it up with a password field of "none" then you will be prompted for the passphrase during boot. I believe there is at least one bug report open about not receiving the prompt and the current solution i to remove 'rhgb quiet' from the kernel command line so that you can see the prompt when it appears. Do you think that might be your situation? I believe the current bug is specific to vmware and/or virtualbox installs but might be more widespread than that.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke
-
- Posts: 12
- Joined: 2014/07/21 15:01:48
Re: /etc/cryptab is precenting my Linux from boot
I've made the file system and I'm also able to mount it and work with it.
but as soon as I add the statement to /etc/crpttab and /etc/fstab and reload the machine, the server worn't but, and I have to destroy the vm and try it again.
I will try the 'rhgb quiet' you suggested and see .
I'm not using GUI, not splash on my boot process, so I'm able to see the message as they kernel is being loaded. so I'm not sure if rhgb quit will work.
thank you for the reply.
will try that option and let you know.
but as soon as I add the statement to /etc/crpttab and /etc/fstab and reload the machine, the server worn't but, and I have to destroy the vm and try it again.
I will try the 'rhgb quiet' you suggested and see .
I'm not using GUI, not splash on my boot process, so I'm able to see the message as they kernel is being loaded. so I'm not sure if rhgb quit will work.
thank you for the reply.
will try that option and let you know.
-
- Posts: 12
- Joined: 2014/07/21 15:01:48
Re: /etc/cryptab is precenting my Linux from boot
tried this option and the boot is stuck on
[***] (1 of 2) A start job is running for dev-mapper-safe.device
[***] (1 of 2) A start job is running for cryptoghraphy setup for safe
[***] (1 of 2) A start job is running for dev-mapper-safe.device
[***] (1 of 2) A start job is running for cryptoghraphy setup for safe
Re: /etc/cryptab is precenting my Linux from boot
I just tried this with my CentOS7 VM and it worked as expected. I used UUIDs in /etc/crypttab and /etc/fstab instead of actual devices or mapper names.
Re: /etc/cryptab is precenting my Linux from boot
You've typo'd "crypttab" a few times here - did you do it on your system?below is what I'm adding to /etc/cryptab
safe /dev/sdb1 none
-
- Posts: 1
- Joined: 2014/07/31 09:37:24
Re: /etc/cryptab is precenting my Linux from boot
Here's the related bug: http://bugs.centos.org/view.php?id=7293 . Note, it doesn't happen with all hardware, and mostly (or especially) with virtual machines. I ran into this with vmware workstation 10.
-
- Posts: 12
- Joined: 2014/07/21 15:01:48
Re: /etc/cryptab is precenting my Linux from boot
it was indeed a bug, I tried this on a different environment and had no issues.
thank you all for the help
thank you all for the help