1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
---|
3 | "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
---|
4 | <!ENTITY % general-entities SYSTEM "../general.ent">
|
---|
5 | %general-entities;
|
---|
6 | ]>
|
---|
7 |
|
---|
8 | <sect1 id="space-creatingfilesystem">
|
---|
9 | <?dbhtml filename="creatingfilesystem.html"?>
|
---|
10 |
|
---|
11 | <title>Creating a File System on the Partition</title>
|
---|
12 |
|
---|
13 | <para>Now that a blank partition has been set up, the file system can be
|
---|
14 | created. LFS can use any file system recognized by the Linux kernel, but the
|
---|
15 | most common types are ext3 and ext4. The choice of file system can be
|
---|
16 | complex and depends on the characteristics of the files and the size of
|
---|
17 | the partition. For example:</para>
|
---|
18 |
|
---|
19 | <variablelist>
|
---|
20 | <varlistentry>
|
---|
21 | <term>ext2</term>
|
---|
22 | <listitem><para>is suitable for small partitions that are updated infrequently
|
---|
23 | such as /boot.</para>
|
---|
24 | </listitem>
|
---|
25 | </varlistentry>
|
---|
26 | <varlistentry>
|
---|
27 | <term>ext3</term>
|
---|
28 | <listitem><para>is an upgrade to ext2 that includes a journal
|
---|
29 | to help recover the partition's status in the case of an unclean
|
---|
30 | shutdown. It is commonly used as a general purpose file system.
|
---|
31 | </para>
|
---|
32 | </listitem>
|
---|
33 | </varlistentry>
|
---|
34 | <varlistentry>
|
---|
35 | <term>ext4</term>
|
---|
36 | <listitem><para>is the latest version of the ext file system family of
|
---|
37 | partition types. It provides several new capabilities including
|
---|
38 | nano-second timestamps, creation and use of very large files (16 TB), and
|
---|
39 | speed improvements.</para>
|
---|
40 | </listitem>
|
---|
41 | </varlistentry>
|
---|
42 | </variablelist>
|
---|
43 |
|
---|
44 | <para>Other file sytems, including FAT32, NTFS, ReiserFS, JFS, and XFS are
|
---|
45 | useful for specialized purposes. More information about these file systems
|
---|
46 | can be found at <ulink
|
---|
47 | url="http://en.wikipedia.org/wiki/Comparison_of_file_systems"/>.</para>
|
---|
48 |
|
---|
49 | <para>LFS assumes that the root file system (/) is of type ext4. To create
|
---|
50 | an <systemitem class="filesystem">ext4</systemitem> file system on the LFS
|
---|
51 | partition, run the following:</para>
|
---|
52 |
|
---|
53 | <screen role="nodump"><userinput>mkfs -v -t ext4 /dev/<replaceable><xxx></replaceable></userinput></screen>
|
---|
54 |
|
---|
55 | <!--
|
---|
56 | <para>Replace <replaceable><xxx></replaceable> with the name of the LFS
|
---|
57 | partition (<filename class="devicefile">sda5</filename> in our previous
|
---|
58 | example).</para>
|
---|
59 |
|
---|
60 | <note>
|
---|
61 | <para>Some host distributions use custom features in their filesystem
|
---|
62 | creation tools (E2fsprogs). This can cause problems when booting into your new
|
---|
63 | LFS in Chapter 9, as those features will not be supported by the LFS-installed
|
---|
64 | E2fsprogs; you will get an error similar to <quote>unsupported filesystem
|
---|
65 | features, upgrade your e2fsprogs</quote>. To check if your host system
|
---|
66 | uses custom enhancements, run the following command:</para>
|
---|
67 |
|
---|
68 | <screen role="nodump"><userinput>debugfs -R feature /dev/<replaceable><xxx></replaceable></userinput></screen>
|
---|
69 |
|
---|
70 | <para>If the output contains features other than
|
---|
71 | <option>has_journal</option>, <option>ext_attr</option>,
|
---|
72 | <option>resize_inode</option>, <option>dir_index</option>,
|
---|
73 | <option>filetype</option>, <option>sparse_super</option>,
|
---|
74 | <option>large_file</option> or <option>needs_recovery</option>, then your
|
---|
75 | host system may have custom enhancements. In that case, to avoid later
|
---|
76 | problems, you should compile the stock E2fsprogs package and use the
|
---|
77 | resulting binaries to re-create the filesystem on your LFS partition:</para>
|
---|
78 |
|
---|
79 | <screen role="nodump"><userinput>cd /tmp
|
---|
80 | tar -xzvf /path/to/sources/e2fsprogs-&e2fsprogs-version;.tar.gz
|
---|
81 | cd e2fsprogs-&e2fsprogs-version;
|
---|
82 | mkdir -v build
|
---|
83 | cd build
|
---|
84 | ../configure
|
---|
85 | make #note that we intentionally don't 'make install' here!
|
---|
86 | ./misc/mke2fs -jv /dev/<replaceable><xxx></replaceable>
|
---|
87 | cd /tmp
|
---|
88 | rm -rfv e2fsprogs-&e2fsprogs-version;</userinput></screen>
|
---|
89 | </note>
|
---|
90 | -->
|
---|
91 | <para>If you are using an existing <systemitem class="filesystem">swap
|
---|
92 | </systemitem> partition, there is no need to format it. If a new
|
---|
93 | <systemitem class="filesystem"> swap</systemitem> partition was created,
|
---|
94 | it will need to be initialized with this command:</para>
|
---|
95 |
|
---|
96 | <screen role="nodump"><userinput>mkswap /dev/<replaceable><yyy></replaceable></userinput></screen>
|
---|
97 |
|
---|
98 | <para>Replace <replaceable><yyy></replaceable> with the name of the
|
---|
99 | <systemitem class="filesystem">swap</systemitem> partition.</para>
|
---|
100 |
|
---|
101 | </sect1>
|
---|