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

Quirky output of Windows NTFS mount inside WSL #295

Open
danie-dejager opened this issue Jan 15, 2023 · 1 comment
Open

Quirky output of Windows NTFS mount inside WSL #295

danie-dejager opened this issue Jan 15, 2023 · 1 comment

Comments

@danie-dejager
Copy link

Hi,

I see that most Linux apps struggle to get the actual file size of a NTFS drive mounted in WSL.
Using Dust 0.8.3

From my Linux instance I go to /mnt/d/ and see the following results
Normal output

# dust
13294035T       ┌── QtGraphicalEffects
13196115T       │   ┌── eo
13458252T       │   │ ┌── LC_MESSAGES
13458252T       │   ├─┴ bs
13574211T       │   ├── fi
13589332T       │   │ ┌── LC_MESSAGES
13589332T       │   ├─┴ nb
14721323T       │   │ ┌── LC_MESSAGES
14721323T       │   ├─┴ mk
14721323T       │   │ ┌── LC_MESSAGES
14721323T       │   ├─┴ uz@cyrillic
14721323T       │   │ ┌── LC_MESSAGES
14721323T       │   ├─┴ cy
14871114T       │   │ ┌── LC_MESSAGES
14871114T       │   ├─┴ lt
15056111T       │ ┌─┴ locale
14673252T       ├─┴ data
10797842T     ┌─┴ bin
10797842T   ┌─┴ KDE
 4117825T ┌─┴ .

with apparent-size things are looking better

# dust -s -b
 17G   ┌── Data
 45G   ├── Hyper-V
 13G   │ ┌── ubuntu 22.04
 14G   │ │ ┌── FreeBSD13.vdi
 14G   │ ├─┴ FreeBSD13
 16G   │ │ ┌── FreeBSD.vdi
 16G   │ ├─┴ FreeBSD 12
 16G   │ ├── Amazon Linux 2
 17G   │ │ ┌── Oracle Linux 7.6.vdi
 17G   │ ├─┴ Oracle Linux 7
 18G   │ │   ┌── {a1599947-7d7c-492d-b377-7b4187c508a7}.vdi
 19G   │ │ ┌─┴ Snapshots
 38G   │ │ ├── Sophos.vdi
 58G   │ ├─┴ Windows7
 28G   │ │   ┌── {17213b5e-2726-444d-9ecc-41254bcc1fc1}.vdi
 28G   │ │ ┌─┴ Snapshots
 32G   │ │ ├── Centos 6.vdi
 60G   │ ├─┴ Centos 6
260G   ├─┴ VM
332G ┌─┴ .

Is there something wrong with how WSL is presenting the drive as other tools like Dust is also not printing sizes correctly. gdu also needs to use apparent size to display correctly.
dundee/gdu#162

@danie-dejager danie-dejager changed the title Quirky output of Windows mount in WSL Quirky output of Windows NTFS mount in WSL Jan 15, 2023
@danie-dejager danie-dejager changed the title Quirky output of Windows NTFS mount in WSL Quirky output of Windows NTFS mount inside WSL Jan 15, 2023
@bootandy
Copy link
Owner

I've no idea how WSL works, but if it is fixed in gdu then I should be able to replicate that here

apparent size uses file length instead of counting the blocks that the file uses. It is possible that the block size in WSL is strange:
https://doc.rust-lang.org/std/os/linux/fs/trait.MetadataExt.html#tymethod.st_blocks

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

No branches or pull requests

2 participants