Update Grub after modifying fstab?

Volker Wysk post at volker-wysk.de
Wed Jan 29 20:15:47 UTC 2020


Hi

The ubuntu installer sets up LVM, when choosing encryption. I want to
rename the volume group. It is always set to "ubuntu-vg" by the ubuntu
installer. I want to avoid volume group name clashes in the future.

In the process of doing this, the /etc/fstab file needs to be changed.
Amongst other things, it contains the line for the root filesystem. For
instance:

/dev/mapper/ubuntu--vg-root / ext4 errors=remount-ro 0 1

Now "ubuntu-vg" shall be renamed to "desktop-vg":

/dev/mapper/desktop--vg-root / ext4 errors=remount-ro 0 1

Does this break the bootability of the system? In other words, does
Grub need to be updated when changing /etc/fstab? The renaming needs to
be done from a live/maintenance system, because otherwise the VG to be
renamed is being in use. (really?)

>From what I've learned, the following command sequence is needed to
make the system bootable again, in the case of an UEFI system. The
system is mounted at /mnt/root:

mount <boot/-partition> /mnt/root/boot
mount <boot/efi/-partition> /mnt/root/boot/efi
mount --rbind /dev /mnt/root/dev
mount --rbind /proc /mnt/root/proc
mount --rbind /sys /mnt/root/sys
chroot /mnt/root
update-initramfs -u
grub-install --target=x86_64-efi --efi-directory=/boot/efi --
bootloader-id=Desktop
update-grub

So
- Is this necessary?
- Is the grub-install line correct?


Cheers,
Volker





More information about the ubuntu-users mailing list