Bug 247324 - livecd-creator runs out of loopback devices
livecd-creator runs out of loopback devices
Product: Fedora
Classification: Fedora
Component: livecd-tools (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: David Zeuthen
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2007-07-06 19:04 EDT by Robin Norwood
Modified: 2013-03-05 22:51 EST (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2007-09-13 11:12:02 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Robin Norwood 2007-07-06 19:04:29 EDT
Description of problem:

When running livecd-creator multiple times, it can eventually run out of loop

Version-Release number of selected component (if applicable): livecd-tools-009-1.fc7

How reproducible:

Maybe hard.  I only ran into this after doing many, many livecd builds on a
system, sometimes more than one at a time, some of which I canceled (ctrl-c)
before they were complete.

Steps to Reproduce:
1. Run lots of livecd builds
2. Cancel some of them
3. Maybe run more than one at a time?
Actual results:

losetup: could not find any free loop device
Error creating Live CD : Failed to loopback mount
'/var/tmp/livecd-creator-BOnxs8/data/os.img' : Failed to allocate loop device
for '/var/tmp/livecd-creator-BOnxs8/data/os.img'

[root@kandor ~]# mount

[...normal stuff...]

/dev/loop0 on /var/tmp/livecd-creator-zEbpYi/install_root type ext3 (rw)
/sys on /var/tmp/livecd-creator-zEbpYi/install_root/sys type none (rw,bind)
/proc on /var/tmp/livecd-creator-zEbpYi/install_root/proc type none (rw,bind)
/dev on /var/tmp/livecd-creator-zEbpYi/install_root/dev type none (rw,bind)
/dev/pts on /var/tmp/livecd-creator-zEbpYi/install_root/dev/pts type none (rw,bi
/selinux on /var/tmp/livecd-creator-zEbpYi/install_root/selinux type none (rw,bi
/var/tmp/livecd-creator-zEbpYi/yum-cache on /var/tmp/livecd-creator-zEbpYi/insta
ll_root/var/cache/yum type none (rw,bind)

[...lots more loopback stuff...]

Expected results:

Warm and toasty livecd image.  livecd-creator should free the loopback device
when I cancel.

Additional info:

I was able to recover from this by unmounting each of the things mounted under
the loopback device's mount point, then the loopback device in question.
Comment 1 Robin Norwood 2007-07-06 19:08:04 EDT
Almost forgot: I also had to run losetup -d <looback_device> once I'd unmounted
Comment 2 Jeremy Katz 2007-07-06 22:43:43 EDT
Depending on where the ctrl-c gets caught, we may or may not be able to do
anything about it.  KeyboardInterrupt handling is .. painful at best especially
when you start throwing in rpm's signal handling just to make things extra special.

At the same time, I've fixed a pile of places where we could end up not
unmounting things in git.  So trying to reproduce with the current git tip might
be worthwhile.   
Comment 3 Jeremy Katz 2007-09-13 11:12:02 EDT
Haven't seen a stale mount in a while.  If you reproduce one, please give a good
reproducer and I'll catch it and make sure we clean it up.
Comment 4 Fabian A. Scherschel 2010-08-02 04:55:43 EDT
This is still happening as of livecd-creator in F13.
Comment 5 Renich Bon Ciric 2011-05-11 14:33:30 EDT
happened in F14 too. loop7 seems to be busy.

Just create and recreate a livecd a few times and you'll see ;)

Note You need to log in before you can comment on or make changes to this bug.