296 lines
5.4 KiB
HTML
296 lines
5.4 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
|
<HTML
|
|
><HEAD
|
|
><TITLE
|
|
>What is SquashFS</TITLE
|
|
><META
|
|
NAME="GENERATOR"
|
|
CONTENT="Modular DocBook HTML Stylesheet Version 1.7"><LINK
|
|
REL="HOME"
|
|
TITLE="SquashFS HOWTO"
|
|
HREF="index.html"><LINK
|
|
REL="PREVIOUS"
|
|
TITLE="SquashFS HOWTO"
|
|
HREF="index.html"><LINK
|
|
REL="NEXT"
|
|
TITLE="Getting ready for SquashFS"
|
|
HREF="gettingready.html"></HEAD
|
|
><BODY
|
|
CLASS="sect1"
|
|
BGCOLOR="#FFFFFF"
|
|
TEXT="#000000"
|
|
LINK="#0000FF"
|
|
VLINK="#840084"
|
|
ALINK="#0000FF"
|
|
><DIV
|
|
CLASS="NAVHEADER"
|
|
><TABLE
|
|
SUMMARY="Header navigation table"
|
|
WIDTH="100%"
|
|
BORDER="0"
|
|
CELLPADDING="0"
|
|
CELLSPACING="0"
|
|
><TR
|
|
><TH
|
|
COLSPAN="3"
|
|
ALIGN="center"
|
|
>SquashFS HOWTO</TH
|
|
></TR
|
|
><TR
|
|
><TD
|
|
WIDTH="10%"
|
|
ALIGN="left"
|
|
VALIGN="bottom"
|
|
><A
|
|
HREF="index.html"
|
|
ACCESSKEY="P"
|
|
>Prev</A
|
|
></TD
|
|
><TD
|
|
WIDTH="80%"
|
|
ALIGN="center"
|
|
VALIGN="bottom"
|
|
></TD
|
|
><TD
|
|
WIDTH="10%"
|
|
ALIGN="right"
|
|
VALIGN="bottom"
|
|
><A
|
|
HREF="gettingready.html"
|
|
ACCESSKEY="N"
|
|
>Next</A
|
|
></TD
|
|
></TR
|
|
></TABLE
|
|
><HR
|
|
ALIGN="LEFT"
|
|
WIDTH="100%"></DIV
|
|
><DIV
|
|
CLASS="sect1"
|
|
><H1
|
|
CLASS="sect1"
|
|
><A
|
|
NAME="whatis"
|
|
></A
|
|
>1. What is SquashFS</H1
|
|
><DIV
|
|
CLASS="sect2"
|
|
><H2
|
|
CLASS="sect2"
|
|
><A
|
|
NAME="intro"
|
|
></A
|
|
>1.1. Introduction</H2
|
|
><P
|
|
> When creating tiny-sized and embedded Linux systems, every byte of the storage device (floppy, flash disk, etc.)
|
|
is very important, so compression is used everywhere possible. Also, compressed file systems are frequently needed
|
|
for archiving purposes. For huge public archives, as well as for personal media archives, this is essential.
|
|
</P
|
|
><P
|
|
> SquashFS brings all this to a new level. It is a read-only file system that lets you compress whole file systems or
|
|
single directories, write them to other devices/partitions or to ordinary files, and then mount them directly (if
|
|
a device) or using a loopback device (if it is a file). The modular, compact system design of SquashFS is bliss.
|
|
For archiving purposes, SquashFS gives you a lot more flexibility and performance speed than a tarball archive.
|
|
</P
|
|
><P
|
|
> SquashFS is distributed as a Linux kernel source patch (which enables SquashFS read support in your kernel),
|
|
the <B
|
|
CLASS="command"
|
|
>mksquashfs</B
|
|
> tool, which creates squashed file systems (in a file or on a block device) and
|
|
the <B
|
|
CLASS="command"
|
|
>unsquashfs</B
|
|
> tool, which extracts multiple files from an existing squashed file system.
|
|
</P
|
|
><P
|
|
> The latest SquashFS release tree is 3.x, the former one was 2.x. This document
|
|
describes both these releases with proper notes given. For example, if some feature or
|
|
parameter is different in these release trees, it will be written as follows:
|
|
<EM
|
|
>new value (3.x) or old value (2.x)</EM
|
|
>
|
|
</P
|
|
></DIV
|
|
><DIV
|
|
CLASS="sect2"
|
|
><H2
|
|
CLASS="sect2"
|
|
><A
|
|
NAME="overview"
|
|
></A
|
|
>1.2. Overview of SquashFS</H2
|
|
><P
|
|
></P
|
|
><UL
|
|
><LI
|
|
><P
|
|
>Data, inodes and directories are compressed
|
|
</P
|
|
></LI
|
|
><LI
|
|
><P
|
|
>SquashFS stores full uid/gids (32 bits), and file creation time
|
|
</P
|
|
></LI
|
|
><LI
|
|
><P
|
|
>Files up to 2^64 bytes are supported; file systems can be up to 2^64 bytes
|
|
</P
|
|
></LI
|
|
><LI
|
|
><P
|
|
>Inode and directory data are highly compacted, and packed on byte
|
|
boundaries; each compressed inode is on average 8 bytes in length
|
|
(the exact length varies on file type, i.e. regular file, directory,
|
|
symbolic link, and block/character device inodes have different sizes)
|
|
</P
|
|
></LI
|
|
><LI
|
|
><P
|
|
>SquashFS can use block sizes up to up to 64 Kb (2.x) and 1Mb (3.x). The default size is 128Kb (3.x), which achieves
|
|
greater compression ratios than the normal 4K block size
|
|
</P
|
|
></LI
|
|
><LI
|
|
><P
|
|
>By the 2.x release it was introduced the concept of <EM
|
|
>fragment blocks</EM
|
|
>:
|
|
an ability to join multiple files smaller than block size into a single
|
|
block, achieving greater compression ratios
|
|
</P
|
|
></LI
|
|
><LI
|
|
><P
|
|
>File duplicates are detected and removed
|
|
</P
|
|
></LI
|
|
><LI
|
|
><P
|
|
>Both big and little endian architectures are supported; SquashFS can
|
|
mount file systems created on different byte-order machines
|
|
</P
|
|
></LI
|
|
></UL
|
|
></DIV
|
|
><DIV
|
|
CLASS="sect2"
|
|
><H2
|
|
CLASS="sect2"
|
|
><A
|
|
NAME="makingclear"
|
|
></A
|
|
>1.3. Making it clear</H2
|
|
><P
|
|
> Now let's make sure any further discussions will be clearer
|
|
for you to understand.
|
|
The procedure of getting SquashFS working basically
|
|
consists of the following steps:
|
|
</P
|
|
><P
|
|
></P
|
|
><OL
|
|
TYPE="1"
|
|
><LI
|
|
><P
|
|
>Patching and recompiling the target Linux kernel to enable SquashFS support
|
|
</P
|
|
></LI
|
|
><LI
|
|
><P
|
|
>Compiling the <B
|
|
CLASS="command"
|
|
>mksquashfs </B
|
|
> and the <B
|
|
CLASS="command"
|
|
>unsquashfs </B
|
|
> tools
|
|
</P
|
|
></LI
|
|
><LI
|
|
><P
|
|
>Creating a compressed file system with <B
|
|
CLASS="command"
|
|
>mksquashfs</B
|
|
>
|
|
</P
|
|
></LI
|
|
><LI
|
|
><P
|
|
>Testing: mounting a squashed file system to a temporary location
|
|
</P
|
|
></LI
|
|
><LI
|
|
><P
|
|
>Modifying the <TT
|
|
CLASS="filename"
|
|
>/etc/fstab </TT
|
|
> or startup scripts of
|
|
your target Linux system to mount the new squashed file system when needed
|
|
</P
|
|
></LI
|
|
></OL
|
|
></DIV
|
|
></DIV
|
|
><DIV
|
|
CLASS="NAVFOOTER"
|
|
><HR
|
|
ALIGN="LEFT"
|
|
WIDTH="100%"><TABLE
|
|
SUMMARY="Footer navigation table"
|
|
WIDTH="100%"
|
|
BORDER="0"
|
|
CELLPADDING="0"
|
|
CELLSPACING="0"
|
|
><TR
|
|
><TD
|
|
WIDTH="33%"
|
|
ALIGN="left"
|
|
VALIGN="top"
|
|
><A
|
|
HREF="index.html"
|
|
ACCESSKEY="P"
|
|
>Prev</A
|
|
></TD
|
|
><TD
|
|
WIDTH="34%"
|
|
ALIGN="center"
|
|
VALIGN="top"
|
|
><A
|
|
HREF="index.html"
|
|
ACCESSKEY="H"
|
|
>Home</A
|
|
></TD
|
|
><TD
|
|
WIDTH="33%"
|
|
ALIGN="right"
|
|
VALIGN="top"
|
|
><A
|
|
HREF="gettingready.html"
|
|
ACCESSKEY="N"
|
|
>Next</A
|
|
></TD
|
|
></TR
|
|
><TR
|
|
><TD
|
|
WIDTH="33%"
|
|
ALIGN="left"
|
|
VALIGN="top"
|
|
>SquashFS HOWTO</TD
|
|
><TD
|
|
WIDTH="34%"
|
|
ALIGN="center"
|
|
VALIGN="top"
|
|
> </TD
|
|
><TD
|
|
WIDTH="33%"
|
|
ALIGN="right"
|
|
VALIGN="top"
|
|
>Getting ready for SquashFS</TD
|
|
></TR
|
|
></TABLE
|
|
></DIV
|
|
></BODY
|
|
></HTML
|
|
> |