creatingfilesystem.xml 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <?xml version="1.0" encoding="ISO-8859-1"?>
  2. <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
  3. "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
  4. <!ENTITY % general-entities SYSTEM "../general.ent">
  5. %general-entities;
  6. ]>
  7. <sect1 id="space-creatingfilesystem">
  8. <?dbhtml filename="creatingfilesystem.html"?>
  9. <title>Creating a File System on the Partition</title>
  10. <para>Now that a blank partition has been set up, the file system can be created.
  11. The most widely-used system in the Linux world is the second extended file
  12. system (<systemitem class="filesystem">ext2</systemitem>), but with newer
  13. high-capacity hard disks, journaling file systems are becoming increasingly
  14. popular. The third extended filesystem (<systemitem class="filesystem">ext3
  15. </systemitem>) is a widely-used development of <systemitem class="filesystem">
  16. ext2</systemitem> which adds a journal and is compatible with the E2fsprogs
  17. utilities. We will create an <systemitem class="filesystem">ext3</systemitem>
  18. file system. Build instructions for other file systems can be found at
  19. <ulink url="&blfs-root;view/svn/postlfs/filesystems.html"/>.</para>
  20. <para>To create an <systemitem class="filesystem">ext3</systemitem> file
  21. system on the LFS partition, run the following:</para>
  22. <screen role="nodump"><userinput>mke2fs -jv /dev/<replaceable>&lt;xxx&gt;</replaceable></userinput></screen>
  23. <para>Replace <replaceable>&lt;xxx&gt;</replaceable> with the name of the LFS
  24. partition (<filename class="devicefile">hda5</filename> in our previous
  25. example).</para>
  26. <note>
  27. <para>Some host distributions use custom features in their filesystem
  28. creation tools (E2fsprogs). This can cause problems when booting into your new
  29. LFS in Chapter 9, as those features will not be supported by the LFS-installed
  30. E2fsprogs; you will get an error similar to <quote>unsupported filesystem
  31. features, upgrade your e2fsprogs</quote>. To check if your host system
  32. uses custom enhancements, run the following command:</para>
  33. <screen role="nodump"><userinput>debugfs -R feature /dev/<replaceable>&lt;xxx&gt;</replaceable></userinput></screen>
  34. <para>If the output contains features other than: <option>dir_index</option>;
  35. <option>filetype</option>; <option>large_file</option>;
  36. <option>resize_inode</option> or <option>sparse_super</option> then your host
  37. system may have custom enhancements. In that case, to avoid later problems,
  38. you should compile the stock E2fsprogs package and use the resulting binaries
  39. to re-create the filesystem on your LFS partition:</para>
  40. <screen role="nodump"><userinput>cd /tmp
  41. tar -xjvf /path/to/sources/e2fsprogs-&e2fsprogs-version;.tar.bz2
  42. cd e2fsprogs-&e2fsprogs-version;
  43. mkdir -v build
  44. cd build
  45. ../configure
  46. make #note that we intentionally don't 'make install' here!
  47. ./misc/mke2fs -jv /dev/<replaceable>&lt;xxx&gt;</replaceable>
  48. cd /tmp
  49. rm -rfv e2fsprogs-&e2fsprogs-version;</userinput></screen>
  50. </note>
  51. <para>If a <systemitem class="filesystem">swap</systemitem> partition was
  52. created, it will need to be initialized for use by issuing the command below.
  53. If you are using an existing <systemitem class="filesystem">swap</systemitem>
  54. partition, there is no need to format it.</para>
  55. <screen role="nodump"><userinput>mkswap /dev/<replaceable>&lt;yyy&gt;</replaceable></userinput></screen>
  56. <para>Replace <replaceable>&lt;yyy&gt;</replaceable> with the name of the
  57. <systemitem class="filesystem">swap</systemitem> partition.</para>
  58. </sect1>