centos7.6 删除lv、vg记录过程
Last login: Sat Mar 30 22:47:35 2019 from 10.0.0.3
[root@vmhzpcentosdisk ~]# pvdisplay
--- Physical volume ---
PV Name /dev/sdb1
VG Name centos
PV Size 5.00 GiB / not usable 4.00 MiB
Allocatable yes (but full)
PE Size 4.00 MiB
Total PE 1279
Free PE 0
Allocated PE 1279
PV UUID XlSjh3-kTyb-wkzF-hk73-3tG1-zLZX-imxY82
--- Physical volume ---
PV Name /dev/sdc1
VG Name mydata
PV Size 1.00 GiB / not usable 64.00 MiB
Allocatable yes (but full)
PE Size 64.00 MiB
Total PE 15
Free PE 0
Allocated PE 15
PV UUID GlgU4F-l80g-qcc5-BdZw-wySh-Ugjq-Qcvfp6
--- Physical volume ---
PV Name /dev/sdc2
VG Name mydata
PV Size 1023.00 MiB / not usable 63.00 MiB
Allocatable yes (but full)
PE Size 64.00 MiB
Total PE 15
Free PE 0
Allocated PE 15
PV UUID AiIywo-sV07-RxIG-giE0-8DqM-N0Sd-K904ko
--- Physical volume ---
PV Name /dev/sdd1
VG Name mydata
PV Size 1.00 GiB / not usable 64.00 MiB
Allocatable yes
PE Size 64.00 MiB
Total PE 15
Free PE 15
Allocated PE 0
PV UUID nktGm1-3dJ9-deCX-4UQX-SfdB-HXR0-39C217
--- Physical volume ---
PV Name /dev/sdd2
VG Name mydata
PV Size 1023.00 MiB / not usable 63.00 MiB
Allocatable yes
PE Size 64.00 MiB
Total PE 15
Free PE 15
Allocated PE 0
PV UUID 358BPy-5Z5Q-v1vf-BGNX-f6Dx-qfXE-8lkLge
[root@vmhzpcentosdisk ~]# pvs
PV VG Fmt Attr PSize PFree
/dev/sdb1 centos lvm2 a-- <5.00g 0
/dev/sdc1 mydata lvm2 a-- 960.00m 0
/dev/sdc2 mydata lvm2 a-- 960.00m 0
/dev/sdd1 mydata lvm2 a-- 960.00m 960.00m
/dev/sdd2 mydata lvm2 a-- 960.00m 960.00m
[root@vmhzpcentosdisk ~]# vgdisplay mydata
--- Volume group ---
VG Name mydata
System ID
Format lvm2
Metadata Areas 4
Metadata Sequence No 6
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 2
Open LV 1
Max PV 0
Cur PV 4
Act PV 4
VG Size 3.75 GiB
PE Size 64.00 MiB
Total PE 60
Alloc PE / Size 30 / <1.88 GiB
Free PE / Size 30 / <1.88 GiB
VG UUID cDzX9b-GB2t-vdX1-H6SF-4Zra-wGGz-9WxVS4
[root@vmhzpcentosdisk ~]# lvdisplay
--- Logical volume ---
LV Path /dev/centos/root
LV Name root
VG Name centos
LV UUID bntBvT-ohQb-h5AS-g7Uz-S2IZ-MJXY-g5vHN2
LV Write Access read/write
LV Creation host, time converter, 2019-02-22 01:34:34 +0800
LV Status available
# open 1
LV Size 4.39 GiB
Current LE 1125
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 8192
Block device 253:0
--- Logical volume ---
LV Path /dev/centos/swap
LV Name swap
VG Name centos
LV UUID 1jlIZY-wZeS-rpqo-PZGl-TSzc-qQBY-cy1MVV
LV Write Access read/write
LV Creation host, time converter, 2019-02-22 01:34:34 +0800
LV Status available
# open 2
LV Size 616.00 MiB
Current LE 154
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 8192
Block device 253:1
--- Logical volume ---
LV Path /dev/mydata/lv1
LV Name lv1
VG Name mydata
LV UUID jz5eV4-dGeG-yjGD-JBbv-cN6P-t21g-Z3ujby
LV Write Access read/write
LV Creation host, time vmhzpcentosdisk, 2019-03-30 08:23:10 +0800
LV Status available
# open 1
LV Size 1.31 GiB
Current LE 21
Segments 2
Allocation inherit
Read ahead sectors auto
- currently set to 8192
Block device 253:2
--- Logical volume ---
LV Path /dev/mydata/lve2
LV Name lve2
VG Name mydata
LV UUID uTZpF1-v1M6-EiEC-sOSz-cupZ-BZLG-iNEH14
LV Write Access read/write
LV Creation host, time vmhzpcentosdisk, 2019-03-30 13:29:19 +0800
LV Status available
# open 0
LV Size 576.00 MiB
Current LE 9
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 8192
Block device 253:3
[root@vmhzpcentosdisk ~]# df -hl
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/centos-root 4.4G 1.4G 3.1G 31% /
devtmpfs 483M 0 483M 0% /dev
tmpfs 496M 0 496M 0% /dev/shm
tmpfs 496M 7.0M 489M 2% /run
tmpfs 496M 0 496M 0% /sys/fs/cgroup
/dev/sda1 1014M 156M 859M 16% /boot
/dev/mapper/mydata-lv1 1.3G 2.5M 1.3G 1% /data1
tmpfs 100M 0 100M 0% /run/user/0
[root@vmhzpcentosdisk ~]# vgscan
Reading volume groups from cache.
Found volume group "centos" using metadata type lvm2
Found volume group "mydata" using metadata type lvm2
[root@vmhzpcentosdisk ~]# vgdisplay -v mydata
--- Volume group ---
VG Name mydata
System ID
Format lvm2
Metadata Areas 4
Metadata Sequence No 6
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 2
Open LV 1
Max PV 0
Cur PV 4
Act PV 4
VG Size 3.75 GiB
PE Size 64.00 MiB
Total PE 60
Alloc PE / Size 30 / <1.88 GiB
Free PE / Size 30 / <1.88 GiB
VG UUID cDzX9b-GB2t-vdX1-H6SF-4Zra-wGGz-9WxVS4
--- Logical volume ---
LV Path /dev/mydata/lv1
LV Name lv1
VG Name mydata
LV UUID jz5eV4-dGeG-yjGD-JBbv-cN6P-t21g-Z3ujby
LV Write Access read/write
LV Creation host, time vmhzpcentosdisk, 2019-03-30 08:23:10 +0800
LV Status available
# open 1
LV Size 1.31 GiB
Current LE 21
Segments 2
Allocation inherit
Read ahead sectors auto
- currently set to 8192
Block device 253:2
--- Logical volume ---
LV Path /dev/mydata/lve2
LV Name lve2
VG Name mydata
LV UUID uTZpF1-v1M6-EiEC-sOSz-cupZ-BZLG-iNEH14
LV Write Access read/write
LV Creation host, time vmhzpcentosdisk, 2019-03-30 13:29:19 +0800
LV Status available
# open 0
LV Size 576.00 MiB
Current LE 9
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 8192
Block device 253:3
--- Physical volumes ---
PV Name /dev/sdc1
PV UUID GlgU4F-l80g-qcc5-BdZw-wySh-Ugjq-Qcvfp6
PV Status allocatable
Total PE / Free PE 15 / 0
PV Name /dev/sdc2
PV UUID AiIywo-sV07-RxIG-giE0-8DqM-N0Sd-K904ko
PV Status allocatable
Total PE / Free PE 15 / 0
PV Name /dev/sdd1
PV UUID nktGm1-3dJ9-deCX-4UQX-SfdB-HXR0-39C217
PV Status allocatable
Total PE / Free PE 15 / 15
PV Name /dev/sdd2
PV UUID 358BPy-5Z5Q-v1vf-BGNX-f6Dx-qfXE-8lkLge
PV Status allocatable
Total PE / Free PE 15 / 15
[root@vmhzpcentosdisk ~]# df -hl
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/centos-root 4.4G 1.4G 3.1G 31% /
devtmpfs 483M 0 483M 0% /dev
tmpfs 496M 0 496M 0% /dev/shm
tmpfs 496M 7.0M 489M 2% /run
tmpfs 496M 0 496M 0% /sys/fs/cgroup
/dev/sda1 1014M 156M 859M 16% /boot
/dev/mapper/mydata-lv1 1.3G 2.5M 1.3G 1% /data1
tmpfs 100M 0 100M 0% /run/user/0
[root@vmhzpcentosdisk ~]# umount /dev/mapper/mydata-lv1
[root@vmhzpcentosdisk ~]# df -hl
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/centos-root 4.4G 1.4G 3.1G 31% /
devtmpfs 483M 0 483M 0% /dev
tmpfs 496M 0 496M 0% /dev/shm
tmpfs 496M 7.0M 489M 2% /run
tmpfs 496M 0 496M 0% /sys/fs/cgroup
/dev/sda1 1014M 156M 859M 16% /boot
tmpfs 100M 0 100M 0% /run/user/0
[root@vmhzpcentosdisk ~]# lvremove /dev/mapper/mydata-lv1
Do you really want to remove active logical volume mydata/lv1? [y/n]: y
Logical volume "lv1" successfully removed
[root@vmhzpcentosdisk ~]# lvs
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
root centos -wi-ao---- 4.39g
swap centos -wi-ao---- 616.00m
lve2 mydata -wi-a----- 576.00m
[root@vmhzpcentosdisk ~]# vgremove mydata
Do you really want to remove volume group "mydata" containing 1 logical volumes? [y/n]: y
Do you really want to remove active logical volume mydata/lve2? [y/n]: y
Logical volume "lve2" successfully removed
Volume group "mydata" successfully removed
[root@vmhzpcentosdisk ~]# vgscan
Reading volume groups from cache.
Found volume group "centos" using metadata type lvm2
[root@vmhzpcentosdisk ~]# pvremove /dev/sdc1
Labels on physical volume "/dev/sdc1" successfully wiped.
[root@vmhzpcentosdisk ~]# pvremove /dev/sdc2
Labels on physical volume "/dev/sdc2" successfully wiped.
[root@vmhzpcentosdisk ~]# pvremove /dev/sdd1
Labels on physical volume "/dev/sdd1" successfully wiped.
[root@vmhzpcentosdisk ~]# pvremove /dev/sdd2
Labels on physical volume "/dev/sdd2" successfully wiped.
[root@vmhzpcentosdisk ~]# pvs
PV VG Fmt Attr PSize PFree
/dev/sdb1 centos lvm2 a-- <5.00g 0
[root@vmhzpcentosdisk ~]# fdisk -l
Disk /dev/sda: 1075 MB, 1075838976 bytes, 2101248 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x741b59c1
Device Boot Start End Blocks Id System
/dev/sda1 * 128 2097279 1048576 83 Linux
Disk /dev/sdb: 5370 MB, 5370806272 bytes, 10489856 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x4821b046
Device Boot Start End Blocks Id System
/dev/sdb1 128 10485887 5242880 8e Linux LVM
Disk /dev/sdc: 2147 MB, 2147483648 bytes, 4194304 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x957753d6
Device Boot Start End Blocks Id System
/dev/sdc1 2048 2099199 1048576 8e Linux LVM
/dev/sdc2 2099200 4194303 1047552 8e Linux LVM
Disk /dev/sdd: 2147 MB, 2147483648 bytes, 4194304 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x5e81ca7f
Device Boot Start End Blocks Id System
/dev/sdd1 2048 2099199 1048576 8e Linux LVM
/dev/sdd2 2099200 4194303 1047552 8e Linux LVM
Disk /dev/mapper/centos-root: 4718 MB, 4718592000 bytes, 9216000 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/mapper/centos-swap: 645 MB, 645922816 bytes, 1261568 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
[root@vmhzpcentosdisk ~]# cat /etc/fstab
#
# /etc/fstab
# Created by anaconda on Tue Feb 5 15:11:01 2019
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
/dev/centos/root / xfs defaults 0 0
/dev/sda1 /boot xfs defaults 0 0
/dev/centos/swap swap swap defaults 0 0
/dev/mydata/lv1 /data1 ext4 defaults 0 0
[root@vmhzpcentosdisk ~]# vim /etc/fstab
#
# /etc/fstab
# Created by anaconda on Tue Feb 5 15:11:01 2019
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
/dev/centos/root / xfs defaults 0 0
/dev/sda1 /boot xfs defaults 0 0
/dev/centos/swap swap swap defaults 0 0
/dev/mydata/lv1 /data1 ext4 defaults 0 0
0 0
"/etc/fstab" 11L, 342C written
[root@vmhzpcentosdisk ~]# reboot