Steps required to replace a failing PV from a non-root VG
- Backup all filesystems found on the failing PV.
- lspv -l <PV> (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 <LV> (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 <FILESYSTEM_NAME> to unmount each filesystem from the PV in question.
- Remove all LVs found on that PV. rmlv <LV> (rmlv /oracle)
- Remove the questionable PV from the system. reducevg <VG> <PV>
- Remove the PV entry from the ODM database. rmdev -l <PV_NAME> -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 <VG> <PV> (eg., extendvg datavg hdisk2)
- Re-create the LVs removed from the OLD PV to the NEW PV.
mklv -y<LV> -m<MAP_FILE> <VG> <PP_NUM> <PV> (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/<LV> (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/<LV> (fsck -f /dev/oracle)
- Mount all filesystems on that PV. mount <FILESYSTEM_NAME> (mount /oracle)
- Now restore the data you backed up
No comments:
Post a Comment