2019-04-21 11:50:48 +08:00

25 lines
1.4 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.

<h1 id="mkfs">mkfs</h1>
<p>用于在设备上创建Linux文件系统</p>
<h2 id="补充说明">补充说明</h2>
<p><strong>mkfs命令</strong> 用于在设备上通常为硬盘创建Linux文件系统。mkfs本身并不执行建立文件系统的工作而是去调用相关的程序来执行。</p>
<h3 id="语法">语法</h3>
<pre><code class="language-bash">mkfs(选项)(参数)</code></pre>
<h3 id="选项">选项</h3>
<pre><code class="language-bash">fs指定建立文件系统时的参数
-t&lt;文件系统类型&gt;:指定要建立何种文件系统;
-v显示版本信息与详细的使用方法
-V显示简要的使用方法
-c在制做档案系统前检查该partition是否有坏轨。</code></pre>
<h3 id="参数">参数</h3>
<ul>
<li>文件系统:指定要创建的文件系统对应的设备文件名;</li>
<li>块数:指定文件系统的磁盘块数。</li>
</ul>
<h3 id="实例">实例</h3>
<p><code>/dev/hda5</code>上建一个msdos的档案系统同时检查是否有坏轨存在并且将过程详细列出来</p>
<pre><code class="language-bash">mkfs -V -t msdos -c /dev/hda5
mkfs -t ext3 /dev/sda6 //将sda6分区格式化为ext3格式
mkfs -t ext2 /dev/sda7 //将sda7分区格式化为ext2格式</code></pre>
<!-- Linux命令行搜索引擎https://jaywcjlove.github.io/linux-command/ -->