Help with vgrename and lvrename
Hello, I'm using RHEL 4.0 and have lvm2 v2.0 and I wish to rename both my volume group and logical volumes. Here is my current setup,/dev/VolGroup00/LogVol00, and I want to change to something like /dev/sys/home. I read the docs on tldp.org but they don't go into detail about vgrename and lvrename.
Must I first umount the filesystems, use lvchange -an
pathtoLogicalVolume, and then lvrename?
Here is an example of what I tried and the error I got.
[root@UW-RASBERRYL ~]# umount /opt
[root@UW-RASBERRYL ~]# lvchange -an /dev/VolGroup00/LogVol06
[root@UW-RASBERRYL ~]# lvrename /dev/VolGroup00/LogVol06 /dev/VolGroup00/sys-opt
[root@UW-RASBERRYL ~]# lvchange -ay /dev/VolGroup00/sys-opt
One or more specified logical volume(s) not found.
I solved the problem using knoppix livecd. It was a synch to rename the vg and lv's.
Revisiting of an old topic. I opened a support ticket with RH to find an official solution to this problem. Here is the conclusion we came too after a few trial and errors.
Logical Volume Rename
1.) boot into rescue mode
2.) issue lvrename OLD NEW for each lv
3.) edit fstab and grub.conf
Oddly, I did not have to use lvchange -an/y.
VG renames proved very troublesome.
Volume Group Rename
1.)boot into rescue mode
2.) edit fstab and grub.conf to new VG name
3.)exit and boot into rescue mode. When prompted to select 'Continue', Read-Only' or 'Skip' choose skip
4.) type lvm vgrename OLD NEW
5.)exit and boot into rescue mode
6.) chroot /mnt/sysimage
7.) rebuild initial ramdisk
Cool thanks. Have you added this to the wiki yet? That may prove helpful to anyone else that has similar issues.