LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices



Reply
 
Search this Thread
Old 07-21-2005, 10:55 AM   #1
dplazz
LQ Newbie
 
Registered: Jul 2005
Distribution: RedHat AS4
Posts: 5

Rep: Reputation: 0
Maximum mounted loop devices?


I'm building an ISO jukebox on RedHat AS4, and was curious what the maximum number of loop devices (used to mount an ISO) is for the 2.6 kernel. I know that the default setting is 256, but I'm pretty sure it can be increased. Anyone know what the actual maximum is?
 
Old 07-21-2005, 11:14 AM   #2
jailbait
Guru
 
Registered: Feb 2003
Location: Blue Ridge Mountain
Distribution: Debian Wheezy, Debian Jessie
Posts: 7,590

Rep: Reputation: 188Reputation: 188
"I'm building an ISO jukebox on RedHat AS4, and was curious what the maximum number of loop devices (used to mount an ISO) is for the 2.6 kernel. I know that the default setting is 256, but I'm pretty sure it can be increased. Anyone know what the actual maximum is?"

The limit is the smaller of two constraints. One constraint is the maximum number set in the kernel. Increasing this number causes the kernel to use more memory so I suppose memory size is the ultimate constraint. A second constraint is the number of loopback devices available in /dev. These devices have a name of /dev/loopx where x is an integer. You can increase the number of loopback devices with the mknod command.

---------------------------
Steve Stites
 
Old 07-21-2005, 11:30 AM   #3
dplazz
LQ Newbie
 
Registered: Jul 2005
Distribution: RedHat AS4
Posts: 5

Original Poster
Rep: Reputation: 0
Thanks for the info! I figured out how to create additional loop devices in /dev now, but can the number specified in the kernel be changed without a recompile?
 
Old 07-21-2005, 11:50 AM   #4
jailbait
Guru
 
Registered: Feb 2003
Location: Blue Ridge Mountain
Distribution: Debian Wheezy, Debian Jessie
Posts: 7,590

Rep: Reputation: 188Reputation: 188
"can the number specified in the kernel be changed without a recompile?"

I doubt it because the number is used to set aside a certain amount of memory for loop devices during a kernel compile.

------------------------------
Steve Stites
 
Old 07-21-2005, 04:30 PM   #5
dplazz
LQ Newbie
 
Registered: Jul 2005
Distribution: RedHat AS4
Posts: 5

Original Poster
Rep: Reputation: 0
It turns out the default setting isn't 256 after all. It's 8, just like in the 2.4.x kernel (I'm using 2.6.9). The silver lining is that I'm supposed to be able to pass a "max_loop=255" command through to the kernel using grub during the boot.

The problem persists though, and I still can't mount more than 8 loop devices. I even tried creating more loop devices with mknod ("mknod -m660 /dev/loop8 b 7 8"), and while they show up properly in an ls, they disappear on reboot, and still don't function while they do exist. Am I overlooking something?
 
Old 07-21-2005, 05:15 PM   #6
jailbait
Guru
 
Registered: Feb 2003
Location: Blue Ridge Mountain
Distribution: Debian Wheezy, Debian Jessie
Posts: 7,590

Rep: Reputation: 188Reputation: 188
"The problem persists though, and I still can't mount more than 8 loop devices. I even tried creating more loop devices with mknod ("mknod -m660 /dev/loop8 b 7 8"), and while they show up properly in an ls, they disappear on reboot, and still don't function while they do exist."

Your command is correct. Why they don't function and why they disappear probably is caused by your kernel maximum loop parameter being set to 8.

"It turns out the default setting isn't 256 after all. It's 8, just like in the 2.4.x kernel (I'm using 2.6.9). The silver lining is that I'm supposed to be able to pass a "max_loop=255" command through to the kernel using grub during the boot."

The kernel parameter is set by your distribution when they compiled your kernel. They may or may not have used the default, whatever the default is.

I doubt very much that you can pass the kernel a parameter to increase the number of loop devices beyond the number that are built into the kernel's loop table or whatever. The kernel just does not have the memory available to keep track of more loop devices than were compiled in when the kernel was compiled. So loop devices in /dev beyond the kernel maximum would be inoperative. Maybe the kernel is smart enough at boot to delete excessive loop devices but I am just theorizing on that. Maybe your distribution has a boot script to delete excessive loop devices. In any case I think that you will have to both recompile the kernel and use mknod to increase the number of loop devices.

-----------------------------
Steve Stites
 
Old 07-21-2005, 06:52 PM   #7
dplazz
LQ Newbie
 
Registered: Jul 2005
Distribution: RedHat AS4
Posts: 5

Original Poster
Rep: Reputation: 0
Take a look at "/linux/drivers/block/loop.c" for a 2.6.x kernel, it actually states in the comments that you can pass that value to the kernel without altering the file itself. Anyhow, there seems to be a bit more to it than just that.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
fstab and loop devices MBH Linux - Hardware 3 10-21-2004 09:58 AM
un/mounting loop devices box_l Linux - Software 4 08-05-2004 10:03 AM
new kernel installation & loop back devices? fbarre Linux - Newbie 5 10-21-2003 02:40 PM
Mounted Devices kbeaver Linux - Hardware 3 07-11-2003 02:44 PM
Mounted Devices natethebate Linux - General 6 08-29-2000 01:36 AM


All times are GMT -5. The time now is 08:07 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration