LVM commands tutorial : Part 2 : Volume group (vgremove, vgsync)

Series of tutorial to learn LVM commands. In this part, learn how to remove volume group from system and how to sync stale PE within VG (vgremove, vgsync)

We have seen 10 commands of volume group activities til now under part two. Now we will cover remaining two commands in this post.
Command : vgremove
vgremove commands used to remove volume group from system. But this is destroying command since it requires removal of all LV, PV in VG. It is always recommended to use vgexport instead of vgremove. Since vgexport also removes VG information from system but keeps it untouched on PV so that same PV can be imported to new VG on new/same system using vgimport.
Read : 
Safe removal of VG can be done with below steps :
    1. Backup all user data in that VG
    2. Get information of all LV and PV in that VG using vgdisplay -v command
    3. Make sure no LV is in use using fuser -cu /mount_point command
    4. Unmount mount points of related LV
    5. Remove all LVs with lvremove /dev/vg01/lvol-name command
    6. Remove all PVs in VG except any one with vgreduce /dev/vg01 /dev/disk/diskX command
    7. Finally use vgremove command to remove VG from system
    8. Remove related group files from system using rm /dev/vg01 command

Command : vgsync
This command used to sync stale LE of LV mirrors in current VG. This used in mirroring only. Once can observe output of vgdisplay -v and confirm if there are any stale LE in current VG. If you found stale LE then you can synchronize them using this command.
There are no special option requried for this command.


This concludes part two (Volume group) of our LVM tutorials.
SHARE

sangeethakumar

  • Image
  • Image
  • Image
  • Image
  • Image
    Blogger Comment
    Facebook Comment

0 comments:

Post a Comment