Bug 1083392 - "failed: Device or resource busy" when creating lvm snapshot of ext4 filesystem
"failed: Device or resource busy" when creating lvm snapshot of ext4 filesystem
Status: RESOLVED WONTFIX
Classification: openSUSE
Product: openSUSE Distribution
Classification: openSUSE
Component: Other
Leap 42.3
x86-64 openSUSE 42.3
: P5 - None : Normal (vote)
: ---
Assigned To: Gang He
E-mail List
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2018-02-28 23:40 UTC by Tommy Frossman
Modified: 2018-04-04 15:14 UTC (History)
6 users (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments
dmsetup ls (516 bytes, text/plain)
2018-03-15 13:19 UTC, Tommy Frossman
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tommy Frossman 2018-02-28 23:40:36 UTC
User-Agent:       Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/604.5.6 (KHTML, like Gecko) Version/11.0.3 Safari/604.5.6
Build Identifier: 

I get the error "device-mapper: remove ioctl on (254:13) failed: Device or resource busy" when I try to create a snapshot of a logical partition using LVM and ext4.

The snapshot seems to be created alright but I get this error message every time i create a snapshot using LVM.

Reproducible: Always

Steps to Reproduce:
1. lvcreate --size 5G -s -n s1519859674 /dev/datavg/lv_kvmdata

Actual Results:  
device-mapper: remove ioctl on (254:13) failed: Device or resource busy
Logical volume "s1519859674" created.

Expected Results:  
Logical volume "s1519859674" created.

$ vgs

  --- Volume group ---
  VG Name               datavg
  System ID
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  28
  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               3.64 TiB
  PE Size               16.00 MiB
  Total PE              238465
  Alloc PE / Size       25600 / 400.00 GiB
  Free  PE / Size       212865 / 3.25 TiB
  VG UUID               LWBkc4-1i3m-CfKM-77uJ-Svv6-3uoC-zRno43

$ lvdisplay

  --- Logical volume ---
  LV Path                /dev/datavg/lv_kvmdata
  LV Name                lv_kvmdata
  VG Name                datavg
  LV UUID                B4F1O3-pxva-e1t6-Rdpj-TuFq-9fOK-k7dJQ9
  LV Write Access        read/write
  LV Creation host, time sth-bg-kvm000, 2018-02-25 17:39:01 +0100
  LV Status              available
  # open                 1
  LV Size                400.00 GiB
  Current LE             25600
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     1024
  Block device           254:12


$ blkid /dev/mapper/datavg-lv_kvmdata
/dev/mapper/datavg-lv_kvmdata: UUID="a8aaeff4-ba66-4c42-9be9-e48c4144dd3a" TYPE="ext4"
Comment 1 zhen ren 2018-03-07 09:29:54 UTC
> Steps to Reproduce:
> 1. lvcreate --size 5G -s -n s1519859674 /dev/datavg/lv_kvmdata
> 
> Actual Results:  
> device-mapper: remove ioctl on (254:13) failed: Device or resource busy
> Logical volume "s1519859674" created.
> 

I take a very quick test on my 42.3, but don't see this issue:

ws:~ # cat /etc/issue
Welcome to openSUSE Leap 42.3 - Kernel \r (\l).

ws:~ # rpm -qa|grep lvm2
lvm2-2.02.120-80.1.x86_64

ws:~ # vgcreate vg1 /dev/sda2
  Volume group "vg1" successfully created
ws:~ # lvcreate -L1G -n lv1 vg1
  Logical volume "lv1" created.
ws:~ # mkfs.ext4 /dev/vg1/lv1 
mke2fs 1.42.11 (09-Jul-2014)
...

ws:~ # mount /dev/vg1/lv1 /mnt/
ws:~ # lvcreate -L500M -s -n lv1-snap vg1/lv1
  Logical volume "lv1-snap" created.
ws:~ # lvs vg1
  LV       VG   Attr       LSize   Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  lv1      vg1  owi-aos---   1.00g                                                    
  lv1-snap vg1  swi-a-s--- 500.00m      lv1    0.00
Comment 2 zhen ren 2018-03-07 09:32:16 UTC
> Steps to Reproduce:
> 1. lvcreate --size 5G -s -n s1519859674 /dev/datavg/lv_kvmdata
> 
> Actual Results:  
> device-mapper: remove ioctl on (254:13) failed: Device or resource busy
> Logical volume "s1519859674" created.
>

Can you run "lvcreate -vvv ..." to get verbose output? and other commands:

$lsblk

$dmsetup ls --tree

$dmsetup info -c
Comment 3 Tommy Frossman 2018-03-15 13:19:24 UTC
Created attachment 763803 [details]
dmsetup ls
Comment 4 Tommy Frossman 2018-03-15 13:22:41 UTC
(In reply to zhen ren from comment #2)
> > Steps to Reproduce:
> > 1. lvcreate --size 5G -s -n s1519859674 /dev/datavg/lv_kvmdata
> > 
> > Actual Results:  
> > device-mapper: remove ioctl on (254:13) failed: Device or resource busy
> > Logical volume "s1519859674" created.
> >
> 
> Can you run "lvcreate -vvv ..." to get verbose output? and other commands:
https://pastebin.com/sSVX4bTH
> 
> $lsblk
https://pastebin.com/6jUCwFkS
> 
> $dmsetup ls --tree
https://pastebin.com/muPdkfdr
> 
> $dmsetup info -c
https://pastebin.com/2m5hATBz


Sure here you go.
Comment 5 Sébastien POHER 2018-03-30 07:42:30 UTC
Hi,
Not sure if it is related but this also happens in Leap 15 when the system shutting down.
My Leap 15 Beta install has been set up with encrypted LVM volume, when I shutdown lots of these « device-mapper: remove ioctl on  failed: Device or resource busy » are printed on stdout.
Exactly as described here : https://www.suse.com/support/kb/doc/?id=7017390
Comment 6 Neil Rickert 2018-03-30 13:07:22 UTC
From c#5

>My Leap 15 Beta install has been set up with encrypted LVM volume, when I shutdown lots of these « device-mapper: remove ioctl on  failed: Device or resource busy » are printed on stdout.

That appears to be bug 1080485 and it also happens on Tumbleweed.
Comment 7 Martin Wilck 2018-04-04 15:14:40 UTC
This is not an error. You can see it in https://pastebin.com/sSVX4bTH, line 638-640. 

        dm remove   (254:13) NFT    [16384] (*1)
        device-mapper: remove ioctl on (254:13) failed: Device or resource busy
        dm remove   (254:13) NFT    [16384] (*2)
  
The command is simply retried, and succeeds the second time. The LVM2 source code does this explicitly for the error code EBUSY.

			/*
			 * It's sometimes worth retrying after EBUSY in case
			 * it's a transient failure caused by an asynchronous
			 * process quickly scanning the device.
			 */
			*retryable = dmt->ioctl_errno == EBUSY;