Grub and rename of btrfs root subvol

Just for my understanding I am playing a bit with a situation where I

  • use Grub
  • have a system with luks and btrfs
  • want to rename the root subvol @ to @eos

I did the following

  • renaming btrfs subvol @ to @eos
  • renaming it in /etc/fstab
  • ran sudo systemctl daemon-reload
  • ran sudo grub-mkconfig -o /boot/grub/grub.cfg

When rebooting I end up in an emergency shell because I forgot to change @ to @eos somewhere else. If it were systemd-boot then I would have to change in /etc/kernel/cmdline but here I don’t know what I am missing.

Look into /etc/default/grub and see if there is any reference to @ in there which needs to be changed to @eos.

If there is, make the change and rub the grub-mkconfig afterwards.

That I did already but nothing found.

1 Like

Did you get any error messages while booting up before being dropped into emergency shell?

  1. shows that the passphrase entered was ok
  2. shows that somewhere there is still just @

I don’t have any LUKS setup so I wouldn’t know if that may play a part in here.

However, the nomal.mod file not being found may be resolved by re-installing the grub, the package itself.

Perhaps you could boot up your live usb, unlock the partition, arch-chroot into the system and reinstall the package Grub?

While you are in chroot, it won’t hurt to rebuild your initramfs and also reinstall the grub’s bootloader.

These are only suggestions so please regard them as such.

That will leave your kernel options wrong in grub.

Just edit then from the grub menu and the re-run grub-mkconfig and dracut-rebuild after booting.

1 Like

normal.mod isn’t found because is says /@/boot... instead of /@eos/boot...

1 Like

Not sure I understand. As I don’t come to any grub display I don’t know what to edit. Any specific file?

Did you regenerate the initramfs?

sudo dracut-rebuild

You may need to do it from a chroot at this point.

You probably need to chroot to fix this now,

FWIW, this procedure is what I would do in that situation:

  • rename btrfs subvol @ to @eos
  • Modify /etc/fstab to match
  • chroot into the system
  • run dracut-rebuild
  • run grub-mkconfig -o /boot/grub/grub.cfg
  • Exit the chroot
  • Reboot

I did not run dracut-rebuild.

As my test is in a VM I restarted from a snapshot, did the steps I mentioned initially and added sudo dracut-rebuild as last step. Still the same problem as before.

Try rebuilding the initramfs before regenerating the Grub config.

This did not help. Same error.

Did you follow my steps from above? You have to setup a proper chroot into the renamed subvol from the running system.

I misunderstood what you said above and thought you meant that I have to use chroot because I was already stuck.

So, are you saying that when doing a rename of a btrfs root subvol I have to use chroot in any case?

That is how I have always done it. Renaming a btrfs subvol has no impact on the running system so when you run dracut-rebuild or grub-mkconfig you are still getting the old values from the running system. That is why I chroot in after renaming.

Hm, I didn’t expect this as grub-mkconfig changed /boot/grub/grub.cfg correctly by changing all occurences of @ to @eos.

I should add that after systemctl daemon-reload also mount showed @eos for the / mount.

I have not extensively tested all methods so it is possible that would also work. I was just mentioning how I have always done it.

I don’t use grub very often so it is possible that when using grub with encryption there is some additional step. I suppose you could try running grub-install --no-nvram and see if that helps. Although, off the top of my head I can’t think of why that would be needed.

No that didn’t help. I assume that there is no chance to make renaming the root btrfs subvol easier.

Is it easier when using systemd-boot?