0

I made a typo when I created an LVM group under Centos 6.4. I'm trying to rename using the syntax vgrename /dev/mapper/oldVG /dev/mapper/newVG. However, both the old and new VGs have hyphens in the name: /dev/mapper/BACKUP-StoreVG and /dev/mapper/StoreVG-BackupLV, respectively.

I get the error message:

New volume group name "StoreVG/BackupLV" is invalid

I've tried escaping with \, putting the volumes in single and double quotes. Also tried a -- after the command vgrename. If I try to rename to something without a hyphen (i.e. StoreVGBackupLV) it complains about the old name instead: Volume group name BACKUP/StoreVG has invalid characters.

The LVM is unmounted. What am I doing wrong?

0

The /dev/mapper path always has an hyphen because it has two components, the vg name and the lv name. Do this:

lvrename /dev/mapper/VGName-LVName NewLVName
0

The OP is trying to rename the VG, not the LV, so lvrename won't cut it.

The problem is that you're trying to reference the end path of the LV (/dev/mapper/vgname-lvname) whereas you have to use the /dev/vgname/lvname format for vgrename. That is to say, you should be trying:

vgrename /dev/vgname-old /dev/vgname-new

That just worked for me, with hyphens and all.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.