You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
du is reporting wildly unusual file sizes on DrvFs.
# PWD = /mnt/c/Users/duhowett/Desktop
$ du --apparent-size file
8784 file
$ du --block-size=1 file
6291968 file
When du is used without --apparent-size, it should be returning the number of filesystem blocks consumed by file, converted into bytes. This reports that file is 6.2MiB where on disk it is truly 8KiB.
If we look at stat we see that the number of "512B blocks" is reported to match the number of bytes the file consumes according to Explorer.
$ stat file
File: file
Size: 8784 Blocks: 12289
Excerpt from man 2 stat
blkcnt_t st_blocks; /* Number of 512B blocks allocated */
DrvFs reports the number of bytes occupied by the file on-disk as the number of 512B blocks the file occupies on disk, which makes disk usage tools such as du report vastly incorrect file sizes.
The text was updated successfully, but these errors were encountered:
du is reporting wildly unusual file sizes on DrvFs.
When du is used without
--apparent-size
, it should be returning the number of filesystem blocks consumed byfile
, converted into bytes. This reports thatfile
is 6.2MiB where on disk it is truly 8KiB.If we look at stat we see that the number of "512B blocks" is reported to match the number of bytes the file consumes according to Explorer.
Excerpt from
man 2 stat
DrvFs reports the number of bytes occupied by the file on-disk as the number of 512B blocks the file occupies on disk, which makes disk usage tools such as
du
report vastly incorrect file sizes.The text was updated successfully, but these errors were encountered: