IBM Power 740 Replace Local Hard Disk
P740 Replace Local Hard Drive (Reference)
- Confirm the serial number of the reporting device:
Run uname –uM to confirm the last 7 digits of the serial number are <Serial Number>

- View system errors:
The errpt command shows that the disk hdisk1 has a DISK OPERATION ERROR, indicating a hard drive failure or bad sectors.

- Check if the reported hdisk1 is in rootvg:
lsvg –p rootvg View the disks in rootvg, including hdisk0 and hdisk1. 
- View the faulty hard drive model:
Run lscfg –vpl hdisk1 to view the spare part number for the reported hard drive hdisk1 as 74Y6496, with physical location P2-D2

- Confirm physical location:
The physical location corresponding to U78AA.001.WZSJUKN-P2-D2 is shown in the figure below:

- Check disk mirroring:
lsvg -l rootvg Check whether all lvs are mirrored. The number of PPs should be twice the number of LPs, and LV STATE should be syncd.- If the output contains an LV status of stale, it indicates that this LV contains bad sectors.
- If the number of PPs for the LV is not twice the number of LPs, it indicates that this LV is not mirrored.
(Important: If there are any LVs without mirroring, use step 3's lspv -l hdisk* command to check which disk the LV resides on.)

- Run lspv -l hdisk1 and lspv -l hdisk0 commands to view the LVs for hdisk0 and hdisk1 respectively.

In the figure above, the quantity and size of all LVs on hdisk0 and hdisk1 should be consistent (except for lg_dumplv, as it does not require mirroring; if lg_dumplv is on hdisk0, it can be ignored).
For example, in the figure above, verification shows that lvdb exists only on hdisk1 and not on hdisk0, indicating this LV is not mirrored. Coincidentally, the drive to be replaced is hdisk1, so use the following command to migrate lvdb to the healthy disk hdisk0 (otherwise replacing hdisk0 will cause data loss for this LV).
migratepv -l lvdb hdisk1 hdisk0
- Remove disk mirroring and eject from vg:
- unmirrorvg rootvg hdisk1 Removes the mirror on hdisk1; hdisk1 is the drive to be replaced.
- reducevg rootvg hdisk1 Ejects hdisk1 from rootvg.
- Run lsvg –p rootvg to confirm hdisk1 is no longer in rootvg.

- Physically replace the hard drive:
- rmdev -dl hdisk1 Deletes the faulty hdisk1 from the system.
- Physically replace the hard drive and install the new one. (Refer to the image in step 5 for physical location; do not remove the wrong drive.)
- cfgmgr -v Scans for the new hard drive.
(These 3 steps for replacing the disk can be replaced by using the diag command via the menu for replacement, which is safer.)
diag command -> Task Selection -> Hot Plug Task -> SAS RAID ... Hot Plug Manager -> Replace/Remove a Device …. -> (select failed hdisk)
- Physically replace the hard drive:
lsdev -Cc disk After replacing hdisk1, check whether it is available; this is the normal state.
- Add pvid to the new hard drive after physical replacement:
chdev -l hdisk1 -a pv=yes Adds a PVID to hdisk1.
- Add the hard drive to vg and mirror:
- extendvg rootvg hdisk1 Add the new disk hdisk* to rootvg
- mirrorvg -S rootvg hdisk0 hdisk1 Mirror hdisk0 and hdisk1
The mirroring will proceed in the background, expected to complete in 30-60 minutes.
- Modify disk boot order:
- bosboot -ad /dev/hdisk1 Set boot attributes for hdisk1
- bootlist -m normal hdisk0 hdisk1 Change boot order
- bootlist -m normal -o Display boot device order; confirm that both hdisk0 and hdisk1 are present.
- View disk mirroring progress:
Check the stale pp count via lsvg rootvg. During synchronization, this number continuously decreases; when it becomes 0, mirroring is complete.

lsvg -l rootvg If all lv states are sync, mirroring is complete.
The entire synchronization process takes approximately 30-60 minutes.