# [SOLVED]mount: cannot setup loop device: no such file or dir

## bob doe

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

```
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:

```
brw-rw---- 1 0      0      7,    0 Dec 21  13:18 /dev/loop0
```

And the proper modules built in to the kernel:

```
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:

```
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

----------

## mikegpitt

 *bob doe wrote:*   

> At present, when I try to run my mount command I get this:
> 
> ```
> mount -t squashfs -o loop /cdrom/files/source.img /new
> 
> ...

 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.

----------

## bob doe

Unfortunately, thats not it.  Both /cdrom/files/source.img and /new exist.

----------

## mikegpitt

 *bob doe wrote:*   

> Unfortunately, thats not it.  Both /cdrom/files/source.img and /new exist.

 Do you have any loop devices under /dev?

```
ls /dev/loop*
```

----------

## bob doe

Yes.  As per the code block in my initial post.  :Smile: 

----------

## Hu

What is the output of strace on that mount attempt?

----------

## mikegpitt

 *bob doe wrote:*   

> Yes.  As per the code block in my initial post. 

 Whoops!  :Embarassed: 

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

```

ls -l /cdrom/files/source.img

ls- l /new 

```

----------

## bob doe

Here are the outputs of ls -l:

```
-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.

----------

## bob doe

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  :Smile: 

----------

