HP-UX 11.31 How to change root volume group name vg00

By Dusan Baljevic ()

a) Boot the server into LVM maintenance mode:

> boot vmunix -lm

b) Export root volume group:

# vgexport -s -m /vg00.map /dev/vg00

vgexport: Volume group "/dev/vg00" has been successfully removed.

c) Create new directory and group file for the root volume group.

Let's name it vgroot...

# mknod /dev/vgroot

# mknod /dev/vgroot/group c 64 0x010000

d) Import the map file from original vg00:

# vgimport -N -s -m /vg00.map vgroot

vgimport: Volume group "/dev/vgroot" has been successfully created.

Warning: A backup of this volume group may not exist on this machine.

Please remember to take a backup using the vgcfgbackup command after activating the volume group.

Also, upon first activation of an imported bootable volume group, make

sure to run lvlnboot(1M) command in recovery mode (-R option) to rsync the information on the disk.

e) Activate the new root volume group:

# vgchange -a y vgroot

Activated volume group.

Volume group "vgroot" has been successfully changed.

f) Check the status and make changes in LVM accordingly:

# lvlnboot -v

Boot Definitions for Volume Group /dev/vgroot:

Physical Volumes belonging in Root Volume Group:

/dev/disk/disk11_p2 -- Boot Disk

Boot: lvol1 on: /dev/disk/disk11_p2

Root: ??? on: /dev/disk/disk11_p2

Swap: ??? on: /dev/disk/disk11_p2

Dump: ??? on: /dev/disk/disk11_p2, 0

# lvrmboot -r vgroot

Volume Group configuration for /dev/vgroot has been saved in /etc/lvmconf/vgroot.conf

# lvlnboot -b /dev/vgroot/lvol1

Volume Group configuration for /dev/vgroot has been saved in /etc/lvmconf/vgroot.conf

# lvlnboot -r /dev/vgroot/lvol3

Volume Group configuration for /dev/vgroot has been saved in /etc/lvmconf/vgroot.conf

# lvlnboot -s /dev/vgroot/lvol2

Volume Group configuration for /dev/vgroot has been saved in /etc/lvmconf/vgroot.conf

If dump was part of primary swap (not in my case), one would need to run this as well:

# lvlnboot -d /dev/vgroot/lvol2

# lvlnboot -R /dev/vgroot

Volume Group configuration for /dev/vgroot has been saved in /etc/lvmconf/vgroot.conf

# lvlnboot -v

Boot Definitions for Volume Group /dev/vgroot:

Physical Volumes belonging in Root Volume Group:

/dev/disk/disk11_p2 -- Boot Disk

Boot: lvol1 on: /dev/disk/disk11_p2

Root: lvol3 on: /dev/disk/disk11_p2

Swap: lvol2 on: /dev/disk/disk11_p2

No Dump Logical Volume configured

# lvmadm -l

--- Version 1.0 volume groups ---

VG Name /dev/vgroot

PV Name /dev/disk/disk11_p2

g) We need to ensure that file system file uses new volume group name.

To get access to commands like vi(1M) or sed(1M):

# mount /dev/vgroot/lvol7 /usr

Just for fun, I did not use vi(1M) but sed(1M):

# sed -e 's/vg00/vgroot/g' /etc/fstab >/etc/fstab.new

# diff /etc/fstab /etc/fstab.new

3,10c3,10

< /dev/vg00/lvol3 / vxfs delaylog 0 1

< /dev/vg00/lvol1 /stand vxfs tranflush 0 1

< /dev/vg00/lvol4 /home vxfs delaylog 0 2

< /dev/vg00/lvol5 /opt vxfs delaylog 0 2

< /dev/vg00/lvol6 /tmp vxfs delaylog 0 2

< /dev/vg00/lvol7 /usr vxfs delaylog 0 2

< /dev/vg00/lvol8 /var vxfs delaylog 0 2

< /dev/vg00/lvol9 /var/tmp vxfs delaylog 0 2

---

> /dev/vgroot/lvol3 / vxfs delaylog 0 1

> /dev/vgroot/lvol1 /stand vxfs tranflush 0 1

> /dev/vgroot/lvol4 /home vxfs delaylog 0 2

> /dev/vgroot/lvol5 /opt vxfs delaylog 0 2

> /dev/vgroot/lvol6 /tmp vxfs delaylog 0 2

> /dev/vgroot/lvol7 /usr vxfs delaylog 0 2

> /dev/vgroot/lvol8 /var vxfs delaylog 0 2

> /dev/vgroot/lvol9 /var/tmp vxfs delaylog 0 2

# cp -p /etc/fstab.new /etc/fstab

# mount -a

mount: /dev/vgroot/lvol7 is already mounted on /usr

# bdf

Filesystem kbytes used avail %used Mounted on

/dev/vg00/lvol3 2097152 432552 1651696 21% /

/dev/vgroot/lvol7 12288000 3446528 8772480 28% /usr

/dev/vgroot/lvol8 14336000 2396872 11845920 17% /var

/dev/vgroot/lvol9 2097152 20501 1949796 1% /var/tmp

/dev/vgroot/lvol6 1048576 20816 1019736 2% /tmp

/dev/vgroot/lvol5 15368192 7992488 7318224 52% /opt

/dev/vgroot/lvol4 524288 20848 499512 4% /home

/dev/vgroot/lvol1 2097152 291696 1791408 14% /stand

# setboot -v

Primary bootpath : 1/0/1/1/0/1/1.0x6.0x0 (/dev/rdisk/disk11)

HA Alternate bootpath : 1/0/1/1/0/1/1.0x6.0x0 (/dev/rdisk/disk11)

Alternate bootpath : 0/0/0/3/0.0x5.0x0 (/dev/rdisk/disk7)

Autoboot is ON (enabled)

TEST CURRENT DEFAULT

------

all partial partial

SELFTESTS on on

early_cpu on on

late_cpu on on

FASTBOOT on on

Platform on on

Full_memory on on

Memory_init on on

IO_HW off off

Chipset on on

# swapinfo -tm

Mb Mb Mb PCT START/ Mb

TYPE AVAIL USED FREE USED LIMIT RESERVE PRI NAME

dev 8192 0 8192 0% 0 - 1 64,0x000002

reserve - 2 -2

memory 19349 1679 17670 9%

total 27541 1681 25860 6% - 0 -

h) Reboot and enjoy using the server with new root volume group name:

# /usr/sam/lbin/vginfo -v

vgroot:available,read/write@:255:16:9:1:0:16:4329:69104:12224:764:4319:0:0:/dev/vgroot/lvol1@available/syncd@2048@128@1,/dev/vgroot/lvol2@available/syncd@8192@512@1,/dev/vgroot/lvol3@available/syncd@2048@128@1,/dev/vgroot/lvol4@available/syncd@512@32@1,/dev/vgroot/lvol5@available/syncd@15008@938@1,/dev/vgroot/lvol6@available/syncd@1024@64@1,/dev/vgroot/lvol7@available/syncd@12000@750@1,/dev/vgroot/lvol8@available/syncd@14000@875@1,/dev/vgroot/lvol9@available/syncd@2048@128@1:/dev/disk/disk11_p2@@available@4319@764::LVM