Suggestion to modify the syntax which the filesystem.squashfs is being created with.
Using VyOS 1.4-rolling-202308250021 in below example.
Original filesystem.squashfs is: 376 418 304 bytes
Extracted size: 1 361 427 831 bytes.
Compressed size using below syntax: 357 666 816 bytes
mksquashfs squashfs-root/ filesystem.squashfs -no-recovery -always-use-fragments -b 256k -no-duplicates -comp xz -Xbcj x86
The above saves 18 751 488 bytes (~5%) and increase read performance (estimated by 10-15% according to https://jonathancarter.org/2015/04/06/squashfs-performance-testing/ - also verified with other systems utilizing squashfs).
The penalty is estimated 10-15% longer time to create (compress) the filesystem.squashfs file .
For ARM-based systems the following syntax should be used (alter Xbcj):
mksquashfs squashfs-root/ filesystem.squashfs -no-recovery -always-use-fragments -b 256k -no-duplicates -comp xz -Xbcj arm
Original filesystem.squashfs info:
# unsquashfs -s ./filesystem.squashfs Found a valid SQUASHFS 4:0 superblock on ./filesystem.squashfs. Creation or last append time Fri Aug 25 02:22:28 2023 Filesystem size 376417488 bytes (367595.20 Kbytes / 358.98 Mbytes) Compression xz Block size 131072 Filesystem is exportable via NFS Inodes are compressed Data is compressed Uids/Gids (Id table) are compressed Fragments are compressed Always-use-fragments option is not specified Xattrs are compressed Duplicates are removed Number of fragments 2621 Number of inodes 69488 Number of ids 63 Number of xattr ids 8
Modified filesystem.squashfs info:
# unsquashfs -s ./filesystem.squashfs Found a valid SQUASHFS 4:0 superblock on ./filesystem.squashfs. Creation or last append time Sat Aug 26 03:45:28 2023 Filesystem size 357666467 bytes (349283.66 Kbytes / 341.10 Mbytes) Compression xz Dictionary size 262144 Filters selected: x86 Block size 262144 Filesystem is exportable via NFS Inodes are compressed Data is compressed Uids/Gids (Id table) are compressed Fragments are compressed Always-use-fragments option is specified Xattrs are compressed Duplicates are not removed Number of fragments 2021 Number of inodes 69488 Number of ids 63 Number of xattr ids 8