当前位置: 技术问答>linux和unix
ubuntu系统fdisk和df命令显示磁盘空间大小不一样
来源: 互联网 发布时间:2017-03-18
本文导语: sudo fdisk -l Disk /dev/sda: 438.5 GB, 438489317376 bytes 255 heads, 63 sectors/track, 53309 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...
sudo fdisk -l
Disk /dev/sda: 438.5 GB, 438489317376 bytes
255 heads, 63 sectors/track, 53309 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: 0x00000ca4
Device Boot Start End Blocks Id System
/dev/sda1 * 1 51148 410839040 83 Linux
/dev/sda2 51148 53310 17370113 5 Extended
/dev/sda5 51148 53310 17370112 82 Linux swap / Solaris
df -lh
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 386G 201G 166G 55% /
none 5.9G 224K 5.9G 1% /dev
none 5.9G 364K 5.9G 1% /dev/shm
none 5.9G 724K 5.9G 1% /var/run
none 5.9G 0 5.9G 0% /var/lock
none 5.9G 0 5.9G 0% /lib/init/rw
df: `/home/mudingyu/.gvfs': Permission denied
如上,怎么用fdisk看到的是438.5 GB,用df 看到的是386G?
感觉也不是换算的问题阿?
看硬盘大小到底该看哪个数据??
Disk /dev/sda: 438.5 GB, 438489317376 bytes
255 heads, 63 sectors/track, 53309 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: 0x00000ca4
Device Boot Start End Blocks Id System
/dev/sda1 * 1 51148 410839040 83 Linux
/dev/sda2 51148 53310 17370113 5 Extended
/dev/sda5 51148 53310 17370112 82 Linux swap / Solaris
df -lh
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 386G 201G 166G 55% /
none 5.9G 224K 5.9G 1% /dev
none 5.9G 364K 5.9G 1% /dev/shm
none 5.9G 724K 5.9G 1% /var/run
none 5.9G 0 5.9G 0% /var/lock
none 5.9G 0 5.9G 0% /lib/init/rw
df: `/home/mudingyu/.gvfs': Permission denied
如上,怎么用fdisk看到的是438.5 GB,用df 看到的是386G?
感觉也不是换算的问题阿?
看硬盘大小到底该看哪个数据??
|
fdisk -l看到的是物理磁盘大小(包括swap分区的物理大小)
df -h 看到的是文件系统使用状况(不包括swap分区)
df -h 看到的是文件系统使用状况(不包括swap分区)