Operating System - HP-UX
1833758 Members
2667 Online
110063 Solutions
New Discussion

Re: Renaming Volume Group IDs?

 
SOLVED
Go to solution
Khalil Ahmed
Frequent Advisor

Renaming Volume Group IDs?

Question: Is it possible to rename a volume group ID eg rename VG15 to VG04?

It's purely for consmetic reasons, I have removed some volume groups and I would like to resequence my Volume Group IDs. The VGs do have disks allocated to them containing data ie LVs with associated mount points.

I suspect you can't rename VGs. However, if it is possible how would I do it?

Thanks

Khalil

5 REPLIES 5
Gary L. Paveza, Jr.
Trusted Contributor
Solution

Re: Renaming Volume Group IDs?

Easiest way is to export and import

1. Unmount all filesystems in /dev/vg15

2. vgchange -a n /dev/vg15

3. vgexport -m -s -v /dev/vg15
(using the -s option eliminates the need to specify the device filenames in the vgimport)

4. mkdir /dev/vg04

5. mknod /dev/vg04/group c 64 0x040000 (assuming you're going to use 04 as the minor number)

6. vgimport -m -s -v /dev/vg04

7. vgchange -a y /dev/vg04

8. Mount all your filesystems.

Change to a filename that will act as the mapfile of the voluem group.

One thing to be warned, vgexport/vgimport will not preserve your alternate links in the way they are now. If you use alternate links you may need to do some vgreduce vgextend commands to get them the way you want.
Jan Sladky
Trusted Contributor

Re: Renaming Volume Group IDs?

hi,

only renaming itself is not possible, you have to use vgexport, create the new one and vgimport:


# umount fs
# vgchange -a n /dev/vgname
# vgexport -m mapfile /dev/vgname
in mapfile change new lv names
# mkdir /dev/vgNEW

- create control file for vg:

# mknod /dev/vgNEW/group c 64 0xminornumber
(where minor number consists of vg number in
HEX e.g.02 for vg02 and 0000 - 0x020000)

# vgimport -m mapfile /dev/vgneNEW
/dev/dsk/cxtyd0

(where cxtyd0 are dev files of physical
volumes in VG)

hope this will help

br Jan

GSM, Intelligent Networks, UNIX
Jan Sladky
Trusted Contributor

Re: Renaming Volume Group IDs?

sorry, I have forgotten

vgchange -a y /dev/vgNEW

mount fs

br Jan
GSM, Intelligent Networks, UNIX
Khalil Ahmed
Frequent Advisor

Re: Renaming Volume Group IDs?

Cheers guys, I have just successfully renamed one of my VGs using the vgexport and vgimport method you suggested.

Thanks again.

Khalil

Thayanidhi
Honored Contributor

Re: Renaming Volume Group IDs?

Remember to edit your /etc/fstab after you do the above suggested procedure.

TT
Attitude (not aptitude) determines altitude.