LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 12-10-2008, 03:25 AM   #1
kauuttt
Member
 
Registered: Dec 2008
Location: Atlanta, GA, USA
Distribution: Ubuntu
Posts: 135

Rep: Reputation: 26
Want to create loop devices


Hi,

I have one iso image.When I am trying to mount (trying to mount it on /cdrom) it I get the following error:
[root@betty swd]# mount -o loop image.iso /cdrom/
mount: could not find any device /dev/loop#

ls –Rl /dev/loop* shows nothing. So the loop devices are not being created in /dev. While ideally it should be:
[root@betty swd]# ls -lR /dev/loop*
lrwxrwxrwx 1 root root 6 Dec 9 13:41 /dev/loop0 -> loop/0
lrwxrwxrwx 1 root root 6 Dec 9 13:41 /dev/loop1 -> loop/1
lrwxrwxrwx 1 root root 6 Dec 9 13:41 /dev/loop2 -> loop/2
lrwxrwxrwx 1 root root 6 Dec 9 13:41 /dev/loop3 -> loop/3
lrwxrwxrwx 1 root root 6 Dec 9 13:41 /dev/loop4 -> loop/4
lrwxrwxrwx 1 root root 6 Dec 9 13:41 /dev/loop5 -> loop/5
lrwxrwxrwx 1 root root 6 Dec 9 13:41 /dev/loop6 -> loop/6
lrwxrwxrwx 1 root root 6 Dec 9 13:41 /dev/loop7 -> loop/7

/dev/loop:
total 0
brw-rw---- 1 root disk 7, 0 Dec 9 13:41 0
brw-rw---- 1 root disk 7, 1 Dec 9 13:41 1
brw-rw---- 1 root disk 7, 2 Dec 9 13:41 2
brw-rw---- 1 root disk 7, 3 Dec 9 13:41 3
brw-rw---- 1 root disk 7, 4 Dec 9 13:41 4
brw-rw---- 1 root disk 7, 5 Dec 9 13:41 5
brw-rw---- 1 root disk 7, 6 Dec 9 13:41 6
brw-rw---- 1 root disk 7, 7 Dec 9 13:41 7

As a workaround I am able to create the loop devices by modprobe loop and then I am able to mount the image successfully.

But where (I mean in which file/script) I need to change in kernel level to get a permanent solution, so the loop devices are created during booting.
I did some sort of googling, but I didn’t get any such satisfactory permanent solution or may be they are tedious.

Will the addition of ‘loop’ in /etc/modules help? So that if I compile the kernel (with the appropriate changes) and NUKE my system with the image, I can mount the image without any workaround (like modprobe or mknod etc..).

I am really in hurry and fast responses will be highly appreciated.
Thanks in advance.

-KD
 
Old 12-10-2008, 03:46 AM   #2
pinniped
Senior Member
 
Registered: May 2008
Location: planet earth
Distribution: Debian
Posts: 1,732

Rep: Reputation: 50
Quote:
Originally Posted by kauuttt View Post
Will the addition of ‘loop’ in /etc/modules help?
Yes.

Since you don't mention what distribution you are using, it is difficult for people to assess why your loop module is not being loaded at startup (except for the obvious 'it wasn't in /etc/modules'). If you know how to unpack an initrd (actually probably initramfs) image, have a look at your initrd and see if 'loop' is included there; if it is not, then that is one possible reason why 'loop' isn't loaded at boot time.
 
Old 12-10-2008, 03:59 AM   #3
kauuttt
Member
 
Registered: Dec 2008
Location: Atlanta, GA, USA
Distribution: Ubuntu
Posts: 135

Original Poster
Rep: Reputation: 26
I need to know how to compile a new kernel with loop support built-in.
Actually I use the kernel rpms for the smooth running of my application part(related to SIP and VOIP).
I use kernel version of 2.6.14.

Anyways I faced this problem, when we tried to change system to 64 bit and changed the file system to ext3 from xfs type.

i checked the earlier version of my image and found that I dont have 'loop' enlisted in /etc/modules files.
So I ma wondering about the problem and need to know where exactly i need to change in kernel level to get a permanent solution.

Please help me to get rid of this issue.

-KD
 
Old 12-10-2008, 04:04 AM   #4
kauuttt
Member
 
Registered: Dec 2008
Location: Atlanta, GA, USA
Distribution: Ubuntu
Posts: 135

Original Poster
Rep: Reputation: 26
Do I need to build-in loop modules in the kernel; and need to compile it?
if that helps, then please share the steps

And then if I create an image with the compiled kernel packages and my application codes, will that help me to avoid this issue?

Thanks
 
Old 12-10-2008, 04:43 AM   #5
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,128

Rep: Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121
If you can modprobe loop, it is already built.
Simply add it to /etc/modules should suffice - no need to compile a kernel just for that. Especially if it's supposedly so urgent.
 
Old 12-10-2008, 05:32 AM   #6
kauuttt
Member
 
Registered: Dec 2008
Location: Atlanta, GA, USA
Distribution: Ubuntu
Posts: 135

Original Poster
Rep: Reputation: 26
Hey Thanks for your suggestions!!

But if I do that, then I think I will face the same issue when I will mount and install a new image or during the reboot. Actually in my system I need to change the image.iso quite frequently.So I want a permanent solution.
 
Old 12-10-2008, 05:35 AM   #7
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,128

Rep: Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121
It is a permanent solution. Just do the edit and reboot - see what happens.
 
Old 12-10-2008, 05:38 AM   #8
kauuttt
Member
 
Registered: Dec 2008
Location: Atlanta, GA, USA
Distribution: Ubuntu
Posts: 135

Original Poster
Rep: Reputation: 26
To add-on:-
in my previous images, where I can mount the image successfully, I dont see the 'loop' in /etc/modules.Thats why I am still wondering.as i can do a modprobe loop, so loop module is built in the kernel.

Basiccally my image.iso contains kernel packages + my application C++ codes.So as I change (it may be upgrade or fresh installation) my image.iso very frequently, so I need some thing permanently, so that I dont need this work-around again and again.

Thanks--KD
 
Old 12-10-2008, 05:45 AM   #9
kauuttt
Member
 
Registered: Dec 2008
Location: Atlanta, GA, USA
Distribution: Ubuntu
Posts: 135

Original Poster
Rep: Reputation: 26
Will i go and change my /etc/modules file and compile the kernel to get updated kernel packages.
And if I use this packages for my application code to build a new image.iso, I hope I will not see this issue.
please lemme know
-KD
 
Old 12-10-2008, 05:46 AM   #10
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,128

Rep: Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121
In that case just ensure CONFIG_BLK_DEV_LOOP=Y to ensure the support is built in.
 
Old 12-10-2008, 06:04 AM   #11
kauuttt
Member
 
Registered: Dec 2008
Location: Atlanta, GA, USA
Distribution: Ubuntu
Posts: 135

Original Poster
Rep: Reputation: 26
Thanks a lot for your sincere suggestion !!

I think i am not able to bring out my issue or about my system clearly.Here it (overview of my system and my issue) goes :
1)I compile my kernel with some changes, if neccessary and create some packages.
2)I use those packages for/with my application codes ,compile and create a image.iso.
3)then I put it on my system (hardware).and at this step I generally do mount -o loop /image.iso /cdrom
4)here I faced this issue.

As I change my image (kernel codes+application codes)quite frequently, I need some changes at the kernel levels.

So what I need to check or do?
As I am not that much experienced in Linux, so it will be good if you can go into bit details.
 
Old 12-10-2008, 07:33 AM   #12
kauuttt
Member
 
Registered: Dec 2008
Location: Atlanta, GA, USA
Distribution: Ubuntu
Posts: 135

Original Poster
Rep: Reputation: 26
I did a modprobe loop and was able to create the lopping devices temporarily.I added 'loop' in /etc/modules and gave reboot.

When my system comes up I faced the same issue again;I mean la -Rl /dev/loop* gives nothing.

Please help me out
--KD
 
Old 12-10-2008, 07:34 AM   #13
kauuttt
Member
 
Registered: Dec 2008
Location: Atlanta, GA, USA
Distribution: Ubuntu
Posts: 135

Original Poster
Rep: Reputation: 26
Typing mistake***

ls -Rl /dev/loop* gives nothing.
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Create loop devices? Vitalie Ciubotaru Linux From Scratch 3 11-30-2006 04:45 PM
Can't get more than 8 loop devices going tommyrot Linux - Newbie 4 07-27-2006 10:17 PM
Maximum mounted loop devices? dplazz Linux - General 6 07-21-2005 05:52 PM
fstab and loop devices MBH Linux - Hardware 3 10-21-2004 08:58 AM
un/mounting loop devices box_l Linux - Software 4 08-05-2004 09:03 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 10:20 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
Open Source Consulting | Domain Registration