Increase Loop Device on CentOS 5/6, Fedora

Ever faced mount: could not find any free loop device?

You’ll face above error only if you are trying to mount more than 8 loop devices.
As a part of my job I often have to install diff version of OEL / CentOS, to install & for yum I usually mount dvd / cd & createrepo. As I am storing iso images I prefer using same iso for yum rather coping all rpm to local hdd.
This is where I often cross limit of 8 loop devices. So howto increase loop devices?

For CentOS 5 / RHEL 5
#enter following line in /etc/modprobe.conf
options loop max_loop=64

#Run following commands or reboot to take effect.
rmmod loop
modprobe loop

For CentOS 6 / RHEL 6 / Fedora
#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

To make loop devices permanent on CentOS6 or latest Fedora, you need to enter MAKEDEV command in /etc/rc.local

if you find any missing point in here, please let us know in comment section or tweet us at @linuxreaders. To get more articles like this, subscribe to our RSS feeds / Mails.
Read 248 articles by

Trending Posts