Changeset 1b20267
- Timestamp:
- 01/11/2006 08:22:30 PM (18 years ago)
- Children:
- e956635
- Parents:
- e1266e5
- Location:
- chapter02
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
chapter02/chapter02.xml
re1266e5 r1b20267 1 1 <?xml version="1.0" encoding="ISO-8859-1"?> 2 <!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [ 2 <!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" 3 "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [ 3 4 <!ENTITY % general-entities SYSTEM "../general.ent"> 4 5 %general-entities; 5 6 ]> 7 6 8 <chapter id="chapter-partitioning" xreflabel="Chapter 2"> 7 <?dbhtml dir="chapter02"?> 8 <title>Preparing a New Partition</title> 9 <?dbhtml filename="chapter02.html"?> 9 <?dbhtml dir="chapter02"?> 10 <?dbhtml filename="chapter02.html"?> 10 11 11 <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="introduction.xml"/> 12 <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="creatingpartition.xml"/> 13 <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="creatingfilesystem.xml"/> 14 <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="mounting.xml"/> 12 <title>Preparing a New Partition</title> 13 14 <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="introduction.xml"/> 15 <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="creatingpartition.xml"/> 16 <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="creatingfilesystem.xml"/> 17 <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="mounting.xml"/> 15 18 16 19 </chapter> -
chapter02/creatingfilesystem.xml
re1266e5 r1b20267 1 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" [ 2 <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" 3 "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [ 3 4 <!ENTITY % general-entities SYSTEM "../general.ent"> 4 5 %general-entities; 5 6 ]> 7 6 8 <sect1 id="space-creatingfilesystem"> 7 <title>Creating a File System on the Partition</title> 8 <?dbhtml filename="creatingfilesystem.html"?> 9 <?dbhtml filename="creatingfilesystem.html"?> 9 10 10 <para>Now that a blank partition has been set up, the file system can 11 be created. The most widely-used system in the Linux world is the 12 second extended file system (ext2), but with newer high-capacity 13 hard disks, journaling file systems are becoming increasingly 14 popular. We will create an ext2 file system. Build instructions for other file 15 systems can be found at <ulink 16 url="&blfs-root;view/svn/postlfs/filesystems.html"/>.</para> 11 <title>Creating a File System on the Partition</title> 17 12 18 <para>To create an ext2 file system on the LFS partition, run the following:</para> 13 <para>Now that a blank partition has been set up, the file system can be created. 14 The most widely-used system in the Linux world is the second extended file 15 system (<systemitem class="filesystem">ext2</systemitem>), but with newer 16 high-capacity hard disks, journaling file systems are becoming increasingly 17 popular. We will create an <systemitem class="filesystem">ext2</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 21 <para>To create an <systemitem class="filesystem">ext2</systemitem> file 22 system on the LFS partition, run the following:</para> 19 23 20 24 <screen role="nodump"><userinput>mke2fs -v /dev/<replaceable>[xxx]</replaceable></userinput></screen> 21 25 22 <para>Replace <replaceable>[xxx]</replaceable> with the name of the LFS 23 partition (<filename class="devicefile">hda5</filename> in our previous example).</para> 26 <para>Replace <replaceable>[xxx]</replaceable> with the name of the LFS 27 partition (<filename class="devicefile">hda5</filename> in our previous 28 example).</para> 24 29 25 <note><para>Some host distributions use custom features in their filesystem 26 creation tools (e2fsprogs). This can cause problems when booting into your new 27 LFS in Chapter 9, as those features will not be supported by the LFS-installed 28 e2fsprogs; you will get an error similar to <quote>unsupported filesystem 29 features, upgrade your e2fsprogs</quote>. To check if your host system 30 uses custom enhancements, run the following command:</para> 30 <note> 31 <para>Some host distributions use custom features in their filesystem 32 creation tools (E2fsprogs). This can cause problems when booting into your new 33 LFS in Chapter 9, as those features will not be supported by the LFS-installed 34 E2fsprogs; you will get an error similar to <quote>unsupported filesystem 35 features, upgrade your e2fsprogs</quote>. To check if your host system 36 uses custom enhancements, run the following command:</para> 31 37 32 38 <screen role="nodump"><userinput>debugfs -R feature /dev/<replaceable>[xxx]</replaceable></userinput></screen> 33 39 34 <para>If the output contains features other than: dir_index; filetype; 35 large_file; resize_inode or sparse_super then your host system may have custom 36 enhancements. In that case, to avoid later problems, you should compile the 37 stock e2fsprogs package and use the resulting binaries to re-create the 38 filesystem on your LFS partition:</para> 40 <para>If the output contains features other than: <option>dir_index</option>; 41 <option>filetype</option>; <option>large_file</option>; 42 <option>resize_inode</option> or <option>sparse_super</option> then your host 43 system may have custom enhancements. In that case, to avoid later problems, 44 you should compile the stock E2fsprogs package and use the resulting binaries 45 to re-create the filesystem on your LFS partition:</para> 39 46 40 47 <screen role="nodump"><userinput>cd /tmp … … 48 55 cd /tmp 49 56 rm -rfv e2fsprogs-&e2fsprogs-version;</userinput></screen> 50 </note>57 </note> 51 58 52 <para>If a swap partition was created, it will need to be initialized for use by 53 issuing the command below. If you are using an existing swap partition, there is 54 no need to format it.</para> 59 <para>If a <systemitem class="filesystem">swap</systemitem> partition was 60 created, it will need to be initialized for use by issuing the command below. 61 If you are using an existing <systemitem class="filesystem">swap</systemitem> 62 partition, there is no need to format it.</para> 55 63 56 64 <screen role="nodump"><userinput>mkswap /dev/<replaceable>[yyy]</replaceable></userinput></screen> 57 65 58 <para>Replace <replaceable>[yyy]</replaceable> with the name of the swap 59 partition.</para>66 <para>Replace <replaceable>[yyy]</replaceable> with the name of the 67 <systemitem class="filesystem">swap</systemitem> partition.</para> 60 68 61 69 </sect1> 62 -
chapter02/creatingpartition.xml
re1266e5 r1b20267 1 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" [ 2 <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" 3 "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [ 3 4 <!ENTITY % general-entities SYSTEM "../general.ent"> 4 5 %general-entities; 5 6 ]> 7 6 8 <sect1 id="space-creatingpartition"> 7 <title>Creating a New Partition</title> 8 <?dbhtml filename="creatingpartition.html"?> 9 <?dbhtml filename="creatingpartition.html"?> 9 10 10 <para>Like most other operating systems, LFS is usually installed on 11 a dedicated partition. The recommended approach to building an LFS 12 system is to use an available empty partition or, if you have enough 13 unpartitioned space, to create one. However, an LFS system (in 14 fact even multiple LFS systems) may also be installed on a partition 15 already occupied by another operating system and the different systems 16 will co-exist peacefully. The document 17 <ulink url="&hints-root;lfs_next_to_existing_systems.txt"/> explains 18 how to implement this, whereas this book discusses the method of 19 using a fresh partition for the installation.</para> 11 <title>Creating a New Partition</title> 20 12 21 <para>A minimal system requires a partition of around 1.3 gigabytes 22 (GB). This is enough to store all the source tarballs and compile 23 the packages. However, if the LFS system is intended to be the primary 24 Linux system, additional software will probably be installed which 25 will require additional space (2-3 GB). The LFS system itself will 26 not take up this much room. A large portion of this requirement 27 is to provide sufficient free temporary storage. Compiling 28 packages can require a lot of disk space which will be reclaimed after 29 the package is installed.</para>13 <para>Like most other operating systems, LFS is usually installed on a 14 dedicated partition. The recommended approach to building an LFS system 15 is to use an available empty partition or, if you have enough unpartitioned 16 space, to create one. However, an LFS system (in fact even multiple LFS 17 systems) may also be installed on a partition already occupied by another 18 operating system and the different systems will co-exist peacefully. The 19 document <ulink url="&hints-root;lfs_next_to_existing_systems.txt"/> 20 explains how to implement this, whereas this book discusses the method of 21 using a fresh partition for the installation.</para> 30 22 31 <para>Because there is not always enough Random Access Memory (RAM) 32 available for compilation processes, it is a good idea to use a small 33 disk partition as swap space. This is used by the kernel to 34 store seldom-used data and leave more memory available for active processes. 35 The swap partition for an LFS system can be the same as the one used 36 by the host system, in which case it is not necessary to create another 37 one.</para> 23 <para>A minimal system requires a partition of around 1.3 gigabytes (GB). 24 This is enough to store all the source tarballs and compile the packages. 25 However, if the LFS system is intended to be the primary Linux system, 26 additional software will probably be installed which will require additional 27 space (2-3 GB). The LFS system itself will not take up this much room. 28 A large portion of this requirement is to provide sufficient free temporary 29 storage. Compiling packages can require a lot of disk space which will be 30 reclaimed after the package is installed.</para> 38 31 39 <para>Start a disk partitioning program such as 40 <command>cfdisk</command> or <command>fdisk</command> with a command 41 line option naming the hard disk on which the new partition will be 42 created—for example <filename class="devicefile">/dev/hda</filename> for 43 the primary Integrated Drive Electronics (IDE) disk. Create a Linux native 44 partition and a swap partition, if needed. Please refer to 45 <filename>cfdisk(8)</filename> or <filename>fdisk(8)</filename> if you 46 do not yet know how to use the programs.</para> 32 <para>Because there is not always enough Random Access Memory (RAM) available 33 for compilation processes, it is a good idea to use a small disk partition as 34 <systemitem class="filesystem">swap</systemitem> space. This is used by the 35 kernel to store seldom-used data and leave more memory available for active 36 processes. The <systemitem class="filesystem">swap</systemitem> partition for 37 an LFS system can be the same as the one used by the host system, in which 38 case it is not necessary to create another one.</para> 47 39 48 <para>Remember the designation of the new partition (e.g., 49 <filename class="devicefile">hda5</filename>). This book will refer to this as the LFS 50 partition. Also remember the designation of the swap partition. These 51 names will be needed later for the <filename>/etc/fstab</filename> 52 file.</para> 40 <para>Start a disk partitioning program such as <command>cfdisk</command> 41 or <command>fdisk</command> with a command line option naming the hard 42 disk on which the new partition will be created—for example 43 <filename class="devicefile">/dev/hda</filename> for the primary Integrated 44 Drive Electronics (IDE) disk. Create a Linux native partition and a 45 <systemitem class="filesystem">swap</systemitem> partition, if needed. Please 46 refer to <filename>cfdisk(8)</filename> or <filename>fdisk(8)</filename> if 47 you do not yet know how to use the programs.</para> 48 49 <para>Remember the designation of the new partition (e.g., <filename 50 class="devicefile">hda5</filename>). This book will refer to this as 51 the LFS partition. Also remember the designation of the <systemitem 52 class="filesystem">swap</systemitem> partition. These names will be 53 needed later for the <filename>/etc/fstab</filename> file.</para> 53 54 54 55 </sect1> 55 -
chapter02/introduction.xml
re1266e5 r1b20267 1 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" [ 2 <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" 3 "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [ 3 4 <!ENTITY % general-entities SYSTEM "../general.ent"> 4 5 %general-entities; 5 6 ]> 7 6 8 <sect1 id="space-introduction"> 7 <title>Introduction</title> 8 <?dbhtml filename="introduction.html"?> 9 <?dbhtml filename="introduction.html"?> 9 10 10 <para>In this chapter, the partition which will host the LFS system is 11 prepared. We will create the partition itself, create a file system 12 on it, and mount it.</para> 11 <title>Introduction</title> 12 13 <para>In this chapter, the partition which will host the LFS system is 14 prepared. We will create the partition itself, create a file system 15 on it, and mount it.</para> 13 16 14 17 </sect1> 15 -
chapter02/mounting.xml
re1266e5 r1b20267 1 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" [ 2 <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" 3 "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [ 3 4 <!ENTITY % general-entities SYSTEM "../general.ent"> 4 5 %general-entities; 5 6 ]> 7 6 8 <sect1 id="space-mounting"> 7 <title>Mounting the New Partition</title> 8 <?dbhtml filename="mounting.html"?> 9 <?dbhtml filename="mounting.html"?> 9 10 10 <para>Now that a file system has been created, the partition needs to 11 be made accessible. In order to do this, the partition needs to be 12 mounted at a chosen mount point. For the purposes of this book, it is 13 assumed that the file system is mounted under <filename 14 class="directory">/mnt/lfs</filename>, but the directory choice is up 15 to you.</para> 11 <title>Mounting the New Partition</title> 16 12 17 <para>Choose a mount point and assign it to the <envar>LFS</envar> 18 environment variable by running:</para> 13 <para>Now that a file system has been created, the partition needs to 14 be made accessible. In order to do this, the partition needs to be 15 mounted at a chosen mount point. For the purposes of this book, it is 16 assumed that the file system is mounted under <filename 17 class="directory">/mnt/lfs</filename>, but the directory choice is up 18 to you.</para> 19 20 <para>Choose a mount point and assign it to the <envar>LFS</envar> 21 environment variable by running:</para> 19 22 20 23 <screen role="nodump"><userinput>export LFS=/mnt/lfs</userinput></screen> 21 24 22 <para>Next, create the mount point and mount the LFS file system by23 running:</para>25 <para>Next, create the mount point and mount the LFS file system by 26 running:</para> 24 27 25 28 <screen role="nodump"><userinput>mkdir -pv $LFS 26 29 mount -v /dev/<replaceable>[xxx]</replaceable> $LFS</userinput></screen> 27 30 28 <para>Replace <replaceable>[xxx]</replaceable> with the designation of the LFS29 partition.</para>31 <para>Replace <replaceable>[xxx]</replaceable> with the designation of the LFS 32 partition.</para> 30 33 31 <para>If using multiple partitions for LFS (e.g., one for <filename32 class="directory">/</filename> and another for <filename33 class="directory">/usr</filename>), mount them using:</para>34 <para>If using multiple partitions for LFS (e.g., one for <filename 35 class="directory">/</filename> and another for <filename 36 class="directory">/usr</filename>), mount them using:</para> 34 37 35 38 <screen role="nodump"><userinput>mkdir -pv $LFS … … 38 41 mount -v /dev/<replaceable>[yyy]</replaceable> $LFS/usr</userinput></screen> 39 42 40 <para>Replace <replaceable>[xxx]</replaceable> and41 <replaceable>[yyy]</replaceable> with the appropriate partition42 names.</para>43 <para>Replace <replaceable>[xxx]</replaceable> and 44 <replaceable>[yyy]</replaceable> with the appropriate partition 45 names.</para> 43 46 44 <para>Ensure that this new partition is not mounted with permissions 45 that are too restrictive (such as the nosuid, nodev, or noatime 46 options). Run the <command>mount</command> command without any 47 parameters to see what options are set for the mounted LFS48 partition. If <parameter>nosuid</parameter>, <parameter>nodev</parameter>, 49 and/or <parameter>noatime</parameter> are set, the partition will need 50 to beremounted.</para>47 <para>Ensure that this new partition is not mounted with permissions that 48 are too restrictive (such as the <option>nosuid</option>, <option>nodev</option>, 49 or <option>noatime</option> options). Run the <command>mount</command> command 50 without any parameters to see what options are set for the mounted LFS 51 partition. If <option>nosuid</option>, <option>nodev</option>, and/or 52 <option>noatime</option> are set, the partition will need to be 53 remounted.</para> 51 54 52 <para>Now that there is an established place to work, it is time to53 download the packages.</para>55 <para>Now that there is an established place to work, it is time to 56 download the packages.</para> 54 57 55 58 </sect1>
Note:
See TracChangeset
for help on using the changeset viewer.