📄 kernfs.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>
6.2. Mounting Virtual Kernel File Systems
</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 6. 安装系统基础软件
</h3>
</div>
<ul class="headerlinks">
<li class="prev">
<a accesskey="p" href="chapter06.html" title="Installing Basic System Software">后退</a>
<p>
安装系统基础软件
</p>
</li>
<li class="next">
<a accesskey="n" href="chroot.html" title="Entering the Chroot Environment">前进</a>
<p>
Entering the Chroot Environment
</p>
</li>
<li class="up">
<a accesskey="u" href="chapter06.html" title="Chapter 6. 安装系统基础软件">上一级</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">
6.2. 挂载虚拟内核文件系统
</h1>
</div>
<p>虚拟内核文件系统(Virtual Kernel File Systems),是指那些是由内核产生但并不存在于硬盘上的文件系统,它们可以用来与内核进行通信。
</p>
<p>首先让我们为虚拟内核文件系统建立挂载目录:
</p>
<pre class="userinput"><kbd class="command">mkdir -p $LFS/{proc,sys}</kbd></pre>
<p>现在挂载虚拟内核文件系统:
</p>
<pre class="userinput"><kbd class="command">mount -t proc proc $LFS/proc
mount -t sysfs sysfs $LFS/sys</kbd></pre>
<p>注意,如果因为某些原因你需要临时停止建立 LFS 系统的工作,准备过一段时间再继续。那么在进入 chroot 环境之前,有一件相当重要的事情要做,就是要检查这些文件系统是否已经再次被挂载。
</p>
<p>后面的操作会在 chroot 环境中挂载一些附加的文件系统。 为了让宿主环境与 LFS 系统保持一致,我们要在宿主环境中对这些附加文件系统进行“伪挂载”:
</p>
<pre class="userinput"><kbd class="command">mount -f -t tmpfs tmpfs $LFS/dev
mount -f -t tmpfs tmpfs $LFS/dev/shm
mount -f -t devpts -o gid=4,mode=620 devpts $LFS/dev/pts</kbd></pre>
</div>
<div class="navfooter">
<ul>
<li class="prev">
<a accesskey="p" href="chapter06.html" title="Installing Basic System Software">后退</a>
<p>
安装系统基础软件
</p>
</li>
<li class="next">
<a accesskey="n" href="chroot.html" title="Entering the Chroot Environment">前进</a>
<p>
Entering the Chroot Environment
</p>
</li>
<li class="up">
<a accesskey="u" href="chapter06.html" title="Chapter 6. 安装系统基础软件">上一级</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 + -