Re: The loop device

Albert Cahalan (albert@ccs.neu.edu)
Sat, 24 Feb 1996 19:26:14 -0500 (EST)


>> that can handle mounting something over the loop device. For example,
>> mount -t lo@/dev/loop3 fdimage /mnt -o vfs=msdos:blocksize=1024
>> will attach the device /dev/loop3 to the file fdimage, and then
>> mount it as a msdos file system, with blocksize 1024.
>
> Why shouldn't the mount system call just accept files? I took
> a brief look at this a while back, and there didn't appear to
> be any particular reason for requiring block devices.

That would be good. There are several ways to do this.
I think the best is to check for holes, then just map
the blocks directly w/o filesystem overhead. Refuse a
mount if there are holes.

Then there is file-on-file. Maybe holes are OK for this.

You should be able to mount a file or device on top of anything,
as a whole filesystem or just as a file.

> I can imagine interesting things might happen if you had a filesystem
> mounted r/w on a sparse file in another filesystem with no free space,
> but you can already hang yourself that way with swap files... ;-)

Either it should not be possible to swap to something with holes,
or there should be a way to swap around the holes when space runs
out. Maybe filling holes and swapping around the holes is too slow
and bug prone. I would really like swap files to have the speed
of swap partitions; they could be that fast if they bypassed the
filesystem.