In the Linux system, remove LV, VG, pv__linux

Source: Internet
Author: User
Tags uuid
View Volume group related information

[Root@localhost/]# Vgscan Reading All physical volumes.     This could take a while ... Found Volume Group "VolGroup00" using metadata type LVM2

View the PV, LV information contained in the volume group VolGroup00.

[root@localhost /]# vgdisplay -v volgroup00       Using  Volume group (s)  on command line       finding volume  group  "VolGroup00"      --- Volume group ---      VG Name                volgroup00     System ID                   Format                 lvm2     Metadata Areas         1     Metadata Sequence No  2      vg access             read/write      vg status             resizable      MAX LV                 0     Cur LV                 1     Open LV                0     Max PV                 0      Cur PV                 1     Act PV                 1     VG Size                1.01 gib     PE Size                8.00 MiB     total pe               129      alloc pe / size       100 / 800.00 mib      free  pe / size       29 /  232.00 MiB     VG UUID                Cug510-pQb6-RELO-lb1K-zjbt-3f62-jQLoQp            --- Logical volume ---     LV Path                 /dev/volgroup00/iscsi00     &Nbsp;lv name                 iscsi00     VG Name                 VolGroup00     LV UUID                 te78d6-5kjf-0hoh-4jrx-olhi-ehyr-xhmmmq      lv write access        read/write      LV Creation host, time localhost.iscsi, 2017-01-19  14:25:40 +0800     LV Status               available     # open                  0     lv size                 800.00 mib      current le             100     Segments                1     Allocation              inherit     Read ahead sectors     auto      - currently set to     256      block device           253:0            --- Physical volumes ---     PV  name               /dev/sda7           PV UUID                OWz0uw-gTR1-WylF-z6HW-cgpe-LLd9-2W8Q9g     PV Status              allocatable     to Editor/etc/ Fstab, delete the corresponding mount information tal pe / free pe    129 / 29  

unload a logical volume on a volume group LV

To uninstall all logical volume LV of the corresponding volume group VG. From the above information can be seen corresponding volume group VolGroup00 only/dev/volgroup00/iscsi00 this logical volume LV

[Root@localhost/]# umount/dev/volgroup00/iscsi00

If you are using a process to use a file that corresponds to a logical volume, you must force the Unload hook (#df-th view). Delete Logical Volume LV [Root@localhost/]# lvremove/dev/volgroup00/iscsi00 do your really want to remove active logical volume? [y/n]: Y Logical Volume "iscsi00" successfully removed [root@localhost/]#

If the deletion prompts an error, check the process that is currently using the logical volume, and then close the process or service.

Verify that the LV is deleted [Root@localhost/]# Lvdisplay | grep "dev/volgroup00/iscsi00" Deletes volume group VG [root@localhost/]# vgremove VolGroup00 Volume Group "VolGroup00" suc Cessfully removed [root@localhost/]#

If you delete a volume group VG in a secure manner, you must close it using vgchange-a n VolGroup00, and then delete it.
[Root@localhost/]# vgchange-a n VolGroup00 0 Logical Volume (s) in volume group ' VolGroup00 ' now active [root@local Host/]# vgremove VolGroup00 Volume Group "VolGroup00" successfully removed [root@localhost/]#

Verify that the volume group (VG) deletes [root@localhost /]# vgscan      Reading all  physical volumes.  this may take a while...     No  volume groups found   [root@localhost /]#    Delete Physical volume PV [ root@localhost /]# pvremove /dev/sda7  

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.