SquashFS

{{Short description|Compressed read-only file system for Linux}}

{{Infobox filesystem

| name = Squashfs

| developer = Phillip Lougher, Robert Lougher

| full_name =

| introduction_date = 2002

| introduction_os = Linux

| partition_id =

| directory_struct =

| file_struct =

| bad_blocks_struct =

| max_file_size = 16 EiB (264) bytes

| max_files_no =

| max_filename_size =

| max_volume_size = 16 EiB (264) bytes

| dates_recorded =

| date_range =

| date_resolution =

| forks_streams =

| attributes = POSIX and extended attributes

| file_system_permissions =

| compression = gzip LZMA LZO LZMA2 LZ4 Zstd

| encryption =

| OS = Linux

| website = {{URL|https://github.com/plougher/squashfs-tools}}

| variants =

| data_deduplication =

}}

Squashfs is a compressed read-only file system for Linux. Squashfs compresses files, inodes and directories, and supports block sizes from 4 KiB up to 1 MiB for greater compression. Several compression algorithms are supported. Squashfs is also the name of free software, licensed under the GPL, for accessing Squashfs filesystems.

Squashfs is intended for general read-only file-system use and in constrained block-device memory systems (e.g. embedded systems) where low overhead is needed.

Uses

Squashfs is used by the Live CD versions of Arch Linux, Clonezilla, Debian, Fedora, Gentoo Linux, KDE neon, Kali Linux, Linux Mint, NixOS, Salix, Ubuntu, openSUSE and on embedded distributions such as the OpenWrt{{cite web |url=https://openwrt.org/docs/techref/flash.layout#partitioning_of_the_flash |title=The OpenWrt Flash Layout – OpenWrt Wiki |website=OpenWrt.org |date=2018-06-07 |access-date=2018-06-11 |archive-date=2021-08-17 |archive-url=https://web.archive.org/web/20210817144413/https://openwrt.org/docs/techref/flash.layout#partitioning_of_the_flash |url-status=live }} and DD-WRT router firmware. It is also used in Chromecast,{{Cite web|url=https://blog.exploitee.rs/2013/chromecast-exploiting-the-newest-device-by-google/|title=Exploitee.rs » Blog Archive » Chromecast: Exploiting the Newest Device By Google.|access-date=2021-03-07|archive-date=2021-03-19|archive-url=https://web.archive.org/web/20210319040200/https://blog.exploitee.rs/2013/chromecast-exploiting-the-newest-device-by-google/|url-status=live}} in Tiny Core Linux for [http://wiki.tinycorelinux.net/doku.php?id=wiki:creating_extensions packaging extensions], and for the system partitions of some Android releases (Android Nougat).{{Cite web|url=https://arstechnica.com/gadgets/2016/05/android-n-borrows-chrome-os-code-for-seamless-update-installation/|title=Android N Borrows Chrome OS Code for 'Seamless' Update Installation|first=Ron|last=Amadeo|date=May 18, 2016|website=Ars Technica|access-date=June 15, 2017|archive-date=March 17, 2018|archive-url=https://web.archive.org/web/20180317025736/https://arstechnica.com/gadgets/2016/05/android-n-borrows-chrome-os-code-for-seamless-update-installation/|url-status=live}} It is often combined with a union mount filesystem, such as UnionFS, OverlayFS, or aufs, to provide a read-write environment for live Linux distributions. This takes advantage of both Squashfs's high-speed compression abilities and the ability to alter the distribution while running it from a live CD. Distributions such as Debian Live, Mandriva One, Puppy Linux, Salix Live and Slax use this combination. The AppImage project, which aims to create portable Linux applications, uses Squashfs for creating AppImages. The snap package system also uses Squashfs as its file container format.

Squashfs is also used by Linux Terminal Server Project and Splashtop. The tools unsquashfs and mksquashfs have been ported to Windows NT{{cite web |url=http://www.slax.org/blog/482-Squashfs-tools-for-Windows |title=Squashfs tools for Windows |access-date=2017-09-22 |archive-date=2017-09-23 |archive-url=https://web.archive.org/web/20170923051003/http://www.slax.org/blog/482-Squashfs-tools-for-Windows |url-status=live }}Windows 8.1.{{cite web |url=http://domoticx.com/bestandssysteem-squashfs-tools-software/ |title=Squashfs Tools (Linux/Windows) |access-date=2017-09-22 |language=nl |archive-date=2017-09-23 |archive-url=https://web.archive.org/web/20170923101223/http://domoticx.com/bestandssysteem-squashfs-tools-software/ |url-status=live }} 7-Zip also supports Squashfs.{{Cite web|url=https://www.7-zip.org/|title=7-Zip|website=www.7-zip.org|access-date=2021-03-07|archive-date=2006-05-12|archive-url=https://web.archive.org/web/20060512045746/http://www.7-zip.org/|url-status=live}}

History

Squashfs was initially maintained as an out-of-tree Linux patch. The initial version 1.0 was released on 23 October 2002.{{cite web|title=Squashfs CHANGES file|url=https://sourceforge.net/p/squashfs/code/ci/master/tree/CHANGES|access-date=19 April 2017|date=2014-08-08|archive-date=2020-04-22|archive-url=https://web.archive.org/web/20200422081730/https://sourceforge.net/p/squashfs/code/ci/master/tree/CHANGES|url-status=live}} In 2009 Squashfs was merged into Linux mainline as part of Linux 2.6.29.{{cite web|title=Linux 2 6 29 -- Linux Kernel Newbies|url=https://kernelnewbies.org/Linux_2_6_29|website=Linux Kernel Newbies|access-date=19 April 2017|date=2009-06-10|archive-date=2019-10-24|archive-url=https://web.archive.org/web/20191024172818/https://kernelnewbies.org/Linux_2_6_29|url-status=live}}{{cite web|url=http://www.h-online.com/open/news/item/Btrfs-and-Squashfs-merged-into-Linux-kernel-739613.html|title=Btrfs and Squashfs merged into Linux kernel - The H Open: News and Features|website=The H Open|date=2009-01-10|access-date=2017-04-19|archive-date=2016-03-04|archive-url=https://web.archive.org/web/20160304112236/http://www.h-online.com/open/news/item/Btrfs-and-Squashfs-merged-into-Linux-kernel-739613.html|url-status=live}} In that process, the backward-compatibility code for older formats was removed. Since then the Squashfs kernel-space code has been maintained in the Linux mainline tree, while the user-space tools remain on the project's GitHub page.{{cite web|title=Squashfs README file|website=GitHub|url=https://github.com/plougher/squashfs-tools/blob/master/README|access-date=23 July 2021|date=2021-07-23|archive-date=2021-07-23|archive-url=https://web.archive.org/web/20210723053014/https://github.com/plougher/squashfs-tools/blob/master/README|url-status=live}}

The original version of Squashfs used gzip compression, although Linux kernel 2.6.34 added support for LZMA{{cite web |url=http://www.squashfs-lzma.org/ |title=Official Squashfs LZMA |website=Squashfs-LZMA.org |access-date=2012-11-08 |archive-date=2012-10-29 |archive-url=https://web.archive.org/web/20121029153107/http://www.squashfs-lzma.org/ |url-status=live }} and LZO compression,{{cite web |url=http://kernelnewbies.org/Linux_2_6_34#head-35808ff36eeaca6084c79975a7d50263b726acc1 |title=Linux 2 6 34 - Linux Kernel Newbies |website=KernelNewbies.org |access-date=2012-11-08 |archive-date=2012-11-03 |archive-url=https://web.archive.org/web/20121103165341/http://kernelnewbies.org/Linux_2_6_34#head-35808ff36eeaca6084c79975a7d50263b726acc1 |url-status=live }} Linux kernel 2.6.38 added support for LZMA2 compression (which is used by xz),{{cite web |url=http://kernelnewbies.org/Linux_2_6_38#head-1ca50229f5801418cffa063f800aae8b466f1c60 |title=Linux 2 6 38 - Linux Kernel Newbies |website=KernelNewbies.org |access-date=2012-11-08 |archive-date=2012-11-16 |archive-url=https://web.archive.org/web/20121116092921/http://kernelnewbies.org/Linux_2_6_38#head-1ca50229f5801418cffa063f800aae8b466f1c60 |url-status=live }} Linux kernel 3.19 added support for LZ4 compression,[https://github.com/torvalds/linux/commit/7a02d089695a1217992434f03a78aa32bad85b5c Merge of LZ4 Squashfs support] {{Webarchive|url=https://web.archive.org/web/20200723112006/https://github.com/torvalds/linux/commit/7a02d089695a1217992434f03a78aa32bad85b5c |date=2020-07-23 }} to Linus Torvalds tree. and Linux kernel 4.14 added support for Zstandard compression.{{Cite web|url=https://github.com/torvalds/linux/commit/87bf54bb43ddd385d2538b777324bf737f243042|title=squashfs: Add zstd support · torvalds/linux@87bf54b|website=GitHub|access-date=2018-04-15|archive-date=2023-10-28|archive-url=https://web.archive.org/web/20231028232822/https://github.com/torvalds/linux/commit/87bf54bb43ddd385d2538b777324bf737f243042|url-status=live}}

Linux kernel 2.6.35 added support for extended file attributes.{{cite web |url=http://kernelnewbies.org/Linux_2_6_35#head-7b60ef60876830625c37e8f1c24e460eebc418cc |title=Linux 2 6 35 - Linux Kernel Newbies |website=KernelNewbies.org |access-date=2012-11-08 |archive-date=2020-01-08 |archive-url=https://web.archive.org/web/20200108183602/https://kernelnewbies.org/Linux_2_6_35#head-7b60ef60876830625c37e8f1c24e460eebc418cc |url-status=live }}

See also

{{Portal|Free and open-source software}}

{{Div col|colwidth=20em}}

{{div col end}}

References

{{Reflist}}