uTools-Manuals/docs/linux/blockdev.html
2019-04-21 11:50:48 +08:00

27 lines
1.2 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="blockdev">blockdev</h1>
<p>从命令行调用区块设备控制程序</p>
<h2 id="补充说明">补充说明</h2>
<p><strong>blockdev命令</strong> 在命令调用“ioxtls”函数以实现对设备的控制。</p>
<h3 id="语法">语法</h3>
<pre><code class="language-bash">blockdev(选项)(参数)</code></pre>
<p>选项</p>
<pre><code class="language-bash">-V打印版本号并退出
-q安静模式
-v详细信息模式
--setro只读
--setrw只写
--getro打印只读状态“1”表示只读“0”表示非只读
--getss打印扇区大小。通常为521
--flushbufs刷新缓冲区
--rereadpt重新读取分区表。</code></pre>
<h3 id="参数">参数</h3>
<p>设备文件名:指定要操作的磁盘的设备文件名。</p>
<h3 id="实例">实例</h3>
<p>设置设备为只读:</p>
<pre><code class="language-bash">blockdev --setro /dev/hda4</code></pre>
<p>读取设备是否为只读:</p>
<pre><code class="language-bash">blockdev --getro /dev/hda4</code></pre>
<p>设置设别为可读写:</p>
<pre><code class="language-bash">blockdev --setrw /dev/hda4</code></pre>
<!-- Linux命令行搜索引擎https://jaywcjlove.github.io/linux-command/ -->