Wednesday, October 15, 2008

Steps required to replace a failing PV from a non-root VG

--> Backup all filesystems found on the failing PV.
--> lspv -l (lspv -l hdisk2) To determine which filesystem(s) are found on the PV in question.

--> Find out how the LVs are laid-out on the PV so you will know how to re-create them when the time comes.
lslv -m (lslv -m oracle) You will use the output of the lslv command to serve as a template for creating a map file for this LV later on.

--> Unmount all filesystems on that PV. umount to unmount each filesystem from the PV in question.

--> Remove all LVs found on that PV. rmlv (rmlv /oracle)

--> Remove the questionable PV from the system. reducevg

--> Remove the PV entry from the ODM database. rmdev -l -d (rmdev -l hdisk2 -d)

--> Shutdown the system: Shutdown -F

--> Remove the bad PV and install the new PV

--> Add the new PV to the VG in question. extendvg (eg., extendvg datavg hdisk2)

--> Re-create the LVs removed from the OLD PV to the NEW PV.
mklv -y -m (mklv -y oracle -m oracle.map oraclevg 200 hdisk2)
The map file is assembled from the output generated from the lslv -m command in step 2 above. Do this for each LV that existed on the removed PV.

--> Re-size the filesystems on the new PV. mkfs /dev/ (mkfs /dev/oracle) Do this for each file system that existed on the removed PV.

--> Perform a filesystem check before mounting it. fsck -f /dev/ (fsck -f /dev/oracle)

--> Mount all filesystems on that PV. mount (mount /oracle)

--> Now restore the data you backed up

No comments: