⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 linux 查看磁盘分区、文件系统、使用情况的命令和相关工具介绍 linuxsir_org.htm

📁 linuxSir 网站的精华文章
💻 HTM
📖 第 1 页 / 共 2 页
字号:
      相似;在本标题中,我们只来解说如何查看机器的中的磁盘分区状况及所用的文件系统等;</P>
      <P>查看磁盘分区的用法 cfdisk -Ps 磁盘设备名;<BR>比如<BR>
      <DIV class=codeblock><CODE>[root@localhost beinan]cfdisk 
      -Ps<BR>[root@localhost beinan]cfdisk -Ps /dev/hda <BR>[root@localhost 
      beinan]cfdisk -Ps<BR>Partition Table for 
      /dev/hda<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;First 
      Last<BR>&nbsp;# Type Sector Sector Offset Length Filesystem Type (ID) 
      Flag<BR>-- ------- ----------- ----------- ------ ----------- 
      -------------------- ----<BR>&nbsp;1 Primary 0 23438834 63 23438835 Linux 
      (83) Boot<BR>&nbsp;2 Primary 23438835 156296384 0 132857550 Extended (05) 
      None<BR>&nbsp;5 Logical 23438835 155268224 63 131829390 Linux (83) 
      None<BR>&nbsp;6 Logical 155268225 156296384 63 1028160 Linux swap (82) 
      None</CODE></DIV>
      <P></P>
      <P>我们只用的参数 -Ps,就列出了磁盘的分区情况;目前在Slackware Debian Mandrake 等主流发行版中存在cfdisk 
      ,而fedora 4.0把这个小工具剔除了;有点可惜;这是我在Slackware中操作的;</P>
      <P>如果您这样操作,就更直观了;<BR>
      <DIV class=codeblock><CODE>[root@localhost beinan]cfdisk 
      磁盘设备名</CODE></DIV><BR>举例:<BR>
      <DIV class=codeblock><CODE>[root@localhost beinan]cfdisk 
      /dev/hda</CODE></DIV>
      <P></P>
      <P>您所看到的是如下的模式:</P>
      <P>
      <DIV 
      class=codeblock><CODE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cfdisk 
      2.12a<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Disk 
      Drive: 
      /dev/hda<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Size: 
      80026361856 bytes, 80.0 
      GB<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Heads: 
      255 Sectors per Track: 63 Cylinders: 9729<BR>&nbsp;&nbsp;&nbsp;&nbsp;Name 
      Flags Part Type FS Type [Label] Size 
      (MB)<BR>&nbsp;-------------------------------------------------------------------------------------------<BR>&nbsp;&nbsp;&nbsp;&nbsp;hda1 
      Boot Primary Linux ReiserFS 12000.69<BR>&nbsp;&nbsp;&nbsp;&nbsp;hda5 
      Logical Linux ReiserFS 67496.65<BR>&nbsp;&nbsp;&nbsp;&nbsp;hda6 Logical 
      Linux swap 526.42<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Bootable] [ Delete ] [ 
      Help ] [Maximize] [ Print ] [ Quit ]<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[ 
      Type ] [ Units ] [ Write 
      ]<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Toggle 
      bootable flag of the current partition</CODE></DIV>
      <P></P>
      <P>您进入了cfdisk 的操作界面;用键盘移动指针到[Quit]就可以退出; </P>
      <P><B><BR>四、parted 功能不错的分区工具;在Fedora 
      4.0中有带,可以自己安装上;在此主题中,我们只说如何查看磁盘的分区情况;<BR></B><BR>调用方法简单,parted 
      默认是打开的设备是/dev/hda ,也可以自己指定;比如 parted /dev/hda 或/dev/sda 等;退出的方法是 quit<BR>
      <DIV class=codeblock><CODE>[root@localhost beinan]# parted<BR>使用 
      /dev/hda<BR>(parted) p<BR>/dev/hda 的磁盘几何结构:0.000-76319.085 
      兆字节<BR>磁盘标签类型:msdos<BR>Minor 起始点 终止点 类型 文件系统 标志<BR>1 0.031 6000.842 主分区 
      ntfs 启动<BR>2 6000.842 22003.088 主分区 fat32 lba<BR>3 22003.088 60800.690 
      扩展分区<BR>5 22003.119 30004.211 逻辑分区 reiserfs<BR>6 30004.242 40005.615 逻辑分区 
      reiserfs<BR>7 40005.646 40774.350 逻辑分区 linux-swap<BR>8 40774.381 52219.094 
      逻辑分区 ext3<BR>9 52219.125 60800.690 逻辑分区 reiserfs</CODE></DIV>
      <P></P>
      <P>我们在partd 的操作面上,用p就可以列出当前磁盘的分区情况,如果想要查看其它磁盘,可以用 select 功能,比如 select 
      /dev/sda ;<BR><B><BR>五、qtparted ,与parted 相关的软件还有qtparted 
      ,也能查看到磁盘的结构和所用的文件系统,是图形化的;<BR></B><BR>[beinan@localhost ~]# qtparted</P>
      <P>图形化的查看,一目了然;</P>
      <P><A 
      href="Linux 查看磁盘分区、文件系统、使用情况的命令和相关工具介绍  LinuxSir_Org.files/qtpartedlinuxsir.org0001.jpg"><IMG 
      height=100 
      src="Linux 查看磁盘分区、文件系统、使用情况的命令和相关工具介绍  LinuxSir_Org.files/qtpartedlinuxsir.org0001.jpg" 
      weight="100"></A><BR><B><BR>六、sfdisk 
      也是一个分区工具,功能也多多;我们在这里只说他的列磁盘分区情况的功能;<BR></B><BR>
      <DIV class=codeblock><CODE>[root@localhost beinan]# sfdisk 
      -l</CODE></DIV><BR>自己看看吧;
      <P></P>
      <P>sfdisk 有几个很有用的功能;有兴趣的弟兄不妨看看;</P>
      <P><B><BR>七、partx 也简要的说一说,有些系统自带了这个工具,功能也简单,和fdisk 、parted、cfdisk 
      来说不值一提;不用也罢;<BR></B><BR>用法: partx 设备名 </P>
      <P>
      <DIV class=codeblock><CODE>[root@localhost beinan]# partx /dev/hda<BR># 1: 
      63- 12289724 ( 12289662 sectors, 6292 MB)<BR># 2: 12289725- 45062324 ( 
      32772600 sectors, 16779 MB)<BR># 3: 45062325-124519814 ( 79457490 sectors, 
      40682 MB)<BR># 4: 0- -1 ( 0 sectors, 0 MB)<BR># 5: 45062388- 61448624 ( 
      16386237 sectors, 8389 MB)<BR># 6: 61448688- 81931499 ( 20482812 sectors, 
      10487 MB)<BR># 7: 81931563- 83505869 ( 1574307 sectors, 806 MB)<BR># 8: 
      83505933-106944704 ( 23438772 sectors, 12000 MB)<BR># 9: 
      106944768-124519814 ( 17575047 sectors, 8998 MB)</CODE></DIV>
      <P></P>
      <P>八、查看目前机器中的所有磁盘及分区情况:<BR>
      <DIV class=codeblock><CODE>[beinan@localhost ~]$ cat 
      /proc/partitions<BR>major minor #blocks name<BR>&nbsp;&nbsp;&nbsp;3 0 
      78150744 hda<BR>&nbsp;&nbsp;&nbsp;3 1 6144831 hda1<BR>&nbsp;&nbsp;&nbsp;3 
      2 16386300 hda2<BR>&nbsp;&nbsp;&nbsp;3 5 8193118 
      hda5<BR>&nbsp;&nbsp;&nbsp;3 6 10241406 hda6<BR>&nbsp;&nbsp;&nbsp;3 7 
      787153 hda7<BR>&nbsp;&nbsp;&nbsp;3 8 11719386 hda8<BR>&nbsp;&nbsp;&nbsp;3 
      9 8787523 hda9<BR>&nbsp;&nbsp;&nbsp;8 0 58605120 
      sda<BR>&nbsp;&nbsp;&nbsp;8 1 58604528 
      sda1</CODE></DIV><BR><B><BR>九、mac-fdisk 
      这个工具主要是用在Powerpc版本的Linux中,咱们常用X86版本中没有这个工具;这个只是介绍一下;<BR></B>
      <P></P>
      <P><FONT size=4><B>相关文档</B></FONT></P>
      <P><A 
      href="http://www.linuxsir.org/main/?q=node/127">《在Linux系统中存储设备的两种表示方法》</A><BR><A 
      href="http://www.linuxsir.org/main/?q=node/80">《合理规划您的硬盘分区》</A><BR><A 
      href="http://www.linuxsir.org/main/?q=node/82">《系统引导过程及硬盘分区结构论述》</A><BR><A 
      href="http://www.linuxsir.org/main/?q=node/41">《Linux 
      查看磁盘分区、文件系统、使用情况的命令和相关工具介绍》</A><BR><A 
      href="http://www.linuxsir.org/main/?q=node/81">《实例解说 fdisk 使用方法》</A><BR><A 
      href="http://www.linuxsir.org/main/?q=node/23">《在Fedora core 4.0 
      加载NTFS和FAT32分区详述》</A><BR><A 
      href="http://www.linuxsir.org/main/?q=node/40">《Fedora Core 4.0 
      HAL配置即插即用移动存储(USB及1394)的实践》</A></P>
      <TABLE id=attachments>
        <TBODY>
        <TR>
          <TH>附件</TH>
          <TH>大小</TH></TR>
        <TR class=dark>
          <TD><A 
            href="Linux 查看磁盘分区、文件系统、使用情况的命令和相关工具介绍  LinuxSir_Org.files/qtpartedlinuxsir.org0001.jpg">qtpartedlinuxsir.org0001.jpg</A></TD>
          <TD>101.59 KB</TD></TR></TBODY></TABLE></DIV>
      <DIV class=links>By 北南南北 at 2005/08/19 - 15:18 | <A 
      href="http://www.linuxsir.org/main/?q=taxonomy/term/1">Linux</A> | <A 
      href="http://www.linuxsir.org/main/?q=taxonomy/term/25">基础知识</A> | <A 
      title=共享你有关本文的思想和意见。 
      href="http://www.linuxsir.org/main/?q=comment/reply/41#comment">参与评论</A> | 
      8537 阅读</DIV></DIV><A id=comment></A>
      <FORM action=?q=comment method=post>
      <DIV><INPUT type=hidden value=41 name=edit[nid]> </DIV></FORM><!-- end content -->
      <DIV id=footer>
      <CENTER><A href="http://www.linuxsir.org/"><IMG 
      src="Linux 查看磁盘分区、文件系统、使用情况的命令和相关工具介绍  LinuxSir_Org.files/logo.jpg"></A> 
      <BR><A href="http://www.miibeian.gov.cn/"><FONT color=blue 
      size=3><B>闽ICP备06025536号</B></FONT></A><BR>
      <SCRIPT language=JavaScript 
      src="Linux 查看磁盘分区、文件系统、使用情况的命令和相关工具介绍  LinuxSir_Org.files/cyberpolice.htm"></SCRIPT>
      <BR><A href="http://www.linuxsir.org/main/?q=node/78"><FONT color=blue 
      size=3><B>© 2002-2006 LinuxSir.Org</B></FONT></A><BR></CENTER></DIV></TD>
    <TD id=sidebar-right>
      <DIV class="block block-block" id=block-block-2>
      <H2 class=title>基础知识</H2>
      <DIV class=content>
      <UL>
        <LI><A href="http://www.linuxsir.org/main/?q=taxonomy/term/23">安装配置</A> 
        <LI><A 
        href="http://www.linuxsir.org/main/?q=taxonomy/term/1/25/">基础入门</A> 
        <LI><A href="http://www.linuxsir.org/main/?q=taxonomy/term/22/">硬件解决</A> 

        <LI><A href="http://www.linuxsir.org/main/?q=taxonomy/term/21">软件管理</A> 
        <LI><A 
        href="http://www.linuxsir.org/main/?q=taxonomy/term/35/48/">重要资源</A> 
        </LI></UL></DIV></DIV>
      <DIV class="block block-block" id=block-block-4>
      <H2 class=title>软件应用</H2>
      <DIV class=content>
      <UL>
        <LI><A href="http://www.linuxsir.org/main/?q=taxonomy/term/30">网络工具</A> 
        <LI><A href="http://www.linuxsir.org/main/?q=taxonomy/term/32">图形图像</A> 
        <LI><A href="http://www.linuxsir.org/main/?q=taxonomy/term/31">音乐视频</A> 
        <LI><A href="http://www.linuxsir.org/main/?q=taxonomy/term/49">字体中文</A> 
        <LI><A href="http://www.linuxsir.org/main/?q=taxonomy/term/33">软件其它</A> 
        </LI></UL></DIV></DIV>
      <DIV class="block block-block" id=block-block-5>
      <H2 class=title>网络服务器</H2>
      <DIV class=content>
      <UL>
        <LI><A href="http://www.linuxsir.org/main/?q=taxonomy/term/27">文件服务器<A> 
        <LI><A 
        href="http://www.linuxsir.org/main/?q=taxonomy/term/28">Web服务器</A> 
        <LI><A href="http://www.linuxsir.org/main/?q=taxonomy/term/29">邮件服务器</A> 

        <LI><A href="http://www.linuxsir.org/main/?q=taxonomy/term/37">数据库应用</A> 

        <LI><A href="http://www.linuxsir.org/main/?q=taxonomy/term/50">服务器其它</A> 
        </LI></UL></DIV></DIV>
      <DIV class="block block-comment" id=block-comment-0>
      <H2 class=title>最新评论</H2>
      <DIV class=content>
      <DIV class=item-list>
      <UL>
        <LI><A 
        href="http://www.linuxsir.org/main/?q=node/226#comment-629">投影机</A><BR>17 
        hours 38 min 前
        <LI><A 
        href="http://www.linuxsir.org/main/?q=node/10#comment-628">压缩:</A><BR>17 
        hours 58 min 前
        <LI><A 
        href="http://www.linuxsir.org/main/?q=node/178#comment-627">不行</A><BR>22 
        hours 28 min 前
        <LI><A 
        href="http://www.linuxsir.org/main/?q=node/158#comment-626"></A><BR>1 
        day 13 hours 前
        <LI><A 
        href="http://www.linuxsir.org/main/?q=node/42#comment-625">太感谢了</A><BR>1 
        day 18 hours 前
        <LI><A 
        href="http://www.linuxsir.org/main/?q=node/222#comment-624">错了</A><BR>2 
        days 8 hours 前
        <LI><A 
        href="http://www.linuxsir.org/main/?q=node/222#comment-623">q</A><BR>2 
        days 8 hours 前
        <LI><A 
        href="http://www.linuxsir.org/main/?q=node/222#comment-622">有些道理</A><BR>2 
        days 9 hours 前
        <LI><A 
        href="http://www.linuxsir.org/main/?q=node/219#comment-621">"内置的摄像头也能用这个吗?"</A><BR>2 
        days 22 hours 前
        <LI><A 
        href="http://www.linuxsir.org/main/?q=node/80#comment-620">终于知道了...</A><BR>3 
        days 7 hours 
前</LI></UL></DIV></DIV></DIV></TD></TR></TBODY></TABLE></BODY></HTML>

⌨️ 快捷键说明

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