我的分区上剩余 4GB,但出现磁盘已满错误。
Ubuntu 磁盘程序:
Size: 97 GB — 4.7 GB free (95.2% full)
df
命令:
Filesystem 1K-blocks Used Available Use% Mounted on
udev 1945292 0 1945292 0% /dev
tmpfs 394692 2132 392560 1% /run
/dev/sda8 92856968 88268000 0 100% /
tmpfs 1973456 45584 1927872 3% /dev/shm
tmpfs 5120 4 5116 1% /run/lock
tmpfs 1973456 0 1973456 0% /sys/fs/cgroup
/dev/loop1 56704 56704 0 100% /snap/core18/1885
/dev/loop2 58752 58752 0 100% /snap/discord/112
/dev/loop0 56320 56320 0 100% /snap/core18/1880
/dev/loop4 11648 11648 0 100% /snap/glade/231
/dev/loop3 58880 58880 0 100% /snap/discord/115
/dev/loop5 165376 165376 0 100% /snap/gnome-3-28-1804/128
/dev/loop6 166784 166784 0 100% /snap/gnome-3-28-1804/145
/dev/loop7 261760 261760 0 100% /snap/gnome-3-34-1804/36
/dev/loop8 223232 223232 0 100% /snap/gnome-3-34-1804/60
/dev/loop9 63616 63616 0 100% /snap/gtk-common-themes/1506
/dev/loop10 118912 118912 0 100% /snap/icloud-for-linux/166
/dev/loop11 185472 185472 0 100% /snap/obs-studio/1139
/dev/loop13 44288 44288 0 100% /snap/snap-store/415
/dev/loop12 185472 185472 0 100% /snap/obs-studio/1141
/dev/loop16 31104 31104 0 100% /snap/snapd/9279
/dev/loop17 297472 297472 0 100% /snap/vlc/1700
/dev/sda2 262144 38400 223744 15% /boot/efi
/dev/loop18 31744 31744 0 100% /snap/snapd/9607
tmpfs 394688 44 394644 1% /run/user/1000
/dev/loop15 51968 51968 0 100% /snap/snap-store/481
/dev/sdd1 7847952 16 7847936 1% /media/[username here]/A FAT32 DISK
df -i
命令:
Filesystem Inodes IUsed IFree IUse% Mounted on
udev 486323 697 485626 1% /dev
tmpfs 493364 1304 492060 1% /run
/dev/sda8 5931008 723915 5207093 13% /
tmpfs 493364 159 493205 1% /dev/shm
tmpfs 493364 6 493358 1% /run/lock
tmpfs 493364 18 493346 1% /sys/fs/cgroup
/dev/loop1 10775 10775 0 100% /snap/core18/1885
/dev/loop2 288 288 0 100% /snap/discord/112
/dev/loop0 10756 10756 0 100% /snap/core18/1880
/dev/loop4 1465 1465 0 100% /snap/glade/231
/dev/loop3 290 290 0 100% /snap/discord/115
/dev/loop5 27798 27798 0 100% /snap/gnome-3-28-1804/128
/dev/loop6 27807 27807 0 100% /snap/gnome-3-28-1804/145
/dev/loop7 24339 24339 0 100% /snap/gnome-3-34-1804/36
/dev/loop8 18513 18513 0 100% /snap/gnome-3-34-1804/60
/dev/loop9 62342 62342 0 100% /snap/gtk-common-themes/1506
/dev/loop10 3173 3173 0 100% /snap/icloud-for-linux/166
/dev/loop11 7221 7221 0 100% /snap/obs-studio/1139
/dev/loop13 15358 15358 0 100% /snap/snap-store/415
/dev/loop12 7221 7221 0 100% /snap/obs-studio/1141
/dev/loop16 472 472 0 100% /snap/snapd/9279
/dev/loop17 51155 51155 0 100% /snap/vlc/1700
/dev/sda2 0 0 0 - /boot/efi
/dev/loop18 472 472 0 100% /snap/snapd/9607
tmpfs 493364 99 493265 1% /run/user/1000
/dev/loop15 15843 15843 0 100% /snap/snap-store/481
/dev/sdd1 0 0 0 - /media/[username here]/A FAT32 DISK
请注意/
,它显示容量为 92856968 字节:已使用 88268000 字节,但可用容量为 0?什么?我有一个 512GB 的磁盘,但它目前正在被擦除。
答案1
这 4G 是为特权进程保留的块。默认值为整个文件系统的 5%。请参阅 tune2fs 的手册页以更改此百分比:
man tune2fs
...
-m 保留块百分比
设置仅可由特权进程分配的文件系统百分比。保留一定数量的文件系统块供特权进程使用是为了避免文件系统碎片化,并允许系统守护进程(如 syslogd(8))在非特权进程被阻止写入文件系统后继续正常运行。通常,保留块的默认百分比为 5%。