Bug 63421 - max loopback devices not detected but guessed
max loopback devices not detected but guessed
Status: CLOSED RAWHIDE
Product: Red Hat Public Beta
Classification: Retired
Component: mkinitrd (Show other bugs)
skipjack-beta1
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Matt Wilson
David Lawrence
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2002-04-13 12:12 EDT by Simon Matter
Modified: 2007-04-18 12:41 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2002-04-15 03:31:25 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Simon Matter 2002-04-13 12:12:52 EDT
From Bugzilla Helper:
User-Agent: Mozilla/4.77 [de] (X11; U; Linux 2.2.19-6.2.16 i586)

Description of problem:
When I try to create a new initrd with mkinitrd (or through kernel upgrade), it
complains "All of your loopback devices are in use!" and exits. I have "options
loop max_loop=64" in /etc/modules.conf and can have much more than 8 loop
devices.

Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
1. mkinitrd myinitrd.img `uname -r`
2.
3.
	

Actual Results:  [root@xxl /boot]# mkinitrd myinitrd.img `uname -r`
All of your loopback devices are in use!

myinitrd.img was not created.

Expected Results:  [root@xxl /boot]# mkinitrd myinitrd.img `uname -r`

myinitrd.img was created.

Additional info:

The following section in mkinitrd should be changed:

if [ "$devnum" = "8" ]; then
    rm -rf $MNTPOINT $IMAGE
    echo "All of your loopback devices are in use!" >&2
    exit 1
fi
Comment 1 Simon Matter 2002-04-15 03:31:20 EDT
Sorry, I didn't look at the code well. Here is how a possible modification could
look like:

if [ -e /dev/.devfsd ]; then
        LOOPDEV=/dev/loop/
else
        LOOPDEV=/dev/loop
fi
 
unset LODEV
for dev in ${LOOPDEV}*; do
    if losetup ${dev} $IMAGE 2>/dev/null; then
        LODEV=${dev}
        break
    fi
done
 
if [ -z "$LODEV" ]; then
    rm -rf $MNTPOINT $IMAGE
    echo "All of your loopback devices are in use!" >&2
    exit 1
fi

The only thing I don't like here is that loop devices are not tried in numerical
order but that's not a true problem. I think with this code loop creation will
succeed if you have
a) enough loop devices enabled in kernel or via module parameter and
b) have enough device nodes available
Comment 2 Erik Troan 2002-05-20 21:36:41 EDT
I added a command to nash to find the right block device more elegantly, and
the fix is in 3.3.11. It should work for up to 256 loopback devices.

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