Link to home
Start Free TrialLog in
Avatar of assistunix
assistunixFlag for United States of America

asked on

Procedure to replace hard disk in AIX

Hello, i have two questions in regards to my failing disks on AIX server


1)Can someone provide me with the complete procedure steps as to how to replace a hard disk in AIX.

2)i have another hdisk, which needs to be reformatted to get rid of the errors on the disk and certified- how can i do that?

Thanks.
ASKER CERTIFIED SOLUTION
Avatar of woolmilkporc
woolmilkporc
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of assistunix

ASKER

Hello- wmp - thank you for your prompt reply-

I think step 1) mirrored - applies to me.
the disk in question is hdisk2 and it part of rootvg. rootvg has two disks, hdisk1 and hdisk2.
most of lv's are mirrored between the two disks- the only lv that is not mirrored is sysdump!
is that an issue, or a concern to prevent me from following your step 1 process? do i have to add an additional step due to this sysdump lv not being mirrored?

# lsvg -l rootvg
rootvg:
LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINT
hd5              boot    1     2      2   closed/syncd       N/A
hd8              jfslog   1     2      2 open/syncd            N/A
hd6             paging   9   18     2 open/syncd            N/A
paging00      paging  9   18     2 open/syncd             N/A
hd1                jfs      1     2     2 open/syncd             /home
hd10opt         jfs      2     4     2 open/syncd              /opt
hd3                jfs      8    16    2 open/syncd              /tmp
hd2                jfs    18    36    2 open/syncd              /usr
hd9var           jfs      3      6    2 open/syncd              /var
hd4                jfs      2     4     2 open/syncd              /
hd7           sysdump 7     7     1 open/syncd               N/A
hd7x         sysdump 7     7     1 open/syncd               N/A
 not mirrored
bogus             jfs    40    80   2 open/syncd             /bogus

Also, do i need to check boot device order and change it to hdisk1, if it happens to be on hdisk2?
............

2) Would Formating a disk delete the data on the disk?
Do extra steps such as unmirror and reducevg needs to be taken , if i am to format a mirrored rootvg disk?

..........
I just found some more information regrading dump devices , that dumpdevices are NEVER mirrored- please confirm if that is true? and if so, than what would be my next course of action in regards to dump device, should i migratelv dumpdevice to another disk in rootvg(in this case to hdisk1) and than migrate it back to the original disk (hdisk2) after the format has been completed or if a new disk has been installed.

or should i just create a new dump device after the format has been completed or a new disk has been installed.
Yes, dump LVs cannot be  mirrored.
Migrating the affected device to the other disk is the easiest way, but if you're interested, this is (for the pedantic) how to delete a dumplv:

Issue "lslv -l hd7" and "lslv -l hd7x" to find out which dump device is on hdisk2.
Issue "sysdumpdev -l" to find out whether the affected device is primary or secondary.
Depending on the result issue either "sysdumpdev -P -p /dev/sysdumpnull" (for primary) or "sysdumpdev -P -s /dev/sysdumpnull" (for secondary) to free the device.
Finally issue "rmlv hd7" or "rmlv hd7x", whatever device is on hdisk2.

After the disk has been replaced/formatted, create a new device with mkly and sysdumpdev.

After unmirroring and removing hdisk2 you should run "bosboot -a -d hdisk1" and "bootlist -m normal hdisk1" to be on the safe side.

2) Formatting will delete all data on the disk. You must follow exactly the same steps as you would for replacing the disk.

wmp
I have also learned that - reducevg command also formats the disk and along with command chpv -c <hdiskX> is equivalent to your process of smitty diag to format the disk- can you validate that ?
...
Nope.

reducevg will clear the PVID (the "label" of the disk), just as "chdev -a pv=clear -l hdiskx"  would do, and extendvg writes a new PVID, just as "chdev -a pv=yes -l hdiskx" would do.

All of the above will make the old data on the disk unusable, that's true, but has nothing to do with block-level formatting or with surface checking (as with smitty diag -> SSA format / SSA certify).

chpv will clear the boot record (if any) of the disk, but leave all other data intact and usable.

wmp
Forgot a detail:

reducevg will not only clear the PVID, but will also remove the VGDA (the "Volume Group Descriptor Area"), and extendvg will create a new VGDA, as opposed to chdev, which will only remove/create the PVID. That's why extendvg/reducevg will make the disk's data unusable.
Thanks for that clarification-

This is my final plan: Please do validate.
root / >
# bootlist -m normal -o
hdisk1 blv=hd5
hdisk2 blv=hd5
If hdisk1 is already the primary boot device as shown above, than there is no need to run bosboot commands when replacing hdisk2, is that correct?

Unmirror rootvg with following command
unmirrorvg rootvg hdisk2

migrate sysdump
migratepv -lv hd7x hdisk2 hdisk1

Use Smit diag to format and certify it-
After formatting and certifying it-
-which step comes first? should i migrate sysdump lv before mirroring the disk or after mirroring disk
migratepv -lv hd7x hdisk2 hdisk1
mirrorvg rootvg hdisk2
?
........
Also, does mirroring remove the content that was on the disk prior to mirroring?
The disk has to be in the volume group, to be able to run smit format and smit diag.
I dont believe i need to run reducevg, and therefore don't need to run rmdev -dl hdiskx, for formatting, is that correct? and i should also not need to run cfgmgr either-

Please do validate my plan above, as i believe the commands reducevg, rmdev -dl and cgfmgr, extendvg are only needed when replacing a disk!

>> there is no need to run bosboot commands << Correct!

>> Unmirror rootvg with ... << Correct!

>> migrate sysdump << The syntax is migratepv -l hd7x hdisk2 hdisk1 without the v!

>> which step comes first << Format first, then certify.

>> should i migrate sysdump lv before mirroring .. << Not essential, but migrate it after mirroring! Mind the syntax (no "v")!

>> does mirroring remove the content ... << "unmirrorvg" and "migratepv" already removed the content.

>> The disk has to be in the volume group, to be able to run smit format and smit diag << NO! It's a particularity of SSA that the disk CAN stay in the VG (but it'doesn't have to). With e.g. SCSI the disk MUST be offline (i.e. out of the VG).

>> i believe the commands reducevg, rmdev -dl and cgfmgr, extendvg are only needed when replacing a disk <<
Nearly correct, see above! Please keep in mind that omitting "reducevg" only works for SSA! I, personally, would run "reducevg" and later "extendvg", just by instinct. But you're correct, don't run rmdev before formatting/certifying! It would make the disk unknown to the OS, thus unavailable for "diag". But when replacing the disk with new hardware rmdev is strongly advised, else a phantom disk will be left in your configuration!

wmp
Thanks- what do you mean by phantom disk- do you mean that an actual physical disk has been removed from the system, but an entry of that disk still remains within AIX?