In this answer on a previous question, I found out how to modify files in a squashfs filesystem:# unsquash the filesystem to a local directorysudo cp /media/clonezilla/live/filesystem.squashfs ./sudo unsquashfs filesystem.squashfs# now, insert my own script which I want as part of the distributionsudo cp ~/autobackup squashfs-root/usr/sbin/# now, resquash the filesystem to be able to use itsudo mksquashfs squashfs-root filesystem.squashfs -b 1024k -comp xz -Xbcj x86 -e bootHowever, on that last line, I run into some problems making the filesystem:Source directory entry bin already used! - trying bin_1Source directory entry dev already used! - trying dev_1Source directory entry etc already used! - trying etc_1Source directory entry home already used! - trying home_1Source directory entry initrd.img already used! - trying initrd.img_1Source directory entry lib already used! - trying lib_1Source directory entry lib64 already used! - trying lib64_1Source directory entry media already used! - trying media_1Source directory entry mnt already used! - trying mnt_1Source directory entry opt already used! - trying opt_1Source directory entry proc already used! - trying proc_1Source directory entry root already used! - trying root_1Source directory entry run already used! - trying run_1Source directory entry sbin already used! - trying sbin_1Source directory entry selinux already used! - trying selinux_1Source directory entry srv already used! - trying srv_1Source directory entry sys already used! - trying sys_1Source directory entry tmp already used! - trying tmp_1Source directory entry usr already used! - trying usr_1Source directory entry var already used! - trying var_1Source directory entry vmlinuz already used! - trying vmlinuz_1Essentially, since it's overwriting an existing squashfs filesystem, instead of merging duplicate files, it creates new folders and files in the root of the filesystem named bin_1, etc_1, var_1, tmp_1, etc. Obviously, this is not desired. Is there a way that I can force it to merge the directories? I have attempted to run it with -noappend, but that breaks the Clonezilla install and I can't get into the Clonezilla wizard. Any ideas?
Merging preexisting source folders in mksquashfs
clonezilla;squashfs
As I said in my other answer you have to move the old filesystem.squashfs to another location (or rename it) before repacking your modified squashfs-root into a new filesystem.squashfs:mv filesystem.squashfs /path/to/backup/ormv filesystem.squashfs filesystem.squashfs.oldthen:mksquashfs squashfs-root filesystem.squashfs -b 1024k -comp xz -Xbcj x86 -e boot