日期:2014-05-16  浏览次数:20729 次

查看文件系统类型的Linux命令
不需挂载就能查看的命令:

1. file
[root@localhost dev]# file -s /dev/sda1
/dev/sda1: Linux rev 1.0 ext4 filesystem data (extents) (huge files)

2.parted
[root@localhost dev]# parted /dev/sda
GNU Parted 1.8.8
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print
Model: VMware, VMware Virtual S (scsi)
Disk /dev/sda: 21.5GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Number  Start   End     Size    Type     File system  Flags
1      32.3kB  206MB   206MB   primary  ext3         boot
2      206MB   21.5GB  21.3GB  primary               lvm

3.fdisk
[root@localhost dev]# fdisk -l /dev/sda
Disk /dev/sda: 21.4 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x0007c1e8
   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          25      200781   83  Linux
/dev/sda2              26        2610    20764012+  8e  Linux LVM


需要挂载才能查看的命令:

1.mount
[root@localhost dev]# mount
/dev/mapper/VolGroup00-LogVol00 on / type ext3 (rw)
/proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
/dev/sda1 on /boot type ext3 (rw)
tmpfs on /dev/shm type tmpfs (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)

2.df
[root@localhost dev]# df -T
Filesystem    Type   1K-blocks      Used Available Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
              ext3    18320140   3426724  13962808  20% /
/dev/sda1     ext3      194442     13480    170923   8% /boot
tmpfs        tmpfs      516908         0    516908   0% /dev/shm

3.stat
[root@localhost /]# stat -f bin
  File: "bin"
    ID: 3ef5d5f4a8cc1340 Namelen: 255     Type: ext2/ext3
Block size: 4096       Fundamental block size: 4096
Blocks: Total: 4580035    Free: 3723354    Available: 3490702
Inodes: Total: 1163264    Free: 1044678