Re: 2.3.11+/dev/loop problems

Mike A. Harris (mharris@meteng.on.ca)
Wed, 28 Jul 1999 19:33:43 -0400 (EDT)


On 27 Jul 1999, Andi Kleen wrote:

>> I've been playing with creating a filesystem in a file, mounting it with the
>> loopback device, copying files to it, and then unmounting it. In the process
>> of doing this, the directory acting as the mount point has become corrupted:
>> % ls -l /mnt
>> br-xr-S-wx 0 root root 0, 0 Jan 1 1970 /mnt
>>
>> The loopback filesystem was an ext2 filesystem in a file consisting mostly of
>> holes (until I filled it up).
>>
>> I haven't yet been able to recreate the situation.
>>
>> In trying to use /dev/loop0 again, I received the error:
>> ioctl: LOOP_SET_FD: Device or resource busy
>
>You have to remove a loopback device first (with losetup -d) before you
>can recreate it. Umounting doesn't do that.

I'm confused by this. I've been using loopback AFAIK, almost as
long as it has been in the kernel. I have no idea what losetup
actually does, and what it's purpose is. I have no problem
mounting and unmounting loopback devices.

I basically:

dd if=/dev/zero of=file.img
mke2fs file.img

mount file.img /wherever -t ext2 -o loop=/dev/loop0

umount /wherever

That is about it. I could have a typo or missing option I
suppose, but it is pretty basic...

--
Mike A. Harris                   Linux advocate      GNU advocate
Computer Consultant                          Open Source advocate  

Tea, Earl Grey, Hot...

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/