Posts: 3
Joined: Thu Mar 08, 2018 10:10 am

Dual-boot and encrypt

Thu Mar 08, 2018 10:16 am

Is there a way to get Solus working on a laptop with dual boot and disk encryption?

Both systems on the same disk, it's small laptop :)

I tried manually creating LUKS but then installer doesn't recognize it, another option is FDE which would destroy my second/first OS ("kinda" breaks my dual boot).

Even encrypting only UserHome would suffice for my needs.


Posts: 6
Joined: Sun Feb 25, 2018 10:37 pm

Re: Dual-boot and encrypt

Thu Mar 08, 2018 6:15 pm

This is not comprehensive how to but instead I'm trying to remember all the steps & I do expect own knowledge & researching if something is off etc..

Use this at your own risk, this is what I did with having 1HDD | 4 partitions | W7 truecrypt + Solus on LVM-luks | mbr scheme |using windows boot loader.
And I first tried this with VM's, it's possible that I forgot something so I'd advice you to test this in VM's first too!

1 primary partition ~100MB windows system partition
2 primary partition C: for windblows
3 primary partion for /boot ~2GB fat32..yeah I know lol..(HP laptop and there is need for FAT32 partition for uefi tools and I didn't have inspiration to decrypt C: to affect partitioning scheme as truecrypt/windows mbr cannot be affected when encrypted!
4 primary partition for luks-lvm

So if you have windows encrypted, you might have "unmodifiable" mbr at present so I suggest you decrypt partitions first and then create the space and partitions needed, either extended or primary and atleast 2 of them, 1 for boot & 1 for luks-lvm.

In the following example I will be using partitions /dev/sda3 for boot and /dev/sda4 for lvm-luks, windows stuff is on sda1 & sda2

1. BACKUP everything you can't loose!
2. Install Solus on another hdd, I used esata stick, but you might be able to install it on usb device (like usb 16GB stick I haven't tested, Solus needs 10GB minimal) or another hdd. You might also be able to attach another hdd on laptop's optical slot or temporarily install what ever hdd you have laying around on primary slot and afterwards mount this hdd via usb adapter or something. Use you own creativity on this step and if !
3. Use LVM+Luks settings with whole disk selected as there is not another option, install grub on the right device ie. /dev/sdb if you are sure what you are doing and didn't unattach /dev/sda containing C: which you can't loose and didn't even backup!
4. confirm that installed solus boots ok from usb stick or where you installed it
5. boot from solus live disk
6. create + format /dev/sda3 to ext2 mkfs.ext2
7. luksformat /dev/sda4 & luksopen /dev/sda4 cryptoroot & pvcreate /dev/mapper/cryptoroot
8. create vgroot + lvm's for atleast swap + root
9. format swap mkswap + root mkfs.ext4
10. luksopen /dev/sdb2 oldcryptoroot (the earlier installed encrypted solus)
11. mkdir -p /mnt/oldroot ; mkdir -p /mnt/root
12. mount /dev/mapper/oldcryptoroot to /mnt/oldroot, /dev/sdb1 to /mnt/oldroot/boot, /dev/mapper/cryptoroot to /mnt/root and /dev/sda3 to /mnt/root/boot
13 cp -a /mnt/oldroot /mnt/root && cp -a /mnt/oldroot/boot /mnt/root/boot
14 mount --bind /dev /mnt/root/dev; mount --bind /proc /mnt/root/proc; mount --bind /sys /mnt/root/sys
15 chroot /mnt/root
16 with blkid check for uuid's and fix following files of uuid's & mountpoins
/etc/fstab <- mountpoints
/etc/grub.d/10_com.solus-project <- remember resume UUID for swap!
/etc/kernel/cmdline.d/10_resume.conf <- again swap
17. mv /boot/grub/grub.cfg /boot/grub/grub.cfg.old && grub-mkconfig -o /boot/grub/grub.cfg
18. grub-install /dev/sda3 -f <- have to force because partition
19. mkinitrd /boot/initramfs-4.15.7-60.current.img 4.15.7-60.current
20. exit & umounts
21. mkdir /mnt/cdrive; mount /dev/sda2 /mnt/cdrive
22. dd if=/dev/sda3 of=/mnt/cdrive/linux.bin bs=512 count=1 <- because using windows bootloader in this example we need to copy grub to windows
23. shutdown & unattach usb media were you installed solus first time and boot from hdd fingers crossed and go to windows, if your installation boots to linux then you have wrong partition active fdisk /dev/sda and make partition 2 active and 3 not and reboot
24. when in windows use guide from archwiki to create windows boot option for linux:

bcdedit /create /d "Linux" /application BOOTSECTOR

BCDEdit will return a UUID for this entry that I will refer to as {ID} in the remaining steps. You will need to replace {ID} by the actual returned identifier. An example of {ID} is {d7294d4e-9837-11de-99ac-f3f3a79e3e93}.

bcdedit /set {ID} device partition=c:
bcdedit /set {ID} path \linux.bin
bcdedit /displayorder {ID} /addlast
bcdedit /timeout 5

If your lvm luks boot is slow after giving the key look for sudo journalctl -b there might be errors like I had of old swap/resume uuid missing and I have hopefully got the old swap uuid away from all the correct config files!

Posts: 3
Joined: Thu Mar 08, 2018 10:10 am

Re: Dual-boot and encrypt

Thu Mar 08, 2018 8:56 pm

wow, ingenuity in this post :)

Anyway, I have to do this on MacBook PRO so it has to work with EFI (I need OSx for occasional login (company policy)).

Anyway thanks a lot for the idea, will post my approach for macbooks when I get it into working stage.

I'm planning more simpler approach (move home to encrypted partition), but now I might go further (need to evaluate is it worth the time).

Posts: 6
Joined: Sun Feb 25, 2018 10:37 pm

Re: Dual-boot and encrypt

Thu Mar 08, 2018 9:51 pm

Yep, home encyption shouldn't be a big deal. Whatever linux guide should give you a way to achieve this. Just install normally and leave space for /home and afterwards create luks partition on free space and copy home there and make mountpoint in fstab. I dunno if you need to enable some dmcrypt modules for home as in my example it was first installed in mode where surely all dmcrypt related stuff is enabled.
FDE shouldn't be any harder with efi just a little different process with boot related stuff. With the caveat that I have no experience with macs.

Yeah there was a lot of how to questions regarding different luks & dualboot needs, I came up with when searching info about this. I was about to make some guide somewhere when I got it working, but been busy and saw your post and was like, okay here goes :D!

Return to “Installation”