Help with vgrename & 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. |
That procedure seems correct, it works for me:
Code:
root@slackw:~$ lvs |
Did you have to go into single user mode and/or shut down services first?
I get device busy messages for my / and /var partitions. |
No, but my LV is something that doesn't need to be mounted for normal operation. If your LV contain / and /var, I'd suggest that you take a LVM2-compatible live CD, boot that and change the LV names and /etc/fstab from there.
Personally I use RIP but I guess that in your case, the CentOS LiveCD should be a good choice. Haven't used it, though. |
thanks alot for the suggestion. I downloaded and used knoppix and it allowed me to change the vg's and lv's. It's my first time using a livecd so I'm trying to figure out how to access original fstab and make necessary changes.
|
Last time I used Knoppix the local partitions were shown as icons on the desktop, but they weren't LVM partitions. If they show up, you can click on those and you should see fstab in the subfolder /etc.
Otherwise, go to a shell, create a mountpoint, mount your LV there and under you mountpoint you'll find etc/fstab as well which you can edit directly. |
thanks alot! I had to create mountpoints for the lv's. From there I was able to edit any file I wanted.
|
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 |
All times are GMT -5. The time now is 03:30 PM. |