I made a fresh install of Kubuntu with the latest Ubuntu version and installed the system on a btrfs root partition.
After reading up on proposed filesystem layout, I rearranged the system by making several subvolumes besides the @ subvolume made by the installer: I have now @, opt, root, srv, swap, tmp, user_local and var as separate subvolumes. Also a snapshot subvolume which was the reason to separate everything to begin with.
The contents of the corresponding directories (/opt, /root, /srv, /swapfile, /tmp, /usr/local, var
) were copied over, and I changed /etc/fstab
as follows:
# /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>
# / was on /dev/sda6 during installation
UUID=5bfaac4c-e3cc-4ed9-adae-2d7d45e58097 / btrfs defaults,noatime,compress=zstd,autodefrag,subvol=@ 0 1
# /boot/efi was on /dev/sda1 during installation
UUID=3B70-67C3 /boot/efi vfat umask=0077 0 1
UUID=5bfaac4c-e3cc-4ed9-adae-2d7d45e58097 /.snapshots btrfs defaults,noatime,autodefrag,compress=zstd,commit=120,subvol=snapshots 0 0
UUID=5bfaac4c-e3cc-4ed9-adae-2d7d45e58097 /opt btrfs defaults,noatime,autodefrag,compress=zstd,commit=120,subvol=opt 0 0
UUID=5bfaac4c-e3cc-4ed9-adae-2d7d45e58097 /root btrfs defaults,noatime,autodefrag,compress=zstd,commit=120,subvol=home_root 0 0
UUID=5bfaac4c-e3cc-4ed9-adae-2d7d45e58097 /srv btrfs defaults,noatime,autodefrag,compress=zstd,commit=120,subvol=srv 0 0
UUID=5bfaac4c-e3cc-4ed9-adae-2d7d45e58097 /tmp btrfs defaults,noatime,autodefrag,compress=zstd,commit=120,subvol=tmp 0 0
UUID=5bfaac4c-e3cc-4ed9-adae-2d7d45e58097 /usr/local btrfs defaults,noatime,autodefrag,compress=zstd,commit=120,subvol=usr_local 0 0
UUID=5bfaac4c-e3cc-4ed9-adae-2d7d45e58097 /var btrfs defaults,noatime,autodefrag,compress=zstd,commit=120,subvol=var 0 0
# /home was on /dev/sda2 during installation
UUID=72e99d79-d20b-49d8-b6e5-25506f8dfb1d /home btrfs defaults,noatime,compress=zstd,autodefrag 0 0
UUID=5bfaac4c-e3cc-4ed9-adae-2d7d45e58097 /swap btrfs defaults,noatime,subvol=swap 0 0
/swap/swapfile none swap defaults 0 0
Then I rebuilt initramfs with sudo update-initramfs -c -k $(uname -r)
and rebooted.
Result is that the system drops into emergency mode.
From emergency mode, I can run update-grub
, followed by Ctrl-D, and get a normal system with KDE running. There's no clear indication what went wrong. Not with sudo dmesg
, not with journalctl -xb
.
For a permanent fix, I tried to re-run sudo update-grub
from within the now running system. Unfortunately, this doesn't stick. Whenever I reboot, I drop into emergency mode again, the system comes up only after a repeat update-grub
and Ctrl-D from there.
What is the reason, and what can I do to fix?