Bug 63421

Summary: max loopback devices not detected but guessed
Product: [Retired] Red Hat Public Beta Reporter: Simon Matter <simon.matter>
Component: mkinitrdAssignee: Matt Wilson <msw>
Status: CLOSED RAWHIDE QA Contact: David Lawrence <dkl>
Severity: medium Docs Contact:
Priority: medium    
Version: skipjack-beta1   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2002-04-15 07:31:25 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 Simon Matter 2002-04-13 16:12:52 UTC
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 07:31:20 UTC
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-21 01:36:41 UTC
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.