From Wiki-UX.info

Wiki-UX / Logical Volume Manager / How to remove a LVM mirror boot disk
Jump to: navigation, search

How to remove a LVM mirror boot disk

Abstract

Using Logical Volume Manager (LVM) Mirro/ux to have a mirror of the HP-UX system boot disk is an standard security practice. Sometimes is required to revert the procedure to release the physical volumes that hold the mirror. This article details the procedure to perform this task on HP-UX 11i Operating Environment. This procedure can be use on boot volume groups not affected by physical errors. For replacement of damage mirror disks follow the guidelines of the How to replace a mirror disk article.

Contents


HP 9000 11i v1 (11.11) / 11i v2 (11.23)

1. Identify the current mirror boot drives. By default LVM bootable mirror volume group is "/dev/vg00". Use "strings" and "vgdisplay" commands.

#  strings /etc/lvmtab
/dev/vg00
/dev/dsk/c1t2d0
/dev/dsk/c2t2d0
# vgdisplay -v /dev/vg00
--- Volume groups ---
VG Name                     /dev/vg00
VG Write Access             read/write
VG Status                   available
Max LV                      255
Cur LV                      8
Open LV                     8
Max PV                      16
Cur PV                      1
Act PV                      1
Max PE per PV               4350
VGDA                        2
PE Size (Mbytes)            8
Total PE                    4341
Alloc PE                    3296
Free PE                     1045
Total PVG                   0
Total Spare PVs             0
Total Spare PVs in use      0

   --- Logical volumes ---
   LV Name                     /dev/vg00/lvol1
   LV Status                   available/syncd
   LV Size (Mbytes)            1792
   Current LE                  224
   Allocated PE                448
   Used PV                     2

   LV Name                     /dev/vg00/lvol2
   LV Status                   available/syncd
   LV Size (Mbytes)            4096
   Current LE                  512
   Allocated PE                1024
   Used PV                     2

   LV Name                     /dev/vg00/lvol3
   LV Status                   available/syncd
   LV Size (Mbytes)            1024
   Current LE                  128
   Allocated PE                256
   Used PV                     2

   LV Name                     /dev/vg00/lvol4
   LV Status                   available/syncd
   LV Size (Mbytes)            512
   Current LE                  64
   Allocated PE                128
   Used PV                     2

   LV Name                     /dev/vg00/lvol5
   LV Status                   available/syncd
   LV Size (Mbytes)            6144
   Current LE                  768
   Allocated PE                1536
   Used PV                     1

   LV Name                     /dev/vg00/lvol6
   LV Status                   available/syncd
   LV Size (Mbytes)            512
   Current LE                  64
   Allocated PE                128
   Used PV                     2

   LV Name                     /dev/vg00/lvol7
   LV Status                   available/syncd
   LV Size (Mbytes)            6144
   Current LE                  768
   Allocated PE                1536
   Used PV                     2

   LV Name                     /dev/vg00/lvol8
   LV Status                   available/syncd
   LV Size (Mbytes)            6144
   Current LE                  768
   Allocated PE                1536
   Used PV                     2


   --- Physical volumes ---
   PV Name                     /dev/dsk/c1t2d0
   PV Status                   available
   Total PE                    4341
   Free PE                     1045
   Autoswitch                  On
   Proactive Polling           On

   PV Name                     /dev/dsk/c2t2d0
   PV Status                   available
   Total PE                    4341
   Free PE                     1045
   Autoswitch                  On
   Proactive Polling           On

2. Change NVRAM [ primary | alternate ] paths to boot only from the drive that will be keep as a bootable drive, normally the primary boot disk. Use "setboot" command.

# setboot
Primary bootpath : 0/0/1/1.2.0
Alternate bootpath : 0/0/2/0.0.0

Autoboot is ON (enabled)
Autosearch is ON (enabled)

# setboot -a 0/0/1/1.2.0

# setboot
Primary bootpath : 0/0/1/1.2.0
Alternate bootpath : 0/0/1/1.2.0

Autoboot is ON (enabled)
Autosearch is ON (enabled)

3. Reduce the physical volume mirror from the logicals volumes in reverse order using "lvreduce -m - /dev/vg00/lvol## /dev/dsk/c#t#d#" command. Remember to specific the physical volume that will be removed.

