LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   free loop device question (https://www.linuxquestions.org/questions/linux-general-1/free-loop-device-question-4175451774/)

rocker65 02-26-2013 11:34 AM

free loop device question
 
Hello all

I have a question about loop device creation. On a centos 6 system, I need to mount a lot of ISO's and need extra loop devices. I want to make the devices permanent. I follow the steps described on the site listed below, and they seem to jive with what I've seen in other places.

http://seriousbirder.com/blogs/linux...e-loop-device/

Do the instructions here make sense?

Thanks in advance

yowi 03-01-2013 10:00 AM

Yeah, why?

rocker65 03-01-2013 10:15 AM

Sorry, didn't make my post very clear. I followed those instructions, and when the system is rebooted, all my loop devices are gone. I end up with the default number which isn't enough. I can recreate them fine, but it seems odd that I have to do that.

onebuck 03-01-2013 10:41 AM

Member Response
 
Hi,

Welcome to LQ!

Quote:

Originally Posted by rocker65 (Post 4900158)
Hello all

I have a question about loop device creation. On a centos 6 system, I need to mount a lot of ISO's and need extra loop devices. I want to make the devices permanent. I follow the steps described on the site listed below, and they seem to jive with what I've seen in other places.

http://seriousbirder.com/blogs/linux...e-loop-device/

Do the instructions here make sense?

Thanks in advance

What part of this do you not understand;
Quote:

excerpt from Linux error mount: could not find any free loop device For CentOS 6 / RHEL 6 / Fedora;

To make loop devices permanent on CentOS6 or latest Fedora,
op devices permanent on CentOS6 or latest Fedora, you need to enter MAKEDEV command in /etc/rc.local
rhel 6 see /etc/modprobe.d
create loop.conf

add to /etc/modprobe.d/loop.conf
options loop max_loop=64

#You can use following command to create 256 loop devices.

MAKEDEV -v /dev/loop

#Or followings to create 10

MAKEDEV -v /dev/loop7
MAKEDEV -v /dev/loop8
MAKEDEV -v /dev/loop9

#Mount some other ISO’s…
#example mounts, yours can/will differ

# losetup -a
/dev/loop0: [fd05]:2506814 (/var/mrepo/centos5-x86_64/CentOS-5.8-x86_64-bin-DVD-1of2.iso)
/dev/loop1: [fd05]:2506813 (/var/mrepo/centos5-x86_64/CentOS-5.8-x86_64-bin-DVD-2of2.iso)
/dev/loop2: [fd05]:12992520 (/var/mrepo/centos6-x86_64/CentOS-6.3-x86_64-bin-DVD1.iso)
/dev/loop3: [fd05]:12992521 (/var/mrepo/centos6-x86_64/CentOS-6.3-x86_64-bin-DVD2.iso)
/dev/loop4: [fd05]:12992520 (/var/mrepo/centos6-x86_64/CentOS-6.3-x86_64-bin-DVD1.iso)
/dev/loop5: [fd05]:12992521 (/var/mrepo/centos6-x86_64/CentOS-6.3-x86_64-bin-DVD2.iso)
/dev/loop6: [fd05]:2834850 (/var/mrepo/sles11sp1-x86_64/SLES-11-SP1-for-VMware-DVD-x86_64-*)
/dev/loop7: [fd05]:2834851 (/var/mrepo/sles11sp1-x86_64/SLES-11-SP1-for-VMware-DVD-x86_64-*)

rocker65 03-01-2013 10:55 AM

I guess I don't know what I don't understand. The instructions are pretty plain. So I don't know how I have missed anything:


# cat /etc/rc.local

#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.

touch /var/lock/subsys/local
logger "/etc/rc.local starting tracd"
#tracd -d -s -p 8000 --pidfile=/var/run/tracd.pid /var/www/trac
/usr/bin/python /usr/sbin/tracd -d -s -p 8000 --auth=trac,/var/www/trac/.htpasswd,ssc-dcs2 --pidfile=/var/run/tracd.pid /var/www/trac
MAKEDEV /dev/loop
exit 0

my loop.conf

# cat /etc/modprobe.d/loop.conf
options loop max_loop=32

I can create them manually as I said, MAKEDEV -v /dev/loop etc..... But using the above configuration, when I reboot I only have 8 loop devices. Maybe it was that dam meteor, it messed everything up.

rocker65 03-01-2013 11:35 AM

Ok, I'll answer this myself. I had time to look at it this morning.

Putting

MAKEDEV /dev/loop in the rc.local doesn't work.

but, putting

MAKEDEV -v /dev/loop

does work.

?

trickykid 07-09-2013 03:22 PM

Quote:

Originally Posted by rocker65 (Post 4902528)
Ok, I'll answer this myself. I had time to look at it this morning.

Putting

MAKEDEV /dev/loop in the rc.local doesn't work.

but, putting

MAKEDEV -v /dev/loop

does work.

?

Tell it to create the amount of loop devices you need by doing:

/sbin/MAKEDEV -m 32 /dev/loop

By default, MAKEDEV /dev/loop will only create the first 8 devices and since that's what you have in your rc.local, it's basically doing nothing since by default your system will create 8 to start with.

Use -m ## to specify the number you need, I think the max still is 256 but if you only need 32, just create 32.


All times are GMT -5. The time now is 10:15 PM.