Bug 901778 - LoopError: multiple loops associated with /run/install/isodir/Fedora-18-i386-DVD.iso
Summary: LoopError: multiple loops associated with /run/install/isodir/Fedora-18-i386-...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: anaconda
Version: 20
Hardware: All
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Brian Lane
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: abrt_hash:dc99064dbbc39fc3f3b18eae972...
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-01-19 05:23 UTC by Generic User
Modified: 2015-02-17 08:51 UTC (History)
7 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2014-12-09 21:41:58 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
File: anaconda-tb (925.80 KB, text/plain)
2013-01-19 05:23 UTC, Generic User
no flags Details
File: anaconda.log (10.43 KB, text/plain)
2013-01-19 05:23 UTC, Generic User
no flags Details
File: environ (780 bytes, text/plain)
2013-01-19 05:23 UTC, Generic User
no flags Details
File: ifcfg.log (485 bytes, text/plain)
2013-01-19 05:23 UTC, Generic User
no flags Details
File: packaging.log (383.76 KB, text/plain)
2013-01-19 05:23 UTC, Generic User
no flags Details
File: program.log (92.08 KB, text/plain)
2013-01-19 05:23 UTC, Generic User
no flags Details
File: storage.log (210.34 KB, text/plain)
2013-01-19 05:24 UTC, Generic User
no flags Details
File: syslog (88.50 KB, text/plain)
2013-01-19 05:24 UTC, Generic User
no flags Details
F19 64 bit similar crash (159.29 KB, application/x-gzip)
2013-07-19 20:35 UTC, Cedric Buissart
no flags Details
Anaconda backtrace on F20 (516.83 KB, text/plain)
2014-03-29 20:20 UTC, Cedric Buissart
no flags Details

Description Generic User 2013-01-19 05:23:26 UTC
Description of problem:
I am attempting to install Fedora 18 from a bootable USB flash drive.  The USB flash drive is located at /dev/sdb and the installation target SATA hard drive is at /dev/sda.  Using GRUB2 I was able to boot from the USB flash drive which has the vmlinuz and initrd.img from the isolinux directory on /dev/sdb1 with the following sequence of commands:

grub2> linux (hd0,1)/vmlinuz repo=hd:/dev/sdb5
grub2> initrd (hd0,1)/initrd.img
grub2> boot

On /dev/sdb5 I have the Fedora-18-i386-DVD.iso file stored.  Both /dev/sdb1 and /dev/sdb5 are ext4.

Installation proceeded through the graphical installation until the SATA hard drive was selected as the destination for the installation.  At this point, the graphical installer seemed to have problems with the ISO image and the loop device.
The following was filed automatically by anaconda:
anaconda 18.37.11 exception report
Traceback (most recent call first):
  File "/usr/lib/python2.7/site-packages/pyanaconda/storage/devicelibs/loop.py", line 66, in get_loop_name
    raise LoopError("multiple loops associated with %s" % path)
  File "/usr/lib/python2.7/site-packages/pyanaconda/storage/devices.py", line 3621, in status
    loop.get_loop_name(self.slave.path) == self.name)
  File "/usr/lib/python2.7/site-packages/pyanaconda/storage/devices.py", line 265, in __repr__
    "name": self.name, "kids": self.kids, "status": self.status,
  File "/usr/lib/python2.7/site-packages/pyanaconda/storage/devices.py", line 606, in __repr__
    s = Device.__repr__(self)
  File "/usr/lib/python2.7/site-packages/pyanaconda/storage/devicetree.py", line 1106, in addUdevDevice
    log.info("got device: %r" % device)
  File "/usr/lib/python2.7/site-packages/pyanaconda/storage/devicetree.py", line 1894, in _populate
    self.addUdevDevice(dev)
  File "/usr/lib/python2.7/site-packages/pyanaconda/storage/devicetree.py", line 1842, in populate
    self._populate()
  File "/usr/lib/python2.7/site-packages/pyanaconda/storage/__init__.py", line 428, in reset
    self.devicetree.populate(cleanupOnly=cleanupOnly)
  File "/usr/lib/python2.7/site-packages/pyanaconda/ui/gui/spokes/storage.py", line 408, in _doExecute
    self.storage.reset()
  File "/usr/lib/python2.7/threading.py", line 504, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/usr/lib/python2.7/site-packages/pyanaconda/threads.py", line 91, in run
    threading.Thread.run(self, *args, **kwargs)
LoopError: multiple loops associated with /run/install/isodir/Fedora-18-i386-DVD.iso

Additional info:
cmdline:        /usr/bin/python  /sbin/anaconda
cmdline_file:   BOOT_IMAGE=/vmlinuz repo=hd:/dev/sdb5
executable:     /sbin/anaconda
hashmarkername: anaconda
kernel:         3.6.10-4.fc18.i686
other involved packages: 
package:        anaconda-18.37.11
product:        Fedora
release:        Cannot get release name.
type:           libreport
version:        18

Comment 1 Generic User 2013-01-19 05:23:43 UTC
Created attachment 682928 [details]
File: anaconda-tb

Comment 2 Generic User 2013-01-19 05:23:45 UTC
Created attachment 682929 [details]
File: anaconda.log

Comment 3 Generic User 2013-01-19 05:23:47 UTC
Created attachment 682930 [details]
File: environ

Comment 4 Generic User 2013-01-19 05:23:49 UTC
Created attachment 682931 [details]
File: ifcfg.log

Comment 5 Generic User 2013-01-19 05:23:54 UTC
Created attachment 682932 [details]
File: packaging.log

Comment 6 Generic User 2013-01-19 05:23:56 UTC
Created attachment 682933 [details]
File: program.log

Comment 7 Generic User 2013-01-19 05:24:00 UTC
Created attachment 682934 [details]
File: storage.log

Comment 8 Generic User 2013-01-19 05:24:02 UTC
Created attachment 682935 [details]
File: syslog

Comment 9 Brian Lane 2013-03-12 17:39:53 UTC
Did you create this USB stick yourself? This does look like a bug, but you should be able to work around it by using dd to write the iso to a USB stick and install from that.

Comment 10 Cedric Buissart 2013-07-19 20:31:07 UTC
I face the same issue on Fedora 19 :

1) boot from USB disk, via grub, to the F19 vmlinuz & initrd, with a repo=hd:LABEL=bootstuff:/isos/f19/

That /isos/f19/ folder contains the DVD.

2) Then select the installation drive and go to custom installation layout. select a partition, and watch the crash

Reproduced 4 times out of 4 attempts.



It is possible to work around it, I agree, but my environment is to choose what I want to install from a collection of isos on that disk. a dd image would help me for this time, but not on the long run.

Note : 
On my side : yes, I created that USB disk myself. That was working very fine for at least F15 -> F17.

Comment 11 Cedric Buissart 2013-07-19 20:35:20 UTC
Created attachment 775961 [details]
F19 64 bit similar crash

Comment 12 Brian Lane 2013-07-23 17:59:01 UTC
Please attach logs as individual text/plain attachments, not zips or tarballs.

Comment 13 Fedora End Of Life 2013-12-21 10:33:32 UTC
This message is a reminder that Fedora 18 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 18. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '18'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 18's end of life.

Thank you for reporting this issue and we are sorry that we may not be 
able to fix it before Fedora 18 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior to Fedora 18's end of life.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 14 Fedora End Of Life 2014-02-05 15:17:27 UTC
Fedora 18 changed to end-of-life (EOL) status on 2014-01-14. Fedora 18 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.

Comment 15 Cedric Buissart 2014-03-29 20:17:11 UTC
Re-opening : Issue still appears on Fedora 20.

Issue is that there are 2 loopback references to the ISO /run/install/isodir/f20-64/Fedora-20-x86_64-DVD.iso.

`losetup -j /run/install/isodir/f20-64/Fedora-20-x86_64-DVD.iso` returns 2 entries :


/dev/loop0 /run/install/repo iso9660 ro,relatime 0 0
/dev/loop4 /run/install/source iso9660 ro,relatime 0 0

This lead to an exception in loop.py :

def get_loop_name(path):
    args = ["-j", path]
    buf = losetup(args, capture=True)
    if len(buf.splitlines()) > 1:
        # there should never be more than one loop device listed
        raise LoopError("multiple loops associated with %s" % path)

Comment 16 Cedric Buissart 2014-03-29 20:20:19 UTC
Created attachment 880212 [details]
Anaconda backtrace on F20

Comment 17 Cedric Buissart 2014-03-30 12:41:30 UTC
=> From the source, it it appears that "there should never be more than one loop device listed", I suspect the loop0 is created by dracut[*]. I am unsure yet who is creating loop4, but it actually may be something from the dracut modules.

* : 
- loop1 is squashfs.img and loop2 is rootfs (found in squashfs.img), thus it was logically created prior to starting anaconda

Comment 18 Cedric Buissart 2014-03-31 08:57:47 UTC
OK ... I bypassed the incident by manually removing the second loop and replaced it by a symlink from the terminal screen :

umount /run/install/source
rmdir /run/install/source
cd /run/install
ln -s repo /run/install/source

I got my inspiration from the initrd's /lib/dracut/hooks/pre-trigger/50-repo-genrules.sh, so I thought I could do the same :
---8<---
case "$root" in
[...]
  anaconda-auto-cd)
[...]
    # HACK: anaconda demands that CDROMs be mounted at /mnt/install/source
    ln -s repo /run/install/source
--->8---

Unfortunately, it may affect the repository set up, , and I was forced to use a netinstall... but at least, I successfully installed F20 :)

Comment 19 Cedric Buissart 2014-03-31 09:06:27 UTC
So, I believe that the first iso mount, and thus the loop0 creation, is coming from the function anaconda_live_root_dir() in initrd's lib/anaconda-lib.sh :

---8<---
repodir="/run/install/repo"
[...]

# try to find a usable runtime image from the repo mounted at $mnt.
# if successful, move the mount(s) to $repodir/$isodir.
anaconda_live_root_dir() {
    local img="" iso="" srcdir="" mnt="$1" path="$2"; shift 2
    img=$(find_runtime $mnt/$path)
    if [ -n "$img" ]; then
        info "anaconda: found $img"
        [ "$mnt" = "$repodir" ] || { mount --make-rprivate /; mount --move $mnt $isodir; }
        anaconda_auto_updates $repodir/$path/images
    else
        if [ "${path%.iso}" != "$path" ]; then
            iso=$path
            path=${path%/*.iso}
        else
            iso=$(find_iso $mnt/$path)
        fi
        [ -n "$iso" ] || { warn "no suitable images"; return 1; }
        info "anaconda: found $iso"
        mount --make-rprivate /
        mount --move $mnt $isodir
        iso=${isodir}/${iso#$mnt}
        mount -o loop,ro $iso $repodir                                             <== There!
        img=$(find_runtime $repodir) || { warn "$iso has no suitable runtime"; }
        anaconda_auto_updates $isodir/$path/images
    fi
[...]
}
--->8---

=> I still have not managed to trace back where is the 2nd loop (loop4) is coming from, but my understanding is that the second one should be somehow avoided to match with the python Anaconda requirement of 1 loop per device only.

=> note : I have setup a raw LV that is self sufficient to reproduce the incident : it contains grub, F20's vmlinuz/initrd, F20's ISO, and an encrypted PV that will force anaconda to hit the problematic code path and crash when we unlock the PV

Comment 20 Cedric Buissart 2014-04-13 15:10:53 UTC
The second mount is coming from the python Anaconda itself :

From lib64/python2.7/site-packages/pyanaconda/constants.py
MOUNT_DIR = "/mnt/install"
INSTALL_TREE = MOUNT_DIR + "/source"

lib64/python2.7/site-packages/pyanaconda/packaging/__init__.py :

class PackagePayload(Payload):
    """ A PackagePayload installs a set of packages onto the target system. """
[...]
    def _setupMedia(self, device):
        method = self.data.method
        if method.method == "harddrive":
            self._setupDevice(device, mountpoint=ISO_DIR)

            # check for ISO images in the newly mounted dir
            path = ISO_DIR
            if method.dir:
                path = os.path.normpath("%s/%s" % (path, method.dir))

            # XXX it would be nice to streamline this when we're just setting
            #     things back up after storage activation instead of having to
            #     pretend we don't already know which ISO image we're going to
            #     use
            image = findFirstIsoImage(path)
            if not image:
                device.teardown(recursive=True)
                raise PayloadSetupError("failed to find valid iso image")

            if path.endswith(".iso"):
                path = os.path.dirname(path)

            # this could already be set up the first time through
            if not os.path.ismount(INSTALL_TREE):
                # mount the ISO on a loop
                image = os.path.normpath("%s/%s" % (path, image))
                mountImage(image, INSTALL_TREE)        <== THERE

lib64/python2.7/site-packages/pyanaconda/image.py :

def mountImage(isodir, tree):

    while True:
        if os.path.isfile(isodir):
            image = isodir
        else:
            image = findFirstIsoImage(isodir)  
            [...]

            image = os.path.normpath("%s/%s" % (isodir, image))

        try:
            blivet.util.mount(image, tree, fstype = 'iso9660', options="ro") <== THERE



lib/python2.7/site-packages/blivet/util.py :

def mount(device, mountpoint, fstype, options=None):
    [...]
    argv = ["mount", "-t", fstype, "-o", options, device, mountpoint]



=> So the double-mounting is apparently coming from python Anaconda itself (the first iso mount is from dracut, and python Anaconda mounts the second one).

=>  _setupMedia() should probably check if the ISO has been already mounted elsewhere, and if so, maybe create some symlink or something ?

Comment 21 Brian Lane 2014-12-09 21:41:58 UTC
This should be working fine with F21.

Comment 22 hejia 2015-02-15 02:19:38 UTC
(In reply to bcl from comment #21)
> This should be working fine with F21.

Hi,
 Could u double check the python-blivet in F21?
I watched the similiar double mount error in F21 ppc64 installtion.
And I checked that the commit https://github.com/rhinstaller/blivet/commit/d63c967affc5a6b88c355d6b24089d68080f02e2 had been included in F21 yet

Comment 23 hejia 2015-02-15 02:20:33 UTC
(In reply to hejia from comment #22)
> (In reply to bcl from comment #21)
> > This should be working fine with F21.
> 
> Hi,
>  Could u double check the python-blivet in F21?
> I watched the similiar double mount error in F21 ppc64 installtion.
> And I checked that the commit
> https://github.com/rhinstaller/blivet/commit/
> d63c967affc5a6b88c355d6b24089d68080f02e2 had been included in F21 yet

sorry. s/had been/had not been/

Comment 24 Brian Lane 2015-02-16 23:01:50 UTC
Sorry, I was mistaken. This will be fixed in F22.

Comment 25 Cedric Buissart 2015-02-17 08:51:30 UTC
On my side, F19 and F20 were crashing, but I didn't face any issue with F21 using similar method. So it has been working fine for me, at least (x86_64).


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