可能重复:
ext4 分区大小/可用空间差异
我只是对看到的一些输出感到困惑。当我运行“df -h”时,让我困惑的行如下:
Filesystem Size Used Avail Use%
/dev/mapper/sysvg-lvvideos 293G 4.5G 274G 2%
当我运行“vgdisplay”时,我得到:
--- Volume group ---
VG Name sysvg
System ID
Format lvm2
Metadata Areas 2
Metadata Sequence No 8
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 4
Open LV 4
Max PV 0
Cur PV 2
Act PV 2
VG Size 1.01 TiB
PE Size 4.00 MiB
Total PE 265251
Alloc PE / Size 120508 / 470.73 GiB
Free PE / Size 144743 / 565.40 GiB
VG UUID 4TjHj7-11CY-auM2-h05h-BXSV-2S4X-WUDh5R
当我运行“lvdisplay sysvg”时,我得到:
--- Logical volume ---
LV Name /dev/sysvg/lvvideos
VG Name sysvg
LV UUID ZXNPP0-2IUI-UT1s-3riN-fxZH-QmfW-3OgwPI
LV Write Access read/write
LV Status available
# open 1
LV Size 293.00 GiB
Current LE 75008
Segments 2
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 254:2
我不明白的是:293 - 4.5 不等于 274。我有 14.5 GiB 未被计入。
答案1
这是因为通常 5% 的空间是为 root 用户保留的。
你可以通过以下方式禁用它
tune2fs -m0 /dev/sysvg/lvvideos
编辑
这与 LVM 无关,这是所选文件系统的“功能”......
编辑2
mke2fs 的手册页说明如下
-m reserved-blocks-percentage
Specify the percentage of the filesystem blocks reserved for the
super-user. This avoids fragmentation, and allows root-owned
daemons, such as syslogd(8), to continue to function correctly
after non-privileged processes are prevented from writing to the
filesystem. The default percentage is 5%.
是的,这适用于所有 ext2/ext3/ext4 分区。