Linux查看磁盘剩余空间以及挂载磁盘分区

  • Post author:
  • Post category:linux



1、fdisk -l 查看磁盘信息,请切到root

aa@ubuntu:~$ fdisk -l fdisk: cannot open /dev/sda: Permission denied

aa@ubuntu:~$ cd su bash: cd: su: No such file or directory

aa@ubuntu:~$ su

root@ubuntu:/home/aa# fdisk -l Disk /dev/sda: 80 GiB, 85899345920

bytes, 167772160 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 Disklabel type: dos Disk

identifier: 0x28a5ba0b

Device     Boot     Start       End   Sectors  Size Id Type
/dev/sda1  *         2048 123828223 123826176   59G 83 Linux
/dev/sda2       123830270 125827071   1996802  975M  5 Extended
/dev/sda3       125827072 167772159  41945088   20G 83 Linux
/dev/sda5       123830272 125827071   1996800  975M 82 Linux swap / Solaris
Partition table entries are not in disk order.



2、df -h 查看磁盘剩余空间

root@ubuntu:/home/aa# df -h 
df: /mnt/hgfs: Protocol error
Filesystem      Size  Used Avail Use% Mounted on
udev            1.9G     0  1.9G   0% /dev
tmpfs           393M  6.4M  386M   2% /run
/dev/sda1        58G   54G  1.1G  99% /
tmpfs           2.0G  272K  2.0G   1% /dev/shm
tmpfs           5.0M  4.0K  5.0M   1% /run/lock
tmpfs           2.0G     0  2.0G   0% /sys/fs/cgroup
tmpfs           393M   48K  393M   1% /run/user/1000



版权声明:本文为qq_34418380原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。