Sunday, 26 June 2011

logical volume management


logical volume management:

Steps required to replace a failing PV from a non-root VG:
  1. Backup all filesystems found on the failing PV.
  2. lspv -l <PV> (lspv -l hdisk2) To determine which filesystem(s) are found on the PV in question.
  3. Find out how the LVs are laid-out on the PV so you will know how to re-create them when the time comes.
  4. 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.
  5. Unmount all filesystems on that PV. umount <FILESYSTEM_NAME> to unmount each filesystem from the PV in question.
  6. Remove all LVs found on that PV. rmlv <LV> (rmlv /oracle)
  7. Remove the questionable PV from the system. reducevg <VG> <PV>
  8. Remove the PV entry from the ODM database. rmdev -l <PV_NAME> -d (rmdev -l hdisk2 -d)
  9. Shutdown the system: Shutdown -F
  10. Remove the bad PV and install the new PV
  11. Add the new PV to the VG in question. extendvg <VG> <PV> (eg., extendvg datavg hdisk2)
  12. 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.
  13. 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.
  14. Perform a filesystem check before mounting it. fsck -f /dev/<LV> (fsck -f /dev/oracle)
  15. Mount all filesystems on that PV. mount <FILESYSTEM_NAME> (mount /oracle)
  16. Now restore the data you backed up

No comments:

Post a Comment