Re: Suggestion for new filesystem : tar files ?

Richard Gooch (rgooch@atnf.csiro.au)
Fri, 11 Sep 1998 17:51:51 +1000


Scott Gordon writes:

Hi, Scott. How's the thesis going?

> I'm wondering if anyone has ever tried to implement tar files as a
> filesystem in Linux ? It sounds to me like it would be simple (at
> least for the read-only case), and could be useful, eg. easily
> examining and extracting files from distributions of software, or
> recovering backups, without having to use special commands.

The read-write case would be awfully hard, because you'd end up with a
nasty fragmented tarfile. You'd have to get into defragmentation
issues. I don't even know if tarfiles allow holes. If they don't then
a delete operation in the middle would be very expensive as you'd have
to shuffle data around.

But even a read-only implementation would be useful. IIRC tarfiles
don't have a directory structure, so doing inode lookups would be
expensive. You may want to cache the directory structure, although for
a first implementation you wouldn't bother, since the Linux dcache is
quite good already.
A thing to watch out for is the random placement of files in tarfiles:
I think it's possible to get:
dir1/file2
dir3/file4
dir1/file5

in that order.

But anyway, if there isn't someone already working on it, go ahead and
have a go! Check out
http://www.atnf.csiro.au/~rgooch/linux/docs/vfs.txt
for info on the VFS. You might also want to look at userfs (I vaguely
recall someone working on this), as it would allow you to avoid
writing the VFS code and do it all in userspace.

> Probably using compressed tar files ( *.tar.gz ) would be tricky and slow
> though I suspect, since decoding each byte depends on the whole earlier
> contents of the file (as I understand it).

Yup.

Regards,

Richard....

-
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/faq.html