0

During installation of Ubuntu 16.04 LTS Server I could choose manual partitioning and create a /-partition using BTRFS. The installer automatically mapped that to creating one subvolume called @ for / itself and and another one called @home for /home. That doesn't seem to be the case anymore for UB 18.04, I only managed to get one BTRFS subvolume for / itself if I only create one partition.

Am I'm doing something wrong or does have things simply changed for some reason? In case of the latter, is there any discussion somewhere on why that was changed? Did the former setup have any downsides that needed to be addressed with the new release? Are there maybe any plans to restore the old behaviour if the new installer has matured?

I couldn't find any such discussion myself, only descriptions about the old behvaiour of UB 16.04.

Thanks!

  • the netinst and mini.iso installer still makes @ and @home in 18.04, i guess the shiny new GUI installer doesn't? – hanshenrik Oct 14 at 3:25
1

The installer is not aware of BTRFS subvolumes, but there is a workaround.

This is an adaptation of an answer from Ask Ubuntu. As I'm only an occasional user of Ubuntu and never of BTRFS, better verify my answer.

 - Do the server setup as usual, at the *Finish installation* step, select **Go Back** and **Execute a shell**.
 - List all your target file systems:

        mount | grep target

        /dev/dm-0 on /target type btrfs (rw,noatime,space_cache,subvolid=257,subvol=/@)
        /dev/dm-0 on /target/home type btrfs (rw,noatime,space_cache,subvolid=258,subvol=/@home)
        proc on /target/proc type proc (rw,nosuid,nodev,noexec,relatime)
        devtmpfs on /target/dev type devtmpfs (rw,nosuid,relatime,size=475608k,nr_inodes=118902,mode=755)

 - Take a note of the BTRFS device, in this example `/dev/dm-0`.
 - Now un-mount all of your mounted file systems.

        umount /target/dev
        umount /target/proc
        umount /target/boot/efi
        umount /target/home
        umount /target/

 - Mount your **flat** btrfs filesystem :

        cd /tmp
        mkdir work
        mount /dev/dm-0 work
        cd work

 - Verify the mount is correct (should show `@` and `@home`):

        ls 

        @ @home

 - Create your additional subvolumes (`@tmp`, `@var`, `@var-log`)

        btrfs subvolume create @tmp
        btrfs subvolume create @var
        btrfs subvolume create @var-log

 - Move the data

        mv @/var/log/* @var-log/
        mv @/var/* @var/

        # Remove data from tmp
        rm @/tmp/* @/tmp/.*

        # For 18.04, remove the swapfile since it won't work on btrfs
        rm @/swapfile

 - Add the new subvolumes to fstab, the device part may be different than the previous mount command, copy the device part from the already existing mount points.

        ...
        /dev/mapper/root-root /               btrfs   noatime,subvol=@ 0       1
        /dev/mapper/root-root /home           btrfs   noatime,subvol=@home 0       2
        /dev/mapper/root-root /var            btrfs   noatime,subvol=@var 0       2
        /dev/mapper/root-root /var/log        btrfs   noatime,subvol=@var-log 0       2


 - Unmount

        cd /tmp
        umount work
        sync


 - `exit`, then **Finish the installation**

 - Install and configure [snapper](http://snapper.io), a great tool for automatizing snapshots.
  • This is not answering my question, because as I said, in 16.04 the installer WAS aware of subvolumes and created at least two implicitly. I'm interested in getting to know why that was changed, because I don't really want to do all that stuff manually and therefore only care about default behaviour of installers. That default behaviour might change again. – Thorsten Schöning Sep 30 '18 at 10:55
0

One part of my answer comes from the users mailing list:

It depends on which installer you use. If you use the default subiquity installer, you get your current setup. If you use the no-longer-default d-i installer, you get the previous setup.

What I'm still missing is some background discussion, if multiple different subvolumes will be added to the new installer as well in future or if such a setup is not recommended anymore at all.

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.