28

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?

  • Have you tried mount -o loop option? – Citylight Nov 19 '14 at 9:43
  • Yes, the question is which filesystem to use. – Grodriguez Nov 19 '14 at 9:59
  • If you're looking for compressed read-only filesystem, consider using squashfs. – WGH Feb 28 '15 at 14:17
  • I am not looking for "a compressed read-only file system" in a generic way. I am specifically looking for a way to mount a zip file as a read-only file system. – Grodriguez Mar 2 '15 at 9:58
  • See SU:367540 for a similar question on WinNT. – n611x007 Sep 28 '16 at 17:59
29

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?

| improve this answer | |
  • 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 9: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 9: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 9:57
  • 3
    @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
7

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

1 -- Install fuse-zip on your system.

UBUNTU

sudo apt-get install fuse-zip

CENTOS/REDHAT/FEDORA

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
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.