Wind River Support Network


LIN5-3580 : The loopback device will not release occasionally on Ubuntu 12.04 with make usb-image-loop

Created: Nov 3, 2013    Updated: Dec 19, 2017
Resolved Date: Dec 5, 2013
Found In Version: 5.0.1
Fix Version:
Severity: Standard
Applicable for: Wind River Linux 5
Component/s: Build & Config


Running the following command will sometimes encounter problems

make usb-image-loop IMGARGS=--fat16-mb=512 < /dev/null

This is an intermittent race condition and when it fails the failure will look like:

mount /dev/loop0 /tmp/tmp.oydcXotddV
./scripts/ tar -C export/dist -cSpf - . | (cd /tmp/tmp.oydcXotddV && tar -xSvf -)
#==Copying files to media, each . == 1000 files copied, this may take a while==

#==Unmounting and syncing, may take some time...==
umount /tmp/tmp.oydcXotddV
#      OUTPUT: umount: /tmp/tmp.oydcXotddV: device is busy.
#      OUTPUT:         (In some cases useful info about processes that use
#      OUTPUT:          the device is found by lsof(8) or fuser(1))

# Copy complete
rmdir /tmp/tmp.oydcXotddV
#      OUTPUT: rmdir: failed to remove `/tmp/tmp.oydcXotddV': Device or resource busy
chown -R 5002 host-cross/var/pseudo


When the problem happens, manually shutdown the loop back device and umount.

sudo umount /dev/loop0
sudo losetup -d /dev/loop0

Steps to Reproduce

configure --enable-rootfs=glibc_std --enable-board=qemu86-64
make fs

Try 5 times in a row on ubuntu 12.04, and there is no gaurantee that it will even happen. 

make usb-image-loop IMGARGS=--fat16-mb=512 < /dev/null

Other Downloads

Live chat