device-mapper: remove ioctl failed: Device or resource busy
2014-11-04 20:05
686 查看
[root@QA mapper]# ls -ltr /dev/mapper
lrwxrwxrwx. 1 root root 8 Oct 23 09:34 newUUID-lv_root -> ../dm-17
[root@QA mapper]# dmsetup remove newUUID-lv_root
[root@QA mapper]# dmsetup remove --force /dev/mapper/vg_qa-snap2
[root@QA mapper]#
[root@QA mapper]# dmsetup remove --force /dev/mapper/vg_qa-snap2
device-mapper: remove ioctl on vg_qa-snap2 failed: Device or resource busy
Command failed
[root@QA mapper]# dmsetup info -c /dev/mapper/vg_qa-snap2
Name Maj Min Stat Open Targ Event UUID
vg_qa-snap2 253 16 L--w 1 1 0 part2-LVM-HZDfYZOYXTlZCP8n3Z8mmMACc05JJdUVjkfBxS7oshjjCk7pT6DojiR3g01XXUMf
[root@QA mapper]# dmsetup status | grep snap
vg_qa-snap2: 0 20445184 error
vg_qa-kickstart--first: 0 20971520 snapshot-origin
[root@QA mapper]# kpartx -av /dev/mapper/vg_qa-snap
add map vg_qa-snap1 (253:15): 0 524288 linear /dev/mapper/vg_qa-snap 2048
add map vg_qa-snap2 (253:16): 0 20445184 linear /dev/mapper/vg_qa-snap 526336
[root@QA mapper]# pvs
PV VG Fmt Attr PSize PFree
/dev/mapper/vg_qa-snap2 newUUID lvm2 a-- 9.75g 0
/dev/sda2 vg_qa lvm2 a-- 232.63g 0
/dev/sdb1 vg_qa lvm2 a-- 931.51g 724.84g
[root@QA mapper]# vgchange -ay
1 logical volume(s) in volume group "newUUID" now active
13 logical volume(s) in volume group "vg_qa" now active
[root@QA mapper]# lvscan | grep UUID
ACTIVE '/dev/newUUID/lv_root' [9.75 GiB] inherit
The UUID named newUUID was trapped with an error as described in the quote above, once that was clear it was able to become active.
[root@QA mapper]# mount /dev/newUUID/lv_root /mnt
[root@QA mapper]# ls /mnt
bin boot dev etc home lib lib64 lost+found media mnt opt proc root sbin selinux srv sys tmp usr var
The logical volume was named /dev/lvols/ubuntu64
At first
This command couldn’t remove the logical volume the next command I tried was
So some process is using this logical volume and to find the process id the next command was
Now issued the commands
[root@QA mapper]# ls -ltr /dev/mapper
lrwxrwxrwx. 1 root root 8 Oct 23 09:34 newUUID-lv_root -> ../dm-17
[root@QA mapper]# dmsetup remove newUUID-lv_root
[root@QA mapper]# dmsetup remove --force /dev/mapper/vg_qa-snap2
[root@QA mapper]#
[root@QA mapper]# dmsetup remove --force /dev/mapper/vg_qa-snap2
device-mapper: remove ioctl on vg_qa-snap2 failed: Device or resource busy
Command failed
[root@QA mapper]# dmsetup info -c /dev/mapper/vg_qa-snap2
Name Maj Min Stat Open Targ Event UUID
vg_qa-snap2 253 16 L--w 1 1 0 part2-LVM-HZDfYZOYXTlZCP8n3Z8mmMACc05JJdUVjkfBxS7oshjjCk7pT6DojiR3g01XXUMf
[root@QA mapper]# dmsetup status | grep snap
vg_qa-snap2: 0 20445184 error
vg_qa-kickstart--first: 0 20971520 snapshot-origin
[root@QA mapper]# kpartx -av /dev/mapper/vg_qa-snap
add map vg_qa-snap1 (253:15): 0 524288 linear /dev/mapper/vg_qa-snap 2048
add map vg_qa-snap2 (253:16): 0 20445184 linear /dev/mapper/vg_qa-snap 526336
[root@QA mapper]# pvs
PV VG Fmt Attr PSize PFree
/dev/mapper/vg_qa-snap2 newUUID lvm2 a-- 9.75g 0
/dev/sda2 vg_qa lvm2 a-- 232.63g 0
/dev/sdb1 vg_qa lvm2 a-- 931.51g 724.84g
[root@QA mapper]# vgchange -ay
1 logical volume(s) in volume group "newUUID" now active
13 logical volume(s) in volume group "vg_qa" now active
[root@QA mapper]# lvscan | grep UUID
ACTIVE '/dev/newUUID/lv_root' [9.75 GiB] inherit
The UUID named newUUID was trapped with an error as described in the quote above, once that was clear it was able to become active.
[root@QA mapper]# mount /dev/newUUID/lv_root /mnt
[root@QA mapper]# ls /mnt
bin boot dev etc home lib lib64 lost+found media mnt opt proc root sbin selinux srv sys tmp usr var
The logical volume was named /dev/lvols/ubuntu64
At first
$lvremove /dev/lvols/ubuntu64
This command couldn’t remove the logical volume the next command I tried was
root@manager-desktop:~# dmsetup remove --force /dev/lvols/ubuntu64 device-mapper: remove ioctl failed: Device or resource busy Command failed
So some process is using this logical volume and to find the process id the next command was
root@manager-desktop:~# lsof /dev/lvols/ubuntu64 COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME vblade 31213 root 3u BLK 252,4 0t0 115749 /dev/lvols/../mapper/lvols-ubuntu64
root@manager-desktop:~# kill -9 31213
Now issued the commands
root@manager-desktop:~# dmsetup remove --force /dev/lvols/ubuntu64 root@manager-desktop:~# lvremove /dev/lvols/ubuntu64 Logical volume "ubuntu64" successfully removed
相关文章推荐
- android 删除文件错误:open failed: EBUSY (Device or resource busy)
- rmmod: remove 'led': Device or resource busy解决办法
- WARNING: the kernel failed to re-read the partition table on /dev/sda (Device or resource busy). .
- WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
- how to deal with fdisk error: Re-reading the partition table failed with error 16: Device or resource busy.
- Docker: devicemapper fix for “device or resource busy” (EBUSY) Cannot start container
- ubuntu truecrypt device-mapper: remove ioctl failed: 设备或资源忙 Command fa
- WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
- Linux rm -rf 之rm: cannot remove `linux': Device or resource busy
- dequeueBuffer failed (Device or resource busy)
- mount: mounting proc on /proc failed: Device or resource busy
- 进行删除文件操作时碰到错误:open failed: EBUSY (Device or resource busy)
- 重启docker服务器后 遇到 'device or resource busy'错误
- Device or resource busy
- docker 磁盘问题:device or resource busy
- 关于BUG的那些事儿-Device or resource busy
- ERROR: Removing '***': Device or resource busy
- LINUX驱动学习:加载模块时出现Device or resource busy的解决方法
- mdam "Device or resource busy" Problem
- mount device or resource busy