Indented chapter 02.

git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@7271 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689
This commit is contained in:
Manuel Canales Esparcia 2006-01-11 20:21:38 +00:00
parent 35edd526b5
commit 87bae3144c
5 changed files with 136 additions and 121 deletions

View File

@ -1,16 +1,19 @@
<?xml version="1.0" encoding="ISO-8859-1"?> <?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [ <!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
<!ENTITY % general-entities SYSTEM "../general.ent"> <!ENTITY % general-entities SYSTEM "../general.ent">
%general-entities; %general-entities;
]> ]>
<chapter id="chapter-partitioning" xreflabel="Chapter 2">
<?dbhtml dir="chapter02"?>
<title>Preparing a New Partition</title>
<?dbhtml filename="chapter02.html"?>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="introduction.xml"/> <chapter id="chapter-partitioning" xreflabel="Chapter 2">
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="creatingpartition.xml"/> <?dbhtml dir="chapter02"?>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="creatingfilesystem.xml"/> <?dbhtml filename="chapter02.html"?>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="mounting.xml"/>
<title>Preparing a New Partition</title>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="introduction.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="creatingpartition.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="creatingfilesystem.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="mounting.xml"/>
</chapter> </chapter>

View File

@ -1,41 +1,48 @@
<?xml version="1.0" encoding="ISO-8859-1"?> <?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [ <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
<!ENTITY % general-entities SYSTEM "../general.ent"> <!ENTITY % general-entities SYSTEM "../general.ent">
%general-entities; %general-entities;
]> ]>
<sect1 id="space-creatingfilesystem"> <sect1 id="space-creatingfilesystem">
<title>Creating a File System on the Partition</title> <?dbhtml filename="creatingfilesystem.html"?>
<?dbhtml filename="creatingfilesystem.html"?>
<para>Now that a blank partition has been set up, the file system can <title>Creating a File System on the Partition</title>
be created. The most widely-used system in the Linux world is the
second extended file system (ext2), but with newer high-capacity
hard disks, journaling file systems are becoming increasingly
popular. We will create an ext2 file system. Build instructions for other file
systems can be found at <ulink
url="&blfs-root;view/svn/postlfs/filesystems.html"/>.</para>
<para>To create an ext2 file system on the LFS partition, run the following:</para> <para>Now that a blank partition has been set up, the file system can be created.
The most widely-used system in the Linux world is the second extended file
system (<systemitem class="filesystem">ext2</systemitem>), but with newer
high-capacity hard disks, journaling file systems are becoming increasingly
popular. We will create an <systemitem class="filesystem">ext2</systemitem>
file system. Build instructions for other file systems can be found at
<ulink url="&blfs-root;view/svn/postlfs/filesystems.html"/>.</para>
<para>To create an <systemitem class="filesystem">ext2</systemitem> file
system on the LFS partition, run the following:</para>
<screen role="nodump"><userinput>mke2fs -v /dev/<replaceable>[xxx]</replaceable></userinput></screen> <screen role="nodump"><userinput>mke2fs -v /dev/<replaceable>[xxx]</replaceable></userinput></screen>
<para>Replace <replaceable>[xxx]</replaceable> with the name of the LFS <para>Replace <replaceable>[xxx]</replaceable> with the name of the LFS
partition (<filename class="devicefile">hda5</filename> in our previous example).</para> partition (<filename class="devicefile">hda5</filename> in our previous
example).</para>
<note><para>Some host distributions use custom features in their filesystem <note>
creation tools (e2fsprogs). This can cause problems when booting into your new <para>Some host distributions use custom features in their filesystem
LFS in Chapter 9, as those features will not be supported by the LFS-installed creation tools (E2fsprogs). This can cause problems when booting into your new
e2fsprogs; you will get an error similar to <quote>unsupported filesystem LFS in Chapter 9, as those features will not be supported by the LFS-installed
features, upgrade your e2fsprogs</quote>. To check if your host system E2fsprogs; you will get an error similar to <quote>unsupported filesystem
uses custom enhancements, run the following command:</para> features, upgrade your e2fsprogs</quote>. To check if your host system
uses custom enhancements, run the following command:</para>
<screen role="nodump"><userinput>debugfs -R feature /dev/<replaceable>[xxx]</replaceable></userinput></screen> <screen role="nodump"><userinput>debugfs -R feature /dev/<replaceable>[xxx]</replaceable></userinput></screen>
<para>If the output contains features other than: dir_index; filetype; <para>If the output contains features other than: <option>dir_index</option>;
large_file; resize_inode or sparse_super then your host system may have custom <option>filetype</option>; <option>large_file</option>;
enhancements. In that case, to avoid later problems, you should compile the <option>resize_inode</option> or <option>sparse_super</option> then your host
stock e2fsprogs package and use the resulting binaries to re-create the system may have custom enhancements. In that case, to avoid later problems,
filesystem on your LFS partition:</para> you should compile the stock E2fsprogs package and use the resulting binaries
to re-create the filesystem on your LFS partition:</para>
<screen role="nodump"><userinput>cd /tmp <screen role="nodump"><userinput>cd /tmp
tar -xjvf /path/to/sources/e2fsprogs-&e2fsprogs-version;.tar.bz2 tar -xjvf /path/to/sources/e2fsprogs-&e2fsprogs-version;.tar.bz2
@ -47,16 +54,16 @@ make #note that we intentionally don't 'make install' here!
./misc/mke2fs -v /dev/<replaceable>[xxx]</replaceable> ./misc/mke2fs -v /dev/<replaceable>[xxx]</replaceable>
cd /tmp cd /tmp
rm -rfv e2fsprogs-&e2fsprogs-version;</userinput></screen> rm -rfv e2fsprogs-&e2fsprogs-version;</userinput></screen>
</note> </note>
<para>If a swap partition was created, it will need to be initialized for use by <para>If a <systemitem class="filesystem">swap</systemitem> partition was
issuing the command below. If you are using an existing swap partition, there is created, it will need to be initialized for use by issuing the command below.
no need to format it.</para> If you are using an existing <systemitem class="filesystem">swap</systemitem>
partition, there is no need to format it.</para>
<screen role="nodump"><userinput>mkswap /dev/<replaceable>[yyy]</replaceable></userinput></screen> <screen role="nodump"><userinput>mkswap /dev/<replaceable>[yyy]</replaceable></userinput></screen>
<para>Replace <replaceable>[yyy]</replaceable> with the name of the swap <para>Replace <replaceable>[yyy]</replaceable> with the name of the
partition.</para> <systemitem class="filesystem">swap</systemitem> partition.</para>
</sect1> </sect1>

