LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Red Hat (https://www.linuxquestions.org/questions/red-hat-31/)
-   -   RH: cannot rename logical volume (https://www.linuxquestions.org/questions/red-hat-31/rh-cannot-rename-logical-volume-743352/)

unix1adm 07-28-2009 07:04 AM

RH: cannot rename logical volume
 
I wanted to rename an existing lv to a new name. I followed this procedure but get an error.
I am loged in as root.

umount /mountpoint
lvrename /dev/volgroupname/lgvold /dev/volgroupname/lgvnew

When I try this I get :
df -h shows:

/dev/mapper/VolGroup00-LogVol07
20G 173M 19G 1% /opt/ibm/tsom


umount /opt/ibm/tsom
lvrename /dev/mapper/VolGroup00-LogVol07 /dev/mapper/VolGroup00-rvg_opt
Volume group "mapper" not found

Why does it think mapper is not part of the path to the logical volume. The help screen shows this:


lvrename -h
lvrename: Rename a logical volume

lvrename [-A|--autobackup {y|n}]
[-d|--debug]
[-h|-?|--help]
[-t|--test]
[-v|--verbose]
[--version]
{ OldLogicalVolumePath NewLogicalVolumePath |
VolumeGroupName OldLogicalVolumeName NewLogicalVolumeName }

I can cd to the dir and list the files there:
/dev/mapper
[root@sky mapper]# ls
control VolGroup00-LogVol02 VolGroup00-LogVol05
VolGroup00-LogVol00 VolGroup00-LogVol03 VolGroup00-LogVol06
VolGroup00-LogVol01 VolGroup00-LogVol04 VolGroup00-LogVol07

EricTRA 07-28-2009 07:14 AM

Hello,

This should work, normally you just provide the names not the paths, at least in my config.

Code:

lvrename vgname oldname newname
Just tested: you don't even have to umount the lv.

Kind regards,

Eric

EricTRA 07-28-2009 07:19 AM

When I'm in doubt I always look here Beginner's guide to LVM. Has helped me out a lot in the past.

Kind regards,

Eric

unix1adm 07-28-2009 07:40 AM

I will try this but how come the full path did not work according to man and help on the lvrename it should have worked.

That seemed to work

lvrename -v VolGroup00 LogVol07 rvg_tsom
Checking for existing volume group "VolGroup00"
Archiving volume group "VolGroup00" metadata (seqno 9).
Writing out updated volume group
Creating volume group backup "/etc/lvm/backup/VolGroup00" (seqno 10).
Found volume group "VolGroup00"
Found volume group "VolGroup00"
Loading VolGroup00-LogVol07 table
Suppressed VolGroup00-LogVol07 identical table reload.
Suspending VolGroup00-LogVol07 (253:5) without device flush
Found volume group "VolGroup00"
Loading VolGroup00-LogVol07 table
Suppressed VolGroup00-LogVol07 identical table reload.
Renaming VolGroup00-LogVol07 (253:5) to VolGroup00-rvg_tsom
Resuming VolGroup00-rvg_tsom (253:5)
Renamed "LogVol07" to "rvg_tsom" in volume group "VolGroup00"

Thanx for the info

CJ

unix1adm 07-28-2009 08:25 AM

well I rebooted the system avter making the changes and now i says cannot mount /dev/root no such filesystem...

i had changed all the lv to be like this
/dev/VolGroup00/rvg_root / ext3 defaults 1 1
/dev/VolGroup00/rvg_opt /opt ext3 defaults 1 2
/dev/VolGroup00/rvg_usr /usr ext3 defaults 1 2
/dev/VolGroup00/rvg_home /home ext3 defaults 1 2
/dev/VolGroup00/rvg_tmp /tmp ext3 defaults 1 2
/dev/VolGroup00/rvg_var /var ext3 defaults 1 2
/dev/VolGroup00/rvg_tsom /opt/ibm/tsom ext3 defaults 1 2

unix1adm 07-28-2009 09:23 AM

1 Attachment(s)
attached screen shot of console

unix1adm 07-28-2009 09:44 AM

I thought it might be a problem with the /etc/grub.conf file so I modified it to look like the working system... Still gives the same error.


was:

kernel /vmlinuz-2.6.18-92.el5 ro root=/dev/VolGroup00/LogVol00 rhgb quiet

Now is:
kernel /vmlinuz-2.6.18-92.el5 ro root=/dev/VolGroup00/rvg_root rhgb quiet crashkernel=128M@16M

unix1adm 07-28-2009 10:06 AM

I fixed it. I had a typo in the grub.conf file when I booted back to rescue mode i saw it.


All times are GMT -5. The time now is 08:12 PM.