hf
30Gb 가상 드라이브가 할당된 VirtualBox VM인 Lubuntu에서 명령을 테스트하고 있습니다 (참고: 실제 Gb는 gibi/mebi가 아닙니다.). 그러나 다음 명령을 사용하면 hf
매우 이상한 일이 발생합니다 .
root@vbox:~# df -h
Filesystem Size Used Avail Use% Mounted on
tmpfs 292M 1,2M 291M 1% /run
/dev/sda1 30G 20G 8,2G 71% /
tmpfs 1,5G 0 1,5G 0% /dev/shm
tmpfs 5,0M 4,0K 5,0M 1% /run/lock
tmpfs 4,0M 0 4,0M 0% /sys/fs/cgroup
tmpfs 292M 92K 292M 1% /run/user/1000
root@vbox:~# df
Filesystem 1K-blocks Used Available Use% Mounted on
tmpfs 298632 1180 297452 1% /run
/dev/sda1 30833564 20826180 8523272 71% /
tmpfs 1493144 0 1493144 0% /dev/shm
tmpfs 5120 4 5116 1% /run/lock
tmpfs 4096 0 4096 0% /sys/fs/cgroup
tmpfs 298628 92 298536 1% /run/user/1000
root@vbox:~# df --block-size=1
Filesystem 1B-blocks Used Available Use% Mounted on
tmpfs 305799168 1208320 304590848 1% /run
/dev/sda1 31573569536 21326008320 8727830528 71% /
tmpfs 1528979456 0 1528979456 0% /dev/shm
tmpfs 5242880 4096 5238784 1% /run/lock
tmpfs 4194304 0 4194304 0% /sys/fs/cgroup
tmpfs 305795072 94208 305700864 1% /run/user/1000
root@vbox:~# tune2fs -l /dev/sda1
tune2fs 1.46.5 (30-Dec-2021)
Filesystem volume name: <none>
Last mounted on: /
Filesystem UUID: eb1f771e-14d9-461b-98b4-1e399a7ddeb0
Filesystem magic number: 0xEF53
Filesystem revision #: 1 (dynamic)
Filesystem features: has_journal ext_attr resize_inode dir_index filetype needs_recovery extent 64bit flex_bg sparse_super large_file huge_file dir_nlink extra_isize metadata_csum
Filesystem flags: signed_directory_hash
Default mount options: user_xattr acl
Filesystem state: clean
Errors behavior: Continue
Filesystem OS type: Linux
Inode count: 1974272
Block count: 7865088
Reserved block count: 366932
Free blocks: 3060668
Free inodes: 1637218
First block: 0
Block size: 4096
Fragment size: 4096
Group descriptor size: 64
Reserved GDT blocks: 1023
Blocks per group: 32768
Fragments per group: 32768
Inodes per group: 8192
Inode blocks per group: 512
Flex block group size: 16
Filesystem created: Mon Dec 7 20:34:27 2020
Last mount time: Sat Jul 29 08:28:43 2023
Last write time: Sat Jul 29 08:28:43 2023
Mount count: 31
Maximum mount count: -1
Last checked: Mon Dec 7 20:34:27 2020
Check interval: 0 (<none>)
Lifetime writes: 36 GB
Reserved blocks uid: 0 (user root)
Reserved blocks gid: 0 (group root)
First inode: 11
Inode size: 256
Required extra isize: 32
Desired extra isize: 32
Journal inode: 8
First orphan inode: 1186725
Default directory hash: half_md4
Directory Hash Seed: fd016d91-9723-4dcc-9880-0b2a65e0bb49
Journal backup: inode blocks
Checksum type: crc32c
Checksum: 0x54deee1a
보시다시피 df -h
정확한 정확한 30Gb가 반환되는 반면 기본 df
또는 df --block-size=1
대략적인 바이트가 반환됩니다 600 000 000
.
더 흥미롭게도 tune2fs -l /dev/sda1
4k 블록의 정확한 수가 표시되며 총합은 32 215 400 448
바이트 또는 30.0029 Gb
.
df
Size
열이 절대 바이트 총계를 반환해야 하므로 이는 5% 예약 블록에서는 확실히 문제가 되지 않습니다 . 이것을 어떻게 설명할 것인가?