1

I have a fully encrypted Arch Linux system running BTRFS on top of LUKS with separate subvolumes for root, home and /var/log. Plus boot is a separate partition.

How can I install another distro (opensuse Tumbleweed) over this system, keeping the encrypted filesystem and existing partitions?

I'm not concerned about keeping any data, although the separate home partition which I will reuse should result in preserving the data (I assume).

I will need to first open the LUKS devices and then install the new system into the existing partitions. It sounds straightforward, but I'm not finding any existing instructions. The only similar question I found here has no answer:

Need to install new distro in LUKS disk

UPDATE: fixed typo and added output of lsblk and fstab. (NOTE that lsblk only lists the last mount for the BTRFS subvolumes contained in syssluks. Hopefully fstab will make the mounts clear.)

NAME        FSTYPE      LABEL     MOUNTPOINT
sda                                                                    
├─sda1      vfat        ESP       /boot                           
└─sda2      crypto_LUKS           
nvme0n1                                                                
├─nvme0n1p1 (not used)                          
├─nvme0n1p2 crypto_LUKS
│ └─sysluks btrfs       top_level /.snapshots
└─nvme0n1p3 swap                  [SWAP]

Inside the crypto_LUKS, we have BTRFS subvolumes that are mounted as follows:

UUID=abc       /       btrfs           rw,noatime,nodiratime,acl,ssd,space_cache,subvol=/@,subvol=@     0 0

# /dev/sdf1 LABEL=ESP
UUID=wxyz          /boot           vfat            noauto,rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro       0 2

# /dev/mapper/sysluks LABEL=top_level <-- @snapshots
UUID=abc       /.snapshots     btrfs           rw,relatime,ssd,space_cache,subvol=/@snapshots,subvol=@snapshots      0 0

# /dev/mapper/sysluks LABEL=top_level
UUID=abc       /home           btrfs           rw,noatime,nodiratime,acl,ssd,space_cache,subvol=/@home,subvol=@home 0 0

# /dev/mapper/sysluks LABEL=top_level
UUID=abc       /var/log        btrfs           rw,noatime,nodiratime,acl,ssd,space_cache,subvol=/@varlog,subvol=@varlog     0 0
  • How are you running LUKS on top of BTRFS? Are you using a loop device as your LUKS device, or did you mean BTRFS on top of LUKS? If you don't mind, with Arch booted post the output of lsblk. That should explain your exact set up. – Emmanuel Rosa May 14 '17 at 18:57
  • Thanks! updated my question with the info you requested. – MountainX May 14 '17 at 22:37
  • OK, so what you have is a LUKS container with BTRFS and your root and home mount points are BTRFS sub-volumes. You've got a couple of options. A more traditional approach would be to put LVM into LUKS and then put BTRFS on an LVM volume. That would allow you to create additional LVM volumes for other Linux distros. The downside is you'd have to reinstall (or backup/restore) Arch, and you'd be taking an additional disk IO performance hit due to the additional Linux device mapper for LVM. Another approach... – Emmanuel Rosa May 14 '17 at 23:40
  • ... is to install OpenSuse into additional sub-volumes on the same BTRFS filesystem. Perhaps a benefit is that you can leave Arch alone, you'd be able to share the same BTRFS storage pool with both distros, and the ego boost you'd get from completing an advanced Linux installation :) The downside is that I don't know of an installer which supports this method, which is why it's best for distros well suited to chroot installations; like Arch, Gentoo, NixOs, and even Debian. I've used this setup successfully to install Gentoo 32 bit, Gentoo 64 bit, and NixOS. – Emmanuel Rosa May 14 '17 at 23:45
  • I should mention the performance hit with LVM and LUKS is bad if your workload demands high IO throughput. For example, this is the setup I now have on my Mac Mini (NixOS) because I use LVM for KVM guests. So I gave up some performance to gain flexibility. So it's up to you. Which approach is best suitable for you? – Emmanuel Rosa May 14 '17 at 23:48

Your Answer

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

Browse other questions tagged or ask your own question.