So I ran into this one today on RHEL 6.0 when trying to mount up a few additional isos on one of my remote kickstart servers. I have actually run into this issue before in RHEL 5 ( see here) however being that this particular kickstart server was built using RHEL 6.0 and not RHEL 5 I figured that there was probably a new process to resolve as RHEL 6 no longer uses the traditional /etc/modprobe.conf.
Note that a loop device is a pseudo device that makes a file accessible as a block device. In this case, the iso is the file.
So here is how you fix it.
First run the following command to increase the total number of loop devices to the max number of 256.
MAKEDEV -v /dev/loop
Then you need to make sure that this command runs at boot time, so stick it in /etc/rc.local. I think you can also pass this kernel option to the OS at boot in the /etc/grub.conf however I have not tried it.
One of the issues that I have run into in the past when working with iscsi disks occurs when a host (initiator) is unable to logout gracefully from an iscsi disk when attempting to shutdown or reboot a host.
Note that this is a known issue and is documented here and here. I have not read completely through the RHEL 6 Bugzilla to see if the issue has been resolved, however I can tell you that I have seen this issue in RHEL 6.2.
Anyway as a quick work around to save yourself a painfully slow reboot you can logout of the disk before you shutdown to save time, for example, if you were taking some sort of linux test.
First think I do is verify that I actually currently am logged into an iscsi session
Above is the line in my /etc/fstab that mounts the iscsi disk, note that you should always use the _netdev option to mount a remote disk (nfs, san, iscsi — does not matter)
So after unmounting the disk I manually log out from the iscsi disk/s
iscsiadm -m node –logout all
The output of the command above shows me that the logout was successful.
Logging out of session [sid: 1, target: iqn.2012-08.my.new.iscsi, portal: 10.1.224.34,3260] Logout of [sid: 1, target: iqn.2012-08.my.new.iscsi, portal: 10.1.224.34,3260] successful.
I can then check my current connected sessions again and see that I have no active sessions.
# iscsiadm -m session iscsiadm: No active sessions.
Now you should be able to reboot without issue.
As a side note I was actually wondering how the initiator knew to log back into the iscsi disk at boot time. Well if you look in /var/lib/iscsi/nodes/ you will see a directory for each iscsi disk that you logged into using iscsiadm.
So if you are reading this you many not be aware of the fact that I already put up a post on NFS on RHEL6 (you can find it here). However that post is basically just a redirect to another blog post that I ran into on the subject. And despite the fact that its very well written, and has no apparent spelling mistakes, or inapropriate comments about NFS, I felt the need to draft my own post. At this point I really cannot seem to remember anything technical if I don't put up a blog post on the subject. After all I have been doing so for over 4 years, so why stop now.
Anyway, now that I got all that out of the way, lets sit down on brass tacks.
First lets create a directory to be shared on our NFS Server
# mkdir -p /shared/nfs
Now lets change the unix perms so that its wide open
# chmod 777 /shared/nfs
Now lets add our new nfs share to /etc/exports/. In this example I am sharing it out to my local /24 network.
Now restart NFS service
# service nfs restart
Now verify that you are now sharing via NFS with showmount
# showmount -e localhost
Export list for localhost: /shared/nfs 10.1.224.0/24
If you are running iptables on your nfs host you are going to need to do a bit more to get nfs to work
If you go by the book, you are going to need to run to open several ports, the commands below will open up what you need.
The fast and cheap way is to just allow all from your nfs client
# iptables -I INPUT -s 10.1.224.55 -j ACCEPT
Now lets go over to the host that we intend to mount our nfs filesystem on and run our showmount command again
# showmount -e 10.1.224.34 Export list for 10.1.224.34: /shared/nfs 10.1.224.0/24
Now manually mount your share as seen below
mount -t nfs 10.1.224.34:/shared/nfs /mnt
Now add your share to /etc/fstab so that its mounted persistently across reboots.
10.1.224.34:/shared/nfs /mnt nfs defaults 0 0
Just to be sure that everything is correct, unmount /mnt and mount /mnt. This way you will catch any errors in your fstab. Probably not a bad idea to touch a file under your new nfs mount too, just to make sure that its writeable.