8

It seems one cannot mount a tar file (read only), similarly as one mounts an ISO image file. At least, I have not found any implementation.

It would be useful, for example to run a find command inside.

Is this really (or practically) impossible to implement? Why?

UPDATE By accepted answered, this is indeed possible, though a program (not included in present distributions) must be instaled. It worked for me. I copy the installation and use steps in my scenario (Fedora 12).

  # yum install fuse fuse-libs fuse-devel 
  # yum install libarchive libarchive-devel
  # cd /tmp && wget http://www.cybernoia.de/software/archivemount/archivemount-0.6.0.tar.gz
  # tar xzf archivemount-0.6.0.tar.gz && cd archivemount-0.6.0
  # ./configure && make && make install
  # man archivemount
  #  archivemount -o ro /tmp/mytar.tgz /mnt/tt
leonbloy
  • 2,118
  • 17
  • 23

2 Answers2

8

Traditionally, no it's not possible.

However, you can do so using the FUSE filesystem archivemount under Linux.

IMNSHO this is a bit of a novelty and not usually necessary, but I can see a few edge cases for it.

MikeyB
  • 39,291
  • 10
  • 105
  • 189
  • One of possible use cases is mine - I'd like to be able to mount archives on remote server, to be able to perform incremental backups to them by rsync. Not sure if it will work fast. – Illarion Kovalchuk Mar 19 '12 at 11:47
1

The package is available in Ubuntu 11.10, alas broken.

One can install it via this workaround:

mkdir -p ~/src
cd ~/src

sudo aptitude install build-essential devscripts debian-archive-keyring libfuse-dev libarchive-dev
apt-get source archivemount
gpg --keyring /usr/share/keyrings/debian-archive-keyring.gpg --verify *dsc

cd archivemount-0.6.1
cat << EOF | patch -p0
--- debian/control
+++ debian/control
@@ -8,7 +8,7 @@

 Package: archivemount
 Architecture: linux-any
-Depends: \${shlibs:Depends}, \${misc:Depends}, fuse (>=2.8.5-2)
+Depends: \${shlibs:Depends}, \${misc:Depends}, fuse-utils (>=2.8.4-1.4ubuntu1)
 Description: mounts an archive for access as a file system
  archivemount is a FUSE based file system for Unix variants, including Linux.
  Its purpose is to mount archives to a mount point where it can be read from
EOF
dch --nmu 'Depend on fuse-utils instead of fuse on Oneiric Ocelot.'
dpkg-buildpackage

cd ..
sudo dpkg -i archivemount_0.6.1-2.1_amd64.deb

The last step did not work for me, so I

cd archivemount-0.6.1./
configure && make && sudo make install

instead.

k0pernikus
  • 4,170
  • 4
  • 17
  • 17