# SquashFS

> Mediated Wiki article. Canonical URL: https://mediated.wiki/source/SquashFS
> Markdown URL: https://mediated.wiki/source/SquashFS.md
> Source: https://en.wikipedia.org/wiki/SquashFS
> Source revision: 1343387705
> License: Creative Commons Attribution-ShareAlike 4.0 International (https://creativecommons.org/licenses/by-sa/4.0/)

{{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](/source/Exbibyte) (2<sup>64</sup>) bytes
| max_files_no            =
| max_filename_size       =
| max_volume_size         = 16 EiB (2<sup>64</sup>) bytes
| dates_recorded          =
| date_range              =
| date_resolution         =
| forks_streams           =
| attributes              = [POSIX](/source/POSIX) and [extended attributes](/source/Extended_file_attributes)
| file_system_permissions =
| compression             = [gzip](/source/gzip) [LZMA](/source/LZMA) [LZO](/source/Lempel%E2%80%93Ziv%E2%80%93Oberhumer) [LZMA2](/source/LZMA2) [LZ4](/source/LZ4_(compression_algorithm)) [Zstd](/source/Zstandard)
| encryption              =
| OS                      = [Linux](/source/Linux)
| website                 = {{URL|https://github.com/plougher/squashfs-tools}}
| variants                =
| data_deduplication      =
}}

'''Squashfs''' is a [compressed](/source/Data_compression) read-only [file system](/source/file_system) for [Linux](/source/Linux). Squashfs compresses [files](/source/Computer_file), [inode](/source/inode)s and [directories](/source/Directory_(file_systems)), and supports [block sizes](/source/Block_size_(data_storage_and_transmission)) from 4 [KiB](/source/Kibibyte) up to 1 [MiB](/source/Mebibyte) for greater compression. Several compression algorithms are supported. Squashfs is also the name of [free software](/source/free_software), licensed under the [GPL](/source/GNU_General_Public_License), for accessing Squashfs filesystems. 

Squashfs is intended for general read-only file-system use and in constrained block-device [memory system](/source/Computer_data_storage)s (e.g. [embedded system](/source/embedded_system)s) where low [overhead](/source/Overhead_(computing)) is needed.

==Uses==
Squashfs is used by the [Live CD](/source/Live_CD) versions of [Arch Linux](/source/Arch_Linux), [Clonezilla](/source/Clonezilla), [Debian](/source/Debian), [Fedora](/source/Fedora_(operating_system)), [Gentoo Linux](/source/Gentoo_Linux), [KDE neon](/source/KDE_neon), [Kali Linux](/source/Kali_Linux), [Linux Mint](/source/Linux_Mint), [NixOS](/source/NixOS), [Salix](/source/Salix_OS), [Ubuntu](/source/Ubuntu_(operating_system)), [openSUSE](/source/openSUSE) and on embedded distributions such as the [OpenWrt](/source/OpenWrt)<ref>{{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 }}</ref> and [DD-WRT](/source/DD-WRT) [router](/source/router_(computing)) [firmware](/source/firmware). It is also used in [Chromecast](/source/Chromecast)<ref>{{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}}</ref> and [EasyOS](/source/EasyOS), in [Tiny Core Linux](/source/Tiny_Core_Linux) for packaging extension, and for the system partitions of some [Android](/source/Android_(operating_system)) releases ([Android Nougat](/source/Android_Nougat)).<ref>{{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}}</ref> It is often combined with a [union mount](/source/union_mount) filesystem, such as [UnionFS](/source/UnionFS), [OverlayFS](/source/Overlayfs), or [aufs](/source/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](/source/Debian_Live), [Mandriva One](/source/Mandriva_One), [Puppy Linux](/source/Puppy_Linux), [Salix Live](/source/Salix_OS) and [Slax](/source/Slax) use this combination. The [AppImage](/source/AppImage) project, which aims to create portable Linux applications, uses Squashfs for creating AppImages. The [snap](/source/Snap_(software)) package system also uses Squashfs as its file container format.

Squashfs is also used by [Linux Terminal Server Project](/source/Linux_Terminal_Server_Project) and [Splashtop](/source/Splashtop_OS). The tools ''unsquashfs'' and ''mksquashfs'' have been ported to [Windows NT](/source/Windows_NT)<ref>{{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 }}</ref> – [Windows 8.1](/source/Windows_8.1).<ref>{{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 }}</ref> [7-Zip](/source/7-Zip) also supports Squashfs.<ref>{{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}}</ref>

==History==

Squashfs was initially maintained as an out-of-tree Linux patch. The initial version 1.0 was released on 23 October 2002.<ref>{{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}}</ref> In 2009 Squashfs was merged into Linux mainline as part of Linux 2.6.29.<ref>{{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}}</ref><ref>{{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}}</ref> In that process, the [backward-compatibility](/source/Backward_compatibility) code for older formats was removed. Since then the Squashfs [kernel-space](/source/kernel-space) code has been maintained in the Linux mainline tree, while the [user-space](/source/user-space) tools remain on the project's [GitHub](/source/GitHub) page.<ref>{{cite web|title=Squashfs README file|website=[GitHub](/source/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}}</ref>

The original version of Squashfs used [gzip](/source/gzip) compression, although Linux kernel 2.6.34 added support for [LZMA](/source/LZMA)<ref>{{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 }}</ref> and [LZO](/source/Lempel%E2%80%93Ziv%E2%80%93Oberhumer) compression,<ref>{{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 }}</ref> Linux kernel 2.6.38 added support for [LZMA2](/source/LZMA2) compression (which is used by [xz](/source/XZ_Utils)),<ref>{{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 }}</ref> Linux kernel 3.19 added support for [LZ4](/source/LZ4_(compression_algorithm)) compression,<ref>[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](/source/Linus_Torvalds) tree.</ref> and Linux kernel 4.14 added support for [Zstandard](/source/Zstandard) compression.<ref>{{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}}</ref>

Linux kernel 2.6.35 added support for [extended file attributes](/source/extended_file_attributes).<ref>{{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 }}</ref>

==See also==
{{Portal|Free and open-source software}}
{{Div col|colwidth=20em}}
* [AppImage](/source/AppImage)
* [Btrfs](/source/Btrfs)
* [Cloop](/source/Cloop)
* [Comparison of file systems](/source/Comparison_of_file_systems)
* [Cramfs](/source/Cramfs)
* [e2compr](/source/e2compr)
* [EROFS](/source/EROFS)
* [Initramfs](/source/Initramfs)
* [List of file systems](/source/List_of_file_systems)
* [Reboot to restore software](/source/Reboot_to_restore_software)
* [Windows Imaging Format](/source/Windows_Imaging_Format)
* [https://github.com/mhx/dwarfs DwarFS]
{{div col end}}

==References==
{{Reflist}}

==External links==
* {{Official website|https://github.com/plougher/squashfs-tools}}
* [https://dr-emann.github.io/squashfs/squashfs.html Squashfs Binary Format]

{{File systems}}

Category:Compression file systems
Category:Free special-purpose file systems
Category:Read-only file systems supported by the Linux kernel
Category:Free software programmed in C
Category:Software using the GNU General Public License

---
Adapted from the Wikipedia article [SquashFS](https://en.wikipedia.org/wiki/SquashFS) by Wikipedia contributors ([contributor history](https://en.wikipedia.org/wiki/SquashFS?action=history)). Available under [Creative Commons Attribution-ShareAlike 4.0 International](https://creativecommons.org/licenses/by-sa/4.0/). Changes may have been made.
