installer icon indicating copy to clipboard operation
installer copied to clipboard

Cannot boot from BTRFS subvolume

Open ibnesayeed opened this issue 4 years ago • 2 comments

Describe the bug

I tried installing RC3 with BTRFS on SSD disk, but it failed to boot. The boot loader could not find files under /boot/ folder.

To Reproduce

  1. Run the installer and create custom partition
    • A 512 MB FAT32 partition at the beginning of the disk
    • Remaining disk as a BTRFS partition
  2. Follow the remaining installation steps, but shut down before it restarts to create the first user
  3. Boot again with the installation media and use it in demo mode
  4. Mount BTRFS partition somewhere in the demo session
  5. Create subvolumes @, @home, and @swap
  6. Move all the files into @ subvolume
  7. Create a swapfile under @swap subvolume and set necessary flags so that BTRFS can treat it as a swap file
  8. Modify the /etc/fstab from the @ subvolume so that /boot/efi is mounted to the FAT32 drive and /, /home, and /swap are mounted to their respective BTRFS subvolumes (with suitable options)
  9. Create /swap folder under the @ subvolume as a mount point for the swapfile under @swap subvolume
  10. Run update-initramfs
  11. Reboot the machine to complete the first user creation (this is where system fails to go any further from the boot screen)

Am I doing anything wrong? What am I missing? Do I need to manually reinstall GRUB or something?

ibnesayeed avatar Aug 09 '21 20:08 ibnesayeed

Yes. You need manual grub install. http://logan.tw/posts/2015/05/17/grub-install-and-btrfs-root-file-system/

queeup avatar Aug 15 '21 19:08 queeup

@queeup thanks. I was able to resolve the issue that day after a few tries. That said, it would be really cool if the installer could have better integrated support for BTRFS subvolumes to make the process more seamless. Without subvolumes, using BTRFS is not really all that useful. Moreover, the swapfile needs a different set of configs to behave properly, without polluting the history of the journaling file system.

ibnesayeed avatar Aug 17 '21 18:08 ibnesayeed