Hp Ux Ioscan

Ioscan on HP-UX 9.1 I am trying to work out the logical device name on a HP 9000 system running HP-UX 9.1. I see that ioscan-fnC disk looks like the command on later versions of HP-UX unfortunately it seems the n option is not available on 9.1. Solved: Hi, Newbie on HPUX. Our rp3410 running HPUX 11.31 is not showing any disks when i run 'ioscan -fnC disk' (this machine has two scsi disks). Unix World In this post, You can get an idea about HP-UX logical volume manager commands with an example. As you know LVM is basically used for disk management in operating system that allow to manager the physical disks and logical volume. Please find the below HP-UX LVM commands with an example. Hewlett-Packard Company - 1 - HP-UX 11i Version 2: August 2003 ioscan (1M) ioscan (1M) -d driver Restrict the output listing to those devices controlled by the specified driver.

This document addresses the considerations and steps necessary to replace a failed LVM disk that form part of a MirrorDisk/UX mirror, with special attention to LVM boot disks.

Abstract[edit]

This document addresses the considerations and steps necessary to replace a failed LVM disk that form part of a MirrorDisk/UX mirror, with special attention to LVM boot disks. The document evaluates the different scenarios that you may encounter and considerations to help you to select the best and most secure replacing strategy of the failed disk(s).

  • 1Abstract
  • 2Verify the required patches
  • 4Disable I/O requests to the physical volume
  • 5SAS Controllers (Serial Attach SCSI)
  • 6Replacement procedures

Background[edit]

Replacing a mirror disk under LVM is a critical procedure. MirrorDisk/UX is used to protect critical data volumes, like the boot devices of a HP-UX 11i or other high sensitive data. There exist two common scenarios where this operation is performed.

  1. The mirror disk(s) is(are) inside the system or in an enclosure that cannot be extracted on a live system. If this is the case, you must shutdown the system, replace the failed disk and in case where are replacing a mirror boot disk, boot from the remaining disk. You can repair the mirror after booting the system.
  2. The mirror disk(s) is(are) in a hot swappable bay or an external array, that allows the disk or lun to be removed live, but only if the system bus (scsi/fc/sas) is not sending I/O requests to the disk(s). To be sure to comply with this requirement, is necessary to disable the usage of the disk. To perform this task, you may use the OLR (Online Replacement) feature, disable the disk from the volume group, or completly disable the volume group.

Completely disabling volume group vg00 is not an option since this volume group contains several critical filesystems (/, /var, /usr).

Using Hot-Swappable Disks[edit]

The hot-swap feature provides the ability to remove or add an inactive hard disk drive module to a system while electrical power is on the system and the SCSI bus is still active (but not sending I/O requests to the disk that need to be exchanged). In other words, you can replace or remove a hot-swappable disk from a system without turning off the power of the entire system or/and the external enclosure.

Consult your system hardware manuals for information about which disk in your system are hot-swappable. Specifications for other hard disks are available in their installation manuals at http://docs.hp.com.

Verify the required patches[edit]

LVM (Online Replacement feature) OLR is delivered in two patches for HP-UX 11.11 an 11.23. One patch for the kernel and another for the pvchange command. These patch introduce the '–a' flag on the 'pvchange' command to disable I/O to specific physical volumes.

Required patches[edit]

The original patches where for HP-UX 11i version 1 and for HP-UX 11i version 2. Following are the recommend patch releases for both platforms.

HP-UX 11.11

Minimal:

  • s700_800 11.11 LVM Cumulative Patch; LVM OLR; SLVM 16 Node
    PHKL_31216 [1]
  • s700_800 11.11 LVM commands cumulative patch; LVM OLR
    PHCO_30698 [2]

Recommended:

  • s700_800 11.11 LVM Cumulative Patch; LVM OLR; SLVM 16 Node
    PHKL_35970[3]
  • s700_800 11.11 LVM commands cumulative patch
    PHCO_35955 [4]

HP-UX 11.23

Minimal:

  • s700_800 11.23 LVM Cumulative Patch
    PHKL_32095 [5]
  • s700_800 11.23 LVM commands patch
    PHCO_31709 [6]

