4

I installed Ubuntu 22.04 LTS server today and selected BTRFS as for the / partition. Here is the scheme I selected in the custom installation:

/boot     2G ext4
/boot/efi 1G fat32
SWAP      4G
/         469.9G btrfs

From searching around, I saw that ubuntu used to create two separate subvolumes under @ and @home, but I don't see them when I check:

# lsblk
NAME        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
loop0         7:0    0    62M  1 loop /snap/core20/1587
loop1         7:1    0  79.9M  1 loop /snap/lxd/22923
loop2         7:2    0    47M  1 loop /snap/snapd/16292
nvme0n1     259:0    0 476.9G  0 disk 
├─nvme0n1p1 259:1    0     1G  0 part /boot/efi
├─nvme0n1p2 259:2    0     2G  0 part /boot
├─nvme0n1p3 259:3    0     4G  0 part [SWAP]
└─nvme0n1p4 259:4    0 469.9G  0 part /
# cat /etc/fstab
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
/dev/disk/by-uuid/8b2ff495-b8b2-4959-a5a4-1f4aa7e85ffe none swap sw 0 0
# / was on /dev/nvme0n1p4 during curtin installation
/dev/disk/by-uuid/4466d07c-a9a8-452b-a970-667f55eff17a / btrfs defaults 0 1
# /boot was on /dev/nvme0n1p2 during curtin installation
/dev/disk/by-uuid/d15e9776-60c0-4e5f-b782-087126cfde2f /boot ext4 defaults 0 1
# /boot/efi was on /dev/nvme0n1p1 during curtin installation
/dev/disk/by-uuid/E1C9-D08B /boot/efi vfat defaults 0 1
/swap.img       none    swap    sw      0       0
# mount | grep nvme0n1p4
/dev/nvme0n1p4 on / type btrfs (rw,relatime,ssd,space_cache=v2,subvolid=5,subvol=/)

Did I miss something during installation?

I don't think this is a duplicate considering Ubuntu switched to the subquity installer recently, and the installation flow seemed to have changed from when the previous questions on this topic were answered.

1 Answers1

3

It is a standard setup for a btrfs file system with @ and @home subvolumes.

@ is mounted to / and @home is mounted to /home.

It looks like subuiquity doesn't do it. You can fix it. Boot from a LiveUSB and run from there:

sudo mount /dev/nvme0n1p4 /mnt

Run sudo nano /mnt/etc/fstab, remove this line

 /dev/disk/by-uuid/4466d07c-a9a8-452b-a970-667f55eff17a / btrfs defaults 0 1

and add these lines:

/dev/disk/by-uuid/4466d07c-a9a8-452b-a970-667f55eff17a / btrfs subvol=@ 0 0
/dev/disk/by-uuid/4466d07c-a9a8-452b-a970-667f55eff17a /home btrfs subvol=@home 0 0

Then run:

sudo btrfs sub create /mnt/@
sudo btrfs sub create /mnt/@home
sudo mv /mnt/home/* /mnt/@home
cd /mnt
sudo mv !(@|swapfile) /mnt/@
sync
sudo umount /mnt
sudo mount -o subvol=@ /dev/nvme0n1p4 /mnt
sudo mount --bind /dev /mnt/dev
sudo mount --bind /proc /mnt/proc
sudo mount --bind /sys  /mnt/sys
sudo mount /dev/nvme0n1p2 /mnt/boot
sudo mount /dev/nvme0n1p1 /mnt/boot/efi
sudo chroot /mnt
sudo update-grub
exit
sudo umount /mnt/dev
sudo umount /mnt/proc
sudo umount /mnt/sys
sudo umount /mnt/boot
sudo umount /mnt

Reboot, and if I didn't make a mistake, all should work.

Pilot6
  • 92,041