Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED]mount: cannot setup loop device: no such file or dir
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
bob doe
Apprentice
Apprentice


Joined: 11 Jun 2007
Posts: 207

PostPosted: Sat Jan 16, 2010 4:54 pm    Post subject: [SOLVED]mount: cannot setup loop device: no such file or dir Reply with quote

Hey guys. This issue has been bugging me for months and is critical. The latest version of my LiveCD cannot boot due to this issue.

When the LiveCD boots, it runs an initramfs which runs it's own init. Part of this is to mount the actual LiveCD image file which is SquashFS.

The command run is
Code:
mount -t squashfs -o loop /cdrom/files/source.img /new

Previously this has always worked. I do have a proper loop block device at /dev/loop0:
Code:
brw-rw---- 1 0      0      7,    0 Dec 21  13:18 /dev/loop0


And the proper modules built in to the kernel:
Code:
CONFIG_SQUASHFS=y
CONFIG_BLK_DEV_LOOP=y
CONFIG_BLK_DEV_CRYPTOLOOP=m


Nothing has changed between this version and previous versions in those terms. What has changed is my Portage tree. The kernel was updated but even going back to the previous kernel and config didnt solve anything (configs updated using 'make oldconfig') Various package updates have also changed and I believe a change from device-mapper to udev. Though Im not sure how that would be related.

At present, when I try to run my mount command I get this:
Code:
mount -t squashfs -o loop /cdrom/files/source.img /new
mount: cannot setup loop device: no such file or directory


Please help!


Last edited by bob doe on Sun Jan 17, 2010 4:38 pm; edited 1 time in total
Back to top
View user's profile Send private message
mikegpitt
Advocate
Advocate


Joined: 22 May 2004
Posts: 3224

PostPosted: Sat Jan 16, 2010 5:17 pm    Post subject: Re: mount: cannot setup loop device: no such file or directo Reply with quote

bob doe wrote:
At present, when I try to run my mount command I get this:
Code:
mount -t squashfs -o loop /cdrom/files/source.img /new
mount: cannot setup loop device: no such file or directory
This may sound stupid, but sometimes it's the stupid things that drive us the most crazy.

Are you sure that the file /cdrom/files/source.img and the directory /new exist on your machine? It seems like the command is failing because of a missing file/directory.
Back to top
View user's profile Send private message
bob doe
Apprentice
Apprentice


Joined: 11 Jun 2007
Posts: 207

PostPosted: Sat Jan 16, 2010 5:30 pm    Post subject: Reply with quote

Unfortunately, thats not it. Both /cdrom/files/source.img and /new exist.
Back to top
View user's profile Send private message
mikegpitt
Advocate
Advocate


Joined: 22 May 2004
Posts: 3224

PostPosted: Sat Jan 16, 2010 7:54 pm    Post subject: Reply with quote

bob doe wrote:
Unfortunately, thats not it. Both /cdrom/files/source.img and /new exist.
Do you have any loop devices under /dev?
Code:
ls /dev/loop*
Back to top
View user's profile Send private message
bob doe
Apprentice
Apprentice


Joined: 11 Jun 2007
Posts: 207

PostPosted: Sat Jan 16, 2010 9:06 pm    Post subject: Reply with quote

Yes. As per the code block in my initial post. :)
Back to top
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 23064

PostPosted: Sat Jan 16, 2010 9:54 pm    Post subject: Reply with quote

What is the output of strace on that mount attempt?
Back to top
View user's profile Send private message
mikegpitt
Advocate
Advocate


Joined: 22 May 2004
Posts: 3224

PostPosted: Sat Jan 16, 2010 10:06 pm    Post subject: Reply with quote

bob doe wrote:
Yes. As per the code block in my initial post. :)
Whoops! :oops:

Perhaps this is a permissions problem. Can you post this:
Code:

ls -l /cdrom/files/source.img
ls- l /new
Back to top
View user's profile Send private message
bob doe
Apprentice
Apprentice


Joined: 11 Jun 2007
Posts: 207

PostPosted: Sat Jan 16, 2010 11:15 pm    Post subject: Reply with quote

Here are the outputs of ls -l:
Code:
-rwx------   1 0   0   376242176 Jan  3 13:26 /cdrom/files/source.img

drwxr-xr-x   2 0   0   0 Jan 16 18:10 new


I cant run an strace, I didnt include it in the initramfs, though I will try this later.
Back to top
View user's profile Send private message
bob doe
Apprentice
Apprentice


Joined: 11 Jun 2007
Posts: 207

PostPosted: Sun Jan 17, 2010 3:22 pm    Post subject: Reply with quote

I think I've solved the issue. Although I have the loop block device as /dev/loop0, I tried adding a directory /dev/loop and within it a symlink /dev/loop/0 pointing to /dev/loop0 and that seemed to have worked. Im remaking the ISO and will test it out.

Finally!!!!

[Edit] That solved the issue. Now Im back to my original issue as per here: https://forums.gentoo.org/viewtopic-t-808162-highlight-.html Any help still greatly appreciated :)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum