creatingfilesystem.xml 3.2 KB

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