• 要找福利?记不住网址?搜不到?如何与我们保持联系?试试 CTRL+D 把零点博客添加进您的浏览器收藏夹,一键直达永不失联!

磁盘维护Linux sfdisk命令

linux系统 涛涛 111次浏览 0个评论

Linux sfdisk命令是硬盘分区工具程序。

sfdisk为硬盘分区工具程序,可显示分区的设置信息,并检查分区是否正常。

语法

<span class="pln">sfdisk </span><span class="pun">[-?</span><span class="typ">Tvx</span><span class="pun">][-</span><span class="pln">d </span><span class="pun"><硬盘>][-</span><span class="pln">g </span><span class="pun"><硬盘>][-</span><span class="pln">l </span><span class="pun"><硬盘>][-</span><span class="pln">s </span><span class="pun"><分区>][-</span><span class="pln">V </span><span class="pun"><硬盘>]</span>

参数

  • -?或–help 显示帮助。
  • -d<硬盘> 显示硬盘分区的设置。
  • -g<硬盘>或–show-geometry<硬盘> 显示硬盘的CHS参数。
  • -l<硬盘> 显示后硬盘分区的相关设置。
  • -s<分区> 显示分区的大小,单位为区块。
  • -T或–list-types 显示所有sfdisk能辨识的文件系统ID。
  • -v或–version 显示版本信息。
  • -V<硬盘>或–verify<硬盘> 检查硬盘分区是否正常。
  • -x或–show-extend 显示扩展分区中的逻辑分区。

实例

显示分区信息:

<span class="com"># sfdisk -l</span>

<span class="typ">Disk</span> <span class="pun">/</span><span class="pln">dev</span><span class="pun">/</span><span class="pln">sda</span><span class="pun">:</span> <span class="lit">1305</span><span class="pln"> cylinders</span><span class="pun">,</span> <span class="lit">255</span><span class="pln"> heads</span><span class="pun">,</span> <span class="lit">63</span><span class="pln"> sectors</span><span class="pun">/</span><span class="pln">track
</span><span class="typ">Units</span> <span class="pun">=</span><span class="pln"> cylinders of </span><span class="lit">8225280</span><span class="pln"> bytes</span><span class="pun">,</span><span class="pln"> blocks of </span><span class="lit">1024</span><span class="pln"> bytes</span><span class="pun">,</span><span class="pln"> counting </span><span class="kwd">from</span> <span class="lit">0</span>

<span class="typ">Device</span> <span class="typ">Boot</span> <span class="typ">Start</span> <span class="typ">End</span> <span class="com">#cyls #blocks Id System</span>
<span class="pun">/</span><span class="pln">dev</span><span class="pun">/</span><span class="pln">sda1 </span><span class="pun">*</span> <span class="lit">0</span><span class="pun">+</span> <span class="lit">12</span> <span class="lit">13</span><span class="pun">-</span> <span class="lit">104391</span> <span class="lit">83</span> <span class="typ">Linux</span>
<span class="pun">/</span><span class="pln">dev</span><span class="pun">/</span><span class="pln">sda2 </span><span class="lit">13</span> <span class="lit">1304</span> <span class="lit">1292</span> <span class="lit">10377990</span> <span class="lit">8e</span> <span class="typ">Linux</span><span class="pln"> LVM
</span><span class="pun">/</span><span class="pln">dev</span><span class="pun">/</span><span class="pln">sda3 </span><span class="lit">0</span> <span class="pun">-</span> <span class="lit">0</span> <span class="lit">0</span> <span class="lit">0</span> <span class="typ">Empty</span>
<span class="pun">/</span><span class="pln">dev</span><span class="pun">/</span><span class="pln">sda4 </span><span class="lit">0</span> <span class="pun">-</span> <span class="lit">0</span> <span class="lit">0</span> <span class="lit">0</span> <span class="typ">Empty</span>

<span class="typ">Disk</span> <span class="pun">/</span><span class="pln">dev</span><span class="pun">/</span><span class="pln">sdb</span><span class="pun">:</span> <span class="lit">652</span><span class="pln"> cylinders</span><span class="pun">,</span> <span class="lit">255</span><span class="pln"> heads</span><span class="pun">,</span> <span class="lit">63</span><span class="pln"> sectors</span><span class="pun">/</span><span class="pln">track

sfdisk</span><span class="pun">:</span><span class="pln"> ERROR</span><span class="pun">:</span><span class="pln"> sector </span><span class="lit">0</span><span class="pln"> does </span><span class="kwd">not</span><span class="pln"> have an msdos signature
</span><span class="pun">/</span><span class="pln">dev</span><span class="pun">/</span><span class="pln">sdb</span><span class="pun">:</span><span class="pln"> unrecognized partition
</span><span class="typ">No</span><span class="pln"> partitions found</span>

欢迎转载本文:磁盘维护Linux sfdisk命令
喜欢 (0)
[ld]
分享 (0)
发表我的评论
取消评论
表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址