首页 > 系统 > Linux > 正文

Linux LVM学习总结——删除卷组VG

2024-06-28 13:20:11
字体:
来源:转载
供稿:网友
linux LVM学习总结——删除卷组VG 2015-06-11 16:41 by 潇湘隐者, ... 阅读, ... 评论, 收藏, 编辑

在Linux系统中,如何删除一个卷组(VG)呢? 下面我总结了一下如何删除卷组(VG)的具体步骤,仅供参考,如有不足,敬请指出。谢谢!在下面的例子中,我想删除卷组VolGroup05。

步骤1: 查看卷组(VG)相关信息,如下所示

[root@getlnx01uat ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
 97G 36G 57G 39% /
/dev/mapper/VolGroup01-LogVol00
 79G 33G 43G 44% /u01
/dev/mapper/VolGroup02-LogVol00
 197G 182G 5.4G 98% /u02
/dev/mapper/VolGroup03-LogVol00
 197G 57G 130G 31% /u03
/dev/mapper/VolGroup04-LogVol00
 138G 118G 14G 90% /u04
/dev/mapper/VolGroup05-LogVol00
 178G 48G 121G 29% /u05
/dev/sda1 99M 23M 71M 25% /boot
tmpfs 2.0G 0 2.0G 0% /dev/shm
[root@getlnx01uat ~]# vgscan
 Reading all physical volumes. This may take a while...
 Found volume group "VolGroup05" using metadata type lvm2
 Found volume group "VolGroup04" using metadata type lvm2
 Found volume group "VolGroup03" using metadata type lvm2
 Found volume group "VolGroup02" using metadata type lvm2
 Found volume group "VolGroup01" using metadata type lvm2
 Found volume group "VolGroup00" using metadata type lvm2
[root@getlnx01uat ~]# 

查看卷组VolGroup05包含的PV、LV信息。如下所示

[root@getlnx01uat ~]# vgdisplay -v VolGroup05
 Using volume group(s) on command line
 Finding volume group "VolGroup05"
 --- Volume group ---
 VG Name VolGroup05
 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 1
 Max PV 0
 Cur PV 1
 Act PV 1
 VG Size 179.97 GB
 PE Size 32.00 MB
 Total PE 5759
 Alloc PE / Size 5759 / 179.97 GB
 Free PE / Size 0 / 0 
 VG UUID UNFxZH-lAGM-vqF3-jtNK-yuKT-enUX-WwL7FQ
 
 --- Logical volume ---
 LV Name /dev/VolGroup05/LogVol00
 VG Name VolGroup05
 LV UUID kCTJnc-D3zQ-QiJp-TfPh-ivWs-WKyW-VvGTod
 LV Write Access read/write
 LV Status available
 # open 1
 LV Size 179.97 GB
 Current LE 5759
 Segments 1
 Allocation inherit
 Read ahead sectors auto
 - currently set to 256
 Block device 253:2
 
 --- Physical volumes ---
 PV Name /dev/sdg5 
 PV UUID VbSwjS-9ckQ-ZfWf-bl8g-oPWQ-TMBi-H6oMWv
 PV Status allocatable
 Total PE / Free PE 5759 / 0

image

2:卸载卷组的逻辑卷LV

要卸载对应卷组VG的所有逻辑卷LV。从上面的信息可以看出对应的卷组VolGroup05只有/dev/VolGroup05/LogVol00这个逻辑卷LV

[root@getlnx01uat ~]# umount /dev/VolGroup05/LogVol00

使用下面命令亦可

[root@getlnx01uat ~]# umount /u05

如果还用进程在使用对应逻辑卷的文件,就必须强制卸载挂接点。

3:删除逻辑卷LV

[root@getlnx01uat ~]# lvremove /dev/VolGroup05/LogVol00
Do you really want to remove active logical volume LogVol00? [y/n]: y
上一篇:我的Linux随笔目录

下一篇:Linux xxd命令

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表