查看linux分区文件系统类型

 

以往我们拿到一块朋友的硬盘没有办法看是什么分区,导致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

 

原文地址:http://franksinger.javaeye.com/blog/476694

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值