Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save georgitrifonov/b6090d2fcf705237f8c8d6e070a67fc3 to your computer and use it in GitHub Desktop.
Save georgitrifonov/b6090d2fcf705237f8c8d6e070a67fc3 to your computer and use it in GitHub Desktop.
TASK ERROR: clone failed: lvcreate 'vms/pve-vm-119' error: Failed to activate new LV.
root@camille:/etc/pve# lvcreate -L 16M -n vm-119-disk-1 vms
device-mapper: create ioctl on vms-vm--119--disk--1 failed: Device or resource busy
Failed to activate new LV.
root@camille:/etc/pve#
==> http://setaoffice.com/2015/03/25/device-mapper-create-ioctl-failed-device-or-resource-busy/
root@camille:/etc/pve#
root@camille:/etc/pve# dmsetup
Usage:
dmsetup [--version] [-h|--help [-c|-C|--columns]]
[--checks] [--manglename <mangling_mode>] [-v|--verbose [-v|--verbose ...]]
[-r|--readonly] [--noopencount] [--nolockfs] [--inactive]
[--udevcookie [cookie]] [--noudevrules] [--noudevsync] [--verifyudev]
[-y|--yes] [--readahead [+]<sectors>|auto|none] [--retry]
[-c|-C|--columns] [-o <fields>] [-O|--sort <sort_fields>]
[--nameprefixes] [--noheadings] [--separator <separator>]
help [-c|-C|--columns]
create <dev_name> [-j|--major <major> -m|--minor <minor>]
[-U|--uid <uid>] [-G|--gid <gid>] [-M|--mode <octal_mode>]
[-u|uuid <uuid>] [{--addnodeonresume|--addnodeoncreate}]
[--notable | --table <table> | <table_file>]
remove [-f|--force] <device>
remove_all [-f|--force]
suspend [--noflush] <device>
resume <device> [{--addnodeonresume|--addnodeoncreate}]
load <device> [<table_file>]
clear <device>
reload <device> [<table_file>]
wipe_table <device>
rename <device> [--setuuid] <new_name_or_uuid>
message <device> <sector> <message>
ls [--target <target_type>] [--exec <command>] [-o options] [--tree]
info [<device>]
deps [-o options] [<device>]
status [<device>] [--noflush] [--target <target_type>]
table [<device>] [--target <target_type>] [--showkeys]
wait <device> [<event_nr>] [--noflush]
mknodes [<device>]
mangle [<device>]
udevcreatecookie
udevreleasecookie [<cookie>]
udevflags <cookie>
udevcomplete <cookie>
udevcomplete_all <age_in_minutes>
udevcookies
targets
version
setgeometry <device> <cyl> <head> <sect> <start>
splitname <device> [<subsystem>]
<device> may be device name or -u <uuid> or -j <major> -m <minor>
<mangling_mode> is one of 'none', 'auto' and 'hex'.
<fields> are comma-separated. Use 'help -c' for list.
Table_file contents may be supplied on stdin.
Options are: devno, devname, blkdevname.
Tree specific options are: ascii, utf, vt100; compact, inverted, notrunc;
blkdevname, [no]device, active, open, rw and uuid.
root@camille:/etc/pve# dmsetup ls
vms-vm--113--disk--1 (253:17)
vms-vm--200--disk--1 (253:12)
vms-vm--106--disk--2 (253:15)
vms-vm--106--disk--1 (253:16)
vms-vm--111--disk--1 (253:9)
vms-vm--119--disk--1 (253:20)
vms-vm--104--disk--1 (253:8)
pve-swap (253:1)
vms-vm--118--disk--1 (253:19)
vms-vm--103--disk--1 (253:7)
pve-root (253:0)
pve-data (253:2)
vms-vm--117--disk--1 (253:18)
vms-vm--102--disk--1 (253:10)
vms-vm--116--disk--1 (253:14)
vms-vm--101--disk--1 (253:6)
vms-vm--109--disk--2 (253:4)
vms-vm--121--disk--1 (253:23)
vms-vm--100--disk--1 (253:21)
vms-vm--109--disk--1 (253:5)
vms-vm--120--disk--1 (253:22)
vms-vm--114--disk--1 (253:11)
vms-vm--108--disk--1 (253:3)
vms-vm--201--disk--1 (253:13)
root@camille:/etc/pve# kpartx
bash: kpartx: command not found
root@camille:/etc/pve# dmsetup ls -c
vms-vm--113--disk--1 (253:17)
vms-vm--200--disk--1 (253:12)
vms-vm--106--disk--2 (253:15)
vms-vm--106--disk--1 (253:16)
vms-vm--111--disk--1 (253:9)
vms-vm--119--disk--1 (253:20)
vms-vm--104--disk--1 (253:8)
pve-swap (253:1)
vms-vm--118--disk--1 (253:19)
vms-vm--103--disk--1 (253:7)
pve-root (253:0)
pve-data (253:2)
vms-vm--117--disk--1 (253:18)
vms-vm--102--disk--1 (253:10)
vms-vm--116--disk--1 (253:14)
vms-vm--101--disk--1 (253:6)
vms-vm--109--disk--2 (253:4)
vms-vm--121--disk--1 (253:23)
vms-vm--100--disk--1 (253:21)
vms-vm--109--disk--1 (253:5)
vms-vm--120--disk--1 (253:22)
vms-vm--114--disk--1 (253:11)
vms-vm--108--disk--1 (253:3)
vms-vm--201--disk--1 (253:13)
root@camille:/etc/pve# dmsetup -c ls
vms-vm--113--disk--1 (253:17)
vms-vm--200--disk--1 (253:12)
vms-vm--106--disk--2 (253:15)
vms-vm--106--disk--1 (253:16)
vms-vm--111--disk--1 (253:9)
vms-vm--119--disk--1 (253:20)
vms-vm--104--disk--1 (253:8)
pve-swap (253:1)
vms-vm--118--disk--1 (253:19)
vms-vm--103--disk--1 (253:7)
pve-root (253:0)
pve-data (253:2)
vms-vm--117--disk--1 (253:18)
vms-vm--102--disk--1 (253:10)
vms-vm--116--disk--1 (253:14)
vms-vm--101--disk--1 (253:6)
vms-vm--109--disk--2 (253:4)
vms-vm--121--disk--1 (253:23)
vms-vm--100--disk--1 (253:21)
vms-vm--109--disk--1 (253:5)
vms-vm--120--disk--1 (253:22)
vms-vm--114--disk--1 (253:11)
vms-vm--108--disk--1 (253:3)
vms-vm--201--disk--1 (253:13)
root@camille:/etc/pve# dmsetup ls -c
vms-vm--113--disk--1 (253:17)
vms-vm--200--disk--1 (253:12)
vms-vm--106--disk--2 (253:15)
vms-vm--106--disk--1 (253:16)
vms-vm--111--disk--1 (253:9)
vms-vm--119--disk--1 (253:20)
vms-vm--104--disk--1 (253:8)
pve-swap (253:1)
vms-vm--118--disk--1 (253:19)
vms-vm--103--disk--1 (253:7)
pve-root (253:0)
pve-data (253:2)
vms-vm--117--disk--1 (253:18)
vms-vm--102--disk--1 (253:10)
vms-vm--116--disk--1 (253:14)
vms-vm--101--disk--1 (253:6)
vms-vm--109--disk--2 (253:4)
vms-vm--121--disk--1 (253:23)
vms-vm--100--disk--1 (253:21)
vms-vm--109--disk--1 (253:5)
vms-vm--120--disk--1 (253:22)
vms-vm--114--disk--1 (253:11)
vms-vm--108--disk--1 (253:3)
vms-vm--201--disk--1 (253:13)
root@camille:/etc/pve# dmsetup info vms-vm--119--disk--1
Name: vms-vm--119--disk--1
State: ACTIVE
Read Ahead: 256
Tables present: LIVE
Open count: 0
Event number: 0
Major, minor: 253, 20
Number of targets: 1
UUID: LVM-50B7EeCxXI3TfjBinSTX0kOhgdIvQqhYEmDR7xLEJLThXJKEKBK47nXciNC2BN2s
root@camille:/etc/pve# dmsetup mknodes vms-vm--119--disk--1
root@camille:/etc/pve# ls /dev/vms
vm-100-disk-1 vm-102-disk-1 vm-104-disk-1 vm-106-disk-2 vm-109-disk-1 vm-111-disk-1 vm-114-disk-1 vm-117-disk-1 vm-119-disk-1 vm-121-disk-1 vm-201-disk-1
vm-101-disk-1 vm-103-disk-1 vm-106-disk-1 vm-108-disk-1 vm-109-disk-2 vm-113-disk-1 vm-116-disk-1 vm-118-disk-1 vm-120-disk-1 vm-200-disk-1
root@camille:/etc/pve# lvs
LV VG Attr LSize Pool Origin Data% Move Log Copy% Convert
data clubs -wi------ 1024.00g
data miroir -wi------ 55.00g
debian miroir -wi------ 685.00g
pxe miroir -wi------ 10.00g
data pve -wi-ao--- 37.00g
root pve -wi-ao--- 18.75g
swap pve -wi-ao--- 9.38g
vm-100-disk-1 vms -wi-a---- 3.00g
vm-101-disk-1 vms -wi-ao--- 5.00g
vm-102-disk-1 vms -wi-ao--- 10.00g
vm-103-disk-1 vms -wi-ao--- 5.00g
vm-104-disk-1 vms -wi-ao--- 3.00g
vm-105-disk-1 vms -wi------ 10.00g
vm-106-disk-1 vms -wi-ao--- 3.00g
vm-106-disk-2 vms -wi-ao--- 20.00g
vm-107-disk-1 vms -wi------ 32.00g
vm-108-disk-1 vms -wi-ao--- 15.00g
vm-109-disk-1 vms -wi-ao--- 1.00g
vm-109-disk-2 vms -wi-ao--- 10.00g
vm-110-disk-1 vms -wi------ 3.00g
vm-111-disk-1 vms -wi-ao--- 10.00g
vm-112-disk-2 vms -wi------ 5.00g
vm-113-disk-1 vms -wi-a---- 3.00g
vm-114-disk-1 vms -wi-ao--- 5.00g
vm-115-disk-1 vms -wi------ 20.00g
vm-116-disk-1 vms -wi-ao--- 5.00g
vm-117-disk-1 vms -wi-a---- 3.00g
vm-118-disk-1 vms -wi-a---- 34.00g
vm-120-disk-1 vms -wi-a---- 3.00g
vm-121-disk-1 vms -wi-ao--- 3.00g
vm-200-disk-1 vms -wi-a---- 3.00g
vm-201-disk-1 vms -wi-a---- 6.00g
vm-301-disk-1 vms -wi------ 32.00g
vm-302-disk-1 vms -wi------ 10.00g
vm-303-disk-1 vms -wi------ 20.00g
vm-303-disk-2 vms -wi------ 6.00g
vm-304-disk-1 vms -wi------ 4.00g
root@camille:/etc/pve# lvscan
inactive '/dev/miroir/debian' [685.00 GiB] inherit
inactive '/dev/miroir/data' [55.00 GiB] inherit
inactive '/dev/miroir/pxe' [10.00 GiB] inherit
inactive '/dev/clubs/data' [1024.00 GiB] inherit
ACTIVE '/dev/vms/vm-103-disk-1' [5.00 GiB] inherit
ACTIVE '/dev/vms/vm-101-disk-1' [5.00 GiB] inherit
ACTIVE '/dev/vms/vm-102-disk-1' [10.00 GiB] inherit
ACTIVE '/dev/vms/vm-100-disk-1' [3.00 GiB] inherit
ACTIVE '/dev/vms/vm-104-disk-1' [3.00 GiB] inherit
inactive '/dev/vms/vm-105-disk-1' [10.00 GiB] inherit
ACTIVE '/dev/vms/vm-106-disk-1' [3.00 GiB] inherit
ACTIVE '/dev/vms/vm-200-disk-1' [3.00 GiB] inherit
inactive '/dev/vms/vm-301-disk-1' [32.00 GiB] inherit
inactive '/dev/vms/vm-302-disk-1' [10.00 GiB] inherit
ACTIVE '/dev/vms/vm-108-disk-1' [15.00 GiB] inherit
inactive '/dev/vms/vm-107-disk-1' [32.00 GiB] inherit
ACTIVE '/dev/vms/vm-109-disk-2' [10.00 GiB] inherit
ACTIVE '/dev/vms/vm-109-disk-1' [1.00 GiB] inherit
inactive '/dev/vms/vm-110-disk-1' [3.00 GiB] inherit
ACTIVE '/dev/vms/vm-111-disk-1' [10.00 GiB] inherit
inactive '/dev/vms/vm-112-disk-2' [5.00 GiB] inherit
ACTIVE '/dev/vms/vm-114-disk-1' [5.00 GiB] inherit
inactive '/dev/vms/vm-303-disk-1' [20.00 GiB] inherit
inactive '/dev/vms/vm-303-disk-2' [6.00 GiB] inherit
inactive '/dev/vms/vm-304-disk-1' [4.00 GiB] inherit
ACTIVE '/dev/vms/vm-116-disk-1' [5.00 GiB] inherit
inactive '/dev/vms/vm-115-disk-1' [20.00 GiB] inherit
ACTIVE '/dev/vms/vm-201-disk-1' [6.00 GiB] inherit
ACTIVE '/dev/vms/vm-106-disk-2' [20.00 GiB] inherit
ACTIVE '/dev/vms/vm-113-disk-1' [3.00 GiB] inherit
ACTIVE '/dev/vms/vm-117-disk-1' [3.00 GiB] inherit
ACTIVE '/dev/vms/vm-118-disk-1' [34.00 GiB] inherit
ACTIVE '/dev/vms/vm-120-disk-1' [3.00 GiB] inherit
ACTIVE '/dev/vms/vm-121-disk-1' [3.00 GiB] inherit
ACTIVE '/dev/pve/swap' [9.38 GiB] inherit
ACTIVE '/dev/pve/root' [18.75 GiB] inherit
ACTIVE '/dev/pve/data' [37.00 GiB] inherit
root@camille:/etc/pve# pvscan
PV /dev/sde VG miroir lvm2 [750.00 GiB / 0 free]
PV /dev/sdd VG clubs lvm2 [1024.00 GiB / 0 free]
PV /dev/sdb VG vms lvm2 [512.00 GiB / 220.00 GiB free]
PV /dev/sda3 VG pve lvm2 [74.50 GiB / 9.37 GiB free]
Total: 4 [2.31 TiB] / in use: 4 [2.31 TiB] / in no VG: 0 [0 ]
root@camille:/etc/pve# vgscan
Reading all physical volumes. This may take a while...
Found volume group "miroir" using metadata type lvm2
Found volume group "clubs" using metadata type lvm2
Found volume group "vms" using metadata type lvm2
Found volume group "pve" using metadata type lvm2
root@camille:/etc/pve# lvscan
inactive '/dev/miroir/debian' [685.00 GiB] inherit
inactive '/dev/miroir/data' [55.00 GiB] inherit
inactive '/dev/miroir/pxe' [10.00 GiB] inherit
inactive '/dev/clubs/data' [1024.00 GiB] inherit
ACTIVE '/dev/vms/vm-103-disk-1' [5.00 GiB] inherit
ACTIVE '/dev/vms/vm-101-disk-1' [5.00 GiB] inherit
ACTIVE '/dev/vms/vm-102-disk-1' [10.00 GiB] inherit
ACTIVE '/dev/vms/vm-100-disk-1' [3.00 GiB] inherit
ACTIVE '/dev/vms/vm-104-disk-1' [3.00 GiB] inherit
inactive '/dev/vms/vm-105-disk-1' [10.00 GiB] inherit
ACTIVE '/dev/vms/vm-106-disk-1' [3.00 GiB] inherit
ACTIVE '/dev/vms/vm-200-disk-1' [3.00 GiB] inherit
inactive '/dev/vms/vm-301-disk-1' [32.00 GiB] inherit
inactive '/dev/vms/vm-302-disk-1' [10.00 GiB] inherit
ACTIVE '/dev/vms/vm-108-disk-1' [15.00 GiB] inherit
inactive '/dev/vms/vm-107-disk-1' [32.00 GiB] inherit
ACTIVE '/dev/vms/vm-109-disk-2' [10.00 GiB] inherit
ACTIVE '/dev/vms/vm-109-disk-1' [1.00 GiB] inherit
inactive '/dev/vms/vm-110-disk-1' [3.00 GiB] inherit
ACTIVE '/dev/vms/vm-111-disk-1' [10.00 GiB] inherit
inactive '/dev/vms/vm-112-disk-2' [5.00 GiB] inherit
ACTIVE '/dev/vms/vm-114-disk-1' [5.00 GiB] inherit
inactive '/dev/vms/vm-303-disk-1' [20.00 GiB] inherit
inactive '/dev/vms/vm-303-disk-2' [6.00 GiB] inherit
inactive '/dev/vms/vm-304-disk-1' [4.00 GiB] inherit
ACTIVE '/dev/vms/vm-116-disk-1' [5.00 GiB] inherit
inactive '/dev/vms/vm-115-disk-1' [20.00 GiB] inherit
ACTIVE '/dev/vms/vm-201-disk-1' [6.00 GiB] inherit
ACTIVE '/dev/vms/vm-106-disk-2' [20.00 GiB] inherit
ACTIVE '/dev/vms/vm-113-disk-1' [3.00 GiB] inherit
ACTIVE '/dev/vms/vm-117-disk-1' [3.00 GiB] inherit
ACTIVE '/dev/vms/vm-118-disk-1' [34.00 GiB] inherit
ACTIVE '/dev/vms/vm-120-disk-1' [3.00 GiB] inherit
ACTIVE '/dev/vms/vm-121-disk-1' [3.00 GiB] inherit
ACTIVE '/dev/pve/swap' [9.38 GiB] inherit
ACTIVE '/dev/pve/root' [18.75 GiB] inherit
ACTIVE '/dev/pve/data' [37.00 GiB] inherit
root@camille:/etc/pve# lvscan -grep 119
lvscan: invalid option -- 'g'
Error during parsing of command line.
root@camille:/etc/pve# lvscan | grep 119
root@camille:/etc/pve# dmsetup info vms-vm--119--disk--1
Name: vms-vm--119--disk--1
State: ACTIVE
Read Ahead: 256
Tables present: LIVE
Open count: 0
Event number: 0
Major, minor: 253, 20
Number of targets: 1
UUID: LVM-50B7EeCxXI3TfjBinSTX0kOhgdIvQqhYEmDR7xLEJLThXJKEKBK47nXciNC2BN2s
root@camille:/etc/pve# dmsetustatus
bash: dmsetustatus: command not found
root@camille:/etc/pve# dmsetu status
bash: dmsetu: command not found
root@camille:/etc/pve# dmsetup status
vms-vm--113--disk--1: 0 6291456 linear
vms-vm--200--disk--1: 0 6291456 linear
vms-vm--106--disk--2: 0 41943040 linear
vms-vm--106--disk--1: 0 6291456 linear
vms-vm--111--disk--1: 0 20971520 linear
vms-vm--119--disk--1: 0 6291456 linear
vms-vm--104--disk--1: 0 6291456 linear
pve-swap: 0 19660800 linear
vms-vm--118--disk--1: 0 6291456 linear
vms-vm--103--disk--1: 0 10485760 linear
pve-root: 0 39321600 linear
pve-data: 0 77594624 linear
vms-vm--117--disk--1: 0 6291456 linear
vms-vm--102--disk--1: 0 20971520 linear
vms-vm--116--disk--1: 0 10485760 linear
vms-vm--101--disk--1: 0 10485760 linear
vms-vm--109--disk--2: 0 20971520 linear
vms-vm--121--disk--1: 0 6291456 linear
vms-vm--100--disk--1: 0 6291456 linear
vms-vm--109--disk--1: 0 2097152 linear
vms-vm--120--disk--1: 0 6291456 linear
vms-vm--114--disk--1: 0 10485760 linear
vms-vm--108--disk--1: 0 31457280 linear
vms-vm--201--disk--1: 0 12582912 linear
root@camille:/etc/pve# dmsetup targets
striped v1.5.1
linear v1.2.1
error v1.2.0
root@camille:/etc/pve# dmsetup table vms-vm--119--disk--1
0 6291456 linear 8:16 603981824
root@camille:/etc/pve#
root@camille:/etc/pve#
root@camille:/etc/pve# dmsetup remove vms-vm--119--disk--1
root@camille:/etc/pve# ls /dev/vms/
vm-100-disk-1 vm-102-disk-1 vm-104-disk-1 vm-106-disk-2 vm-109-disk-1 vm-111-disk-1 vm-114-disk-1 vm-117-disk-1 vm-120-disk-1 vm-200-disk-1
vm-101-disk-1 vm-103-disk-1 vm-106-disk-1 vm-108-disk-1 vm-109-disk-2 vm-113-disk-1 vm-116-disk-1 vm-118-disk-1 vm-121-disk-1 vm-201-disk-1
root@camille:/etc/pve#
root@camille:/etc/pve# lvcreate -L 16M -n vm-119-disk-1 vms
Logical volume "vm-119-disk-1" created
root@camille:/etc/pve# lv
lvchange lvcreate lvextend lvmchange lvmdiskscan lvmsadc lvreduce lvrename lvs
lvconvert lvdisplay lvm lvmconf lvmdump lvmsar lvremove lvresize lvscan
root@camille:/etc/pve# lvremove vms/vm-119-disk-1
Do you really want to remove and DISCARD active logical volume vm-119-disk-1? [y/n]: y
Logical volume "vm-119-disk-1" successfully removed
root@camille:/etc/pve#
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment