Rename volume group? (96 Views)
Reply
Honored Contributor
Sean OB_1
Posts: 967
Registered: ‎07-29-2002
Message 1 of 13 (96 Views)
Accepted Solution

Rename volume group?

Is it possible to rename a volume group, and if so what are the ramifications?
Please use plain text.
Honored Contributor
Robert-Jan Goossens
Posts: 7,384
Registered: ‎04-04-2000
Message 2 of 13 (96 Views)

Re: Rename volume group?

Hi,

Filesystem: Rename volume groups and logical volumes
date: 4/24/97
document description: Filesystem: Rename volume groups and logical volumes
document id: A4158692

You may provide feedback on this document

--------------------------------------------------------------------------------
Problem Description

Can you explain how to rename a volume group (VG) and the logical volumes
within that VG?

Configuration Info

Operating System - HP-UX
Version -10.01
Hardware System -877

Solution

Follow these guidelines for non-root volume groups:

1. umount /filesys (for each mounted filesys)

2. vgchange -a n /dev/vgname

3. vgexport -m mapfile /dev/vgname

4. vi mapfile (to set up new logical volume names)

5. mkdir /dev/vgnewname

6. mknod /dev/vgnewname/group c 64 0x

7. vgimport -m mapfile /dev/vgnewname /dev/dsk/cxtyd0

where x and y are the device files for the physical volumes in
the VG.

Hope it helps,

Robert-Jan.
Please use plain text.
Honored Contributor
Rita C Workman
Posts: 3,791
Registered: ‎08-03-2000
Message 3 of 13 (96 Views)

Re: Rename volume group?

No I don't believe you can not 'rename' a volume group...

You can do a vgexport and a new mknod to change the minor # (0x_ _ 0000), and then vgimport it back.
But to change the name /dev/vgname .. nope ..

What you might do is...do a complete backup of the affected data. Create a new vg and restore the data to the new location.

Just my thoughts,
Rita
Please use plain text.
Honored Contributor
Uday_S_Ankolekar
Posts: 2,021
Registered: ‎06-05-2001
Message 4 of 13 (96 Views)

Re: Rename volume group?

Command vgimport can be used to rename a volume group. Specify the new name in the 'vgimport' command -- it doesn't matter what the old name was.
for Eg:
mkdir /dev/vgnewname
mknod /dev/vgnewname c 64 0x06000
vgimport -v -s -m vgoldname dev/vg05

-USA..
Good Luck..
Please use plain text.
Honored Contributor
Uday_S_Ankolekar
Posts: 2,021
Registered: ‎06-05-2001
Message 5 of 13 (96 Views)

Re: Rename volume group?

....contd..
vgimport -v -s -m vgoldname dev/vgnewname
Good Luck..
Please use plain text.
Honored Contributor
Sean OB_1
Posts: 967
Registered: ‎07-29-2002
Message 6 of 13 (96 Views)

Re: Rename volume group?

Thanks for the responses. How long does this process take? Is it variable depending on the vg size, or is it just recreating the vg tables on the disk?
Please use plain text.
Outstanding Contributor
Pete Randall
Posts: 16,205
Registered: ‎11-03-1996
Message 7 of 13 (96 Views)

Re: Rename volume group?

Sean,

I believe, assuming I recall correctly, that the import process is relatively quick - measured in seconds rather than minutes, even.

Pete

Pete
Please use plain text.
Acclaimed Contributor
A. Clay Stephenson
Posts: 17,825
Registered: ‎07-16-1998
Message 8 of 13 (96 Views)

Re: Rename volume group?

The vgimport process is essentailly instantaneous. The typical reason for doing this is for database raw devices. You can always use symbolic links to accomplish the same thing.
If it ain't broke, I can fix that.
Please use plain text.
Honored Contributor
Sean OB_1
Posts: 967
Registered: ‎07-29-2002
Message 9 of 13 (96 Views)

Re: Rename volume group?

Thanks for the answers everyone. I'm not sure I'll need to do this, but if I do then you've been a big help.

I'll award points accordingly when I do this work.
Please use plain text.
Honored Contributor
Tim D Fulford
Posts: 1,424
Registered: ‎12-11-2000
Message 10 of 13 (96 Views)

Re: Rename volume group?

I would not even attempt to do this it is puerely esotric....

1 - The convention is to name root volume group vg00
2 - It is imperitive that /dev/vg00/lvol1, 2 & 3 are in the right order on the disk for boot purposes. Calling them by other names confuses the issue.
3 - Assume you have renamed vg00 then certain scripts start to fail. You will have to fix these scripts which is another task you probably could do without.

However I DO name non-standard logical volumes in vg00. e.g. I would not create /dev/vg00/lvol9 it would be /dev/vg00/app1 etc.

Regards

Tim
-
Please use plain text.
Honored Contributor
Sridhar Bhaskarla
Posts: 6,350
Registered: ‎08-15-2001
Message 11 of 13 (95 Views)

Re: Rename volume group?

Hi Sean,

As told by others, renaming a volume group means exporting and importing it back. The time it takes to export is instantaneous. But the time it takes to import depends on the option you use (like -s or -f etc) and the number of PVs in the volume group. One of my systems have 100+ PVs in one volume group and it took me around 10 mins to import using -s option. I suggest using -f option. Look at vgexport and vgimport man pages.

But renaming logical volumes is very simple. Just rename lvolx and rlvolx to your_lv_name and ryour_lv_name. This is applicable to even logical volumes in vg00 also. But you have to be very careful while renaming and be sure to update your fstab. For ex., if I want to rename lvol5 to var, I would do the following.

#mv /dev/vg00/lvol5 /dev/vg00/var
#mv /dev/vg00/rlvol5 /dev/vg00/rvar

vi /etc/fstab and change the reference to /dev/vg00/var.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Please use plain text.
Honored Contributor
Sean OB_1
Posts: 967
Registered: ‎07-29-2002
Message 12 of 13 (95 Views)

Re: Rename volume group?

Just some more information on this.

Here is what I have now.

/dev/development/.... with 5 lvols
I need to move this volume group to new disks, so I've created a new volumegroup:

/dev/newdev/... with the 5 lvols.

I plan on copying the data to the new vg on temp mountpoints, then once everything is verified to be there, removing the /dev/development volume group and renaming /dev/newdev to /dev/development.

Does anyone see any issues with doing this as outlined by the responses above?
Please use plain text.
Honored Contributor
Sridhar Bhaskarla
Posts: 6,350
Registered: ‎08-15-2001
Message 13 of 13 (95 Views)

Re: Rename volume group?

Hi,

Your way will work and that's the safest way.

Keep your old volume group intact for couple of days and delete it once the new setup is found stable.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Please use plain text.
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation