Files
master/chapter02/creatingfilesystem.html
2015-05-23 18:50:06 +08:00

143 lines
5.5 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!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=utf-8" />
<title>
2.3.&nbsp;在分区上创建文件系统
</title>
<link rel="stylesheet" type="text/css" href="../stylesheets/lfs.css" />
<meta name="generator" content="DocBook XSL Stylesheets V1.78.1" />
<link rel="stylesheet" href="../stylesheets/lfs-print.css" type="text/css"
media="print" />
</head>
<body class="lfs" id="lfs-7.7-systemd">
<div class="navheader">
<h4>
Linux From Scratch - Version 7.7-systemd
</h4>
<h3>
第二章&nbsp;准备新分区
</h3>
<ul>
<li class="prev">
<a accesskey="p" href="creatingpartition.html" title=
"创建新分区">上一页</a>
<p>
创建新分区
</p>
</li>
<li class="next">
<a accesskey="n" href="mounting.html" title=
"挂载新分区">下一页</a>
<p>
挂载新分区
</p>
</li>
<li class="up">
<a accesskey="u" href="chapter02.html" title=
"第二章&nbsp;准备新分区">返回</a>
</li>
<li class="home">
<a accesskey="h" href="../index.html" title=
"Linux From Scratch - Version 7.7-systemd">主页</a>
</li>
</ul>
</div>
<div class="sect1" lang="en" xml:lang="en">
<h1 class="sect1">
<a id="space-creatingfilesystem" name=
"space-creatingfilesystem"></a>2.3. 在分区上创建文件系统
</h1>
<p>
现在已经有了一个空的分区可以创建文件系统了。LFS 可以使用 Linux 内核能识别的任何文件系统,但最常用的类型是 ext3 和 ext4。当然至于具体采用哪种文件系统应该取决于所要存储的文件特点和分区的大小。例如
</p>
<div class="variablelist">
<dl class="variablelist">
<dt>
<span class="term">ext2</span>
</dt>
<dd>
<p>
适用于那些分区容量不是太大,更新也不频繁的情况,例如 /boot 分区。
</p>
</dd>
<dt>
<span class="term">ext3</span>
</dt>
<dd>
<p>
是 ext2 的改进版本,其支持日志功能,能够帮助系统从非正常关机导致的异常中恢复。它通常被用作通用的文件系统。
</p>
</dd>
<dt>
<span class="term">ext4</span>
</dt>
<dd>
<p>
是 ext 文件系统的最新版。提供了很多新的特性,包括纳秒级时间戳、创建和使用巨型文件(16TB)、以及速度的提升。
</p>
</dd>
</dl>
</div>
<p>
其它文件系统,包括 FAT32、NTFS、ReiserFS、JFS 和 XFS 等都在专门领域有其独到的作用。关于这些文件系统更多的信息可以在
<a class="ulink" href=
"http://en.wikipedia.org/wiki/Comparison_of_file_systems">http://en.wikipedia.org/wiki/Comparison_of_file_systems</a> 找到。
</p>
<p>
LFS 假定根文件系统(/)是 ext4 类型的。要在 LFS 分区上创建 <code class="systemitem">ext4</code> 文件系统,运行以下命令:
</p>
<pre class="userinput">
<kbd class="command">mkfs -v -t ext4 /dev/<em class=
"replaceable"><code>&lt;xxx&gt;</code></em></kbd>
</pre>
<p>
如果你已经有了现成的 <code class="systemitem">swap</code> 分区,不需要重新格式化。如果是新建 <code class="systemitem">swap</code> 分区,需要用下面的命令初始化:
</p>
<pre class="userinput">
<kbd class="command">mkswap /dev/<em class=
"replaceable"><code>&lt;yyy&gt;</code></em></kbd>
</pre>
<p>
其中,<em class="replaceable"><code>&lt;xxx&gt;</code></em><em class="replaceable"><code>&lt;yyy&gt;</code></em>都需要替换为实际的设备名称(形如 sda1sdb2
</p>
</div>
<div class="navfooter">
<div class="book">
<div class="titlepage">
<div class="author">
<span class="firstname">翻译团队:<a href="http://lctt.github.io/" target="_blank">LCTT</a></span>
<span class="surname">译者/校对:<a href="http://github.com/ictlyh" target="_blank">ictlyh</a>,<a href="http://github.com/dongfengweixiao" target="_blank">dongfengweixiao</a>,<a href="http://github.com/wxy" target="_blank">wxy</a></span>
</div>
</div>
</div>
<ul>
<li class="prev">
<a accesskey="p" href="creatingpartition.html" title=
"创建新分区">上一页</a>
<p>
创建新分区
</p>
</li>
<li class="next">
<a accesskey="n" href="mounting.html" title=
"挂载新分区">下一页</a>
<p>
挂载新分区
</p>
</li>
<li class="up">
<a accesskey="u" href="chapter02.html" title=
"第二章&nbsp;准备新分区">返回</a>
</li>
<li class="home">
<a accesskey="h" href="../index.html" title=
"Linux From Scratch - Version 7.7-systemd">主页</a>
</li>
</ul>
</div>
</body>
</html>