Update Grub after modifying fstab?
Volker Wysk
post at volker-wysk.de
Thu Jan 30 07:15:10 UTC 2020
Am Mittwoch, den 29.01.2020, 18:37 -0500 schrieb Jose I Diaz Bardales:
> 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.
That's unlikely. I've looked at the lvm manpage, and haven't found
anything like this. It would mean that the lvm command calls the
necessary commands to update grub by itself. In the vgrename manpage
isn't anything like this, too.
Bye,
Volker
More information about the ubuntu-users
mailing list