LDP/LDP/howto/docbook/SquashFS-HOWTO/chapter1.xml

114 lines
3.9 KiB
XML
Raw Normal View History

2004-03-02 14:33:32 +00:00
<?xml version = '1.0' encoding = 'ISO-8859-1' ?>
2004-06-07 19:09:22 +00:00
2004-03-02 14:33:32 +00:00
<sect1 id="whatis">
2004-05-24 20:08:55 +00:00
<title>What is SquashFS</title>
<sect2 id="intro">
<title>Introduction</title>
<para>
2004-03-02 14:33:32 +00:00
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.
</para>
2004-05-24 20:08:55 +00:00
<para>
2004-03-02 14:33:32 +00:00
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.
2008-03-02 16:06:57 +00:00
For archiving purposes, SquashFS gives you a lot more flexibility and performance speed than a tarball archive.
2004-03-02 14:33:32 +00:00
</para>
2004-05-24 20:08:55 +00:00
<para>
2004-03-02 14:33:32 +00:00
SquashFS is distributed as a Linux kernel source patch (which enables SquashFS read support in your kernel),
2008-03-02 16:06:57 +00:00
the <command>mksquashfs</command> tool, which creates squashed file systems (in a file or on a block device) and
the <command>unsquashfs</command> tool, which extracts multiple files from an existing squashed file system.
2004-05-24 20:08:55 +00:00
</para>
2004-06-07 19:09:22 +00:00
<para>
2008-03-02 16:06:57 +00:00
The latest SquashFS release tree is 3.x, the former one was 2.x. This document
2004-06-07 19:09:22 +00:00
describes both these releases with proper notes given. For example, if some feature or
2008-03-02 16:06:57 +00:00
parameter is different in these release trees, it will be written as follows:
<emphasis>new value (3.x) or old value (2.x)</emphasis>
2004-06-07 19:09:22 +00:00
</para>
2004-05-24 20:08:55 +00:00
</sect2>
<sect2 id="overview">
<title>Overview of SquashFS</title>
<itemizedlist>
2008-07-25 16:20:47 +00:00
<listitem><para>Data, inodes and directories are compressed
</para></listitem>
2004-05-24 20:08:55 +00:00
2008-07-25 16:20:47 +00:00
<listitem><para>SquashFS stores full uid/gids (32 bits), and file creation time
</para></listitem>
2004-05-24 20:08:55 +00:00
2008-07-25 16:20:47 +00:00
<listitem><para>Files up to 2^64 bytes are supported; file systems can be up to 2^64 bytes
</para></listitem>
2004-05-24 20:08:55 +00:00
2008-07-25 16:20:47 +00:00
<listitem><para>Inode and directory data are highly compacted, and packed on byte
2004-03-02 14:33:32 +00:00
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)
2008-07-25 16:20:47 +00:00
</para></listitem>
2004-05-24 20:08:55 +00:00
2008-07-25 16:20:47 +00:00
<listitem><para>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
2004-06-07 19:09:22 +00:00
greater compression ratios than the normal 4K block size
2008-07-25 16:20:47 +00:00
</para></listitem>
2004-06-07 19:09:22 +00:00
2008-07-25 16:20:47 +00:00
<listitem><para>By the 2.x release it was introduced the concept of <emphasis>fragment blocks</emphasis>:
2004-06-07 19:09:22 +00:00
an ability to join multiple files smaller than block size into a single
block, achieving greater compression ratios
2008-07-25 16:20:47 +00:00
</para></listitem>
2004-05-24 20:08:55 +00:00
2008-07-25 16:20:47 +00:00
<listitem><para>File duplicates are detected and removed
</para></listitem>
2004-05-24 20:08:55 +00:00
2008-07-25 16:20:47 +00:00
<listitem><para>Both big and little endian architectures are supported; SquashFS can
2004-03-02 14:33:32 +00:00
mount file systems created on different byte-order machines
2008-07-25 16:20:47 +00:00
</para></listitem>
2004-05-24 20:08:55 +00:00
</itemizedlist>
</sect2>
<sect2 id="makingclear">
<title>Making it clear</title>
<para>
2004-06-07 19:09:22 +00:00
Now let's make sure any further discussions will be clearer
2008-03-02 16:06:57 +00:00
for you to understand.
The procedure of getting SquashFS working basically
2004-06-07 19:09:22 +00:00
consists of the following steps:
2004-03-02 14:33:32 +00:00
</para>
2004-05-24 20:08:55 +00:00
<orderedlist>
2004-06-07 19:09:22 +00:00
2008-07-25 16:20:47 +00:00
<listitem><para>Patching and recompiling the target Linux kernel to enable SquashFS support
</para></listitem>
2004-05-24 20:08:55 +00:00
2008-07-25 16:20:47 +00:00
<listitem><para>Compiling the <command>mksquashfs </command> and the <command>unsquashfs </command> tools
</para></listitem>
2004-05-24 20:08:55 +00:00
2008-07-25 16:20:47 +00:00
<listitem><para>Creating a compressed file system with <command>mksquashfs</command>
</para></listitem>
2004-05-24 20:08:55 +00:00
2008-07-25 16:20:47 +00:00
<listitem><para>Testing: mounting a squashed file system to a temporary location
</para></listitem>
2004-05-24 20:08:55 +00:00
2008-07-25 16:20:47 +00:00
<listitem><para>Modifying the <filename>/etc/fstab </filename> or startup scripts of
2004-06-07 19:09:22 +00:00
your target Linux system to mount the new squashed file system when needed
2008-07-25 16:20:47 +00:00
</para></listitem>
2004-06-07 19:09:22 +00:00
2004-05-24 20:08:55 +00:00
</orderedlist>
</sect2>
2008-03-02 16:06:57 +00:00
</sect1>