0

Setting up a Full Disk Encryption on Ubuntu derived distro's is easy, because Ubuntu's installer simply provides access to all available partitions on all available disks from within the partitining part of the installer, this includes averything from /dev/mapper. The pre/post - setup parts can be done via a terminal.

This is sadly not the case for the majority of distro installers. Some, like Fedora, tries to provide automated features within the installer, sadly it does not work properly. Others are much more limited by not including anything from /dev/mappper and some not even allowing more than one disk to be used.

I tried installing Solus Linux to day, which turned out to be yet another distro with a limited partition setup. It only allows one disk to be used when selecting mount points manually and these partitions does not include /dev/mapper devices which in turn means no encrypted or LVM volumes.

So if I choose to use "/dev/sda", I can only use "/dev/sdaX" block files for mount point selection. If one of these is an DMC/LVM, the LV's is not included.

If I where to create a small additional partition on "sda" like "/dev/sdaY", is there a way to link that block device file to another device file in /dev/mapper? For example

/dev/sdaY -> /dev/mapper/lv-system

Kind of like "mount --bind" for folders. Or some other way to trick these limited installers into using a different device file?

1

Two approaches. First, you can try just ln -s /dev/mapper/lv-system /dev/sdaY. This may or may not fool the installer. If it doesn't, try the second one:

You can create another device node that points to the same mapped device. To do this, first do ls -l /dev/mapper/lv-system. You'll see that it's itself a symlink to /dev/dm-0 (but possibly a number other than 0). Now, do ls -l /dev/dm-0 (replacing the 0 with your number), and you'll get output like this:

brw-rw---- 1 root disk 253, 0 Mar 4 18:12 /dev/dm-0

The important parts of that are the b at the beginning and the 253, 0 in the middle. Run mknod /dev/sdaY b 253 0 (filling in what you got), and you'll have created a device node that points to the same mapped device as /dev/mapper/lv-system. This still doesn't perfectly replicate a hard drive, so there's a chance it will fail as well.

  • Yes this does not work. The installer is properly reading the partitioning table, which is why I wanted to link an existing device file (dummy partition) to another. That way it would be registered in the table and yet be redirected to another device. – Daniel B Mar 10 '18 at 7:41
  • What if you rm the existing device file, then follow these steps to make the new file have the same name? – Joseph Sible Mar 10 '18 at 14:32
  • Well it half worked. I could use the partition now in the installer, but it crashed for some reason during format. Properly because of mismatch in the information since some information is taken from the file system of the device, while other information is taken from /sys/block. F.eks the size said 10G (Original partition) while remaining space said 260G (Linked partition). But it seams to be the right path, so this has given me something to play around with. – Daniel B Mar 10 '18 at 20:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.