View File

@ -1,55 +1,55 @@
<?xml version="1.0" encoding="ISO-8859-1"?> <?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [ <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
<!ENTITY % general-entities SYSTEM "../general.ent"> <!ENTITY % general-entities SYSTEM "../general.ent">
%general-entities; %general-entities;
]> ]>
<sect1 id="space-creatingpartition"> <sect1 id="space-creatingpartition">
<title>Creating a New Partition</title> <?dbhtml filename="creatingpartition.html"?>
<?dbhtml filename="creatingpartition.html"?>
<para>Like most other operating systems, LFS is usually installed on <title>Creating a New Partition</title>
a dedicated partition. The recommended approach to building an LFS
system is to use an available empty partition or, if you have enough
unpartitioned space, to create one. However, an LFS system (in
fact even multiple LFS systems) may also be installed on a partition
already occupied by another operating system and the different systems
will co-exist peacefully. The document
<ulink url="&hints-root;lfs_next_to_existing_systems.txt"/> explains
how to implement this, whereas this book discusses the method of
using a fresh partition for the installation.</para>
<para>A minimal system requires a partition of around 1.3 gigabytes <para>Like most other operating systems, LFS is usually installed on a
(GB). This is enough to store all the source tarballs and compile dedicated partition. The recommended approach to building an LFS system
the packages. However, if the LFS system is intended to be the primary is to use an available empty partition or, if you have enough unpartitioned
Linux system, additional software will probably be installed which space, to create one. However, an LFS system (in fact even multiple LFS
will require additional space (2-3 GB). The LFS system itself will systems) may also be installed on a partition already occupied by another
not take up this much room. A large portion of this requirement operating system and the different systems will co-exist peacefully. The
is to provide sufficient free temporary storage. Compiling document <ulink url="&hints-root;lfs_next_to_existing_systems.txt"/>
packages can require a lot of disk space which will be reclaimed after explains how to implement this, whereas this book discusses the method of
the package is installed.</para> using a fresh partition for the installation.</para>
<para>Because there is not always enough Random Access Memory (RAM) <para>A minimal system requires a partition of around 1.3 gigabytes (GB).
available for compilation processes, it is a good idea to use a small This is enough to store all the source tarballs and compile the packages.
disk partition as swap space. This is used by the kernel to However, if the LFS system is intended to be the primary Linux system,
store seldom-used data and leave more memory available for active processes. additional software will probably be installed which will require additional
The swap partition for an LFS system can be the same as the one used space (2-3 GB). The LFS system itself will not take up this much room.
by the host system, in which case it is not necessary to create another A large portion of this requirement is to provide sufficient free temporary
one.</para> storage. Compiling packages can require a lot of disk space which will be
reclaimed after the package is installed.</para>
<para>Start a disk partitioning program such as <para>Because there is not always enough Random Access Memory (RAM) available
<command>cfdisk</command> or <command>fdisk</command> with a command for compilation processes, it is a good idea to use a small disk partition as
line option naming the hard disk on which the new partition will be <systemitem class="filesystem">swap</systemitem> space. This is used by the
created&mdash;for example <filename class="devicefile">/dev/hda</filename> for kernel to store seldom-used data and leave more memory available for active
the primary Integrated Drive Electronics (IDE) disk. Create a Linux native processes. The <systemitem class="filesystem">swap</systemitem> partition for
partition and a swap partition, if needed. Please refer to an LFS system can be the same as the one used by the host system, in which
<filename>cfdisk(8)</filename> or <filename>fdisk(8)</filename> if you case it is not necessary to create another one.</para>
do not yet know how to use the programs.</para>
<para>Remember the designation of the new partition (e.g., <para>Start a disk partitioning program such as <command>cfdisk</command>
<filename class="devicefile">hda5</filename>). This book will refer to this as the LFS or <command>fdisk</command> with a command line option naming the hard
partition. Also remember the designation of the swap partition. These disk on which the new partition will be created&mdash;for example
names will be needed later for the <filename>/etc/fstab</filename> <filename class="devicefile">/dev/hda</filename> for the primary Integrated
file.</para> Drive Electronics (IDE) disk. Create a Linux native partition and a
<systemitem class="filesystem">swap</systemitem> partition, if needed. Please
refer to <filename>cfdisk(8)</filename> or <filename>fdisk(8)</filename> if
you do not yet know how to use the programs.</para>
<para>Remember the designation of the new partition (e.g., <filename
class="devicefile">hda5</filename>). This book will refer to this as
the LFS partition. Also remember the designation of the <systemitem
class="filesystem">swap</systemitem> partition. These names will be
needed later for the <filename>/etc/fstab</filename> file.</para>
</sect1> </sect1>

