中国IT动力,最新最全的IT技术教程
最新100篇 | 推荐100篇 | 专题100篇 | 排行榜 | 搜索 | 在线API文档
首 页 | 程序开发 | 操作系统 | 软件应用 | 图形图象 | 网络应用 | 精文荟萃 | 教育认证 | 硬件维护 | 未整理篇 | 站长教程
ASP JS PHP工程 ASP.NET 网站建设 UML J2EESUN .NET VC VB VFP 网络维护 数据库 DB2 SQL2000 Oracle Mysql
服务器 Win2000 Office C DreamWeaver FireWorks Flash PhotoShop 上网宝典 CorelDraw 协议大全 网络安全 微软认证
硬件维护  CPU  主板  硬盘  内存  显卡  显示器  键盘鼠标  声卡音箱  打印机  机箱电源  BIOS  网卡  C#  Java  Delphi  vs.net2005
  当前位置:> 操作系统 > Linux > Linux综合
查看分区类型的方法
作者:未知 时间:2005-09-13 22:03 出处:Blog.ChinaUnix.net 责编:chinaitpower
              摘要:查看分区类型的方法
以往我们拿到一块朋友的硬盘没有办法看是什么分区,导致mount命令不能识别分区类型,现在好了。

fdisk -l不复杂,但是看不到文件系统类型,只能看到分区类型,以Redhat 9为例:

[root@redhat9 root]# fdisk -l

Disk /dev/sda: 8589 MB, 8589934592 bytes
255 heads, 63 sectors/track, 1044 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

  Device Boot    Start       End    Blocks   Id  System
/dev/sda1   *         1        13    104391   83  Linux
/dev/sda2            14      1012   8024467+  83  Linux
/dev/sda3          1013      1044    257040   82  Linux swap

df -Tk是可以的,不过df -Th更友好一些,容量大小是以易读的方式显示的,而且它是显示所有分区,并不是一个分区。这个命令最方便。

[root@redhat9 root]# df -Th
Filesystem    Type    Size  Used Avail Use% Mounted on
/dev/sda2     ext3    7.6G  2.3G  4.9G  32% /
/dev/sda1     ext3     99M  9.3M   85M  10% /boot
none         tmpfs     62M     0   62M   0% /dev/shm

parted倒是有点复杂了,因为它的功能很强,redhat 9中的parted不支持-p参数,但是用parted命令进入后可以用p命令显示出当前的磁盘分区和文件系统情况:

# parted
GNU Parted 1.6.3
Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
This program is free software, covered by the GNU General Public License.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
General Public License for more details.

Using /dev/sda
Information: The operating system thinks the geometry on /dev/sda is 1044/255/63.  Therefore,
cylinder 1024 ends at 8032.499M.
(parted) p                                                                

Disk geometry for /dev/sda: 0.000-8192.000 megabytes
Disk label type: msdos
Minor    Start       End     Type      Filesystem  Flags
1          0.031    101.975  primary   ext3        boot
2        101.975   7938.369  primary   ext3        
3       7938.369   8189.384  primary   linux-swap

关闭本页
 
首页 | 投资与合作 | 服务条款 | 隐私政策 | 收藏本站 | 设为首页 | 新用户注册 | 免责声明 | 使用帮助
Copyright ©2005-2008 chinaitpower.com All rights reserved. www.chinaitpower.com 版权所有