Add menu entry in grub2 for os on btrfs partition

btrfsgrub2

How can I add a menu entry in grub 2 for an os on a btrfs partition?

Currently update-grub does not detect an os on a btrfs partition.

Best Answer

The answer might be too ubuntu specific, I apologise for that.

To add a menu entry, you have to edit /etc/grub.d/40_custom. Append the following to the end of the file:

menuentry "GIVE AN ENTRY NAME" {
  set root=(hd0,5)
  linux /@/vmlinuz root=UUID=xxx-xxx-xxx-xxx-xxxxx rootflags=subvol=@ ro quiet splash
  initrd /@/initrd.img
}

You have to change (hd0,5) to reflect your partition. If grub and the desired partition are on the same hard drive use hd0, else you might need to experiment a bit with hd1, hd2 etc. Instead of 5 use the number of the partition.

To find out the UUID of the partition use blkid

It is possible that your subvolume is not named @ (that's ubuntus default), but something else. You can find out the name if you mount the partition and list its the folders

Related Topic