Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DrvFs reports incorrect file block sizes #2211

Closed
DHowett-MSFT opened this issue Jun 13, 2017 · 3 comments
Closed

DrvFs reports incorrect file block sizes #2211

DHowett-MSFT opened this issue Jun 13, 2017 · 3 comments

Comments

@DHowett-MSFT
Copy link

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

image

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.

@0xbadfca11
Copy link

Maybe same problem as #1894

@stehufntdev
Copy link
Collaborator

Yes this looks like the same issue as #1894 to me as well. Adding @SvenGroot to double check as he was looking into the fix.

@SvenGroot
Copy link
Member

Yes, that's the same problem, and it has been fixed internally. It'll be in a future insider build.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants