# cannot setup loop device: no space left.

## mathfeel

I am using a squashfs and aufs for usr. So this means I have an initrd script that mount /usr (for udev).

This start happening for gentoo-3.6.0 (I can still work in my other working kenerl 3.5.3-ck). The squashfs image usr.sfs fails to mount:

```
mount -o loop -r -t squashfs /mnt/sqfs/usr.sfs /mnt/aufs/usr/ro
```

with the error:

```
Cannot setup loop device: no space left
```

I have the ability to drop to a rescue shell if mount fails. When I do that, and I type:

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

I got 772259 entries!!

It seems squashfs is broken in the new kernel or something? Any idea?

----------

## Ant P.

Does it work if you run losetup and mount as separate steps?

----------

## mv

 *mathfeel wrote:*   

> I am using a squashfs and aufs for usr.

 

Not really an answer to your question, but aufs is not yet available for kernel-3.6. So if you use some older aufs, this might cause your problems.

----------

## mathfeel

 *mv wrote:*   

>  *mathfeel wrote:*   I am using a squashfs and aufs for usr. 
> 
> Not really an answer to your question, but aufs is not yet available for kernel-3.6. So if you use some older aufs, this might cause your problems.

 

That might be a different issue by itself. The init script is stuck at the point where the aufs partition is not yet mounted. In fact, I am only mounting the RO part, in squashfs, for /usr so that udev can boot nicely.

Doing losetup separately did not help. But what might be interesting is that when I do a

```
ls -l ${NEWROOT}/mnt/sqfs ${NEWROOT}/mnt/aufs
```

I see a list of file with zero size!

/mnt/sqfs is a mount point for a xfs partition, and /mnt/aufs is a mount point for an ext4 partition. Here is the relevant part of the init script:

```
prepare_newroot () {

  printf "Prepareing new root: $1"

  local VG=TPx201

  [ -z $1 ] && printf "$$1 cannot be empty! done now.\n" && return 1

  printf "mount -t xfs  /dev/mapper/${VG}-SQFS $1/mnt/sqfs\n"

  mount -t xfs  /dev/mapper/${VG}-SQFS $1/mnt/sqfs || rescue_shell "Fail to mount $1/mnt/sqfs"

  printf "mount -t ext4 /dev/mapper/${VG}-AUFS $1/mnt/aufs\n"

  mount -t ext4 /dev/mapper/${VG}-AUFS $1/mnt/aufs || rescue_shell "Fail to mount $1/mnt/aufs"

  printf "mount -t squashfs -o loop,ro $1/mnt/sqfs/usr.sfs $1/mnt/aufs/usr/ro\n"

  losetup $1/mnt/sqfs/usr.sfs /dev/loop0 || rescue_shell "Fail to setup loop device $1/mnt/sqfs/usr.sfs /dev/loop0"

  mount -t squashfs -r /dev/loop0 $1/mnt/aufs/usr/ro || rescue_shell "Fail to mount /dev/loop"  <- Fails at this point and drops to rescue_shell.

  mount -t squashfs -r /dev/loop0 $1/usr || rescue_shell "Fail to mount $1/usr"

}
```

FYI, the same script is working for 3.5.3-ck.

----------

