vgrename properly.
To change the name of the volume group, we need to actially change VG name, edit two files (/etc/fstab and /etc/grub2.cfg), create new initramfs image and reboot machine:Make 2 variables:
old_name=vg_old
new_name=vg_new
Change VG name:
vgrename -v $old_name $new_name
Edit fstab:
sed -i "s/\/${old_name}-/\/${new_name}-/g" /etc/fstab
Edit grub2.cfg:
sed -i "s/\([/=]\)${old_name}\([-/]\)/\1${new_name}\2/g" /boot/grub2/grub.cfg
Create new initramfs-image
dracut -f -v /boot/initramfs-$(uname -r).img $(uname -r)
Reboot system (-f is required, without this switch, your system will shutdown and hung [see man systemctl]):
systemctl reboot -f
PS:
- you can use both of dracut or mkinitrd
- /etc/grub2.cgg is link to /boot/grub2/grub.cfg
No comments:
Post a Comment