环境:centos7
需求:查看系统分区表信息,磁盘空间及inode占用
方法:
df 命令
fdisk命令
[root@liubaiye_PC ~]# which df
/usr/bin/df
[root@liubaiye_PC ~]# which fdisk
/usr/sbin/fdisk
df -i //查看inode占用情况
-i, --inodes list inode information instead of block usage
df -h //查看磁盘使用量(以MB、G等易读方式统计)
-h, --human-readable print sizes in human readable format (e.g., 1K 234M 2G)
fdisk -l //查看系统分区表信息
fdisk [options] -l
Filesystem Inodes IUsed IFree IUse% Mounted on
/dev/sda2 8912384 79710 8832674 1% /
devtmpfs 122587 375 122212 1% /dev
tmpfs 124990 1 124989 1% /dev/shm
tmpfs 124990 440 124550 1% /run
tmpfs 124990 16 124974 1% /sys/fs/cgroup
/dev/sda1 96496 338 96158 1% /boot
tmpfs 124990 1 124989 1% /run/user/0
Filesystem Size Used Avail Use% Mounted on
/dev/sda2 17G 1.9G 16G 11% /
devtmpfs 479M 0 479M 0% /devtmpfs 489M 0 489M 0% /dev/shm
tmpfs 489M 6.7M 482M 2% /run
tmpfs 489M 0 489M 0% /sys/fs/cgroup/dev/sda1 197M 150M 47M 77% /boot
tmpfs 98M 0 98M 0% /run/user/0
[root@liubaiye_PC ~]# fdisk -l
Disk /dev/sda: 21.5 GB, 21474836480 bytes, 41943040 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x000b3bca
Device Boot Start End Blocks Id System
/dev/sda1 * 2048 411647 204800 83 Linux
/dev/sda2 411648 36061183 17824768 83 Linux
/dev/sda3 36061184 40255487 2097152 82 Linux swap / Solaris