aboutsummaryrefslogtreecommitdiffstats
path: root/chapter02/creatingfilesystem.xml
blob: f7c05250f8d741a4b1edffad542545aab2c4a6ba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
  "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
  <!ENTITY % general-entities SYSTEM "../general.ent">
  %general-entities;
]>

<sect1 id="space-creatingfilesystem">
  <?dbhtml filename="creatingfilesystem.html"?>

  <title>Creating a File System on the Partition</title>

  <para>Now that a blank partition has been set up, the file system can be created.
  The most widely-used system in the Linux world is the second extended file
  system (<systemitem class="filesystem">ext2</systemitem>), but with newer
  high-capacity hard disks, journaling file systems are becoming increasingly
  popular. The third extended filesystem (<systemitem
  class="filesystem">ext3</systemitem>) is a widely used enhancement to
  <systemitem class="filesystem">ext2</systemitem>, which adds journaling
  capabilities and is compatible with the E2fsprogs utilities.
  We will create an <systemitem class="filesystem">ext3</systemitem>
  file system. Instructions for creating other file systems can be found at
  <ulink url="&blfs-root;view/svn/postlfs/filesystems.html"/>.</para>

  <para>To create an <systemitem class="filesystem">ext3</systemitem> file
  system on the LFS partition, run the following:</para>

<screen role="nodump"><userinput>mke2fs -jv /dev/<replaceable>&lt;xxx&gt;</replaceable></userinput></screen>

  <para>Replace <replaceable>&lt;xxx&gt;</replaceable> with the name of the LFS
  partition (<filename class="devicefile">hda5</filename> in our previous
  example).</para>

  <note>
    <para>Some host distributions use custom features in their filesystem
    creation tools (E2fsprogs). This can cause problems when booting into your new
    LFS in Chapter 9, as those features will not be supported by the LFS-installed
    E2fsprogs; you will get an error similar to <quote>unsupported filesystem
    features, upgrade your e2fsprogs</quote>. To check if your host system
    uses custom enhancements, run the following command:</para>

<screen role="nodump"><userinput>debugfs -R feature /dev/<replaceable>&lt;xxx&gt;</replaceable></userinput></screen>

    <para>If the output contains features other than
    <option>has_journal</option>, <option>ext_attr</option>,
    <option>resize_inode</option>, <option>dir_index</option>,
    <option>filetype</option>, <option>sparse_super</option>,
    <option>large_file</option> or <option>needs_recovery</option>, then your
    host system may have custom enhancements.  In that case, to avoid later
    problems, you should compile the stock E2fsprogs package and use the
    resulting binaries to re-create the filesystem on your LFS partition:</para>

<screen role="nodump"><userinput>cd /tmp
tar -xzvf /path/to/sources/e2fsprogs-&e2fsprogs-version;.tar.gz
cd e2fsprogs-&e2fsprogs-version;
mkdir -v build
cd build
../configure
make #note that we intentionally don't 'make install' here!
./misc/mke2fs -jv /dev/<replaceable>&lt;xxx&gt;</replaceable>
cd /tmp
rm -rfv e2fsprogs-&e2fsprogs-version;</userinput></screen>
  </note>

  <para>If you are using an existing <systemitem class="filesystem">swap
  </systemitem> partition, there is no need to format it. If a new
  <systemitem class="filesystem"> swap</systemitem> partition was created,
  it will need to be initialized with this command:</para>

<screen role="nodump"><userinput>mkswap /dev/<replaceable>&lt;yyy&gt;</replaceable></userinput></screen>

  <para>Replace <replaceable>&lt;yyy&gt;</replaceable> with the name of the
  <systemitem class="filesystem">swap</systemitem> partition.</para>

</sect1>