QQ登录

只需一步,快速开始

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 1184|回复: 6

在命令行下使用什么命令能显示出各分区的文件系统?

[复制链接]
发表于 2005-3-16 16:25:27 | 显示全部楼层 |阅读模式
我想在分区没有挂载前,在命令行下查看各分区的文件系统是ext2,vfat还是ext3.
请问使用什么命令能实现这项功能!
mount
发表于 2005-3-16 16:53:14 | 显示全部楼层
fdisk -l /dev/hda   (or /dev/sda for SATA harddisk)
回复

使用道具 举报

发表于 2005-3-16 21:03:00 | 显示全部楼层
我的fdisk -l 已经一年 没有显示啦。。不知道啥原因   
回复

使用道具 举报

 楼主| 发表于 2005-3-17 08:15:49 | 显示全部楼层
[quote:743ebe770c="lanche"]fdisk -l /dev/hda   (or /dev/sda for SATA harddisk)[/quote]

斑竹,我试了,还是看不到是何种文件系统。
这在挂载时,太费事了。因为每次都得先弄清是什么文件系统。
能不能再帮忙想个好办法。
先谢了!
回复

使用道具 举报

发表于 2005-3-17 08:30:02 | 显示全部楼层
先搞清楚各个文件系统类型,然后把挂载命令写入/etc/fstab中.这样每次都自动挂载,不用你再逐个用命令了,这样行吗?
回复

使用道具 举报

发表于 2005-3-17 08:31:23 | 显示全部楼层
还有这里看到一篇文章,我引用过来看看,或许有些帮助:
(1)fdisk -l /dev/hda

[root@Jintao root]# fdisk -l /dev/hda

Disk /dev/hda: 41.1 GB, 41110142976 bytes
255 heads, 63 sectors/track, 4998 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot    Start       End    Blocks   Id  System
/dev/hda1   *         1        13    104391   83  Linux
/dev/hda2            14      3200  25599577+  83  Linux
/dev/hda3          3201      4156   7679070   83  Linux
/dev/hda4          4157      4998   6763365    f  Win95 Ext'd (LBA)
/dev/hda5          4157      4793   5116671   83  Linux
/dev/hda6          4794      4920   1020096   83  Linux
/dev/hda7          4921      4998    626503+  82  Linux swap

(2)mount

[root@Jintao root]# mount
/dev/hda3 on / type ext3 (rw)
none on /proc type proc (rw)
usbdevfs on /proc/bus/usb type usbdevfs (rw)
none on /dev/pts type devpts (rw,gid=5,mode=620)
none on /dev/shm type tmpfs (rw)
/dev/hda2 on /ftproot type ext3 (rw)
/dev/hda5 on /lfs type ext3 (rw)
/dev/hda6 on /www type ext3 (rw)

(3)parted

[root@Jintao root]# 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/hda
Information: The operating system thinks the geometry on /dev/hda is
4998/255/63.  Therefore, cylinder 1024 ends at 8032.499M.
(parted) print
Disk geometry for /dev/hda: 0.000-39205.687 megabytes
Disk label type: msdos
Minor    Start       End     Type      Filesystem  Flags
1          0.031    101.975  primary   ext3        boot
2        101.975  25101.562  primary   ext3
3      25101.562  32600.654  primary   ext3
4      32600.654  39205.502  extended              lba
5      32600.685  37597.434  logical   ext3
6      37597.465  38593.652  logical   ext3
7      38593.683  39205.502  logical   linux-swap

(4)stat -f file

[root@Jintao root]# stat -f 1.c
  File: "1.c"
    ID: 0        Namelen: 255     Type: ext2/ext3
Blocks: Total: 1889600    Free: 142799     Available: 46811      Size: 4096
Inodes: Total: 960992     Free: 849089

(5)file -s /dev/hdaN

[root@Jintao root]# file -s /dev/hda1
/dev/hda1: Linux rev 1.0 ext3 filesystem data (needs journal recovery)

(6)df -T

[root@Jintao root]# df -T
Filesystem    Type   1K-blocks      Used Available Use% Mounted on
/dev/hda3     ext3     7558400   6987204    187244  98% /
none         tmpfs       62324         0     62324   0% /dev/shm
/dev/hda2     ext3    25197252  21128964   2788312  89% /ftproot
/dev/hda5     ext3     5036284    339288   4441164   8% /lfs
/dev/hda6     ext3     1004024     16428    936592   2% /www

可以看到.很多必须是挂载以后才能看到的~

不过这些东西很有用~也挺有意思~
回复

使用道具 举报

 楼主| 发表于 2005-3-17 09:42:36 | 显示全部楼层
谢谢楼上的各位!
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

GMT+8, 2024-10-6 15:32 , Processed in 0.059457 second(s), 15 queries .

© 2021 Powered by Discuz! X3.5.

快速回复 返回顶部 返回列表