LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 07-27-2006, 03:51 PM   #1
rh_bomani
Member
 
Registered: Apr 2006
Posts: 42

Rep: Reputation: 15
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.
 
Old 08-03-2006, 02:02 PM   #2
uselpa
Senior Member
 
Registered: Oct 2004
Location: Luxemburg
Distribution: Slackware, OS X
Posts: 1,507

Rep: Reputation: 47
That procedure seems correct, it works for me:
Code:
root@slackw:~$ lvs
  LV       VG      Attr   LSize  Origin Snap%  Move Copy%
  LVtemp   VGlocal -wi-a- 60,00G
  LVvmware VGlocal -wi-ao 35,94G

root@slackw:~$ lvchange -an /dev/VGlocal/LVtemp

root@slackw:~$ lvrename /dev/VGlocal/LVtemp /dev/VGlocal/LVtest
  Renamed "LVtemp" to "LVtest" in volume group "VGlocal"

root@slackw:~$ lvchange -ay /dev/VGlocal/LVtest

root@slackw:~$ lvs
  LV       VG      Attr   LSize  Origin Snap%  Move Copy%
  LVtest   VGlocal -wi-a- 60,00G
  LVvmware VGlocal -wi-ao 35,94G

root@slackw:~$ mount /dev/VGlocal/LVtest mountpoint

root@slackw:~$ v mountpoint/
total 0
drwxr-xr-x  9 pu pu 216 2006-06-10 14:45 zw26/

root@slackw:~$ mount
/dev/hda6 on / type reiserfs (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
/dev/mapper/VGlocal-LVvmware on /mnt/vmware type ext3 (rw)
/dev/hda3 on /mnt/win type vfat (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
tmpfs on /dev/shm type tmpfs (rw,size=144m)
usbfs on /proc/bus/usb type usbfs (rw)
/dev/mapper/VGlocal-LVtest on /root/mountpoint type reiserfs (rw)
Maybe try issuing an `lvscan` or `vgscan`?
 
Old 08-04-2006, 03:47 PM   #3
rh_bomani
Member
 
Registered: Apr 2006
Posts: 42

Original Poster
Rep: Reputation: 15
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.
 
Old 08-04-2006, 03:55 PM   #4
uselpa
Senior Member
 
Registered: Oct 2004
Location: Luxemburg
Distribution: Slackware, OS X
Posts: 1,507

Rep: Reputation: 47
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.
 
Old 08-04-2006, 08:34 PM   #5
rh_bomani
Member
 
Registered: Apr 2006
Posts: 42

Original Poster
Rep: Reputation: 15
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.
 
Old 08-05-2006, 04:18 AM   #6
uselpa
Senior Member
 
Registered: Oct 2004
Location: Luxemburg
Distribution: Slackware, OS X
Posts: 1,507

Rep: Reputation: 47
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.
 
Old 08-07-2006, 05:59 PM   #7
rh_bomani
Member
 
Registered: Apr 2006
Posts: 42

Original Poster
Rep: Reputation: 15
thanks alot! I had to create mountpoints for the lv's. From there I was able to edit any file I wanted.
 
Old 09-27-2006, 08:38 PM   #8
rh_bomani
Member
 
Registered: Apr 2006
Posts: 42

Original Poster
Rep: Reputation: 15
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
zsnes && logitech dual action gamepad && dpad woes John5788 Linux - Games 5 10-29-2008 09:56 PM
AOL UK && BT Voyager 100 && Slackware 10.2 && RP-PPPoE pitt0071 Linux - Networking 3 01-17-2006 06:10 AM
(FreeBSD && Fedora Core 4 && Slackware 10.0) Filesystem Support taylor_venable *BSD 1 07-14-2005 02:24 PM
Japanese canna won't work : Warning: かな漢字変&am OrganicOrange84 Debian 3 06-30-2005 02:28 PM
Phục hồi dữ liệu bị mất???, cứ pollsite General 1 06-27-2005 12:39 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 07:24 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration