creatingfilesystem.xml 2.8 KB

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