Bug 247324

Summary: livecd-creator runs out of loopback devices
Product: [Fedora] Fedora Reporter: Robin Norwood <robin.norwood>
Component: livecd-toolsAssignee: David Zeuthen <davidz>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: medium    
Version: 7CC: fabsh, katzj, lex.lists, mclasen, renich, sankarshan.mukhopadhyay
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-09-13 15:12:02 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Robin Norwood 2007-07-06 23:04:29 UTC
Description of problem:

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


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
nd)
/selinux on /var/tmp/livecd-creator-zEbpYi/install_root/selinux type none (rw,bi
nd)
/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 23:08:04 UTC
Almost forgot: I also had to run losetup -d <looback_device> once I'd unmounted
everything.

Comment 2 Jeremy Katz 2007-07-07 02:43:43 UTC
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 15:12:02 UTC
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 08:55:43 UTC
This is still happening as of livecd-creator in F13.

Comment 5 Renich Bon Ciric 2011-05-11 18:33:30 UTC
happened in F14 too. loop7 seems to be busy.

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