一、LVM可能被占用
# 查看lvm被占用中 [root@harbor ~]# dmsetup info -c | grep data01 data01-lvdata01 253 2 L--w 0 1 0 LVM-RjmtKrgddy0ejyeqJhVtr3IRsKkukLJNn6z4gQOC22jXKNgBcv92CN2P1f9AlcDS [root@harbor ~]# lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 0 40G 0 disk ├─sda1 8:1 0 1G 0 part /boot └─sda2 8:2 0 39G 0 part ├─bigcloud--enterprise--linux--for--euler-root 253:0 0 35G 0 lvm / └─bigcloud--enterprise--linux--for--euler-swap 253:1 0 4G 0 lvm [SWAP] sdb 8:16 0 8G 0 disk └─vg1-test 253:3 0 24G 0 lvm /data02 sdc 8:32 0 8G 0 disk └─vg1-test 253:3 0 24G 0 lvm /data02 sdd 8:48 0 8G 0 disk └─vg1-test 253:3 0 24G 0 lvm /data02 sde 8:64 0 20G 0 disk └─data01-lvdata01 253:2 0 20G 0 lvm sr0 11:0 1 1024M 0 rom # [root@harbor ~]# ls -la /sys/dev/block/253:2/ total 0 drwxr-xr-x 9 root root 0 Apr 26 13:52 . drwxr-xr-x 6 root root 0 Apr 26 13:50 .. -r--r--r-- 1 root root 4096 Apr 26 13:52 alignment_offset lrwxrwxrwx 1 root root 0 Apr 26 13:50 bdi -> ../../bdi/253:2 -r--r--r-- 1 root root 4096 Apr 26 13:52 capability -r--r--r-- 1 root root 4096 Apr 26 13:50 dev -r--r--r-- 1 root root 4096 Apr 26 13:52 discard_alignment drwxr-xr-x 2 root root 0 Apr 26 13:50 dm -r--r--r-- 1 root root 4096 Apr 26 13:52 ext_range -r--r--r-- 1 root root 4096 Apr 26 13:52 hidden drwxr-xr-x 2 root root 0 Apr 26 13:50 holders -r--r--r-- 1 root root 4096 Apr 26 13:52 inflight drwxr-xr-x 2 root root 0 Apr 26 13:52 integrity drwxr-xr-x 2 root root 0 Apr 26 13:52 power drwxr-xr-x 2 root root 0 Apr 26 13:51 queue -r--r--r-- 1 root root 4096 Apr 26 13:52 range -r--r--r-- 1 root root 4096 Apr 26 13:51 removable -r--r--r-- 1 root root 4096 Apr 26 13:51 ro -r--r--r-- 1 root root 4096 Apr 26 13:51 size drwxr-xr-x 2 root root 0 Apr 26 13:52 slaves -r--r--r-- 1 root root 4096 Apr 26 13:52 stat lrwxrwxrwx 1 root root 0 Apr 26 13:50 subsystem -> ../../../../class/block drwxr-xr-x 2 root root 0 Apr 26 13:52 trace -rw-r--r-- 1 root root 4096 Apr 26 13:50 uevent
二、查找LVM占用情况
# 没有LVM映射相关文件 [root@harbor ~]# ls -la /sys/dev/block/253:2/holders total 0 drwxr-xr-x 2 root root 0 Apr 26 13:52 . drwxr-xr-x 9 root root 0 Apr 26 13:52 .. # lvs卷任然存在 [root@harbor ~]# lvs LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert root bigcloud-enterprise-linux-for-euler -wi-ao---- 35.04g swap bigcloud-enterprise-linux-for-euler -wi-ao---- 3.95g lvdata01 data01 -wi------- <20.00g test vg1 -wi-ao---- <23.99g
三、删除占用方法
# 尝试删除卷占用映射 [root@harbor ~]# dmsetup remove /dev/data01/lvdata01 # lvm已正常删除 [root@harbor ~]# lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 0 40G 0 disk ├─sda1 8:1 0 1G 0 part /boot └─sda2 8:2 0 39G 0 part ├─bigcloud--enterprise--linux--for--euler-root 253:0 0 35G 0 lvm / └─bigcloud--enterprise--linux--for--euler-swap 253:1 0 4G 0 lvm [SWAP] sdb 8:16 0 8G 0 disk └─vg1-test 253:3 0 24G 0 lvm /data02 sdc 8:32 0 8G 0 disk └─vg1-test 253:3 0 24G 0 lvm /data02 sdd 8:48 0 8G 0 disk └─vg1-test 253:3 0 24G 0 lvm /data02 sde 8:64 0 20G 0 disk sr0 11:0 1 1024M 0 rom
四、删除LVM卷
[root@harbor ~]# lvremove /dev/data01/lvdata01 Logical volume "lvdata01" successfully removed
五、参考
https://blog.csdn.net/YH_7059/article/details/109766245
标签:26,--,Apr,52,排查,Linux,LVM,root,13 From: https://www.cnblogs.com/gkhost/p/18159997