查看Linux中的文件系统

时间:2020-01-09 10:43:36  来源:igfitidea点击:

如何查看Linux中的文件系统状态?
您可以使用以下命令查看Linux中文件系统的当前状态。

挂载命令mount

要显示有关已挂载文件系统的信息,请执行:

$ mount | column -t

输出示例:

/dev/sda5         on  /                            type  ext3                   (rw,errors=remount-ro)
proc              on  /proc                        type  proc                   (rw,noexec,nosuid,nodev)
none              on  /sys                         type  sysfs                  (rw,noexec,nosuid,nodev)
none              on  /sys/fs/fuse/connections     type  fusectl                (rw)
none              on  /sys/kernel/debug            type  debugfs                (rw)
none              on  /sys/kernel/security         type  securityfs             (rw)
none              on  /dev                         type  devtmpfs               (rw,mode=0755)
none              on  /dev/pts                     type  devpts                 (rw,noexec,nosuid,gid=5,mode=0620)
none              on  /dev/shm                     type  tmpfs                  (rw,nosuid,nodev)
none              on  /var/run                     type  tmpfs                  (rw,nosuid,mode=0755)
none              on  /var/lock                    type  tmpfs                  (rw,noexec,nosuid,nodev)
none              on  /lib/init/rw                 type  tmpfs                  (rw,nosuid,mode=0755)
binfmt_misc       on  /proc/sys/fs/binfmt_misc     type  binfmt_misc            (rw,noexec,nosuid,nodev)
gvfs-fuse-daemon  on  /home/Hyman/.gvfs            type  fuse.gvfs-fuse-daemon  (rw,nosuid,nodev,user=Hyman)
nas01:/mp3        on  /nfs                         type  nfs                    (rw,addr=192.168.3.1)
none              on  /proc/fs/vmblock/mountPoint  type  vmblock                (rw)

df命令

要了解文件系统磁盘空间的使用情况,请执行:

$ df
$ df -H

输出示例:

Filesystem             Size   Used  Avail Use% Mounted on
/dev/sda5              477G   167G   285G  37% /
none                   4.2G   402k   4.2G   1% /dev
none                   4.2G   2.1M   4.2G   1% /dev/shm
none                   4.2G   312k   4.2G   1% /var/run
none                   4.2G      0   4.2G   0% /var/lock
none                   4.2G      0   4.2G   0% /lib/init/rw
nas01:/mp3             6.0T   127G   5.8T   3% /nfs

du命令

使用du命令估计文件空间使用量,执行:

$ du
$ du /home
$ du -ch /home

列出分区表

执行fdisk命令,如下所示(必须以root身份运行):

# fdisk -l
# fdisk -l /dev/sda

输出示例:

Disk /dev/sda: 500.1 GB, 500107862015 bytes
255 heads, 63 sectors/track, 60801 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: 0xf0000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1        1992    15998976   82  Linux swap / Solaris
/dev/sda2            1993       60802   472384513    5  Extended
/dev/sda5            1993       60802   472384512   83  Linux