How do I write to/make changes to an existing squashfs filesystem?

Vendetta V picture Vendetta V · May 22, 2012 · Viewed 12.1k times · Source

How do I write to/make changes to an existing squashfs filesystem? I have tried using aufs/unionfs, but these require kernel modules that are extremely hard to compile.

Answer

Vendetta V picture Vendetta V · May 29, 2012

Do not use aufs/unionfs. On a Fedora system for example, install squashfs-tools by doing

#yum install squashfs-tools

This will get you /sbin/mksquashfs and /usr/sbin/unsquashfs installed on your host machine. Use these to uncompress an existing squashfs, make changes, and then compress it back again. Like so....

#ls rfs.squashfs 
#unsquashfs rfs.squashfs 
#ls rfs.squashfs squashfs 

Now make changes

#cd squashfs
#mkdir etc/vector

And compress it back

#mksquashfs squashfs my-new-squashfs