creatingfilesystem.xml 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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. <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
  15. class="filesystem">ext3</systemitem>) is a widely used enhancement to
  16. <systemitem class="filesystem">ext2</systemitem>, which adds journaling
  17. capabilities and is compatible with the E2fsprogs utilities.
  18. We will create an <systemitem class="filesystem">ext3</systemitem>
  19. file system. Instructions for creating other file systems can be found at
  20. <ulink url="&blfs-root;view/svn/postlfs/filesystems.html"/>.</para>
  21. <para>To create an <systemitem class="filesystem">ext3</systemitem> file
  22. system on the LFS partition, run the following:</para>
  23. <screen role="nodump"><userinput>mke2fs -jv /dev/<replaceable>&lt;xxx&gt;</replaceable></userinput></screen>
  24. <para>Replace <replaceable>&lt;xxx&gt;</replaceable> with the name of the LFS
  25. partition (<filename class="devicefile">hda5</filename> in our previous
  26. example).</para>
  27. <note>
  28. <para>Some host distributions use custom features in their filesystem
  29. creation tools (E2fsprogs). This can cause problems when booting into your new
  30. LFS in Chapter 9, as those features will not be supported by the LFS-installed
  31. E2fsprogs; you will get an error similar to <quote>unsupported filesystem
  32. features, upgrade your e2fsprogs</quote>. To check if your host system
  33. uses custom enhancements, run the following command:</para>
  34. <screen role="nodump"><userinput>debugfs -R feature /dev/<replaceable>&lt;xxx&gt;</replaceable></userinput></screen>
  35. <para>If the output contains features other than
  36. <option>has_journal</option>, <option>ext_attr</option>,
  37. <option>resize_inode</option>, <option>dir_index</option>,
  38. <option>filetype</option>, <option>sparse_super</option>,
  39. <option>large_file</option> or <option>needs_recovery</option>, then your
  40. host system may have custom enhancements. In that case, to avoid later
  41. problems, you should compile the stock E2fsprogs package and use the
  42. resulting binaries to re-create the filesystem on your LFS partition:</para>
  43. <screen role="nodump"><userinput>cd /tmp
  44. tar -xzvf /path/to/sources/e2fsprogs-&e2fsprogs-version;.tar.gz
  45. cd e2fsprogs-&e2fsprogs-version;
  46. mkdir -v build
  47. cd build
  48. ../configure
  49. make #note that we intentionally don't 'make install' here!
  50. ./misc/mke2fs -jv /dev/<replaceable>&lt;xxx&gt;</replaceable>
  51. cd /tmp
  52. rm -rfv e2fsprogs-&e2fsprogs-version;</userinput></screen>
  53. </note>
  54. <para>If you are using an existing <systemitem class="filesystem">swap
  55. </systemitem> partition, there is no need to format it. If a new
  56. <systemitem class="filesystem"> swap</systemitem> partition was created,
  57. it will need to be initialized with this command:</para>
  58. <screen role="nodump"><userinput>mkswap /dev/<replaceable>&lt;yyy&gt;</replaceable></userinput></screen>
  59. <para>Replace <replaceable>&lt;yyy&gt;</replaceable> with the name of the
  60. <systemitem class="filesystem">swap</systemitem> partition.</para>
  61. </sect1>