kernfs.html

来自「CLFS(Cross-Compiled Linux From Scratch)的」· HTML 代码 · 共 133 行

HTML
133
字号
<!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=iso-8859-1" />    <title>      8.3.&nbsp;Mounting Virtual Kernel File Systems    </title>    <link rel="stylesheet" href="../stylesheets/lfs.css" type="text/css" />    <meta name="generator" content="DocBook XSL Stylesheets V1.69.1" />    <link rel="stylesheet" href="../stylesheets/lfs-print.css" type=    "text/css" media="print" />  </head>  <body id="lfs" class="CLFS-SVN-20060417-PowerPC">    <div class="navheader">      <div class="headertitles">        <h4>          Cross-Compiled Linux From Scratch - Version          CLFS-SVN-20060417-PowerPC        </h4>        <h3>          Chapter&nbsp;8.&nbsp;If You Are Going to Chroot        </h3>      </div>      <ul class="headerlinks">        <li class="prev">          <a accesskey="p" href="util-linux.html" title=          "Util-linux-2.12r">Prev</a>          <p>            Util-linux-2.12r          </p>        </li>        <li class="next">          <a accesskey="n" href="chroot.html" title=          "Entering the Chroot Environment">Next</a>          <p>            Entering the Chroot Environment          </p>        </li>        <li class="up">          <a accesskey="u" href="chapter.html" title=          "Chapter&nbsp;8.&nbsp;If You Are Going to Chroot">Up</a>.        </li>        <li class="home">          <a accesskey="h" href="../index.html" title=          "Cross-Compiled Linux From Scratch - Version CLFS-SVN-20060417-PowerPC">          Home</a>        </li>      </ul>    </div>    <div class="sect1" lang="en" xml:lang="en">      <div class="titlepage">        <h1 class="sect1">          8.3. Mounting Virtual Kernel File Systems        </h1>      </div>      <p>        From this point on, we will be running all commands as the <tt class=        "systemitem">root</tt> user. So begin by exiting from the        <span><strong class="command">su</strong></span> as <tt class=        "systemitem">lfs</tt>.      </p>      <pre class="userinput"><kbd class="command">exit</kbd></pre>      <p>        Various file systems exported by the kernel are used to communicate        to and from the kernel itself. These file systems are virtual in that        no disk space is used for them. The content of the file systems        resides in memory.      </p>      <p>        Begin by creating directories onto which the file systems will be        mounted:      </p>      <pre class="userinput"><kbd class="command">mkdir -pv $LFS/{proc,sys}</kbd></pre>      <p>        Now mount the file systems:      </p>      <pre class="userinput"><kbd class="command">mount -vt proc proc $LFS/procmount -vt sysfs sysfs $LFS/sys</kbd></pre>      <p>        Remember that if for any reason you stop working on the LFS system        and start again later, it is important to check that these file        systems are mounted again before entering the chroot environment.      </p>      <p>        Additional file systems will soon be mounted from within the chroot        environment. To keep the host up to date, perform a        &ldquo;<span class="quote">fake mount</span>&rdquo; for each of these        now:      </p>      <pre class="userinput"><kbd class="command">mount -f -vt tmpfs tmpfs $LFS/devmount -f -vt tmpfs tmpfs $LFS/dev/shmmount -f -vt devpts -o gid=10,mode=620 devpts $LFS/dev/pts</kbd></pre>    </div>    <div class="navfooter">      <ul>        <li class="prev">          <a accesskey="p" href="util-linux.html" title=          "Util-linux-2.12r">Prev</a>          <p>            Util-linux-2.12r          </p>        </li>        <li class="next">          <a accesskey="n" href="chroot.html" title=          "Entering the Chroot Environment">Next</a>          <p>            Entering the Chroot Environment          </p>        </li>        <li class="up">          <a accesskey="u" href="chapter.html" title=          "Chapter&nbsp;8.&nbsp;If You Are Going to Chroot">Up</a>.        </li>        <li class="home">          <a accesskey="h" href="../index.html" title=          "Cross-Compiled Linux From Scratch - Version CLFS-SVN-20060417-PowerPC">          Home</a>.        </li>      </ul>    </div>  </body></html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?