SquashFS

SquashFS is an open source, read only, extremely compressible filesystem. Like other filesystems SquashFS is capable of de-duplicating the data passed to it, which helps it compress data further. Although not fully necessary to operate correctly, SquashFS is typically used with some kind of union filesystem when used for Live media (LiveUSBs and LiveCDs).

Kernel
Activate the following kernel options must be activated for SquashFS support:

USE flags
Like most filesystems in Linux, the SquashFS filesystem tools come in a separate package. This package is called. Set the desired support for the package by adjusting USE flags accordingly.

Emerge
After setting flags as desired, update the system so the changes take effect:

Filesystem creation
Creation of SquashFS filesystems is performed with the command. To create a SquashFS filesystem of the home directory of a user named Larry, the following command could be used:

Depending on what kernel features were selected for SquashFS support, the output of the command will look something like the following:

Notice the command provides an excellent summary of what went into the newly created file. Information such as filesystem size, inode table, directory table, number of duplicate files, UIDs, and GUIs are easily readable. This information can be very helpful when attempting to gather specific information from the filesystem.

Mount
To mount a SquashFS, use the command's   option with escalated privileges:

Now all the files that are included in are available under the  mount point. List the files in the directory using the  options to see all the files:

Unmount
To unmount the filesystem, use the command with escalated privileges:

Extract
SquashFS files can be extracted using. Supposing the directory and the  file have been previously created in the steps above:

can be used to extract a specific file in the SquashFS. Again, presuming the file has been previously created in the steps above, the  file can be extracted to the  directory:

View the extract file using the command:

mount: only root can use "--options" option
This error is should be self-explanatory. Login as the root user or use to run mount the filesystem with escalated privileges.

External resources

 * A SquashFS instructional video on YouTube.
 * Forums thread TIP: Compressing portage using squashfs: initscript method
 * Article/Script using SquashFS to store and update portage tree
 * Portage tree using squashfs and overlayfs
 * GitHub - nrdvana/squash-portage: Script to generate squashfs files of the Gentoo portage tree