Re: loop device

Matthew Wilcox (Matthew.Wilcox@genedata.com)
Mon, 10 May 1999 10:52:18 +0200


On Mon, May 10, 1999 at 12:05:31AM -0400, W. Michael Petullo wrote:
> Mounting a filesystem image with `mount -t ext2 -o loop=/dev/loop1 foo
> bar` works fine -- the first time. Unmounting it also works. However
> once I have executed the above mount/unmount commands, any successive
> mount using /dev/loop1 fails with: "ioctl: LOOP_SET_FD: Device or resource
> busy."

We've had this before.. you've got /etc/mtab as a symlink to /proc/mounts,
haven't you?

When mount is used to create a loop device, it attempts to record the
fact that it has done so in /etc/mtab so it knows to delete it on umount.
If /etc/mtab is a symlink to /proc/mounts then this is not possible.
You must therefore use losetup to delete the mount yourself.

-- 
Matthew Wilcox <willy@bofh.ai>
"Windows and MacOS are products, contrived by engineers in the service of
specific companies. Unix, by contrast, is not so much a product as it is a
painstakingly compiled oral history of the hacker subculture." - N Stephenson

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