Bug 64557

Summary: losetup doesn't work for loop files greater than loop7
Product: [Retired] Red Hat Linux Reporter: Piet E Barber <pietbarber>
Component: util-linuxAssignee: Elliot Lee <sopwith>
Status: CLOSED CURRENTRELEASE QA Contact: Ben Levenson <benl>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.3   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
URL: http://pietbarber.com/RedHat/losetup-output.txt
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2002-05-07 22:05:22 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 Piet E Barber 2002-05-07 22:03:37 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.9) Gecko/20020408

Description of problem:
loopback devices above /dev/loop7 do not seem to be valid

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


How reproducible:
Always

Steps to Reproduce:
1. put redhat iso images in /iso
2. mkdir /mnt/rh73-1
3. type command: 

[root@redhat mnt]# mount /iso/valhalla-i386-disc1.iso /mnt/rh73-3 -o loop=/dev/loop8
/dev/loop8: No such device
[root@redhat mnt]# mount /iso/valhalla-i386-disc1.iso /mnt/rh73-3 -o loop=/dev/loop9
/dev/loop9: No such device
[root@redhat mnt]# mount /iso/valhalla-i386-disc1.iso /mnt/rh73-3 -o loop=/dev/loop7
(works)

Additionally, using the losetup command directly causes the same issues. 
losetup /dev/loop8 /iso/valhalla-i386-disc1.iso doesn't work, 
while the same losetup command on /dev/loop7 works just fine. 
	

Actual Results:  
loop7 works fine
loop0 through loop7 work fine
anything above loop7 does not work, with an error message of: 
No such device.

Expected Results:  I expected the loopback devices to mount.

I have included the output of strace at the URL above. 

Additional info:

a look in the /dev/loop* directory with extra information, shows that the mknods
were performed correctly, so it's not like somebody forgot to include some block
files in the distro: 


[root@redhat mnt]# ls -l /dev/loop*
brw-rw----    1 root     disk       7,   0 Apr 11 10:25 /dev/loop0
brw-rw----    1 root     disk       7,   1 Apr 11 10:25 /dev/loop1
brw-rw----    1 root     disk       7,  10 Apr 11 10:25 /dev/loop10
brw-rw----    1 root     disk       7,  11 Apr 11 10:25 /dev/loop11
brw-rw----    1 root     disk       7,  12 Apr 11 10:25 /dev/loop12
brw-rw----    1 root     disk       7,  13 Apr 11 10:25 /dev/loop13
brw-rw----    1 root     disk       7,  14 Apr 11 10:25 /dev/loop14
brw-rw----    1 root     disk       7,  15 Apr 11 10:25 /dev/loop15
brw-rw----    1 root     disk       7,   2 Apr 11 10:25 /dev/loop2
brw-rw----    1 root     disk       7,   3 Apr 11 10:25 /dev/loop3
brw-rw----    1 root     disk       7,   4 Apr 11 10:25 /dev/loop4
brw-rw----    1 root     disk       7,   5 Apr 11 10:25 /dev/loop5
brw-rw----    1 root     disk       7,   6 Apr 11 10:25 /dev/loop6
brw-rw----    1 root     disk       7,   7 Apr 11 10:25 /dev/loop7
brw-rw----    1 root     disk       7,   8 Apr 11 10:25 /dev/loop8
brw-rw----    1 root     disk       7,   9 Apr 11 10:25 /dev/loop9

lsmod shows the loopback module installed and running. I'm not including the
output of that, because it's not particularly interesting.

Comment 1 Piet E Barber 2002-05-07 22:05:15 UTC
Doh.

The mkdir command, in steps reproducible should be: 
mkdir /mnt/rh73-1

not 

mkdir /mnt/rh73-3


Comment 2 Elliot Lee 2002-05-07 22:07:34 UTC
You need to set the maximum number of loop devices - the default is 8. Since
you're using it as a module,
  echo "options loop max_loop=16" >> /etc/modules.conf
should fix it.

Most people never need 8 loopbacks, and leaving the default low saves memory,
hence the need for you to change your configuration.