mirror of https://github.com/tLDP/LDP
updated
This commit is contained in:
parent
478ea68245
commit
7945cac93b
|
@ -314,7 +314,7 @@ quota commands. </Para>
|
|||
SquashFS-HOWTO</ULink>,
|
||||
<CiteTitle>SquashFS HOWTO</CiteTitle>
|
||||
</Para><Para>
|
||||
<CiteTitle>Updated: May 2004</CiteTitle>.
|
||||
<CiteTitle>Updated: Jun 2004</CiteTitle>.
|
||||
Describes the usage of SquashFS - a highly-compressed
|
||||
file system for Linux, which is intended for use in tiny/embedded
|
||||
Linux systems, as well as for read-only archiving and general
|
||||
|
|
|
@ -4471,7 +4471,7 @@ describes some of the available software. </Para>
|
|||
SquashFS-HOWTO</ULink>,
|
||||
<CiteTitle>SquashFS HOWTO</CiteTitle>
|
||||
</Para><Para>
|
||||
<CiteTitle>Updated: May 2004</CiteTitle>.
|
||||
<CiteTitle>Updated: Jun 2004</CiteTitle>.
|
||||
Describes the usage of SquashFS - a highly-compressed
|
||||
file system for Linux, which is intended for use in tiny/embedded
|
||||
Linux systems, as well as for read-only archiving and general
|
||||
|
|
|
@ -942,7 +942,7 @@ been deleted. </Para>
|
|||
SquashFS-HOWTO</ULink>,
|
||||
<CiteTitle>SquashFS HOWTO</CiteTitle>
|
||||
</Para><Para>
|
||||
<CiteTitle>Updated: May 2004</CiteTitle>.
|
||||
<CiteTitle>Updated: Jun 2004</CiteTitle>.
|
||||
Describes the usage of SquashFS - a highly-compressed
|
||||
file system for Linux, which is intended for use in tiny/embedded
|
||||
Linux systems, as well as for read-only archiving and general
|
||||
|
|
|
@ -7,8 +7,7 @@
|
|||
<!ENTITY chapter2 SYSTEM "chapter2.xml">
|
||||
<!ENTITY chapter3 SYSTEM "chapter3.xml">
|
||||
<!ENTITY chapter4 SYSTEM "chapter4.xml">
|
||||
<!ENTITY acknowledgements SYSTEM "acknowledgements.xml">
|
||||
<!ENTITY license SYSTEM "license.xml">
|
||||
<!ENTITY chapter5 SYSTEM "chapter5.xml">
|
||||
|
||||
]>
|
||||
|
||||
|
@ -28,7 +27,7 @@
|
|||
</affiliation>
|
||||
</author>
|
||||
|
||||
<pubdate>2004-05-22</pubdate>
|
||||
<pubdate>2004-06-07</pubdate>
|
||||
|
||||
<keywordset>
|
||||
<keyword>linux</keyword>
|
||||
|
@ -46,10 +45,11 @@
|
|||
|
||||
<title>Abstract</title>
|
||||
|
||||
<para>This HOWTO describes the usage of SquashFS - a highly-compressed file system for Linux,
|
||||
which is intended for use in tiny/embedded Linux systems, as well as for read-only archiving and general
|
||||
in-file system compression. All steps needed to achieve the result of a mounted and up-and-running
|
||||
squashed file system are given.</para>
|
||||
<para>This HOWTO describes the usage of SquashFS - a highly-compressed
|
||||
read-only file system for Linux, which is intended for use in tiny-sized and
|
||||
embedded systems, and anywhere else you'd want to use a compressed file system.
|
||||
With this document, you'll learn how to prepare a SquashFS-ready
|
||||
Linux kernel, create a sqaushed file system and happily use it.</para>
|
||||
|
||||
</abstract>
|
||||
|
||||
|
@ -66,21 +66,30 @@
|
|||
</abstract>
|
||||
|
||||
<revhistory>
|
||||
|
||||
|
||||
<revision>
|
||||
<revnumber>1.1</revnumber>
|
||||
<date>2004-05-22</date>
|
||||
<revremark>Changes according to SquashFS release 1.3r3</revremark>
|
||||
</revision>
|
||||
|
||||
<revision>
|
||||
<revnumber>1.0</revnumber>
|
||||
<date>2004-02-19</date>
|
||||
<revremark>Initial Release, reviewed by LDP</revremark>
|
||||
<revnumber>1.5</revnumber>
|
||||
<date>2004-06-07</date>
|
||||
<revremark>Changes according to SquashFS release 2.0 alpha.
|
||||
Lots of description improvements and clarifications. Split
|
||||
instructions for Linux kernels of 2.6.x (new) and 2.4.x series.
|
||||
</revremark>
|
||||
</revision>
|
||||
|
||||
<revision>
|
||||
<revnumber>0.1.1</revnumber>
|
||||
<revnumber>1.1</revnumber>
|
||||
<date>2004-05-22</date>
|
||||
<revremark>Changes according to SquashFS release 1.3r3.</revremark>
|
||||
</revision>
|
||||
|
||||
<revision>
|
||||
<revnumber>1.0</revnumber>
|
||||
<date>2004-02-19</date>
|
||||
<revremark>Initial Release, reviewed by LDP.</revremark>
|
||||
</revision>
|
||||
|
||||
<revision>
|
||||
<revnumber>0.2</revnumber>
|
||||
<date>2003-12-08</date>
|
||||
<revremark>Text corrections, license added.</revremark>
|
||||
</revision>
|
||||
|
@ -88,7 +97,7 @@
|
|||
<revision>
|
||||
<revnumber>0.1</revnumber>
|
||||
<date>2003-11-24</date>
|
||||
<revremark>Initial version.</revremark>
|
||||
<revremark>Initial version. Instructions for SquashFS release 1.3r2.</revremark>
|
||||
</revision>
|
||||
|
||||
</revhistory>
|
||||
|
@ -99,7 +108,6 @@
|
|||
&chapter2;
|
||||
&chapter3;
|
||||
&chapter4;
|
||||
&acknowledgements;
|
||||
&license;
|
||||
&chapter5;
|
||||
|
||||
</article>
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
<?xml version = '1.0' encoding = 'ISO-8859-1' ?>
|
||||
|
||||
<sect1 id="whatis">
|
||||
|
||||
<title>What is SquashFS</title>
|
||||
|
@ -21,11 +22,17 @@ For archiving purposes, SquashFS gives you a lot more flexibility and performanc
|
|||
</para>
|
||||
|
||||
<para>
|
||||
|
||||
SquashFS is distributed as a Linux kernel source patch (which enables SquashFS read support in your kernel),
|
||||
and the <command>mksquashfs</command> tool, which creates squashed file systems (in a file or on a block device).
|
||||
</para>
|
||||
|
||||
<para>
|
||||
The latest SquashFS release tree is 2.x, the former one was 1.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: <emphasis>new value
|
||||
(2.x) or old value (1.x)</emphasis>
|
||||
</para>
|
||||
|
||||
</sect2>
|
||||
|
||||
<sect2 id="overview">
|
||||
|
@ -49,8 +56,13 @@ boundaries; each compressed inode is on average 8 bytes in length
|
|||
symbolic link, and block/character device inodes have different sizes)
|
||||
</listitem>
|
||||
|
||||
<listitem>SquashFS can use block sizes up to 32K, which achieves greater
|
||||
compression ratios than the normal 4K block size
|
||||
<listitem>SquashFS can use block sizes up to 32 Kb (1.x) and 64Kb (2.x), which achieves
|
||||
greater compression ratios than the normal 4K block size
|
||||
</listitem>
|
||||
|
||||
<listitem>SquashFS 2.x inroduced the concept of <emphasis>fragment blocks</emphasis>:
|
||||
an ability to join multiple files smaller than block size into a single
|
||||
block, achieving greater compression ratios
|
||||
</listitem>
|
||||
|
||||
<listitem>File duplicates are detected and removed
|
||||
|
@ -69,11 +81,15 @@ mount file systems created on different byte-order machines
|
|||
<title>Making it clear</title>
|
||||
|
||||
<para>
|
||||
To make further chapters clear, the basic steps of getting SquashFS working that we will discuss are:
|
||||
Now let's make sure any further discussions will be clearer
|
||||
fro you to understand.
|
||||
The procedure of getting SquashFS working, basically,
|
||||
consists of the following steps:
|
||||
</para>
|
||||
|
||||
<orderedlist>
|
||||
<listitem>Patching and recompiling the Linux kernel to enable SquashFS support
|
||||
|
||||
<listitem>Patching and recompiling the target Linux kernel to enable SquashFS support
|
||||
</listitem>
|
||||
|
||||
<listitem>Compiling the <command>mksquashfs</command> tool
|
||||
|
@ -85,10 +101,12 @@ To make further chapters clear, the basic steps of getting SquashFS working that
|
|||
<listitem>Testing: mounting a squashed file system to a temporary location
|
||||
</listitem>
|
||||
|
||||
<listitem>Modifying the fstab or startup scripts of your Linux system to mount the squashed file system at boot time
|
||||
<listitem>Modifying the <filename>/etc/fstab</filename> or startup scripts of
|
||||
your target Linux system to mount the new squashed file system when needed
|
||||
</listitem>
|
||||
|
||||
</orderedlist>
|
||||
|
||||
</sect2>
|
||||
|
||||
</sect1>
|
||||
</sect1>
|
|
@ -1,43 +1,54 @@
|
|||
<?xml version='1.0' encoding='ISO-8859-1'?>
|
||||
|
||||
<sect1 id="gettingready">
|
||||
|
||||
<title>Getting ready for SquashFS</title>
|
||||
|
||||
<sect2 id="acquiring">
|
||||
|
||||
<title>Acquiring SquashFS</title>
|
||||
|
||||
<para>
|
||||
The SquashFS home site is located at <ulink url="http://squashfs.sourceforge.net/">http://squashfs.sourceforge.net/</ulink>
|
||||
- it contains latest release and it's changelog, as well as general information about SquashFS.
|
||||
You can grab the latest version at the SqaushFS
|
||||
The SquashFS home site is located at
|
||||
<ulink url="http://squashfs.sourceforge.net/">http://squashfs.sourceforge.net/</ulink>
|
||||
- it contains news for the latest release and it's changelog, as well as general information
|
||||
about SquashFS. You can grab the latest version at the SqaushFS
|
||||
<ulink url="http://sourceforge.net/project/showfiles.php?group_id=63835">project page</ulink>
|
||||
at SourceForge.
|
||||
</para>
|
||||
|
||||
</sect2>
|
||||
|
||||
|
||||
<sect2 id="preparing">
|
||||
|
||||
<title>Preparing a SquashFS-capable kernel</title>
|
||||
|
||||
<para>
|
||||
In order to read SquashFS, you need it supported in your kernel - just as if it was a <filename>reiserfs</filename>
|
||||
or <filename>ext3</filename> file system. You have to make sure there is an appropriate patch for your kernel version - it should be located in
|
||||
<filename>linux-2.x.y</filename> subdirectory of the SquashFS source tree. Also, remember that in most cases you will need a
|
||||
<emphasis>clean</emphasis> (original) Linux kernel source from <ulink url="http://kernel.org/">kernel.org</ulink>. If your
|
||||
kernel source is from a distro vendor, it may be already pre-patched with custom vendor patches, and patching with a SquashFS patch
|
||||
may raise errors, as SquashFS patches are made against <emphasis>original</emphasis> Linux kernels.
|
||||
In order to read SquashFS, you need it supported in your kernel - just as if it was a
|
||||
<filename>reiserfs</filename> or <filename>ext3</filename> file system. You have to make sure
|
||||
there is an appropriate patch for your kernel version - it should be located in
|
||||
<filename>linux-2.x.y</filename> subdirectory of the SquashFS source tree. Also, remember
|
||||
that in most cases you will need a <emphasis>clean</emphasis> (original) Linux kernel
|
||||
source from <ulink url="http://kernel.org/">kernel.org</ulink>. If your kernel source is
|
||||
from a distro vendor, it may be already pre-patched with custom vendor patches, and patching
|
||||
with a SquashFS patch will almost surely not work, as SquashFS patches are made against
|
||||
<emphasis>original</emphasis> Linux kernels.
|
||||
</para>
|
||||
|
||||
<sect3 id="patching">
|
||||
|
||||
<title>Patching the kernel source</title>
|
||||
|
||||
<para>
|
||||
With the 2.x.y kernel source and a proper 2.x.y SquashFS patch present, all you have to do is (we'll assume that
|
||||
you have your Linux kernel source in <filename>/usr/src/linux</filename> and that you have the SquashFS source in
|
||||
<filename>/usr/src/squashfs</filename>):
|
||||
With a kernel source and a proper SquashFS patch present, all you have to do is
|
||||
(we'll assume that you have your Linux kernel source in <filename>/usr/src/linux</filename> and
|
||||
that you have the SquashFS source in <filename>/usr/src/squashfs</filename>):
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Change to the SquashFS source directory and
|
||||
copy the kernel patch (we'll assume it's named <filename>squashfs-patch</filename>) to <filename>/usr/src/linux</filename>.
|
||||
copy the kernel patch (we'll assume it's named <filename>squashfs-patch</filename>) to
|
||||
<filename>/usr/src/linux</filename>.
|
||||
</para>
|
||||
|
||||
<programlisting>
|
||||
|
@ -46,47 +57,154 @@ copy the kernel patch (we'll assume it's named <filename>squashfs-patch</filenam
|
|||
</programlisting>
|
||||
|
||||
<para>
|
||||
Go into the directory <filename>/usr/src/linux</filename>:
|
||||
Go to the linux kernel source directory <filename>/usr/src/linux</filename>:
|
||||
</para>
|
||||
|
||||
<programlisting>
|
||||
bash# cd /usr/src/linux
|
||||
</programlisting>
|
||||
|
||||
<para>Patch the Linux kernel:</para>
|
||||
<para><emphasis>Note:</emphasis> please remember that we will not be leaving this
|
||||
directory during all further kernel-related procedures, and all paths
|
||||
will be given relative to <filename>/usr/src/linux</filename>.</para>
|
||||
|
||||
<para>Now patch the source with the SquashFS patch:</para>
|
||||
|
||||
<programlisting>
|
||||
bash# patch -p1 < squashfs-patch
|
||||
</programlisting>
|
||||
|
||||
<para>Configure your kernel:</para>
|
||||
</sect3>
|
||||
|
||||
<sect3 id="2.6.x">
|
||||
|
||||
<title>Compiling a 2.6.x kernel</title>
|
||||
|
||||
<para>Cleanup and prepare the kernel source:</para>
|
||||
|
||||
<programlisting>
|
||||
bash# make distclean
|
||||
bash# make mrproper
|
||||
</programlisting>
|
||||
|
||||
<para>Configure the kernel using your favourite method
|
||||
(config/menuconfig/xconfig/gconfig):</para>
|
||||
|
||||
<programlisting>
|
||||
bash# make menuconfig
|
||||
</programlisting>
|
||||
|
||||
<para>In the <quote><emphasis>File systems</emphasis></quote> section, make sure you enable <quote><emphasis>Squashed filesystem</emphasis></quote>,
|
||||
whether as module or bundled with kernel (it is only obligatory to compile SquashFS inside the kernel
|
||||
if you plan using squashed initial ramdisks). If you want to be able to mount the squashed file system via a <emphasis>loopback device</emphasis> in future, you should
|
||||
enable <quote><emphasis>Loopback device support</emphasis></quote> in the <quote><emphasis>Block devices</emphasis></quote> section.
|
||||
</para>
|
||||
<orderedlist>
|
||||
|
||||
<listitem>
|
||||
In the <quote><emphasis>File systems</emphasis></quote> section,
|
||||
<quote><emphasis>Miscellaneous file systems</emphasis></quote> subsection, enable
|
||||
the <quote><emphasis>Squashed filesystem</emphasis></quote> option, whether as
|
||||
module or bundled with the kernel. It is only obligatory to compile SquashFS inside
|
||||
the kernel if you plan using squashed initial RAM disks (<command>initrd</command>).
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
If you would like to use a squashed initial RAM disk, enable the
|
||||
<quote><emphasis>Initial RAM disk support</emphasis></quote> in the <quote><emphasis>Device
|
||||
drivets</emphasis></quote> section, <quote><emphasis>Block
|
||||
devices</emphasis></quote> subsection.
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
If you want to be able to mount the squashed file system via a <emphasis>loopback
|
||||
device</emphasis> in future, you should enable <quote><emphasis>Loopback device
|
||||
support</emphasis></quote> in the <quote><emphasis>Device
|
||||
drivers</emphasis></quote> section, <quote><emphasis>Block devices</emphasis></quote>
|
||||
subsection.
|
||||
</listitem>
|
||||
|
||||
</orderedlist>
|
||||
|
||||
<para>Now you may compile the kernel and modules:</para>
|
||||
|
||||
<programlisting>
|
||||
bash# make dep && make bzImage && make modules && make modules_install
|
||||
bash# make
|
||||
</programlisting>
|
||||
|
||||
<para>Install your new kernel (name it <filename>bzImage-sqsh</filename>
|
||||
for convenience, if you like):</para>
|
||||
</sect3>
|
||||
|
||||
<sect3 id="2.4.x">
|
||||
|
||||
<title>Compiling a 2.4.x kernel</title>
|
||||
|
||||
<para>Configure the kernel:</para>
|
||||
|
||||
<programlisting>
|
||||
bash# make menuconfig
|
||||
</programlisting>
|
||||
|
||||
<orderedlist>
|
||||
|
||||
<listitem>
|
||||
In the <quote><emphasis>File systems</emphasis></quote> section, enable
|
||||
the <quote><emphasis>Squashed filesystem</emphasis></quote> option, whether as
|
||||
module or bundled with the kernel. It is only obligatory to compile SquashFS inside
|
||||
the kernel if you plan using squashed initial RAM disks (<command>initrd</command>).
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
If you would like to use a squashed initial RAM disk, enable the
|
||||
<quote><emphasis>Initial RAM disk support</emphasis></quote> in the <quote><emphasis>Block
|
||||
devices</emphasis></quote> section.
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
If you want to be able to mount the squashed file system via a <emphasis>loopback
|
||||
device</emphasis> in future, you should enable <quote><emphasis>Loopback device
|
||||
support</emphasis></quote> in the <quote><emphasis>Block devices</emphasis></quote> section.
|
||||
</listitem>
|
||||
|
||||
</orderedlist>
|
||||
|
||||
<para>Now you may compile the kernel and modules:</para>
|
||||
|
||||
<programlisting>
|
||||
bash# make dep
|
||||
bash# make bzImage
|
||||
bash# make modules
|
||||
</programlisting>
|
||||
|
||||
</sect3>
|
||||
|
||||
<sect3 id="installkernel">
|
||||
|
||||
<title>Installing and testing the kernel</title>
|
||||
|
||||
<para>It's time to install your new SquashFS-enabled kernel.
|
||||
The instructions below are for installing and booting the kernel
|
||||
on the host machine. You may want to install and test it on the
|
||||
target system.
|
||||
</para>
|
||||
|
||||
<para>We assume that the kernel was compiled for a x86
|
||||
architecture, and the compressed kernel image is located in the
|
||||
<filename>arch/i386/boot/</filename> subdirectory of the kernel tree.
|
||||
Now copy the kernel to the <filename>/boot</filename> directory (and name it
|
||||
<filename>bzImage-sqsh</filename> for convenience, if you like):</para>
|
||||
|
||||
<programlisting>
|
||||
bash# cp arch/i386/boot/bzImage /boot/bzImage-sqsh
|
||||
</programlisting>
|
||||
|
||||
<para>
|
||||
Modify your boot loader's configuration file to include your new kernel and install the boot loader.
|
||||
Now you may reboot with your new kernel. When it boots, check that everything went fine:
|
||||
Don't forget to install the kernel modules
|
||||
if you have any:
|
||||
</para>
|
||||
|
||||
<programlisting>
|
||||
bash# make modules_install
|
||||
</programlisting>
|
||||
|
||||
<para>
|
||||
Modify your boot loader's configuration file to include your new kernel and install
|
||||
(update) the boot loader. Now you may reboot with your new kernel. When it boots, check that
|
||||
everything went fine:
|
||||
</para>
|
||||
|
||||
<programlisting>
|
||||
|
@ -103,14 +221,17 @@ Or, if you built SquashFS support as a kernel module:
|
|||
</programlisting>
|
||||
|
||||
<para>
|
||||
You should see the <computeroutput>squashfs</computeroutput> line among other file systems. This means you have successfully enabled SquashFS in your kernel.
|
||||
If you see the <computeroutput>squashfs</computeroutput> line among other file systems,
|
||||
this means you have successfully enabled SquashFS in your kernel.
|
||||
</para>
|
||||
|
||||
</sect3>
|
||||
|
||||
</sect2>
|
||||
|
||||
|
||||
<sect2 id="mksquashfs">
|
||||
<title>Compiling <command>mksquashfs</command></title>
|
||||
|
||||
<title>Compiling the <command>mksquashfs</command> tool</title>
|
||||
|
||||
<para>
|
||||
Now you need to compile <command>mksquashfs</command> - the tool for creating squashed file systems.
|
||||
|
@ -135,4 +256,4 @@ If everything went fine, typing <command>mksquashfs</command> at the shell promp
|
|||
|
||||
</sect2>
|
||||
|
||||
</sect1>
|
||||
</sect1>
|
|
@ -1,58 +1,92 @@
|
|||
<?xml version='1.0' encoding='ISO-8859-1'?>
|
||||
|
||||
<sect1 id="mksqoverview">
|
||||
<title>Overview of mksquashfs</title>
|
||||
|
||||
<title>The mksquashfs tool, exposed</title>
|
||||
|
||||
<sect2 id="mksqusing">
|
||||
|
||||
<title>Using mksquashfs</title>
|
||||
|
||||
<para>
|
||||
The <command>mksquashfs</command> tool can be used for creating new squashed file systems, as
|
||||
well as for appending new data to existing squashed file systems.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
The general format for <command>mksquashfs</command> from the command-line is:
|
||||
<command>mksquashfs</command> is the tool for creating new squashed
|
||||
file systems, and for appending new data to existing squashed file
|
||||
systems. The general command-line format for <command>mksquashfs</command> is:
|
||||
</para>
|
||||
|
||||
<programlisting>
|
||||
bash# mksquashfs source1 source2 ... destination [options]
|
||||
</programlisting>
|
||||
|
||||
<para>
|
||||
<emphasis>source</emphasis> items can be files and directories with mixed relative/absolute paths;
|
||||
<emphasis>destination</emphasis> can be regular files (thus, you will have a file system image on
|
||||
your disk), or a block device, such as <filename>/dev/fd0</filename> or <filename>/dev/hda3</filename>.
|
||||
</para>
|
||||
<itemizedlist>
|
||||
|
||||
<listitem><filename>source1</filename>, <filename>source2</filename>, etc.: files and directories to be
|
||||
added to the resulting filke system, given with relative and/or absolute paths
|
||||
</listitem>
|
||||
|
||||
<listitem><filename>destination</filename>: a regular file (filesystem
|
||||
image file), or a block device (such as <filename>/dev/fd0</filename> or <filename>/dev/hda3</filename>)
|
||||
where you want to have your squashed file system
|
||||
</listitem>
|
||||
|
||||
</itemizedlist>
|
||||
|
||||
<para>
|
||||
|
||||
Notes for default <command>mksquashfs</command> behavior:
|
||||
|
||||
<itemizedlist>
|
||||
|
||||
<listitem>
|
||||
When the new files are added to the new file system or appended to an existing one,
|
||||
<command>mksquashfs</command> will automatically rename files with duplicate names:
|
||||
if two or more files named <filename>text</filename> will appear in the same
|
||||
resulting directory, the second file will be renamed to
|
||||
<filename>text_1</filename>, third one to <filename>text_2</filename> and so on.
|
||||
Additionally, duplicate files will be removed, so there will be only one physical instance.
|
||||
</para>
|
||||
</listitem>
|
||||
|
||||
<para>
|
||||
<listitem>
|
||||
Duplicate files will be removed, so there will be only one physical instance
|
||||
(with SquashFS 2.x, you can disable the detection/rtemoval of the duplicates
|
||||
with the <command>-no-duplicates</command> option).
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
If <emphasis>destination</emphasis> has a pre-existing SquashFS
|
||||
file system on it, by default, the new <emphasis>source</emphasis> items will be appended to existing root directory.
|
||||
Examine the options table below to force <command>mksquashfs</command> to overwrite the whole destination
|
||||
and/or change the way new source items are added.
|
||||
</para>
|
||||
file system on it, by default, the new <emphasis>source</emphasis> items will be appended to
|
||||
the existing root directory. Examine the options table below to force <command>mksquashfs</command> to overwrite the whole destination
|
||||
and/or change the way new source items are added. Please note that it is not possible to
|
||||
append to a file system created with <command>mksquashfs</command> 1.x using
|
||||
<command>mksquashfs</command> 2.x. You will need to mount the SquashFS-1.x file system
|
||||
and copy the files to some location, and then join them with other needed files
|
||||
to create a SquashFS-2.x file system.
|
||||
</listitem>
|
||||
|
||||
<para>
|
||||
<listitem>
|
||||
If a single source file or directory is given, it becomes the root in a newly created file system. If two
|
||||
or more source files and/or directories are given, they will all become sub-items in the root of
|
||||
the new file system.
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
The resulting filesystem will be padded to a multiple of 4 Kb: this
|
||||
is required for filesystems to be used on block devices. If you are very sure
|
||||
you don't ned this, use the <command>-nopad</command> option to disable this
|
||||
operation.
|
||||
</listitem>
|
||||
|
||||
</itemizedlist>
|
||||
|
||||
</para>
|
||||
|
||||
<para>
|
||||
See the next section for more details about <command>mksquashfs</command> options.
|
||||
See the next section for more details about all possible options.
|
||||
</para>
|
||||
|
||||
</sect2>
|
||||
|
||||
<sect2 id="mksqoptions">
|
||||
|
||||
<title>Command-line options</title>
|
||||
|
||||
<para>
|
||||
|
@ -61,7 +95,7 @@ All possible options for <command>mksquashfs</command> are shown in the table be
|
|||
|
||||
<table frame="all">
|
||||
|
||||
<title><command>mksquashfs</command> command-line options</title>
|
||||
<title>Command-line options of the <command>mksquashfs</command> tool</title>
|
||||
|
||||
<tgroup cols="2">
|
||||
|
||||
|
@ -75,35 +109,9 @@ All possible options for <command>mksquashfs</command> are shown in the table be
|
|||
<tbody>
|
||||
|
||||
<row>
|
||||
<entry><command>-info</command></entry>
|
||||
<entry>print files, their original size and compression ratio, as they are added to the file system</entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry><command>-version</command></entry>
|
||||
<entry>print the version, copyright and licence message</entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry><command>-e <files/directories to exclude></command></entry>
|
||||
<entry>specify which files and/or directories to omit
|
||||
from the new file system that is to be created</entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry><command>-ef <file></command></entry>
|
||||
<entry>specify a <filename>file</filename> which contains the list of
|
||||
files/directories to exclude</entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry><command>-noI</command> or <command>-noInodeCompression</command></entry>
|
||||
<entry>do not compress the inode table</entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry><command>-noD</command> or <command>-noDataCompression</command></entry>
|
||||
<entry>do not compress the data</entry>
|
||||
<entry><command>-always-use-fragments</command></entry>
|
||||
<entry>divide all files greater than block size into fragments (2.x only,
|
||||
will result in greater compression ratios)</entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
|
@ -111,11 +119,6 @@ files/directories to exclude</entry>
|
|||
<entry>use [block size] filesystem block size (32 Kbytes default) - this can be either 512, 1024, 2048, 4096, 8192, 16384 or 32768</entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry><command>-nopad</command></entry>
|
||||
<entry>do not pad the resulting file system to a multiple of 4 KBytes</entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry><command>-be</command> or <command>-le</command></entry>
|
||||
<entry>force a big or little endian file system, respectively</entry>
|
||||
|
@ -126,22 +129,80 @@ files/directories to exclude</entry>
|
|||
<entry>enable additional file system checks</entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry><command>-e [file1] ( [file2] ... )</command></entry>
|
||||
<entry>specify which files and/or directories to omit
|
||||
from the new file system that is to be created</entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry><command>-ef [file]</command></entry>
|
||||
<entry>specify a <filename>file</filename> which contains the list of
|
||||
files/directories to exclude</entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry><command>-info</command></entry>
|
||||
<entry>print files, their original size and compression ratio, as they are added to
|
||||
the file system</entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry><command>-keep-as-directory</command></entry>
|
||||
<entry>if the source is a single directory, force this directory to be a subdirectory of the root in the created file system</entry>
|
||||
<entry>if the source is a single directory, force this directory to be a subdirectory
|
||||
of the root in the created file system</entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry><command>-noappend</command></entry>
|
||||
<entry>if the destination file/device already contains a squashed file system, overwrite it, rather than append the new data to an existing file system.</entry>
|
||||
<entry>if the destination file/device already contains a squashed file system,
|
||||
overwrite it, rather than append the new data to an existing file system</entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry><command>-no-duplicates</command></entry>
|
||||
<entry>do not detect/remove duplicate file names</entry>
|
||||
</row>
|
||||
|
||||
|
||||
<row>
|
||||
<entry><command>-noD</command> or <command>-noDataCompression</command></entry>
|
||||
<entry>do not compress the data</entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry><command>-noF</command> or <command>-noFragmentCompression</command></entry>
|
||||
<entry>do not compress the fragments (2.x only)</entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry><command>-no-fragments</command></entry>
|
||||
<entry>do not generate fragment blocks (2.x only, this will
|
||||
produce almost the same filesystem as 1.x did)</entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry><command>-noI</command> or <command>-noInodeCompression</command></entry>
|
||||
<entry>do not compress the inode table</entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry><command>-nopad</command></entry>
|
||||
<entry>do not pad the resulting file system to a multiple of 4 KBytes</entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry><command>-root-becomes [name]</command></entry>
|
||||
<entry>can be used while appending to a pre-existing squashed file system, it will make a new root, and [name] directory will contain all pre-existing files/directories.
|
||||
<entry>can be used while appending to a pre-existing squashed file system: it will make a new root,
|
||||
and [name] directory will contain all pre-existing files/directories
|
||||
</entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry><command>-version</command></entry>
|
||||
<entry>print the version, copyright and license message</entry>
|
||||
</row>
|
||||
|
||||
</tbody>
|
||||
|
||||
</tgroup>
|
||||
|
@ -149,10 +210,10 @@ files/directories to exclude</entry>
|
|||
</table>
|
||||
|
||||
<para>
|
||||
In most cases, you should leave all compression/block options by default, as they allow <command>mksquashfs</command> to achieve
|
||||
the best possible compression ratios.
|
||||
In most cases, you should leave all compression/block options by default, as they allow
|
||||
<command>mksquashfs</command> to achieve the best possible compression ratios.
|
||||
</para>
|
||||
|
||||
</sect2>
|
||||
|
||||
</sect1>
|
||||
</sect1>
|
|
@ -1,4 +1,5 @@
|
|||
<?xml version='1.0' encoding='ISO-8859-1'?>
|
||||
|
||||
<sect1 id="creatingandusing">
|
||||
|
||||
<title>Creating and using squashed file systems</title>
|
||||
|
@ -7,8 +8,9 @@
|
|||
<title>Basic steps</title>
|
||||
|
||||
<para>
|
||||
In order to squash a directory (say, <filename>/some/dir</filename>), and output to a regular file (thus,
|
||||
producing a file system image), you need to perform the following operations:
|
||||
In order to create a squashed file system out of a single directory
|
||||
(say, <filename>/some/dir</filename>), and output it to a regular file
|
||||
(thus, producing a file system image), you need to say only one magic phrase:
|
||||
</para>
|
||||
|
||||
<programlisting>
|
||||
|
@ -16,10 +18,11 @@ producing a file system image), you need to perform the following operations:
|
|||
</programlisting>
|
||||
|
||||
<para>
|
||||
<command>mksquashfs</command> will perform the squashing and print the resulting number of inodes and size of data
|
||||
written, as well as the average compression ratio. Now you have your <filename>/some/dir</filename> directory image in the
|
||||
<filename>dir.sqsh</filename> file. You can now use the <command>mount</command> command to mount it using a
|
||||
loopback device:
|
||||
<command>mksquashfs</command> will perform the squashing and print the resulting
|
||||
number of inodes and size of data written, as well as the average compression ratio.
|
||||
Now you have your <filename>/some/dir</filename> directory image in the
|
||||
<filename>dir.sqsh</filename> file. You can now use the <command>mount</command> command
|
||||
to mount it using a loopback device:
|
||||
</para>
|
||||
|
||||
<programlisting>
|
||||
|
@ -36,11 +39,12 @@ To check if you have what's expected:
|
|||
</programlisting>
|
||||
|
||||
<para>
|
||||
If you want to output the file system directly into a device (say, your floppy at <filename>/dev/fd0</filename>):
|
||||
If you want to output the file system directly into a device (say, your floppy at
|
||||
<filename>/dev/fd0</filename>):
|
||||
</para>
|
||||
|
||||
<programlisting>
|
||||
#bash mksquashfs /some/dir /dev/fd0
|
||||
bash# mksquashfs /some/dir /dev/fd0
|
||||
</programlisting>
|
||||
|
||||
<para>
|
||||
|
@ -63,12 +67,14 @@ And check if it's okay:
|
|||
|
||||
|
||||
<sect2 id="squashing">
|
||||
|
||||
<title>Squashing file systems</title>
|
||||
|
||||
<para>
|
||||
Operations described here correspond to most cases where a read-only compressed file system can be used,
|
||||
whether you want it to be on a block device or in a file. This could be anything from large FTP/HTTP-served
|
||||
archives that don't change often, to having a squashed <filename>/usr</filename> partition and anything alike
|
||||
Operations described here correspond to most cases where a read-only compressed file
|
||||
system can be used, whether you want it to be on a block device or in a file. This
|
||||
could be anything from large FTP/HTTP-served archives that don't change often, to
|
||||
having a squashed <filename>/usr</filename> partition and anything alike
|
||||
with these.
|
||||
</para>
|
||||
|
||||
|
@ -122,6 +128,7 @@ Now just ensure that everything works fine:
|
|||
</sect3>
|
||||
|
||||
<sect3 id="squashing-ex2">
|
||||
|
||||
<title>Example 2</title>
|
||||
|
||||
<para>
|
||||
|
@ -187,8 +194,8 @@ Don't forget to erase the unneeded file system image:
|
|||
|
||||
</sect2>
|
||||
|
||||
|
||||
<sect2 id="tinyemb">
|
||||
|
||||
<title>Creating tiny/embedded systems</title>
|
||||
|
||||
<para>
|
||||
|
@ -276,38 +283,38 @@ transfer the <filename>usr</filename> file system:
|
|||
<title>Squashed file systems on CD-ROMs</title>
|
||||
|
||||
<para>
|
||||
With SquashFS, it is easily possible to squash a full Linux distro complete with XFree86,
|
||||
your favorite desktop manager and other applications onto a single CD-ROM disk. Even
|
||||
a 3.5" CD distro can have all this included.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
When following your usual steps for creating a live Linux CD, don't forget to:
|
||||
With SquashFS, you can compress large file systems that
|
||||
will be used in live CDs (just as an example).
|
||||
</para>
|
||||
|
||||
<orderedlist>
|
||||
|
||||
<listitem><para>
|
||||
Enable SquashFS in your kernel
|
||||
</para></listitem>
|
||||
<listitem>
|
||||
Enable SquashFS in the linux kernel of the target system
|
||||
</listitem>
|
||||
|
||||
<listitem><para>
|
||||
Create a squashed root file system (read the note below)
|
||||
</para></listitem>
|
||||
<listitem>
|
||||
Create a squashed root file system
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
Modify the <filename>/etc/fstab</filename> or startup scripts of the target system
|
||||
to mount the squashd file system when you need it
|
||||
</listitem>
|
||||
|
||||
</orderedlist>
|
||||
|
||||
<para>
|
||||
<emphasis>Note</emphasis>: if you create a root file system out of a running Linux system,
|
||||
use the <command>-e</command> option for <command>mksquashfs</command> to exclude
|
||||
the <filename>/proc</filename> file system and the file system image itself that is
|
||||
being created with <command>mksquashfs</command> (I think you know the reasons
|
||||
for these exclusions). What you would use is:
|
||||
</para>
|
||||
|
||||
<programlisting>
|
||||
bash# mksquashfs / /tmp/root.sqsh -e /proc /tmp/root.sqsh
|
||||
</programlisting>
|
||||
If you create a root file system out of a running Linux system,
|
||||
use the <command>-e</command> option for <command>mksquashfs</command> to exclude
|
||||
all pseudo-filesystems such as <filename>/proc</filename>, <filename>/sys</filename>
|
||||
(on linux kernels after 2.5.x) and <filename>/dev</filename>
|
||||
(when using DevFS). Also, don't forget to add the file system image itself that is
|
||||
being created with <command>mksquashfs</command> (I think you know the reasons
|
||||
for these exclusions).
|
||||
|
||||
</para>
|
||||
|
||||
</sect3>
|
||||
|
||||
|
|
Loading…
Reference in New Issue