# lvreduce -m 0 /dev/vg00/lvol8 /dev/dsk/c2t2d0
# lvreduce -m 0 /dev/vg00/lvol7 /dev/dsk/c2t2d0
# lvreduce -m 0 /dev/vg00/lvol6 /dev/dsk/c2t2d0
# lvreduce -m 0 /dev/vg00/lvol5 /dev/dsk/c2t2d0
# lvreduce -m 0 /dev/vg00/lvol4 /dev/dsk/c2t2d0
# lvreduce -m 0 /dev/vg00/lvol3 /dev/dsk/c2t2d0
# lvreduce -m 0 /dev/vg00/lvol2 /dev/dsk/c2t2d0
# lvreduce -m 0 /dev/vg00/lvol1 /dev/dsk/c2t2d0

4. Reduce the physical volume from the volume group using "vgreduce /dev/vg00 /dev/dsk/c#t#d0" command. Remember to specific the physical volume that will be removed.

# vgreduce /dev/vg00 /dev/dsk/c2t2d0

5. Finally remove LVM headers from the physical volume using "pvremove /dev/rdsk/c#t#d#" command. Remember to use the character (raw) device special file.

# pvremove /dev/rdsk/c2t2d0

HP 9000 11i v3 (11.31) with persistent DSF

#  strings /etc/lvmtab
/dev/vg00
/dev/disk/disk5
/dev/disk/disk6
# vgdisplay -v /dev/vg00
--- Volume groups ---
VG Name                     /dev/vg00
VG Write Access             read/write
VG Status                   available
Max LV                      255
Cur LV                      8
Open LV                     8
Max PV                      16
Cur PV                      1
Act PV                      1
Max PE per PV               4350
VGDA                        2
PE Size (Mbytes)            8
Total PE                    4341
Alloc PE                    3296
Free PE                     1045
Total PVG                   0
Total Spare PVs             0
Total Spare PVs in use      0

   --- Logical volumes ---
   LV Name                     /dev/vg00/lvol1
   LV Status                   available/syncd
   LV Size (Mbytes)            1792
   Current LE                  224
   Allocated PE                448
   Used PV                     2

   LV Name                     /dev/vg00/lvol2
   LV Status                   available/syncd
   LV Size (Mbytes)            4096
   Current LE                  512
   Allocated PE                1024
   Used PV                     2

   LV Name                     /dev/vg00/lvol3
   LV Status                   available/syncd
   LV Size (Mbytes)            1024
   Current LE                  128
   Allocated PE                256
   Used PV                     2

   LV Name                     /dev/vg00/lvol4
   LV Status                   available/syncd
   LV Size (Mbytes)            512
   Current LE                  64
   Allocated PE                128
   Used PV                     2

   LV Name                     /dev/vg00/lvol5
   LV Status                   available/syncd
   LV Size (Mbytes)            6144
   Current LE                  768
   Allocated PE                1536
   Used PV                     1

   LV Name                     /dev/vg00/lvol6
   LV Status                   available/syncd
   LV Size (Mbytes)            512
   Current LE                  64
   Allocated PE                128
   Used PV                     2

   LV Name                     /dev/vg00/lvol7
   LV Status                   available/syncd
   LV Size (Mbytes)            6144
   Current LE                  768
   Allocated PE                1536
   Used PV                     2

   LV Name                     /dev/vg00/lvol8
   LV Status                   available/syncd
   LV Size (Mbytes)            6144
   Current LE                  768
   Allocated PE                1536
   Used PV                     2


   --- Physical volumes ---
   PV Name                     /dev/disk/disk5
   PV Status                   available
   Total PE                    4341
   Free PE                     1045
   Autoswitch                  On
   Proactive Polling           On

   PV Name                     /dev/disk/disk6
   PV Status                   available
   Total PE                    4341
   Free PE                     1045
   Autoswitch                  On
   Proactive Polling           On

2. Change NVRAM [ primary | alternate ] paths to boot only from the drive that will be keep as a bootable drive, normally the primary boot disk. Use "setboot" command.

# setboot
Primary bootpath : 0/0/1/1.0x2.0x0 (/dev/rdisk/disk5)
Alternate bootpath : 0/0/2/0.0x0.0x0 (/dev/rdisk/disk6)

Autoboot is ON (enabled)
Autosearch is ON (enabled)

# setboot -a 0/0/1/1.0x2.0x0

# setboot
Primary bootpath : 0/0/1/1.0x2.0x0 (/dev/rdisk/disk5)
Alternate bootpath : 0/0/1/1.0x2.0x0 (/dev/rdisk/disk5)

Autoboot is ON (enabled)
Autosearch is ON (enabled)

3. Reduce the physical volume mirror from the logicals volumes in reverse order using "lvreduce -m - /dev/vg00/lvol## /dev/disk/disk#" command. Remember to specific the physical volume that will be removed.

# lvreduce -m 0 /dev/vg00/lvol8 /dev/disk/disk6
# lvreduce -m 0 /dev/vg00/lvol7 /dev/disk/disk6
# lvreduce -m 0 /dev/vg00/lvol6 /dev/disk/disk6
# lvreduce -m 0 /dev/vg00/lvol5 /dev/disk/disk6
# lvreduce -m 0 /dev/vg00/lvol4 /dev/disk/disk6
# lvreduce -m 0 /dev/vg00/lvol3 /dev/disk/disk6
# lvreduce -m 0 /dev/vg00/lvol2 /dev/disk/disk6
# lvreduce -m 0 /dev/vg00/lvol1 /dev/disk/disk6

4. Reduce the physical volume from the volume group using "vgreduce /dev/vg00 /dev/dsk/c#t#d0" command. Remember to specific the physical volume that will be removed.

# vgreduce /dev/vg00 /dev//dev/disk/disk6

5. Finally remove LVM headers from the physical volume using "pvremove /dev/rdsk/c#t#d#" command. Remember to use the character (raw) device special file.

# pvremove /dev/rdisk/disk6

Integrity 11i v2 (11.23)

On Integrity (Itanium) servers Mirror/UX uses second EFI partition "/dev/rdsk/c#t#d#s2". The key point of removing the reducing the boot mirror is to use that partition as the physical volume parameter for the commands.


1. Identify the current mirror boot drives. By default LVM bootable mirror volume group is "/dev/vg00". Use "strings" and "vgdisplay" commands.

#  strings /etc/lvmtab
/dev/vg00
/dev/dsk/c1t2d0s2
/dev/dsk/c2t2d0s2
# vgdisplay -v /dev/vg00
--- Volume groups ---
VG Name                     /dev/vg00
VG Write Access             read/write
VG Status                   available
Max LV                      255
Cur LV                      8
Open LV                     8
Max PV                      16
Cur PV                      1
Act PV                      1
Max PE per PV               4350
VGDA                        2
PE Size (Mbytes)            8
Total PE                    4341
Alloc PE                    3296
Free PE                     1045
Total PVG                   0
Total Spare PVs             0
Total Spare PVs in use      0

   --- Logical volumes ---
   LV Name                     /dev/vg00/lvol1
   LV Status                   available/syncd
   LV Size (Mbytes)            1792
   Current LE                  224
   Allocated PE                448
   Used PV                     2

   LV Name                     /dev/vg00/lvol2
   LV Status                   available/syncd
   LV Size (Mbytes)            4096
   Current LE                  512
   Allocated PE                1024
   Used PV                     2

   LV Name                     /dev/vg00/lvol3
   LV Status                   available/syncd
   LV Size (Mbytes)            1024
   Current LE                  128
   Allocated PE                256
   Used PV                     2

   LV Name                     /dev/vg00/lvol4
   LV Status                   available/syncd
   LV Size (Mbytes)            512
   Current LE                  64
   Allocated PE                128
   Used PV                     2

   LV Name                     /dev/vg00/lvol5
   LV Status                   available/syncd
   LV Size (Mbytes)            6144
   Current LE                  768
   Allocated PE                1536
   Used PV                     1

   LV Name                     /dev/vg00/lvol6
   LV Status                   available/syncd
   LV Size (Mbytes)            512
   Current LE                  64
   Allocated PE                128
   Used PV                     2

   LV Name                     /dev/vg00/lvol7
   LV Status                   available/syncd
   LV Size (Mbytes)            6144
   Current LE                  768
   Allocated PE                1536
   Used PV                     2

   LV Name                     /dev/vg00/lvol8
   LV Status                   available/syncd
   LV Size (Mbytes)            6144
   Current LE                  768
   Allocated PE                1536
   Used PV                     2


   --- Physical volumes ---
   PV Name                     /dev/dsk/c1t2d0s2
   PV Status                   available
   Total PE                    4341
   Free PE                     1045
   Autoswitch                  On
   Proactive Polling           On

   PV Name                     /dev/dsk/c2t2d0s2
   PV Status                   available
   Total PE                    4341
   Free PE                     1045
   Autoswitch                  On
   Proactive Polling           On

2. Change NVRAM [ primary | alternate ] paths to boot only from the drive that will be keep as a bootable drive, normally the primary boot disk. Use "setboot" command.

# setboot
Primary bootpath : 0/0/1/1.2.0
Alternate bootpath : 0/0/2/0.0.0

Autoboot is ON (enabled)
Autosearch is ON (enabled)

# setboot -a 0/0/1/1.2.0

# setboot
Primary bootpath : 0/0/1/1.2.0
Alternate bootpath : 0/0/1/1.2.0

Autoboot is ON (enabled)
Autosearch is ON (enabled)

3. Reduce the physical volume mirror from the logicals volumes in reverse order using "lvreduce -m - /dev/vg00/lvol## /dev/dsk/c#t#d#s2" command. Remember to specific the physical volume that will be removed.

# lvreduce -m 0 /dev/vg00/lvol8 /dev/dsk/c2t2d0s2
# lvreduce -m 0 /dev/vg00/lvol7 /dev/dsk/c2t2d0s2
# lvreduce -m 0 /dev/vg00/lvol6 /dev/dsk/c2t2d0s2
# lvreduce -m 0 /dev/vg00/lvol5 /dev/dsk/c2t2d0s2
# lvreduce -m 0 /dev/vg00/lvol4 /dev/dsk/c2t2d0s2
# lvreduce -m 0 /dev/vg00/lvol3 /dev/dsk/c2t2d0s2
# lvreduce -m 0 /dev/vg00/lvol2 /dev/dsk/c2t2d0s2
# lvreduce -m 0 /dev/vg00/lvol1 /dev/dsk/c2t2d0s2

4. Reduce the physical volume from the volume group using "vgreduce /dev/vg00 /dev/dsk/c#t#d0s2" command. Remember to specific the physical volume that will be removed.

# vgreduce /dev/vg00 /dev/dsk/c2t2d0s2

5. Finally, remove LVM headers from the physical volume using "pvremove /dev/rdsk/c#t#d#s2" command. Remember to use the character (raw) device special file.

# pvremove /dev/rdsk/c2t2d0s2

Integrity 11i v3 (11.31) with persistent DSF

On Integrity (Itanium) servers Mirror/UX uses the second EFI partition on the persistent device special file /dev/rdisk/disk#_p2. The key point to reduce the boot mirror is to use that partition as the physical volume parameter for the LVM commands.

1. Identify the current mirror boot drives. By default LVM bootable mirror volume group is "/dev/vg00". Use strings and vgdisplay commands. In this example, /dev/disk/disk6_p2 will be removed from the volume group configuration.

