Is there a way to mount a file.tar.bz2 without extracting it onto the filesystem?

7,319

Solution 1

If you want to mess with fuse they have a plugin to mount archives, including tar.gz.

I'm kind of questioning what you want to do. there is a pretty huge model mismatch between a filesystem (random access to files, random access to bytes in a file) and an archive (needs to be read serially, a write in one byte can will affect all subsequent bytes). At least mount read only.

Solution 2

As already stated, FUSE can be used. Here is a link to reading different archives using FUSE. libarchive is the first one, which allows mounting specifically tar.bz2 archives:

http://sourceforge.net/p/fuse/wiki/ArchiveFileSystems/?version=1

and here is a link to an old article that gives a tutorial on how to use this:

http://archive09.linux.com/feature/132196

Solution 3

The term mount in this context is ill-defined. I'm guessing you want to look inside the tarball without extracting it. One handy utility for this is Midnight Commander. See also Wikipedia Midnight Commander page.

This creates a sort of virtual filesystem for tarballs, rpms, deb and all sorts of other archives. Just fire it up, and navigate to your tarball, and hit Enter. To read a file use F3, F5 to copy a file, F10 quit. On Linux at least there is a convenient command help at the bottom of the screen.

So, to summarize you can read the files inside your tarball and copy them from to your regular filesystem. Hopefully that will do you.

I did a little more checking, and it looks like MC is basically only supported on Unix-like systems like Linux, though there is a Windows port here of some sort. However, you don't state what your OS is. I suggest you do so.

Share:
7,319

Related videos on Youtube

GlassGhost
Author by

GlassGhost

Updated on September 17, 2022

Comments