📄 creatingfilesystem.html
字号:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=gb2312" />
<title>
2.3. Creating a File System on the Partition
</title>
<link rel="stylesheet" href="../stylesheets/lfs.css" type="text/css" />
<meta name="generator" content="DocBook XSL Stylesheets V1.68.1" />
<link rel="stylesheet" href="../stylesheets/lfs-print.css" type="text/css" media="print" />
</head>
<body id="lfs" class="6.1">
<div class="navheader">
<div class="headertitles">
<h4>
Linux From Scratch - Version 6.1
</h4>
<h3>
Chapter 2. 创建一个新的分区
</h3>
</div>
<ul class="headerlinks">
<li class="prev">
<a accesskey="p" href="creatingpartition.html" title="Creating a New Partition">后退</a>
<p>
Creating a New Partition
</p>
</li>
<li class="next">
<a accesskey="n" href="mounting.html" title="Mounting the New Partition">前进</a>
<p>
Mounting the New Partition
</p>
</li>
<li class="up">
<a accesskey="u" href="chapter02.html" title="Chapter 2. 创建一个新的分区">上一级</a>.
</li>
<li class="home">
<a accesskey="h" href="../index.html" title="Linux From Scratch - Version 6.1">回首页</a>
</li>
</ul>
</div>
<div class="sect1" lang="zh_cn" xml:lang="zh_cn">
<div class="titlepage">
<h1 class="sect1">
2.3. 在分区上创建文件系统
</h1>
</div>
<p>
空白分区建立之后,现在可以在上面创建文件系统了。在 Linux 世界使用的最广泛的是 ext2 文件系统,但是随着新的大容量硬盘的出现,日志文件系统开始逐渐流行。这里我们创建的是 ext2 文件系统,您可以在<a href="http://www.linuxfromscratch.org/blfs/view/svn/postlfs/filesystems.html">
<i>http://www.linuxfromscratch.org/blfs/view/svn/postlfs/filesystems.html</i></a>找到创建其它文件系统的指导。
</p>
<p>
在 LFS 分区上创建 ext2 文件系统,请运行下面的命令:
</p>
<pre class="userinput"><kbd class="command">mke2fs /dev/<em class="replaceable"><tt>[xxx]</tt></em></kbd></pre>
<p>
用您创建的 LFS 分区的名称替换 <em class="replaceable"><tt>[xxx]</tt></em> (我们上面的例子里是<tt class="filename">hda5</tt>)。
</p>
<div class="note">
<div class="admonhead">
<img alt="[Note]" src="../images/note.png" />
<h3 class="admontitle">
注意
</h3>
</div>
<div class="admonbody">
<p>
有些宿主系统在文件系统创建工具(e2fsprogs)中使用了自定义的特性。这可能会导致你在第9章重启进入新的LFS系统时出现问题。因为这些特性并不被LFS安装的e2fsprogs支持,你将会得到一个类似于 “<span class="quote">unsupported filesystem
features, upgrade your e2fsprogs</span>”的错误。你可以使用下面的命令来检查你的宿主系统是否使用了自定义的增强特性:</p>
<pre class="userinput"><kbd class="command">debugfs -R feature /dev/<em class="replaceable"><tt>[xxx]</tt></em></kbd></pre>
<p>
如果输出的特性不同于:dir_index; filetype;
large_file; resize_inode; sparse_super 那么就说明你的宿主系统使用了自定义的增强特性。在这种情况下,为了避免后面的问题,重新编译e2fsprogs包,然后用这个重现编译过的工具来创建你将要用来安装LFS系统的文件系统:</p>
<pre class="userinput"><kbd class="command">cd /tmp
tar xjf /path/to/sources/e2fsprogs-1.37.tar.bz2
cd e2fsprogs-1.37
mkdir build
cd build
../configure
make #note that we intentionally don't 'make install' here!
./misc/mke2fs /dev/<em class="replaceable"><tt>[xxx]</tt></em>
cd /tmp
rm -rf e2fsprogs-1.37</kbd></pre>
</div>
</div>
<p>
如果创建了交换分区,那么还需要用下面的命令进行格式化,如果您使用已有的交换分区,那么就不需要格式化了。
</p>
<pre class="userinput"><kbd class="command">mkswap /dev/<em class="replaceable"><tt>[yyy]</tt></em></kbd></pre>
<p>
用您创建的交换分区的名称替换 <em class="replaceable"><tt>[yyy]</tt></em>
</p>
</div>
<div class="navfooter">
<ul>
<li class="prev">
<a accesskey="p" href="creatingpartition.html" title="Creating a New Partition">后退</a>
<p>
Creating a New Partition
</p>
</li>
<li class="next">
<a accesskey="n" href="mounting.html" title="Mounting the New Partition">前进</a>
<p>
Mounting the New Partition
</p>
</li>
<li class="up">
<a accesskey="u" href="chapter02.html" title="Chapter 2. 创建一个新的分区">上一级</a>.
</li>
<li class="home">
<a accesskey="h" href="../index.html" title="Linux From Scratch - Version 6.1">回首页</a>.
</li>
</ul>
</div>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -