LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Password
Red Hat This forum is for the discussion of Red Hat Linux.

Notices


Reply
  Search this Thread
Old 07-28-2009, 07:04 AM   #1
unix1adm
Member
 
Registered: Oct 2008
Posts: 688

Rep: Reputation: 32
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

Last edited by unix1adm; 07-28-2009 at 07:05 AM.
 
Old 07-28-2009, 07:14 AM   #2
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297
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

Last edited by EricTRA; 07-28-2009 at 07:17 AM. Reason: Additional info
 
Old 07-28-2009, 07:19 AM   #3
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297
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
 
Old 07-28-2009, 07:40 AM   #4
unix1adm
Member
 
Registered: Oct 2008
Posts: 688

Original Poster
Rep: Reputation: 32
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
 
Old 07-28-2009, 08:25 AM   #5
unix1adm
Member
 
Registered: Oct 2008
Posts: 688

Original Poster
Rep: Reputation: 32
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
 
Old 07-28-2009, 09:23 AM   #6
unix1adm
Member
 
Registered: Oct 2008
Posts: 688

Original Poster
Rep: Reputation: 32
attached screen shot of console
Attached Thumbnails
Click image for larger version

Name:	DSCN2348.jpg
Views:	32
Size:	253.3 KB
ID:	1087  
 
Old 07-28-2009, 09:44 AM   #7
unix1adm
Member
 
Registered: Oct 2008
Posts: 688

Original Poster
Rep: Reputation: 32
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
 
Old 07-28-2009, 10:06 AM   #8
unix1adm
Member
 
Registered: Oct 2008
Posts: 688

Original Poster
Rep: Reputation: 32
I fixed it. I had a typo in the grub.conf file when I booted back to rescue mode i saw it.
 
  


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to rename a logical volume name tom_sawyer70 Linux - Server 2 07-17-2009 01:37 PM
Extending logical volume LogVol01 Insufficient allocatable logical exte swap space umeshsharma Linux - Newbie 4 06-22-2009 12:26 PM
Rename Logical Volume jackpal Linux - Server 2 03-27-2009 07:34 AM
how to rename logical interfaces? NDR008 Linux - Software 6 12-12-2006 07:50 PM
resizing a logical volume nicentral AIX 2 06-11-2005 04:03 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat

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

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