creatingfilesystem.xml 3.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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
  15. class="filesystem">ext3</systemitem>) is a widely used enhancement to
  16. <systemitem class="filesystem">ext2</systemitem>, which adds journalling
  17. capabilities and is compatible with the E2fsprogs utilities.
  18. We will create an <systemitem class="filesystem">ext3</systemitem>
  19. file system. Build instructions for 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: <option>dir_index</option>;
  36. <option>filetype</option>; <option>large_file</option>;
  37. <option>resize_inode</option> or <option>sparse_super</option> then your host
  38. system may have custom enhancements. In that case, to avoid later problems,
  39. you should compile the stock E2fsprogs package and use the resulting binaries
  40. to re-create the filesystem on your LFS partition:</para>
  41. <screen role="nodump"><userinput>cd /tmp
  42. tar -xjvf /path/to/sources/e2fsprogs-&e2fsprogs-version;.tar.bz2
  43. cd e2fsprogs-&e2fsprogs-version;
  44. mkdir -v build
  45. cd build
  46. ../configure
  47. make #note that we intentionally don't 'make install' here!
  48. ./misc/mke2fs -jv /dev/<replaceable>&lt;xxx&gt;</replaceable>
  49. cd /tmp
  50. rm -rfv e2fsprogs-&e2fsprogs-version;</userinput></screen>
  51. </note>
  52. <para>If a <systemitem class="filesystem">swap</systemitem> partition was
  53. created, it will need to be initialized for use by issuing the command below.
  54. If you are using an existing <systemitem class="filesystem">swap</systemitem>
  55. partition, there is no need to format it.</para>
  56. <screen role="nodump"><userinput>mkswap /dev/<replaceable>&lt;yyy&gt;</replaceable></userinput></screen>
  57. <para>Replace <replaceable>&lt;yyy&gt;</replaceable> with the name of the
  58. <systemitem class="filesystem">swap</systemitem> partition.</para>
  59. </sect1>