mirror of
https://git.linuxfromscratch.org/lfs.git
synced 2025-03-05 22:04:48 +00:00
Indented chapter 02.
git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@7271 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689
This commit is contained in:
parent
35edd526b5
commit
87bae3144c
@ -1,16 +1,19 @@
|
||||
<?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">
|
||||
%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"/>
|
||||
<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 id="chapter-partitioning" xreflabel="Chapter 2">
|
||||
<?dbhtml dir="chapter02"?>
|
||||
<?dbhtml filename="chapter02.html"?>
|
||||
|
||||
<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>
|
||||
|
@ -1,41 +1,48 @@
|
||||
<?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">
|
||||
%general-entities;
|
||||
]>
|
||||
|
||||
<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
|
||||
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>
|
||||
<title>Creating a File System on the Partition</title>
|
||||
|
||||
<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>
|
||||
|
||||
<para>Replace <replaceable>[xxx]</replaceable> with the name of the LFS
|
||||
partition (<filename class="devicefile">hda5</filename> in our previous example).</para>
|
||||
<para>Replace <replaceable>[xxx]</replaceable> with the name of the LFS
|
||||
partition (<filename class="devicefile">hda5</filename> in our previous
|
||||
example).</para>
|
||||
|
||||
<note><para>Some host distributions use custom features in their filesystem
|
||||
creation tools (e2fsprogs). This can cause problems when booting into your new
|
||||
LFS in Chapter 9, as those features will not be supported by the LFS-installed
|
||||
e2fsprogs; you will get an error similar to <quote>unsupported filesystem
|
||||
features, upgrade your e2fsprogs</quote>. To check if your host system
|
||||
uses custom enhancements, run the following command:</para>
|
||||
<note>
|
||||
<para>Some host distributions use custom features in their filesystem
|
||||
creation tools (E2fsprogs). This can cause problems when booting into your new
|
||||
LFS in Chapter 9, as those features will not be supported by the LFS-installed
|
||||
E2fsprogs; you will get an error similar to <quote>unsupported filesystem
|
||||
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>
|
||||
|
||||
<para>If the output contains features other than: dir_index; filetype;
|
||||
large_file; resize_inode or sparse_super then your host system may have custom
|
||||
enhancements. In that case, to avoid later problems, you should compile the
|
||||
stock e2fsprogs package and use the resulting binaries to re-create the
|
||||
filesystem on your LFS partition:</para>
|
||||
<para>If the output contains features other than: <option>dir_index</option>;
|
||||
<option>filetype</option>; <option>large_file</option>;
|
||||
<option>resize_inode</option> or <option>sparse_super</option> then your host
|
||||
system may have custom enhancements. In that case, to avoid later problems,
|
||||
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
|
||||
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>
|
||||
cd /tmp
|
||||
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
|
||||
issuing the command below. If you are using an existing swap partition, there is
|
||||
no need to format it.</para>
|
||||
<para>If a <systemitem class="filesystem">swap</systemitem> partition was
|
||||
created, it will need to be initialized for use by issuing the command below.
|
||||
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>
|
||||
|
||||
<para>Replace <replaceable>[yyy]</replaceable> with the name of the swap
|
||||
partition.</para>
|
||||
<para>Replace <replaceable>[yyy]</replaceable> with the name of the
|
||||
<systemitem class="filesystem">swap</systemitem> partition.</para>
|
||||
|
||||
</sect1>
|
||||
|
||||
|
@ -1,55 +1,55 @@
|
||||
<?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">
|
||||
%general-entities;
|
||||
]>
|
||||
|
||||
<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
|
||||
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>
|
||||
<title>Creating a New Partition</title>
|
||||
|
||||
<para>A minimal system requires a partition of around 1.3 gigabytes
|
||||
(GB). This is enough to store all the source tarballs and compile
|
||||
the packages. However, if the LFS system is intended to be the primary
|
||||
Linux system, additional software will probably be installed which
|
||||
will require additional space (2-3 GB). The LFS system itself will
|
||||
not take up this much room. A large portion of this requirement
|
||||
is to provide sufficient free temporary storage. Compiling
|
||||
packages can require a lot of disk space which will be reclaimed after
|
||||
the package is installed.</para>
|
||||
<para>Like most other operating systems, LFS is usually installed on 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>Because there is not always enough Random Access Memory (RAM)
|
||||
available for compilation processes, it is a good idea to use a small
|
||||
disk partition as swap space. This is used by the kernel to
|
||||
store seldom-used data and leave more memory available for active processes.
|
||||
The swap partition for an LFS system can be the same as the one used
|
||||
by the host system, in which case it is not necessary to create another
|
||||
one.</para>
|
||||
<para>A minimal system requires a partition of around 1.3 gigabytes (GB).
|
||||
This is enough to store all the source tarballs and compile the packages.
|
||||
However, if the LFS system is intended to be the primary Linux system,
|
||||
additional software will probably be installed which will require additional
|
||||
space (2-3 GB). The LFS system itself will not take up this much room.
|
||||
A large portion of this requirement is to provide sufficient free temporary
|
||||
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
|
||||
<command>cfdisk</command> or <command>fdisk</command> with a command
|
||||
line option naming the hard disk on which the new partition will be
|
||||
created—for example <filename class="devicefile">/dev/hda</filename> for
|
||||
the primary Integrated Drive Electronics (IDE) disk. Create a Linux native
|
||||
partition and a swap 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>Because there is not always enough Random Access Memory (RAM) available
|
||||
for compilation processes, it is a good idea to use a small disk partition as
|
||||
<systemitem class="filesystem">swap</systemitem> space. This is used by the
|
||||
kernel to store seldom-used data and leave more memory available for active
|
||||
processes. The <systemitem class="filesystem">swap</systemitem> partition for
|
||||
an LFS system can be the same as the one used by the host system, in which
|
||||
case it is not necessary to create another one.</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 swap partition. These
|
||||
names will be needed later for the <filename>/etc/fstab</filename>
|
||||
file.</para>
|
||||
<para>Start a disk partitioning program such as <command>cfdisk</command>
|
||||
or <command>fdisk</command> with a command line option naming the hard
|
||||
disk on which the new partition will be created—for example
|
||||
<filename class="devicefile">/dev/hda</filename> for the primary Integrated
|
||||
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>
|
||||
|
||||
|
@ -1,15 +1,17 @@
|
||||
<?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">
|
||||
%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
|
||||
prepared. We will create the partition itself, create a file system
|
||||
on it, and mount it.</para>
|
||||
<sect1 id="space-introduction">
|
||||
<?dbhtml filename="introduction.html"?>
|
||||
|
||||
<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>
|
||||
|
||||
|
@ -1,56 +1,59 @@
|
||||
<?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">
|
||||
%general-entities;
|
||||
]>
|
||||
|
||||
<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
|
||||
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>
|
||||
<title>Mounting the New Partition</title>
|
||||
|
||||
<para>Choose a mount point and assign it to the <envar>LFS</envar>
|
||||
environment variable by running:</para>
|
||||
<para>Now that a file system has been created, the partition needs to
|
||||
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>
|
||||
|
||||
<para>Next, create the mount point and mount the LFS file system by
|
||||
running:</para>
|
||||
<para>Next, create the mount point and mount the LFS file system by
|
||||
running:</para>
|
||||
|
||||
<screen role="nodump"><userinput>mkdir -pv $LFS
|
||||
mount -v /dev/<replaceable>[xxx]</replaceable> $LFS</userinput></screen>
|
||||
|
||||
<para>Replace <replaceable>[xxx]</replaceable> with the designation of the LFS
|
||||
partition.</para>
|
||||
<para>Replace <replaceable>[xxx]</replaceable> with the designation of the LFS
|
||||
partition.</para>
|
||||
|
||||
<para>If using multiple partitions for LFS (e.g., one for <filename
|
||||
class="directory">/</filename> and another for <filename
|
||||
class="directory">/usr</filename>), mount them using:</para>
|
||||
<para>If using multiple partitions for LFS (e.g., one for <filename
|
||||
class="directory">/</filename> and another for <filename
|
||||
class="directory">/usr</filename>), mount them using:</para>
|
||||
|
||||
<screen role="nodump"><userinput>mkdir -pv $LFS
|
||||
mount -v /dev/<replaceable>[xxx]</replaceable> $LFS
|
||||
mkdir -v $LFS/usr
|
||||
mount -v /dev/<replaceable>[yyy]</replaceable> $LFS/usr</userinput></screen>
|
||||
|
||||
<para>Replace <replaceable>[xxx]</replaceable> and
|
||||
<replaceable>[yyy]</replaceable> with the appropriate partition
|
||||
names.</para>
|
||||
<para>Replace <replaceable>[xxx]</replaceable> and
|
||||
<replaceable>[yyy]</replaceable> with the appropriate partition
|
||||
names.</para>
|
||||
|
||||
<para>Ensure that this new partition is not mounted with permissions
|
||||
that are too restrictive (such as the nosuid, nodev, or noatime
|
||||
options). Run the <command>mount</command> command without any
|
||||
parameters to see what options are set for the mounted LFS
|
||||
partition. If <parameter>nosuid</parameter>, <parameter>nodev</parameter>,
|
||||
and/or <parameter>noatime</parameter> are set, the partition will need
|
||||
to be remounted.</para>
|
||||
<para>Ensure that this new partition is not mounted with permissions that
|
||||
are too restrictive (such as the <option>nosuid</option>, <option>nodev</option>,
|
||||
or <option>noatime</option> options). Run the <command>mount</command> command
|
||||
without any parameters to see what options are set for the mounted LFS
|
||||
partition. If <option>nosuid</option>, <option>nodev</option>, and/or
|
||||
<option>noatime</option> are set, the partition will need to be
|
||||
remounted.</para>
|
||||
|
||||
<para>Now that there is an established place to work, it is time to
|
||||
download the packages.</para>
|
||||
<para>Now that there is an established place to work, it is time to
|
||||
download the packages.</para>
|
||||
|
||||
</sect1>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user