39

I am looking for a way to mount a ZIP archive as a filesystem so that I can transparently access files within the archive. I only need read access -- the ZIP will not be modified. RAM consumption is important since this is for a (resource constrained) embedded system. What are the available options?

2 Answers2

38

fuse-zip is an option and claims to be faster than the competition.

# fuse-zip -r archivetest.zip /mnt

archivemount is another:

# archivemount -o readonly archivetest.zip  /mnt

Both will probably need to open the whole archive, therefore won't be particularly quick. Have you considered extracting the ZIP to a HDD or USB-stick beforehand and simply mounting that read-only?


There are also other libraries like fuse-archive and ratarmount which supposedly are more performant under certain situations and provide additional features.

Tooster
  • 113
garethTheRed
  • 33,957
  • 1
    Speed is not a problem, but RAM consumption is. USB or HDD is not an alternative. This is an embedded system without an HDD or USB ports. – Grodriguez Nov 19 '14 at 09:43
  • I suppose the bottom line is that you'll need to test it within your particular situation and see which, if any, is the best for memory usage. I'd have thought it depends on how large your archive is and also how many files are within that archive. If you have control of how the ZIP file is created, you could consider a different format such as a raw disk image which can be loop mounted - that may save RAM. – garethTheRed Nov 19 '14 at 09:50
  • Yes, I will have to test. But before that I wanted to know if others had any experience they could share :) (BTW I don't have control overthe ZIP file). – Grodriguez Nov 19 '14 at 09:57
  • 6
    @Grodriguez With an 1GB+ inner file, fuse-zip's memory usage was 1GB+. For the same, archivemount's mem usage was still low. – n611x007 Sep 29 '16 at 16:47
10

You can use fuse-zip to mount the ZIP archive as read only.

  1. Install fuse-zip on your system.

    On Ubuntu run:

    sudo apt-get install fuse-zip
    

    On RHEL / CentOS / Fedora run:

    yum install fuse-zip
    
  2. Run below command to mount zip as read only:

    fuse-zip -o ro /path/abcd.zip /path/to/mount/directory
    
  3. Use below command to unmount directory:

    fusermount -u /path/to/mount/directory
    
  • Thank you. Is there any info available about memory consumption? What works well for desktop might not work that well in resource constrained environments. – Grodriguez Nov 19 '14 at 09:42
  • 1
    https://code.google.com/p/fuse-zip/wiki/PerformancePage – Vaibhav Panmand Nov 19 '14 at 09:48
  • No mentions of memory consumption there. – Grodriguez Nov 19 '14 at 09:57
  • 2
    Google Code has closed, link above moved to https://bitbucket.org/agalanin/fuse-zip/wiki/PerformancePage – silpol Jan 11 '19 at 07:21
  • No mention of random access (seek) speed either. In my case I have a .zip with a single 7GB, and would like reasonable RAM usage and random access. Doing this half-efficiently would require caching things like compression block positions, I suspect nothing ready does this? – Beni Cherniavsky-Paskin Aug 17 '21 at 09:46