48

The only result of any import when I searched for this was from 2001.

In the intervening decade, have any tools/methods for mounting a tar file as a filesystem (perhaps utilizing fuse) been created?

If so, what are they, and how do they work?

Randolf Richardson
  • 14,634
  • 39
  • 52
warren
  • 9,920
  • 23
  • 86
  • 147
  • 2
    See also [Is there away to mount a file.tar.bz2 without extracting onto your fs](http://superuser.com/questions/257542/is-there-away-to-mount-a-file-tar-bz2-without-extracting-onto-your-fs) – Sathyajith Bhat Apr 02 '11 at 19:10
  • 2
    5 years later, and someone benefits again from this question. – insaner Apr 01 '16 at 02:23

3 Answers3

37

In fact, it seems that at least with newer Ubuntu1 versions it is possible to simply apt-get install archivemount. Then you can mount your archive as

archivemount [archive file] [mount point]

1: I tried in Ubuntu 13.04.

Thomas Arildsen
  • 929
  • 2
  • 9
  • 17
  • Generally works fine in Ubuntu 16.04, although it failed for me with a large (18 GB) `.7z` archive: it just showed as empty. – BeeOnRope Jan 08 '17 at 00:30
  • I also had issues with archivemount & a ZIP file; about half of the directories inside simply wouldn't show up. – minexew Oct 27 '21 at 20:30
16

A friend posted me about archivemount (actual archive).

There's a bit of work to get it setup (ie, it's not merely yum install archivemount).

It needs libarchive and fuse-devel (yum install fuse-devel) installed.

warren
  • 9,920
  • 23
  • 86
  • 147
  • On modern Fedora Core (specifically Fedora Server v 37, installed January, 2023) it is not necessary to do anything further for it to just run. This comment might help others try it - I did and am very happy, thanks. – Richard T Feb 27 '23 at 03:11
12

I had problems with large tar files or with tars containing many files, so I created my own alternative to archivemount: ratarmount.

You can install it with pip3 install --user ratarmount. And then simply do ratarmount file.tar mountfolder and unmount with fusermount -u mountfolder.

mxmlnkn
  • 271
  • 2
  • 6
  • 3
    Thanks for the effort you took to implement this! Looks at is EXACTLY what I require. I'll give it a try soon! – Regis May Mar 04 '19 at 19:05
  • I red little your docs a ratarmount. How works refresh indexing? when i using ls, and when is new file just check system if exists? Interesting i looked like that feature for my 7tb images every time moving between new servers was hard, with one file tar, i can using – Kamil Dąbrowski Oct 18 '21 at 01:45
  • @KamilDąbrowski I don't fully get your question but, normally, the index is only created if it could not be found or if the file size of the TAR archive did change. Did you copy the index to the new server, too? You could try to specify the index explicitly with `ratarmount --index-file ...`. If the index gets recreated, a warning message should appear. Maybe also try `ratarmount -d 3 ...` to increase the number of warnings. If you still have problems, please open an issue on [Github](https://github.com/mxmlnkn/ratarmount). – mxmlnkn Oct 18 '21 at 13:50