Tag Archives: cdrom

RHEL 6- loop devices

If you need to mount a lot of ISOs on a system than you could run into the problem, that you do not have free loop devices left.
There are several solutions from running “MAKEDEV -v /dev/loop” at boot time (e.g. add it to rc.local) to creating a file called loop.conf at /etc/modprobe.d/ and inserting the follwoing line:

[pastacode lang=”bash” message=”” highlight=”” provider=”manual”]

[/pastacode]

At the end the following parameter has to be added to the Grub-config file:

max_loop=128

[pastacode lang=”bash” message=”” highlight=”” provider=”manual”]

# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE:  You have a /boot partition.  This means that
#          all kernel and initrd paths are relative to /boot/, eg.
#          root (hd0,0)
#          kernel /vmlinuz-version ro root=/dev/mapper/vg1-root
#          initrd /initrd-[generic-]version.img
#boot=/dev/sda
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
password --encrypted ******************************************************************
title Red Hat Enterprise Linux 6 (2.6.32-504.el6.x86_64)
        root (hd0,0)
        kernel /vmlinuz-2.6.32-504.el6.x86_64 ro root=/dev/mapper/vg1-root rd_NO_LUKS LANG=en_US.UTF-8  KEYBOARDTYPE=pc KEYTABLE=de-latin1-nodeadkeys rd_NO_MD rd_LVM_LV=vg1/root SYSFONT=latarcyrheb-sun16 rd_LVM_LV=vg1/swap crashkernel=auto rd_NO_DM max_loop=128
        initrd /initramfs-2.6.32-504.el6.x86_64.img

[/pastacode]

instead of makedev (which creates 264 loop devices) the following snipped can be used:

 

[pastacode lang=”bash” message=”” highlight=”” provider=”manual”]

mknod -m640  /dev/loop8  b 7  8
mknod -m640  /dev/loop9 b 7  9
mknod -m640  /dev/loop10 b 7  10
mknod -m640  /dev/loop11 b 7  11
mknod -m640  /dev/loop12 b 7  12
mknod -m640 /dev/loop13 b 7 13
mknod -m640 /dev/loop14 b 7 14
mknod -m640 /dev/loop15 b 7 15
mknod -m640 /dev/loop16 b 7 16
mknod -m640 /dev/loop17 b 7 17
mknod -m640 /dev/loop18 b 7 18
mknod -m640 /dev/loop19 b 7 19
mknod -m640 /dev/loop20 b 7 20
mknod -m640 /dev/loop21 b 7 21
mknod -m640 /dev/loop22 b 7 22
mknod -m640 /dev/loop23 b 7 23
mknod -m640 /dev/loop24 b 7 24
mknod -m640 /dev/loop25 b 7 25
mknod -m640 /dev/loop26 b 7 26
mknod -m640 /dev/loop27 b 7 27
mknod -m640 /dev/loop28 b 7 28
mknod -m640 /dev/loop29 b 7 29
mknod -m640 /dev/loop30 b 7 30
mknod -m640 /dev/loop31 b 7 31
mknod -m640 /dev/loop32 b 7 32
mknod -m640 /dev/loop33 b 7 33
mknod -m640 /dev/loop34 b 7 34
mknod -m640 /dev/loop35 b 7 35
mknod -m640 /dev/loop36 b 7 36
mknod -m640 /dev/loop37 b 7 37
mknod -m640 /dev/loop38 b 7 38
mknod -m640 /dev/loop39 b 7 39
mknod -m640 /dev/loop40 b 7 40
mknod -m640 /dev/loop41 b 7 41
mknod -m640 /dev/loop42 b 7 42
mknod -m640 /dev/loop43 b 7 43
mknod -m640 /dev/loop44 b 7 44
mknod -m640 /dev/loop45 b 7 45
mknod -m640 /dev/loop46 b 7 46
mknod -m640 /dev/loop47 b 7 47
mknod -m640 /dev/loop48 b 7 48
mknod -m640 /dev/loop49 b 7 49
mknod -m640 /dev/loop50 b 7 50
mknod -m640 /dev/loop51 b 7 51
mknod -m640 /dev/loop52 b 7 52
mknod -m640 /dev/loop53 b 7 53
mknod -m640 /dev/loop54 b 7 54
mknod -m640 /dev/loop55 b 7 55
mknod -m640 /dev/loop56 b 7 56
mknod -m640 /dev/loop57 b 7 57
mknod -m640 /dev/loop58 b 7 58
mknod -m640 /dev/loop59 b 7 59
mknod -m640 /dev/loop60 b 7 60
mknod -m640 /dev/loop61 b 7 61
mknod -m640 /dev/loop62 b 7 62
mknod -m640 /dev/loop63 b 7 63
mknod -m640 /dev/loop64 b 7 64
chown root:disk /dev/loop*

[/pastacode]