#  strings /etc/lvmtab
/dev/vg00
/dev/disk/disk5_p2
/dev/disk/disk6_p2
# vgdisplay -v /dev/vg00
--- Volume groups ---
VG Name                     /dev/vg00
VG Write Access             read/write
VG Status                   available
Max LV                      255
Cur LV                      8
Open LV                     8
Max PV                      16
Cur PV                      1
Act PV                      1
Max PE per PV               4350
VGDA                        2
PE Size (Mbytes)            8
Total PE                    4341
Alloc PE                    3296
Free PE                     1045
Total PVG                   0
Total Spare PVs             0
Total Spare PVs in use      0

   --- Logical volumes ---
   LV Name                     /dev/vg00/lvol1
   LV Status                   available/syncd
   LV Size (Mbytes)            1792
   Current LE                  224
   Allocated PE                448
   Used PV                     2

   LV Name                     /dev/vg00/lvol2
   LV Status                   available/syncd
   LV Size (Mbytes)            4096
   Current LE                  512
   Allocated PE                1024
   Used PV                     2

   LV Name                     /dev/vg00/lvol3
   LV Status                   available/syncd
   LV Size (Mbytes)            1024
   Current LE                  128
   Allocated PE                256
   Used PV                     2

   LV Name                     /dev/vg00/lvol4
   LV Status                   available/syncd
   LV Size (Mbytes)            512
   Current LE                  64
   Allocated PE                128
   Used PV                     2

   LV Name                     /dev/vg00/lvol5
   LV Status                   available/syncd
   LV Size (Mbytes)            6144
   Current LE                  768
   Allocated PE                1536
   Used PV                     1

   LV Name                     /dev/vg00/lvol6
   LV Status                   available/syncd
   LV Size (Mbytes)            512
   Current LE                  64
   Allocated PE                128
   Used PV                     2

   LV Name                     /dev/vg00/lvol7
   LV Status                   available/syncd
   LV Size (Mbytes)            6144
   Current LE                  768
   Allocated PE                1536
   Used PV                     2

   LV Name                     /dev/vg00/lvol8
   LV Status                   available/syncd
   LV Size (Mbytes)            6144
   Current LE                  768
   Allocated PE                1536
   Used PV                     2


   --- Physical volumes ---
   PV Name                     /dev/disk/disk5_p2
   PV Status                   available
   Total PE                    4341
   Free PE                     1045
   Autoswitch                  On
   Proactive Polling           On

   PV Name                     /dev/disk/disk6_p2
   PV Status                   available
   Total PE                    4341
   Free PE                     1045
   Autoswitch                  On
   Proactive Polling           On

2. Change NVRAM [ primary | alternate ] paths to point only to the drive that will be keep on the configuration, normally the primary boot disk. Use setboot command.

# setboot
Primary bootpath : 0/0/1/1.0x2.0x0 (/dev/rdisk/disk5)
Alternate bootpath : 0/0/2/0.0x0.0x0 (/dev/rdisk/disk6)

Autoboot is ON (enabled)
Autosearch is ON (enabled)

# setboot -a 0/0/1/1.0x2.0x0

# setboot
Primary bootpath : 0/0/1/1.0x2.0x0 (/dev/rdisk/disk5)
Alternate bootpath : 0/0/1/1.0x2.0x0 (/dev/rdisk/disk5)

Autoboot is ON (enabled)
Autosearch is ON (enabled)

3. Reduce the physical volume mirror from the logicals volumes in reverse order using lvreduce -m - /dev/vg00/lvol## /dev/dsk/disk#_s2 command. Remember to specific the physical volume that will be removed.

# lvreduce -m 0 /dev/vg00/lvol8 /dev/disk/disk6_p2
# lvreduce -m 0 /dev/vg00/lvol7 /dev/disk/disk6_p2
# lvreduce -m 0 /dev/vg00/lvol6 /dev/disk/disk6_p2
# lvreduce -m 0 /dev/vg00/lvol5 /dev/disk/disk6_p2
# lvreduce -m 0 /dev/vg00/lvol4 /dev/disk/disk6_p2
# lvreduce -m 0 /dev/vg00/lvol3 /dev/disk/disk6_p2
# lvreduce -m 0 /dev/vg00/lvol2 /dev/disk/disk6_p2
# lvreduce -m 0 /dev/vg00/lvol1 /dev/disk/disk6_p2

4. Reduce the physical volume from the volume group using vgreduce /dev/vg00 /dev/dsk//dev/disk/disk#_p2 command. Remember to specific the physical volume EFI partition that will be removed.

# vgreduce /dev/vg00 /dev/disk/disk6_p2

5.Remove LVM headers from the physical volume using "pvremove /dev/rdsk/c#t#d#s2" command. Remember to use the character (raw) device special file.

# pvremove /dev/rdisk/disk6_p2

6. Remove EFI headers from the disk if desired

# idisk -R -w /dev/rdisk/disk6_p2

Authors

This page was last modified on 3 August 2011, at 19:45. This page has been accessed 5,853 times.