LVM Disk Replacement: Difference between revisions

From UNIX Systems Administration
Jump to navigation Jump to search
No edit summary
No edit summary
 
(9 intermediate revisions by the same user not shown)
Line 1: Line 1:
== Replacing a working non-rootvg Physical Volume ==
== rootvg ==
=== Replacing a Working rootvg Physical Volume ===
# [[LVM Install a New Physical Volume|Install and configure the new physical volume.]]
# Add the new disk to the volume group.
## <tt>'''# extendvg rootvg <new_hdisk#>'''</tt>
# Does the disk contain hd5 (boot partition)?
## <tt>'''# lslv -m hd5'''</tt>
# No? skip to next step, yes? continue.
## <tt>'''# migratepv -l hd5 <old_hdisk#> <new_hdisk#>'''</tt>
## <tt>'''# bosboot -ad <new_hdisk#>'''</tt>
## <tt>'''# chpv -c <old_hdisk#>'''</tt>
## <tt>'''# bootlist -m normal <new_hdisk#>'''</tt>
# Disable the system dump device.
## <tt>'''# sysdupdev -p /dev/sysdumpnull'''</tt>
# Migrate data from old physical volume to new physical volume.
## <tt>'''# migratepv <old_hdisk#> <new_hdisk#>'''</tt>
# Enable the system dump device.
## <tt>'''# sysdupdev -p /dev/<lv_name>'''</tt>
# Remove the old physical volume from the volume group.
## <tt>'''# reducevg rootvg <old_hdisk#>'''</tt>
# [[LVM Remove a Physical Volume|Remove the old physical volume from the system.]]
 
=== Replacing a Mirrored rootvg Physical Volume ===
# Break the mirror.
## <tt>'''# unmirrorvg rootvg <old_hdisk#>'''</tt>
# Remove the old physical volume from the volume group.
## <tt>'''# reducevg rootvg <old_hdisk#>'''</tt>
# [[LVM Remove a Physical Volume|Remove the old physical volume from the system.]]
# [[LVM Install a New Physical Volume|Install and configure the new physical volume.]]
# Add the new disk to the volume group.
## <tt>'''# extendvg rootvg <new_hdisk#>'''</tt>
# Mirror the volume group.
## <tt>'''# mirrorvg -S -c2 rootvg <new_hdisk#>'''</tt>
# Verify the stale PPs in the volume group are 0.
## <tt>'''# lsvg rootvg | grep STALE'''</tt>
# Add the ipldevice to all of the rootvg physical volumes.
## <tt>'''# bosboot -ad <new_hdisk#>'''</tt>
## <tt>'''# bosboot -ad <current_hdisk#>'''</tt> (this step will have to be repeated for each hdisk containing the ipldevice associated with rootvg.
# Modify the bootlist to include ALL physical volumes
## <tt>'''# bootlist -m normal <new_hdisk# current_hdisk#...>'''</tt>
 
== non-rootvg ==
=== Replacing a Working non-rootvg Physical Volume ===
# [[LVM Install a New Physical Volume|Install and configure the new physical volume.]]
# [[LVM Install a New Physical Volume|Install and configure the new physical volume.]]
# Add the new physical volume to the volume group.
# Add the new physical volume to the volume group.
## <tt>'''# extendvg <volume group> <hdisk# of new physical volume>'''</tt>
## <tt>'''# extendvg <vg_name> <new_hdisk#>'''</tt>
# If the logical volumes on the old physical volume are mirrored, break the mirror.
## <tt>'''# unmirrorvg rootvg <hdisk# of old physical volume'''</tt>
# Migrate the logical volumes to the new physical volume.
# Migrate the logical volumes to the new physical volume.
## <tt>'''# migratepv <hdisk# of old physical volume> <hdisk# of new physical volume>'''</tt>
## <tt>'''# migratepv <old_hdisk#> <new_hdisk#>'''</tt>
# Remove the old physical volume from the volume group.
# Remove the old physical volume from the volume group.
## <tt>'''# reducevg <volume group> <hdisk# of old physical volume>'''</tt>
## <tt>'''# reducevg <vg_name> <old_hdisk#>'''</tt>
# [[LVM Remove a Physical Volume|Remove the old physical volume from the system.]]
# [[LVM Remove a Physical Volume|Remove the old physical volume from the system.]]


