linux怎么看硬盘分区类型,Linux下如何查看分区文件系统类型

本文介绍了Linux系统中两个重要的磁盘管理命令:fdisk和df。fdisk用于查看硬盘分区信息,但无法显示文件系统类型;df则用来检查文件系统的磁盘空间使用情况,可显示已挂载文件系统的空间使用、剩余空间等。通过这两个命令,系统管理员可以有效地监控和管理Linux系统的磁盘资源。
摘要由CSDN通过智能技术生成

1,fdisk -l

fdisk -l 只能列出硬盘的分区表、容量大小以及分区类型,但是查看不到文件系统的类型。

[root@AY140716161543837722Z ~]# fdisk -l

Disk /dev/xvda: 21.5 GB, 21474836480 bytes

255 heads, 63 sectors/track, 2610 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk identifier: 0x00073f45

Device Boot      Start         End      Blocks   Id  System

/dev/xvda1   *      1           2611    20970496   83  Linux

[root@AY140716161543837722Z ~]# fdisk -help

Usage:

fdisk [options]     change partition table

fdisk [options] -l list partition table(s)

fdisk -s       give partition size(s) in blocks

Options:

-b             sector size (512, 1024, 2048 or 4096)

-c                        switch off DOS-compatible mode

-h                        print help

-u             give sizes in sectors instead of cylinders

-v                        print version

-C                specify the number of cylinders

-H                specify the number of heads

-S                specify the number of sectors per track

2,df -h

df 命令是用来查看文件系统磁盘空间使用量的。但df 命令只会列出已挂载的文件系统信息,对于没有挂载的文件系统是查看不到的。使用这个命令可以很方便的查看已挂载的文件系统的空间使用量、剩余空间大小等信息。

[root@AY140716161543837722Z ~]# df --help

Usage: df [OPTION]... [FILE]...

Show information about the file system on which each FILE resides,or all file systems by default.

显示每个文件所在的文件系统的信息,或者默认插件所有的文件系统。

[root@AY140716161543837722Z ~]# df

Filesystem           1K-blocks      Used        Available     Use% Mounted on

/dev/xvda1         20641404     7531560  12061320  39%    /

tmpfs                 960472         0            960472      0%     /dev/shm

[root@AY140716161543837722Z ~]# df -hT

Filesystem    Type    Size    Used   Avail     Use%     Mounted on

/dev/xvda1   ext4     20G   7.2G   12G      39%       /

tmpfs           tmpfs    938M     0  938M      0%        /dev/shm

Mandatory arguments to long options are mandatory for short options too.

-a, --all             include dummy file systems

-B, --block-size=SIZE  use SIZE-byte blocks

--direct          show statistics for a file instead of mount point

--total           produce a grand total

-h, --human-readable  print sizes in human readable format (e.g., 1K 234M 2G)人类可读方式读取

-H, --si              likewise, but use powers of 1000 not 1024

-i, --inodes          list inode information instead of block usage

-k                         like --block-size=1K

-l, --local           limit listing to local file systems

--no-sync         do not invoke sync before getting usage info (default)

-P, --portability     use the POSIX output format

--sync            invoke sync before getting usage info

-t, --type=TYPE       limit listing to file systems of type TYPE

-T, --print-type      print file system type

-x, --exclude-type=TYPE   limit listing to file systems not of type TYPE

-v                    (ignored)

--help     display this help and exit

--version  output version information and exit

Display values are in units of the first available SIZE from --block-size,

and the DF_BLOCK_SIZE, BLOCK_SIZE and BLOCKSIZE environment variables.

Otherwise, units default to 1024 bytes (or 512 if POSIXLY_CORRECT is set).

SIZE may be (or may be an integer optionally followed by) one of following:

KB 1000, K 1024, MB 1000*1000, M 1024*1024, and so on for G, T, P, E, Z, Y.

Report df bugs to bug-coreutils@gnu.org

GNU coreutils home page:

General help using GNU software:

For complete documentation, run: info coreutils 'df invocation'

功能:检查文件系统的磁盘空间占用情况。可以用该命令来获取:硬盘被占用了多少空间,目前还剩下多少空间等信息。

语法:df [选项]

说明:df命令可显示所有文件系统对i节点和磁盘块的使用情况。该命令各个选项的含义如下:

-a 显示所有文件系统的磁盘使用情况,包括0块(block)的文件系统,如/proc文件系统。

-k 以k字节为单位显示。

-i 显示i节点信息,而不是磁盘块。

-t 显示各指定类型的文件系统的磁盘空间使用情况。

-x 列出不是某一指定类型文件系统的磁盘空间使用情况(与t选项相反)。

-T 显示文件系统类型。

例1:列出各文件系统的磁盘空间使用情况。

$ df

Filesystem     1 K-blocks  Used     Available Use% Mounted on

/dev/hda2     1361587      1246406 44823     97%     /

df命令的输出清单的第1列是代表文件系统对应的设备文件的路径名(一般是硬盘上的分区);第2列给出分区包含的数据块(1024字节)的数目;第3,4列分别表示已用的和可用的数据块数目。用户也许会感到奇怪的是,第3,4列块数之和不等于第2列中的块数。这是因为缺省的每个分区都留了少量空间供系统管理员使用。即使遇到普通用户空间已满的情况,管理员仍能登录和留有解决问题所需的工作空间。清单中Use% 列表示普通用户空间使用的百分比,即使这一数字达到100%,分区仍然留有系统管理员使用的空间。最后,Mounted on列表示文件系统的安装点。

例2:列出各文件系统的i节点使用情况。

$ df -ia

Filesystem Inodes IUsed IFree Iused% Mounted on

/dev/ hda2 352256 75043 277213 21% /

none 0 0 0 0% /proc

localhost:(pid221) 0 0 0 0% /net

例3:列出文件系统的类型。

$ df -T

Filesystem Type 1K-blocks Used Available use% Mounted on

/dev/hda2 ext2 1361587 1246405 44824 97% /

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值