# Mender-convert not enough loop devices

**URL:** https://hub.mender.io/t/mender-convert-not-enough-loop-devices/573
**Category:** General Discussions
**Tags:** raspberry-pi-cm3
**Created:** [May 16, 2019, 7:57am UTC](https://hub.mender.io/t/mender-convert-not-enough-loop-devices/573 "2019-05-16T07:57:38Z")
**Posts on this page:** 14
**Page:** 1

<div class="post-metadata">

### Author: ![sensslen](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/sensslen/32/245_2.png) [@sensslen](https://hub.mender.io/u/sensslen)
#### Post date: [May 16, 2019, 7:57am UTC](https://hub.mender.io/t/mender-convert-not-enough-loop-devices/573/1 "2019-05-16T07:57:38Z")

</div>

When using docker-mender-convert on a pretty fresh install of xubuntu 18.04 I keep getting an error (Error: cannot find an unused loop device. Aborting.). The Error happens in stage 9/9.  
Unfortunately I haven’t been able to trace the error in any way yet. Does anyone you have any insight into this?  
I try to convert a stock raspbian lite image with the following command:

```auto
./docker-mender-convert from-raw-disk-image --raw-disk-image input/2019-04-08-raspbian-stretch-lite.img --mender-disk-image input/raspbian-mender-ge.img --device-type raspberrypi3 --artifact-name raspbian-mender-ge --bootloader-toolchain arm-buildroot-linux-gnueabihf --demo --demo-host-ip 127.0.0.1 --storage-total-size-mb 4000

```

Edit: @mirzak: prettify command highlighting.

---

<div class="post-metadata">

### Author: ![mirzak](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/mirzak/32/2056_2.png) [@mirzak](https://hub.mender.io/u/mirzak)
#### Post date: [May 16, 2019, 8:02am UTC](https://hub.mender.io/t/mender-convert-not-enough-loop-devices/573/2 "2019-05-16T08:02:14Z")

</div>

> [@sensslen](#):
>
> (Error: cannot find an unused loop device. Aborting.)

Can you check if you have the `loop` kernel module running, e.g

```auto
$ lsmod | grep loop
loop 40960 14

```

And you should also have `/dev/loopX` devices, and based on the error it seems that that it can not find any available loop devices.

---

<div class="post-metadata">

### Author: ![sensslen](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/sensslen/32/245_2.png) [@sensslen](https://hub.mender.io/u/sensslen)
#### Post date: [May 16, 2019, 8:18am UTC](https://hub.mender.io/t/mender-convert-not-enough-loop-devices/573/3 "2019-05-16T08:18:26Z")

</div>

Loop service is running, as I can mount loop devices.

According to [https://askubuntu.com/questions/666880/loop-module-not-present-on-ubuntu-installation](https://askubuntu.com/questions/666880/loop-module-not-present-on-ubuntu-installation) it doesd not appear in lsmod, as the module is compiled into the kernel.

I even tried to increase the number of loop devices of the machine to 64 - and checked that there were 64 loop entries in /dev/. This didn’t change a thing.

---

<div class="post-metadata">

### Author: ![mirzak](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/mirzak/32/2056_2.png) [@mirzak](https://hub.mender.io/u/mirzak)
#### Post date: [May 16, 2019, 8:21am UTC](https://hub.mender.io/t/mender-convert-not-enough-loop-devices/573/4 "2019-05-16T08:21:41Z")

</div>

Wonder if it is a docker permission thing. The `docker-mender-convert` will execute with `--privileged=true` which should give it access to loop devices, but maybe something has changed here.

Can you try to manually verify if you can access loop devices from within docker containers?

---

<div class="post-metadata">

### Author: ![sensslen](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/sensslen/32/245_2.png) [@sensslen](https://hub.mender.io/u/sensslen)
#### Post date: [May 16, 2019, 8:24am UTC](https://hub.mender.io/t/mender-convert-not-enough-loop-devices/573/5 "2019-05-16T08:24:05Z")

</div>

I’ll try to find out. Intrestingly enough the mender-convert utility is able to mount some partitions before the error occurs - if I understand things correctly (sorry I’m very new to docker and mender) this also uses loop devices.

---

<div class="post-metadata">

### Author: ![mirzak](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/mirzak/32/2056_2.png) [@mirzak](https://hub.mender.io/u/mirzak)
#### Post date: [May 16, 2019, 8:25am UTC](https://hub.mender.io/t/mender-convert-not-enough-loop-devices/573/6 "2019-05-16T08:25:36Z")

</div>

Yes, it does seem that it was able to mount things earlier if it fails at stage 9/9.

Can you paste the full build log, and also output of `docker --version`

---

<div class="post-metadata">

### Author: ![sensslen](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/sensslen/32/245_2.png) [@sensslen](https://hub.mender.io/u/sensslen)
#### Post date: [May 16, 2019, 8:27am UTC](https://hub.mender.io/t/mender-convert-not-enough-loop-devices/573/7 "2019-05-16T08:27:17Z")

</div>

It should be the newest one - Docker version 18.09.6, build 481bc77

To answer your previous question - Yes, I am able to access /dev from docker. For this I used:

```auto
docker run -t -i --privileged -v /dev:/dev ubuntu:18.04

```

```auto
ls /dev/ 

```

gave the output:

```auto
autofs core fd initctl loop2 mem ppp sda stderr tty12 tty2 tty27 tty34 tty41 tty49 tty56 tty63 ttyS12 ttyS2 ttyS27 ttyS6 userio vcs5 vcsa5 zero
block cpu_dma_latency full input loop3 memory_bandwidth psaux sda1 stdin tty13 tty20 tty28 tty35 tty42 tty5 tty57 tty7 ttyS13 ttyS20 ttyS28 ttyS7 vboxguest vcs6 vcsa6
bsg cuse fuse kmsg loop4 mqueue ptmx sg0 stdout tty14 tty21 tty29 tty36 tty43 tty50 tty58 tty8 ttyS14 ttyS21 ttyS29 ttyS8 vboxuser vcs7 vcsa7
btrfs-control disk hidraw0 lightnvm loop5 net pts sg1 tty tty15 tty22 tty3 tty37 tty44 tty51 tty59 tty9 ttyS15 ttyS22 ttyS3 ttyS9 vcs vcsa vfio
bus dri hpet log loop6 network_latency random shm tty0 tty16 tty23 tty30 tty38 tty45 tty52 tty6 ttyS0 ttyS16 ttyS23 ttyS30 ttyprintk vcs1 vcsa1 vga_arbiter
cdrom dvd hugepages loop-control loop7 network_throughput rfkill snapshot tty1 tty17 tty24 tty31 tty39 tty46 tty53 tty60 ttyS1 ttyS17 ttyS24 ttyS31 uhid vcs2 vcsa2 vhci
char ecryptfs hwrng loop0 mapper null rtc snd tty10 tty18 tty25 tty32 tty4 tty47 tty54 tty61 ttyS10 ttyS18 ttyS25 ttyS4 uinput vcs3 vcsa3 vhost-net
console fb0 i2c-0 loop1 mcelog port rtc0 sr0 tty11 tty19 tty26 tty33 tty40 tty48 tty55 tty62 ttyS11 ttyS19 ttyS26 ttyS5 urandom vcs4 vcsa4 vhost-vsock

```

---

<div class="post-metadata">

### Author: ![MarekBelisko](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/marekbelisko/32/33_2.png) [@MarekBelisko](https://hub.mender.io/u/MarekBelisko)
#### Post date: [May 16, 2019, 8:42am UTC](https://hub.mender.io/t/mender-convert-not-enough-loop-devices/573/8 "2019-05-16T08:42:54Z")

</div>

can you pls try [following](https://github.com/moby/moby/issues/27886#issuecomment-447108648)  
if losetup seems more loop devices. maybe there is some issue with ubuntu 18.04 (or latest docker). I’m using mender-convert on 16.04 without any problems though.

---

<div class="post-metadata">

### Author: ![sensslen](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/sensslen/32/245_2.png) [@sensslen](https://hub.mender.io/u/sensslen)
#### Post date: [May 16, 2019, 8:54am UTC](https://hub.mender.io/t/mender-convert-not-enough-loop-devices/573/9 "2019-05-16T08:54:15Z")

</div>

Thanks for your help.  
I just figured that the problem was that my Xubuntu installation agressively mounting all available partitions. So it’s a problem in the host system and is resolved by disabling automount during mender-convert.

---

<div class="post-metadata">

### Author: ![MarekBelisko](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/marekbelisko/32/33_2.png) [@MarekBelisko](https://hub.mender.io/u/MarekBelisko)
#### Post date: [May 16, 2019, 9:05am UTC](https://hub.mender.io/t/mender-convert-not-enough-loop-devices/573/10 "2019-05-16T09:05:25Z")

</div>

@sensslen thanks for reporting back. Maybe can you pls copy some command or link how you do it -\> can be helpful for others also. 👍

---

<div class="post-metadata">

### Author: ![sensslen](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/sensslen/32/245_2.png) [@sensslen](https://hub.mender.io/u/sensslen)
#### Post date: [May 16, 2019, 9:12am UTC](https://hub.mender.io/t/mender-convert-not-enough-loop-devices/573/11 "2019-05-16T09:12:24Z")

</div>

Of course I can. Since my Ubuntu uses XFCE I used the Gui Application to disable automount by going to Settings:

 ![Bildschirmfoto_2019-05-16_11-09-12](https://canada1.discourse-cdn.com/flex036/uploads/mender/original/1X/b4149765aa86c76dd615a95d78464ffe0623e8fb.png)  
in submenu Removable Drives and Media:  
 ![Bildschirmfoto_2019-05-16_11-11-35](https://canada1.discourse-cdn.com/flex036/uploads/mender/original/1X/ee1511d33e8fcdde566312a32706bd3961dff888.png)  
Untick all Checkboxes under Removable Drives.

---

<div class="post-metadata">

### Author: ![MarekBelisko](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/marekbelisko/32/33_2.png) [@MarekBelisko](https://hub.mender.io/u/MarekBelisko)
#### Post date: [May 16, 2019, 9:19am UTC](https://hub.mender.io/t/mender-convert-not-enough-loop-devices/573/12 "2019-05-16T09:19:14Z")

</div>

Thanks a lot.

---

<div class="post-metadata">

### Author: ![neoweb](https://avatars.discourse-cdn.com/v4/letter/n/a5b964/32.png) [@neoweb](https://hub.mender.io/u/neoweb)
#### Post date: [May 25, 2019, 7:57am UTC](https://hub.mender.io/t/mender-convert-not-enough-loop-devices/573/13 "2019-05-25T07:57:49Z")

</div>

I am having this issue right now, and I am running ubuntu server via console.

I am working on it now.

---

<div class="post-metadata">

### Author: ![neoweb](https://avatars.discourse-cdn.com/v4/letter/n/a5b964/32.png) [@neoweb](https://hub.mender.io/u/neoweb)
#### Post date: [May 25, 2019, 8:10am UTC](https://hub.mender.io/t/mender-convert-not-enough-loop-devices/573/14 "2019-05-25T08:10:53Z")

</div>

I ended up doing a

> docker system prune

and

> ./docker-build

it seems to have fixed the issue