== Replacing a non-working non-rootvg Physical Volume ==
=== Replacing a Mirrored non-rootvg Physical Volume ===
# Break the mirror.
## <tt>'''# unmirrorvg <vg_name> <old_hdisk#>'''</tt>
# Remove the disk from the volume group.
## <tt>'''# reducevg <vg_name> <old_hdisk#>'''</tt>
# [[LVM Remove a Physical Volume|Remove the old physical volume from the system.]]
# [[LVM Install a New Physical Volume|Install and configure the new physical volume.]]
# [[LVM Install a New Physical Volume|Install and configure the new physical volume.]]
# [[LVM Remove a Physical Volume|Remove the old physical volume from the system.]]
# Add the new disk to the volume group.
## <tt>'''# extendvg <vg_name> <new_hdisk#>'''</tt>
# Mirror the volume group (syn in background, ensuring a copy on each disk).
## <tt>'''# mirrorvg -S -c2 <vg_name> <new_hdisk#>'''</tt>
# Synchronize the volume group.
## <tt>'''# syncvg -v <vg_name>'''</tt>
 
== Further Reading ==
== Further Reading ==
# [http://publib.boulder.ibm.com/infocenter/pseries/v5r3/index.jsp IBM pSeries and AIX Information Center]
# [http://publib.boulder.ibm.com/infocenter/pseries/v5r3/index.jsp IBM pSeries and AIX Information Center]
[[Category:AIX]]
[[Category:Linux]]

Latest revision as of 16:24, 5 January 2012

rootvg

Replacing a Working rootvg Physical Volume

  1. Install and configure the new physical volume.
  2. Add the new disk to the volume group.
    1. # extendvg rootvg <new_hdisk#>
  3. Does the disk contain hd5 (boot partition)?
    1. # lslv -m hd5
  4. No? skip to next step, yes? continue.
    1. # migratepv -l hd5 <old_hdisk#> <new_hdisk#>
    2. # bosboot -ad <new_hdisk#>
    3. # chpv -c <old_hdisk#>
    4. # bootlist -m normal <new_hdisk#>
  5. Disable the system dump device.
    1. # sysdupdev -p /dev/sysdumpnull
  6. Migrate data from old physical volume to new physical volume.
    1. # migratepv <old_hdisk#> <new_hdisk#>
  7. Enable the system dump device.
    1. # sysdupdev -p /dev/<lv_name>
  8. Remove the old physical volume from the volume group.
    1. # reducevg rootvg <old_hdisk#>
  9. Remove the old physical volume from the system.

Replacing a Mirrored rootvg Physical Volume

  1. Break the mirror.
    1. # unmirrorvg rootvg <old_hdisk#>
  2. Remove the old physical volume from the volume group.
    1. # reducevg rootvg <old_hdisk#>
  3. Remove the old physical volume from the system.
  4. Install and configure the new physical volume.
  5. Add the new disk to the volume group.
    1. # extendvg rootvg <new_hdisk#>
  6. Mirror the volume group.
    1. # mirrorvg -S -c2 rootvg <new_hdisk#>
  7. Verify the stale PPs in the volume group are 0.
    1. # lsvg rootvg | grep STALE
  8. Add the ipldevice to all of the rootvg physical volumes.
    1. # bosboot -ad <new_hdisk#>
    2. # bosboot -ad <current_hdisk#> (this step will have to be repeated for each hdisk containing the ipldevice associated with rootvg.
  9. Modify the bootlist to include ALL physical volumes
    1. # bootlist -m normal <new_hdisk# current_hdisk#...>

non-rootvg

Replacing a Working non-rootvg Physical Volume

  1. Install and configure the new physical volume.
  2. Add the new physical volume to the volume group.
    1. # extendvg <vg_name> <new_hdisk#>
  3. Migrate the logical volumes to the new physical volume.
    1. # migratepv <old_hdisk#> <new_hdisk#>
  4. Remove the old physical volume from the volume group.
    1. # reducevg <vg_name> <old_hdisk#>
  5. Remove the old physical volume from the system.

Replacing a Mirrored non-rootvg Physical Volume

  1. Break the mirror.
    1. # unmirrorvg <vg_name> <old_hdisk#>
  2. Remove the disk from the volume group.
    1. # reducevg <vg_name> <old_hdisk#>
  3. Remove the old physical volume from the system.
  4. Install and configure the new physical volume.
  5. Add the new disk to the volume group.
    1. # extendvg <vg_name> <new_hdisk#>
  6. Mirror the volume group (syn in background, ensuring a copy on each disk).
    1. # mirrorvg -S -c2 <vg_name> <new_hdisk#>
  7. Synchronize the volume group.
    1. # syncvg -v <vg_name>

Further Reading

  1. IBM pSeries and AIX Information Center