# Please help me in getting the loopback device to work[SOLVD]

## don quixada

Can anyone help me get loopback device support to work on my machine? It used to work without any set-up but now it doesn't. I noticed that it wasn't enabled in the kernel so I set BLK_DEV_LOOP=y. (I guess something must have changed when I updated the kernel to v2.6.30-gentoo-r5.) But even after trying both the module and then building it into the kernel I still can't get it to work. All I'm trying to do is mount an .iso file using 'mount -o loop'. I suspect this has something to do with setting-up udev properly (I have no /dev/loops.), but I could be totally wrong on that. Any help would be much appreciated. TIA.

dqLast edited by don quixada on Mon Jan 11, 2010 1:27 am; edited 1 time in total

----------

## poly_poly-man

First of all, make sure you have the iso9660 filesystem enabled in the kernel. To make sure this is not the problem:

1. dd if=/dev/zero of=test.img bs=1M count=2

2. mke2fs test.img

3. mount -o loop test.img folder/

If this fails, give us the end of dmesg. If it succeeds, try the first mount command (on the cd image) with -t iso9660

----------

## don quixada

No that doesn't work, when I try and mount I get this error message:

```
mount: Could not find any loop device. Maybe this kernel does not know

       about the loop device? (If so, recompile or `modprobe loop'.)

```

I can mount CDs that are formatted with iso9660 no problem.

Here is dmesg:

```
# dmesg | tail

[21254.964527] usb 3-2: device descriptor read/64, error -62

[21255.200529] usb 3-2: device descriptor read/64, error -62

[21255.432522] usb 3-2: new low speed USB device using ohci_hcd and address 60

[21255.564523] usb 3-2: device descriptor read/64, error -62

[21255.800526] usb 3-2: device descriptor read/64, error -62

[21256.032535] usb 3-2: new low speed USB device using ohci_hcd and address 61

[21256.440519] usb 3-2: device not accepting address 61, error -62

[21256.568037] usb 3-2: new low speed USB device using ohci_hcd and address 62

[21256.976531] usb 3-2: device not accepting address 62, error -62

[21256.976759] hub 3-0:1.0: unable to enumerate USB device on port 2
```

I don't think that this is applicable. But I could be wrong...

dq

----------

## d2_racing

Hi, can you check if you have this inside your kernel :

```

CONFIG_BLK_DEV_LOOP=y

```

----------

## cach0rr0

so methinks this, just as a diagnostic step

change it back to being a moduel

boot

then do a 'modprobe loop' and check dmesg 

I would expect since youre not seeing a /dev/loop* we would see it upchuck an error

----------

## don quixada

Yes, I have BLK_DEV_LOOP enabled in my kernel; I tried both the module and it built-in (its current state).

After building it as a module I could even modprobe loop. All I got was an error message saying 'loop' was not found. I can try to build as a module again though because I didn't check dmesg at the time... But I'll do that tomorrow.

dq

----------

## cach0rr0

 *don quixada wrote:*   

> Yes, I have BLK_DEV_LOOP enabled in my kernel; I tried both the module and it built-in (its current state).
> 
> After building it as a module I could even modprobe loop. All I got was an error message saying 'loop' was not found. I can try to build as a module again though because I didn't check dmesg at the time... But I'll do that tomorrow.
> 
> dq

 

So disclaimer - my apologies in advance if I'm covering things you're already well aware of; just looking to be thorough

ok, so, after issuing a 'make' after reconfiguring it as a module, did you also do a 'make modules_install' ?

Otherwise indeed modprobe wouldn't find it. 

Note that once youve removed it as a built-in and changed it to a module, after the 'make && make modules_install' you will need to do the whole deal with moving the new bzImage over, and reboot. 

Once you've rebooted into the new kernel, if 'modprobe loop' fails, see if you can find it on disk, e.g.

```

find  /lib/modules/<your kernel version>/ -type f -iname 'loop.*'

```

If for some screwy reason it is present, but modprobe fails, try the old way with insmod

```

insmod /path/to/loop.ko

```

----------

## d2_racing

When you recompile your kernel, do you actually reboot your box ?

----------

## don quixada

Yes, I rebooted my machine, copied over the bzImage and did a 'make modules_install'. The result is:

```
# modprobe loop

FATAL: Module loop not found.
```

 or

```
# insmod /lib/modules/2.6.30-gentoo-r5/kernel/drivers/block/loop.ko

insmod: error inserting '/lib/modules/2.6.30-gentoo-r5/kernel/drivers/block/loop.ko': -1 Invalid module format
```

Still no /dev/loops in my /dev directory and dmesg is still all that usb/hub stuff. What kind of thing should I be looking for in dmesg?

dq

----------

## poly_poly-man

 *don quixada wrote:*   

> Yes, I rebooted my machine, copied over the bzImage and did a 'make modules_install'.

 

not in that order, right?

You should: 

make && make modules_install

cp arch/x86/boot/bzImage /boot/whatever

make sure your bootloader points correctly to it

reboot

enjoy.

----------

## don quixada

Whoops, not pointing to the right kernel. That'll fix it.

dq

----------

## don quixada

Yep, I feel really silly. Thanks all for your help!

dq

----------

## poly_poly-man

 *don quixada wrote:*   

> Yep, I feel really silly. Thanks all for your help!
> 
> dq

 it happens to the best of us  :Razz: 

Please add "[solved]" to the title using the edit button on your first post.

----------

## don quixada

This probably explains some of the strange problems I've been having lately...

dq

----------

## d2_racing

No problem man, at least you solved your problem  :Razz: 

----------

