LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   Installing Slackware 14 with LVM, encryption and drive labels. (http://www.linuxquestions.org/questions/slackware-14/installing-slackware-14-with-lvm-encryption-and-drive-labels-4175432458/)

jjthomas 10-16-2012 07:03 AM

Installing Slackware 14 with LVM, encryption and drive labels.
 
I got the LVM with Encryption down, but I need to add drive labels. My BIOS has changed the order of the drives and broke everything. How do I install initrd and lilo using drive labels?

TIA

-JJ

GazL 10-16-2012 07:38 AM

You'll need to use UUIDs. LUKS containers don't support labels.

Unfortunately the stock slackware initrd doesn't support their use to identify luks encrypted devices to unlock, but I took part in a thread a while back that came up with some patches. Have a look at this post and the thread that it is in. It was a while ago though and may or may not apply cleanly.

http://www.linuxquestions.org/questi...4/#post4634484

jjthomas 10-19-2012 09:38 AM

I was not able to get my head around the process and went a different route. However, the thread did give me the final piece to the puzzle. Thank you.

I went with grub because it allows the use of UUID labels. I had to skip using an encrypted LVM for my root partition.

Here is my fstab:
Code:

# /dev/sda3        swap            swap        defaults        0  0
# /dev/sda2        /                ext4        defaults        1  1
# /dev/sda1        /boot            ext2        defaults        1  2

UUID=69b82f90-49d4-4711-95f5-9907a3018381      swap            swap    defaults        0 0
UUID=4331ae31-d4e9-4ab3-9161-4f39bfc45f94      /              ext4    defaults        1 1
UUID=6a34e669-78f1-44d3-ad4f-e93421c4f409      /boot          ext2    defaults        1 2

/dev/mapper/SecStor                            /mnt/SecStor    ext4    defaults        1 2


#/dev/cdrom      /mnt/cdrom      auto        noauto,owner,ro,comment=x-gvfs-show 0  0
/dev/fd0        /mnt/floppy      auto        noauto,owner    0  0
devpts          /dev/pts        devpts      gid=5,mode=620  0  0
proc            /proc            proc        defaults        0  0
tmpfs            /dev/shm        tmpfs      defaults        0  0

and my crypttab:
Code:

SecStor /dev/disk/by-uuid/a45bf7a4-679d-4a27-94f5-0b96cc87dd1d
and to mount by hand (as root):
Code:

cryptsetup luksOpen /dev/disk/by-uuid/a45bf7a4-679d-4a27-94f5-0b96cc87dd1d SecStor
mount /mnt/SecStor

My setup:
Code:

Disk /dev/sda: 9105 MB, 9105018880 bytes
/dev/sda1  *        2048      526335      262144  83  Linux
/dev/sda2          526336    17303551    8388608  83  Linux
/dev/sda3        17303552    17783239      239844  82  Linux swap
Disk /dev/sdb: 500.1 GB, 500107862016 bytes
/dev/sdb1            2048  976773167  488385560  83  Linux
Disk /dev/sdc: 1000.2 GB, 1000204886016 bytes
/dev/sdc1            2048  1953525167  976761560  83  Linux
Disk /dev/sdd: 250.1 GB, 250059350016 bytes
/dev/sdd1            2048  488397167  244197560  83  Linux
Disk /dev/sde: 251.0 GB, 250999111168 bytes
/dev/sde1  *        2048    1050623      524288  83  Linux
/dev/sde2        1050624  490231807  244590592  83  Linux
Disk /dev/mapper/SecStor: 1000.2 GB, 1000201740288 bytes

I disconnected the 500G drive (which is failing)
Code:

Disk /dev/sda: 9105 MB, 9105018880 bytes
/dev/sda1  *        2048      526335      262144  83  Linux
/dev/sda2          526336    17303551    8388608  83  Linux
/dev/sda3        17303552    17783239      239844  82  Linux swap
Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes
/dev/sdb1            2048  1953525167  976761560  83  Linux
Disk /dev/sdc: 250.1 GB, 250059350016 bytes
/dev/sdc1            2048  488397167  244197560  83  Linux
Disk /dev/sdd: 251.0 GB, 250999111168 bytes
/dev/sdd1  *        2048    1050623      524288  83  Linux
/dev/sdd2        1050624  490231807  244590592  83  Linux
Disk /dev/mapper/SecStor: 1000.2 GB, 1000201740288 bytes

And when I reboot, the system is able to find and mount the SecStor encrypted drive. Where as before, the boot would fail due to the order of the drives being changed.

When I started the installation I wrote LILO to a floppy disk. Once I got everything up and running I installed grub from slackbuilds.org, configured and wrote it to the SCSI drive (/dev/sda).

I reordered the drives in BIOS but when I rebooted my SCSI drive remained as /dev/sda. It seems that before I changed the order it would become /dev/sde and the system would not boot. Since everything is working, I going with "If it works don't fool with it!"

Slack rocks! ...and so does slackbuilds.org!

-JJ

GazL 10-19-2012 12:01 PM

Quote:

Originally Posted by jjthomas (Post 4809933)
I had to skip using an encrypted LVM for my root partition.

Yes, that was exactly what that other thread was attempting to address. If you're not using an encrypted root then things get much easier as you can use crypttab with UUIDs, LABELs or even LVM LV device names, as you've already discovered.

Anyway, glad you've found a solution. :)

jjthomas 10-30-2012 12:40 AM

After seeing the reports on the ext4 bug, I rebuilt my systems and returned to jfs. I was able to get this solved my determining the drive order after booting. It still went to the single user prompt since I could not open my encrypted root directory. But I was able to see where Slackware put the drive containing my root directory. Then I had to reboot from the installation CD-ROM, rerun initrd pointing to the booting drive, update lilo.conf to install lilo on the booting drive,

run lilo to install lilo <-- critical

and everything works. I still mount the rest of my drives by UUID.

It seems the difficulty is to find where the root partition lies once Slackware is installed. Running an encrypted /root makes it a little more difficult, but once I figured out how the pieces looked, the puzzle came together rather nicely.

I am marking this solved.

-JJ


All times are GMT -5. The time now is 05:03 PM.