Recommended:

  • s700_800 11.23 LVM Cumulative Patch
    PHKL_36745 [7]
  • s700_800 11.23 LVM commands patch
    PHCO_36744 [8]

Notes:

Ioscan
  • Apply these patches and any required dependencies.
  • These patches, as with any patch, may be superseded.
  • Please check for the latest patches at HP's IT Resource Center (ITRC) at itrc.hp.com

Test installed patches[edit]

The following script can be used to test the availability of the OLR features on a specific HP-UX 11i instance:

Collect current volume group configuration[edit]

Prior to use any replacement procedure, is good policy to create detailed volume group state report. The report will assist you to detect special volume group configuration. The following script creates a detailed volume group / logical volume configuration report.

Be alert to the following points:

  • Physical Volumes (PV) on the volume group configure as alternate paths.
  • Mirrored logical volume distribution (number of mirror).
  • Logical volumes sizes vs physical volumes sizes.

Disable I/O requests to the physical volume[edit]

Using 'vgchange' command[edit]

Sometimes, even if the OLR feature is not enable on the system, is still possible to disable the I/O requests to the disk that need to be exchanged, allowing you to exchange the drive.

You may also found situations when the failed disk has been hot replaced, without causing the system to hang, but leaving the volume group in a state where the “vgcfgrestore” command cannot be performed because the kernel still believes is an active part of the volume group.

Turning off the system and booting without quorum restrictions correct this situation, but require a maintenance window that may be unpractical. The basic concept is to make the kernel aware that the physical volume that forms part of the volume group conglomerate has failed.

If the disk is completely down (HARDWARE UNCLAIMED, “diskinfo” cannot query the disk or the PVRA/VGRA is damage), you can try to re enable the active volume group allowing the kernel to realize that the disk is not longer available.

The command will query the physical volumes and report those physical volumes that cannot be reattached to the volume group. That left the physical volume in a state were it can be hot replaced or “vgcfgrestored”. After that, you follow the normal restore procedure.

If the vgcfgrestore –n /dev/vgXX /dev/rdsk/c#t#d# give an error message informing that the disk is still enable on the volume group, you will need to reboot the system, replace the disk and boot with the quorum restriction disable.

Reducing the logical volume mirrors[edit]

Is has been a common practice, before the appearance of the OLR feature in 11i v1, to reduce the logical volumes from the failed disk and reduce the physical volume from the volume group to assure that no I/O requests are going to the failed disk.

This procedure has several drawbacks:

  1. The disk should be accessible and the PVRA/VGRA should be working.
  2. This approach usually produces more harm than benefits. It’s not uncommon that the system hangs during these tasks.
  3. The procedure is prune to errors. You need to lvreduce the logical volume(s) mirror(s), vgreduce the logical volume group, replace the physical volume, pvcreate the physical volume, vgextend the volume group and lvextend the logical volume(s) mirror(s). That is particulary complex on Integrity systems when disk should be partitioned with the idisk command.

The best practice is to preserve the system logical volume mirror structure and try any of the procedures describe on this document. Never reduce the logical mirrors or remove the disk from the volume group if the OLR feature is available or if the disk report heavy damages with diskinfo or ioscan commands.

Be aware, nonetheless, that on HP-UX 11.0 and below, this is the only way to disable I/O requests to the disks. Be aware than trying this method may hang up the system, and you will have to boot into single user mode / maintenance mode without quorum restriction disable to recover back the system to a proper state.

SAS Controllers (Serial Attach SCSI)[edit]

Serial Attach SCSI controllers adds another layer of complexity to LVM mirror disk replacement. Every SAS attached disk create a new disk instance on the system. To acomplish the disk replacement, is necesary to 'redirect' the the hardware path to the old disk instance.

Legacy Device Special Files[edit]

1. Determinate the current state of the legacy special device special files an the status of the SAS controller.


The 0/4/1/0.0.0.0.0 hardware path correspond to the failed drive. The new dsf /dev/rdsk/c0t4d0 has been created after installing the new drive.

2. Redirect the new dsf to the original dsf, so the SAS controller identified the new disk with the previous address.

Persistent Device Special files (HP-UX 11.31)[edit]

The approach is similar that with legacy device special files on HP-UX 11.23 / 11.31. The may difference is that the usage of persistent device special files (Agile View) needs that you use the 'io_redirect_dsf' command instead of 'sasmgr'. The example uses an Integrity system that also display the dsf for the different EFI partitions.

1. Determinate the current state of the legacy special device special files an the status of the SAS controller.

2. Redirect the new dsf (/dev/disk/disk5) to the previous dsf allowing the SAS to replace one disk with the other.

Replacement procedures[edit]

HP 9000 (PA-RISC) - Required reboot[edit]

1. Shutdown the system.

2. Replace the damaged disk.

Is the damage disk one of the boot disk mirrors? No, jump to step 6.

3. Boot up the system again.

4. Interrupt the PDC boot sequence.

5. Boot from the good mirror disk, with quorum disabled.

6. Rescan the hardware and create the new device special files:

7. Restore the LVM reserved areas (PVRA/VGRA):

Is the damage disk one of the boot disk mirrors? No, jump to step 10.

8. Repopulate the LIF area:

9. Change the AUTO file contents choosing the best police for the boot path:

A) Primary boot disk.

B) Alternate boot disk.

10. Reactivate the volume group to attach the physical volumen.

  • Note:
In case that the volume group don’t start to synchronize the logical volumes automatically, you can force synchronization with:

11. Use lvlnboot to ensure that the LVM logical volumes are prepared to be root, primary swap or dump volume.

HP 9000 (PA-RISC) - Online Hot Plug[edit]

1. Detach the physical volume from volume group:

2. Hot swap the disk.

3. Restore the LVM reserved areas (PVRA/VGRA):

Is a bootable disk? No, jump to step 6.

4. Repopulate the LIF area:

5. Change the AUTO file contents to the proper mode:

A) Primary boot disk.

B) Alternate boot disk.

6. Reattach the new disk:

7. Reactivate the volume group to attach the physical volumen.

Note: In case that the volume group don’t start to synchronize the logical volumes automatically, you can force synchronization with:

8. Use lvlnboot to ensure that the LVM logical volumes are prepared to be root, primary swap or dump volume.

HP 9000 (PA-RISC) 11.31 - Persistent DSF[edit]

1. Save hardware paths information of the disk (printout or file). It's very important to save this information, since some of these details won't be available after the scsimgr command.

Note: If the server is rebooted to execute the change, only the new LUN instance will be displayed. The old LUN will disappear from the ioscan output. Keep the output of these commands in a secure place.

2. Detach the physical volume from the volume group.

3. Physically replace the disk.

4. Replacing and executing ioscan again won't report the disk as CLAIMED yet. Checking the lunpath(s) you should be able to see the AUTH_FAILED state. This is a security mechanism implemented on HP-UX 11.31 to avoid replacing the bad disk unless you explicitly authorize it from the OS.

5. Notify the mass storage subsystem that the disk has been replaced (Authorize the replacement). Make sure you have created the logs specified in step #1, the lunpath HW path can't be read from the original disk after this command.

Note: This command allows the storage subsystem to replace the old disk's LUN World-Wide-Identifier (WWID) with the new disk's LUN WWID. The storage subsystem will create a new LUN instance and new device special files for the new disk. This command is not required if you reboot the server because no lunpath will be assign to the old /dev/rdisk/disk8, because the system automatically authorizes the replacement after the reboot.

6. Determine the new persistent device special file (agile view) of the disk. The lunpath HW path(0/1/1/0.0xa.0x0) was originally assigned to disk8, it is now temporary assigned to disk3 in this example. Using the lunpath HW path you ensure that disk3 is the correct new disk that replaces disk8.

7. Assign the old instance number to the replacement disk. This commands restores disk8 as the valid device file to acces the new disk and removes disk3 device files.

8. Repopulate the LIF area:

9. Change the AUTO file contents to the proper mode:

A) Primary boot disk.

B) Alternate boot disk.

10. Reattach the new disk:

11. Use lvlnboot to ensure that the LVM logical volumes are prepared to be root, primary swap or dump volume.

12. Reactivate the volume group to attach the physical volumen.

Note: In case that the volume group don’t start to synchronize the logical volumes automatically, you can force synchronization with:

13. Use lvlnboot to ensure that the LVM logical volumes are prepared to be root, primary swap or dump volume.

14. Update /stand/bootconf to reflect your current boot disks. The format is 'l' for 'larry' followed by an space and the disk name, for example:

Integrity (Itanium) - Required reboot[edit]

1. Initiate the boot sequence:

2. Replace the damaged disk.

The damage disk is one of the boot disk mirrors? No, jump to step 11.

3. Interrupt the EFI boot manager autoboot.

4. Select the proper mirror. Can be primary or alternate. Depend of which disk you have replaced. your mirrored disk from the boot manager selection menu.

5. Verify which disk/kernel you booted from

6. In the HP-UX system prompt, recreate the device files for EFI and OS partitions on the new disk:

7. Create the EFI and OS partititions using an IPF partition description file.

8. Use idisk to setup the disk partitioning using the file created above:

  • Note:
There will be a prompt with a message saying the operation may be destructive and asks to continue. Be sure to answer 'yes' for the operation to be successful. If the prompt is answered with 'y' only, an error is received along with a message saying 'user aborting'.

9. Use mkboot to format and populate the newly created EFI partition:

10. Change the AUTO file contents to the proper mode:

A) Primary boot disk.

B) Alternate boot disk.

11. Restore the LVM reserved areas (PVRA/VGRA):

12. Reactivate the volume group to attach the physical volume.

Note: In case that the volume group don’t start to synchronize the logical volumes automatically, you can force synchronization with:

13. Use lvlnboot to ensure that the LVM logical volumes are prepared to be root, primary swap or dump volume.

Integrity (Itanium) - Online Hot Plug[edit]

1. Detach the physical volume from volume group:

2. Hot swap the disk.

Is a bootable disk? No, jump to step 5.

3. Create a description file by doing the following:

4. Use idisk to setup the disk partitioning using the file created above:


Note: There will be a prompt with a message saying the operation may be destructive and asks to continue. Be sure to answer 'yes' for the operation to be successful. If the prompt is answered with 'y' only, an error is received along with a message saying 'user aborting'.

5. Use mkboot to format and populate the newly created EFI partition:

6. Change the AUTO file contents to the proper mode:

A) Primary boot disk.

Harry potter minecraft world seed. B) Alternate boot disk.

7. Restore the LVM reserved areas (PVRA/VGRA):

8. Reattach the new disk:

9. Reactivate the volume group to attach the physical volumen.

Note: In case that the volume group don’t start to synchronize the logical volumes automatically, you can force synchronization with:

10. Use lvlnboot to ensure that the LVM logical volumes are prepared to be root, primary swap or dump volume.

Integrity (Itanium) 11.31 - Persistent DSF[edit]

1. Save hardware paths information of the disk (printout or file). It's very important to save this information, since some of these details won't be available after the scsimgr command.



Note: If the server is rebooted to execute the change, only the new LUN instance will be displayed. The old LUN will disappear from the ioscan output. Keep the output of these commands in a secure place.

2. Detach the physical volume from the volume group.

3. Physically replace the disk.

4. Replacing and executing ioscan again won't report the disk as CLAIMED yet. Checking the lunpath(s) you should be able to see the AUTH_FAILED state. This is a security mechanism implemented on HP-UX 11.31 to avoid replacing the bad disk unless you explicitly authorize it from the OS.

5. Notify the mass storage subsystem that the disk has been replaced (Authorize the replacement). Make sure you have created the logs specified in step #1, the lunpath HW path can't be read from the original disk after this command.

Note: This command allows the storage subsystem to replace the old disk's LUN World-Wide-Identifier (WWID) with the new disk's LUN WWID. The storage subsystem will create a new LUN instance and new device special files for the new disk. This command is not required if you reboot the server because no lunpath will be assign to the old /dev/rdisk/disk8, because the system automatically authorizes the replacement after the reboot.

