4

How do I mount a .tar.gz file, update it (add new files, edit files), and then unmount it such that changes are reflected in the original compressed file?

I'm open to other compression formats if no tools exist to do this for gzipped tar files.

I've tried archivemount, but this mounts .tar.gz files in read-only mode.

2
  • I assume you mean FUSE-based filesystems to access compressed tarballs? Commented Jun 15, 2014 at 6:29
  • 1
    I guess this is helpful: archive09.linux.com/feature/132196 Commented Jun 16, 2014 at 19:31

2 Answers 2

8

By default archivemount works in read-write mode, probably the permissions of the mounted tar.gz file does not allow the user to update it.

Adding "-o debug" to the mount options could help to understand what occurs.

2

It works fine for me on Fedora 201, maybe you have a bug, or as mpromonet suggested, the archive is read-only:

[root@f20 ~]# tar czf /tmp/ul137194.tar.gz -C / /etc/passwd /etc/group /etc/shells
tar: Removing leading `/' from member names
[root@f20 ~]# mkdir /tmp/ul137194
[root@f20 ~]# archivemount /tmp/ul137194.tar.gz /tmp/ul137194
[root@f20 ~]# find /tmp/ul137194
/tmp/ul137194
/tmp/ul137194/etc
/tmp/ul137194/etc/passwd
/tmp/ul137194/etc/group
/tmp/ul137194/etc/shells
[root@f20 ~]# rm /tmp/ul137194/etc/shells
rm: remove regular file ‘/tmp/ul137194/etc/shells’? y
[root@f20 ~]# echo nogroups > /tmp/ul137194/etc/group
[root@f20 ~]# umount /tmp/ul137194
[root@f20 ~]# tar xzf /tmp/ul137194.tar.gz -C /tmp/ul137194
[root@f20 ~]# find /tmp/ul137194
/tmp/ul137194
/tmp/ul137194/etc
/tmp/ul137194/etc/group
/tmp/ul137194/etc/passwd
[root@f20 ~]# cat /tmp/ul137194/etc/group
nogroups

1archivemount-0.8.1-2.fc20.x86_64, libarchive-3.1.2-7.fc20.x86_64, fuse-2.9.3-2.fc20.x86_64

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.