View File

@ -1,15 +1,17 @@
<?xml version="1.0" encoding="ISO-8859-1"?> <?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [ <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
<!ENTITY % general-entities SYSTEM "../general.ent"> <!ENTITY % general-entities SYSTEM "../general.ent">
%general-entities; %general-entities;
]> ]>
<sect1 id="space-introduction">
<title>Introduction</title>
<?dbhtml filename="introduction.html"?>
<para>In this chapter, the partition which will host the LFS system is <sect1 id="space-introduction">
prepared. We will create the partition itself, create a file system <?dbhtml filename="introduction.html"?>
on it, and mount it.</para>
<title>Introduction</title>
<para>In this chapter, the partition which will host the LFS system is
prepared. We will create the partition itself, create a file system
on it, and mount it.</para>
</sect1> </sect1>

View File

@ -1,56 +1,59 @@
<?xml version="1.0" encoding="ISO-8859-1"?> <?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [ <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
<!ENTITY % general-entities SYSTEM "../general.ent"> <!ENTITY % general-entities SYSTEM "../general.ent">
%general-entities; %general-entities;
]> ]>
<sect1 id="space-mounting"> <sect1 id="space-mounting">
<title>Mounting the New Partition</title> <?dbhtml filename="mounting.html"?>
<?dbhtml filename="mounting.html"?>
<para>Now that a file system has been created, the partition needs to <title>Mounting the New Partition</title>
be made accessible. In order to do this, the partition needs to be
mounted at a chosen mount point. For the purposes of this book, it is
assumed that the file system is mounted under <filename
class="directory">/mnt/lfs</filename>, but the directory choice is up
to you.</para>
<para>Choose a mount point and assign it to the <envar>LFS</envar> <para>Now that a file system has been created, the partition needs to
environment variable by running:</para> be made accessible. In order to do this, the partition needs to be
mounted at a chosen mount point. For the purposes of this book, it is
assumed that the file system is mounted under <filename
class="directory">/mnt/lfs</filename>, but the directory choice is up
to you.</para>
<para>Choose a mount point and assign it to the <envar>LFS</envar>
environment variable by running:</para>
<screen role="nodump"><userinput>export LFS=/mnt/lfs</userinput></screen> <screen role="nodump"><userinput>export LFS=/mnt/lfs</userinput></screen>
<para>Next, create the mount point and mount the LFS file system by <para>Next, create the mount point and mount the LFS file system by
running:</para> running:</para>
<screen role="nodump"><userinput>mkdir -pv $LFS <screen role="nodump"><userinput>mkdir -pv $LFS
mount -v /dev/<replaceable>[xxx]</replaceable> $LFS</userinput></screen> mount -v /dev/<replaceable>[xxx]</replaceable> $LFS</userinput></screen>
<para>Replace <replaceable>[xxx]</replaceable> with the designation of the LFS <para>Replace <replaceable>[xxx]</replaceable> with the designation of the LFS
partition.</para> partition.</para>
<para>If using multiple partitions for LFS (e.g., one for <filename <para>If using multiple partitions for LFS (e.g., one for <filename
class="directory">/</filename> and another for <filename class="directory">/</filename> and another for <filename
class="directory">/usr</filename>), mount them using:</para> class="directory">/usr</filename>), mount them using:</para>
<screen role="nodump"><userinput>mkdir -pv $LFS <screen role="nodump"><userinput>mkdir -pv $LFS
mount -v /dev/<replaceable>[xxx]</replaceable> $LFS mount -v /dev/<replaceable>[xxx]</replaceable> $LFS
mkdir -v $LFS/usr mkdir -v $LFS/usr
mount -v /dev/<replaceable>[yyy]</replaceable> $LFS/usr</userinput></screen> mount -v /dev/<replaceable>[yyy]</replaceable> $LFS/usr</userinput></screen>
<para>Replace <replaceable>[xxx]</replaceable> and <para>Replace <replaceable>[xxx]</replaceable> and
<replaceable>[yyy]</replaceable> with the appropriate partition <replaceable>[yyy]</replaceable> with the appropriate partition
names.</para> names.</para>
<para>Ensure that this new partition is not mounted with permissions <para>Ensure that this new partition is not mounted with permissions that
that are too restrictive (such as the nosuid, nodev, or noatime are too restrictive (such as the <option>nosuid</option>, <option>nodev</option>,
options). Run the <command>mount</command> command without any or <option>noatime</option> options). Run the <command>mount</command> command
parameters to see what options are set for the mounted LFS without any parameters to see what options are set for the mounted LFS
partition. If <parameter>nosuid</parameter>, <parameter>nodev</parameter>, partition. If <option>nosuid</option>, <option>nodev</option>, and/or
and/or <parameter>noatime</parameter> are set, the partition will need <option>noatime</option> are set, the partition will need to be
to be remounted.</para> remounted.</para>
<para>Now that there is an established place to work, it is time to <para>Now that there is an established place to work, it is time to
download the packages.</para> download the packages.</para>
</sect1> </sect1>