
linux系统fdisk -l 和df -h 命令显示磁盘空间大小不等
2016-09-22
fdisk /dev/sda
然后按 n
输入p
一路回车 直到出现提示符
然后输入w
执行 partprobe
执行mkfs.ext3 /dev/sda4
一路回车
耐心等待
上述步骤完成后
执行mkdir /data1
mount /dev/sda4 /data1
然后执行df -h
就看到新的磁盘分区了
修改/etc/fstab
最后加入
/dev/sda4 /data1 ext3 noatime,acl,user_xattr 1 2
退出保存
/dev/sdb一样的步骤
这部分我是看的《Linux就该这么学》这本书籍,你有兴趣也可以好好看看这本书,讲的非常详细。

2023-07-25 广告
fdisk -l
Device Start End Sectors Size Type
/dev/sda3 72265728 1953523711 1881257984 897.1G Linux filesystem
df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda3 882G 61G 777G 8% /
They’re just measuring different quantities.
fdisk shows your partition’s size: this measures raw sectors on your drive.
df shows usable space. Starting with the 897.1GiB of your partition, you lose some space to your file system’s data structures, resulting in df’s reported 882GiB total. Then you “lose” the reserved space, which you accounted for.
广告 您可能关注的内容 |