Update Grub after modifying fstab?
Jose I Diaz Bardales
jose.dbardales at gmail.com
Wed Jan 29 23:37:35 UTC 2020
On 1/29/20 3:15 PM, Volker Wysk wrote:
> 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
I am not 100 percent sure but I believe you can use the lvm utility to
rename volume groups without the need to edit fstab.
More information about the ubuntu-users
mailing list