add function to rename lvm vg and dependencies

This commit is contained in:
Jakobus Schürz 2021-10-19 10:27:12 +02:00
parent c4e01b78db
commit 7e2ab392fb

View file

@ -1003,4 +1003,17 @@ cporig () {
cp -b -i "${1}" "${1}.orig"
}
vgrename_full () {
altevolumegroup="$1"
neuevolumegroup="$2"
vgrename ${altevolumegroup} ${neuevolumegroup}
sed -i "s/${altevolumegroup}/${neuevolumegroup}/g" /etc/fstab
sed -i "s/${altevolumegroup}/${neuevolumegroup}/g" /boot/grub/grub.cfg
sed -i "s/${altevolumegroup}/${neuevolumegroup}/g" /boot/grub/menu.lst
sed -i "s/${altevolumegroup}/${neuevolumegroup}/g" /etc/initramfs-tools/conf.d/resume
update-initramfs -c -k all
}
#EOF