6. Determine the new persistent device special file (agile view) of the disk. The lunpath HW path(0/1/1/0.0xa.0x0) was originally assigned to disk8, it is now temporary assigned to disk3 in this example. Using the lunpath HW path you ensure that disk3 is the correct new disk that replaces disk8.

7. Create a description file to create the EFI partitions. Use the following command:

8. Use idisk to setup the disk partitioning using the file created above and create the persistent device special files.

  • Note:
There will be a prompt with a message saying the operation may be destructive and asks to continue. Be sure to answer 'yes' for the operation to be successful. If the prompt is answered with 'y' only, an error is received along with a message saying 'user aborting'.

9. Verify the state of the mass storage subsystem after creating the EFI partitions.

10. Assign the old instance number to the replacement disk. This commands restores disk8 as the valid device file to acces the new disk and removes disk3 device files.

  • Note:
If you miss to create the efi partition before using io_redirect_dsf, the command will gracefully fail with the following error message:

11. Verify that the io_redirect_dsf has properly attached the disk to the previous persistent dsf and that the physical volume status is CLAIMED.

12. Use mkboot to format and populate the newly created EFI partition:

13. Change the AUTO file contents to the proper mode:.

A) Primary boot disk.

B) Alternate boot disk.

14. Restore the LVM reserved areas (PVRA/VGRA).

15. Reattach the new disk:

16. Reactivate the volume group to attach the physical volumen.

Note: In case that the volume group don’t start to synchronize the logical volumes automatically, you can force synchronization with:

17. Use lvlnboot to ensure that the LVM logical volumes are prepared to be root, primary swap or dump volume.

18. Update /stand/bootconf to reflect your current boot disks. The format is 'l' for 'larry' followed by an space and the disk name, for example:

Integrity (Itanium) - SAS Disk Replacement[edit]

Please follow these instructions. In this example the failed drive is c1t4d0 and it's corresponding SAS controller name sasd0:

1. Check current configuration state:

Note: It's important to save also the output of 'sasmgr get_info -D /dev/sasd# -q raid=all', this way you can compare the original disk with the replacement disk using the bay number, since the target id will always change and can't be used as a comparison strategy when replacing SAS disks.

2. If the physical volume is part of an existing volume group, temporaly disable LVM I/O to the drive:

3. Turn on the disk’s locator LED to ensure the remove the correct disk from the sas bay.

Verify that only the failed drive locate LED is set to ON.

4. At this point the drive in bay 5 can be physically remove and replace with the new drive.

5. Running ioscan again will output the new disk HW path, 0/4/1/0.0.0.11.0 in this example. Failed drive will still show NO_HW. This behavior is normal:

6. The new disk will use a different SAS address (Similar to WWN on fibre channel connections). The old device special file name must be redirected to the new HW path. Issue the following command to update the configuration:

7. Verify the system state with ioscan:

  • Note: The S/W State of the H/W Path 0/4/1/0.0.0.4.0 changed to CLAIMED, and the S/W State of the H/W Path 0/4/1/0.0.0.11.0 changed to NO_H/W. The hardware path 0/4/1/0.0.0.11.0 will remain as NO_HW in the ioscan output until the system next reboot.

8. Now you must restore LVM mirroring to the new disk. If this is a bootable volume group, it involves creating the EFI partitions and formatting partition 1; changing the autoboot file if this was the mirror (not necessary for the primary disk); and, restoring the LVM information to EFI partition 2.

9. Note: Only necessary for vg00. Rewrite the boot information to the EFI Boot Menu so the system will be able to boot from the new path.

Monitor volume group syncronization[edit]

If you need to monitor the advance of the volume group sincronization, you can use this script to quickly monitor extends that are still 'stale'. Running this command should give a lower value each iteration until it reachs zero.

Example:

Reference[edit]

Linux Scan For New Disk

Authors[edit]

Linux Disk Wwn

  • Editor Scott Marer

Hp-ux Ioscan Wwn

Retrieved from 'http://wiki-ux.info/w/index.php?title=How_to_replace_a_LVM_mirror_boot_disk&oldid=17005'