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

du Disk Usage utility shows all files as 0 bytes #180

Open
ElectricRCAircraftGuy opened this issue May 15, 2023 · 7 comments
Open

du Disk Usage utility shows all files as 0 bytes #180

ElectricRCAircraftGuy opened this issue May 15, 2023 · 7 comments

Comments

@ElectricRCAircraftGuy
Copy link

ElectricRCAircraftGuy commented May 15, 2023

Normally, when you run du at the command line, it shows all files and their size on the far left. When mounted with apfs-fuse, however, my Macbook apfs filesystem shows all files as 0 bytes. Looking at them in the thunar file manager, however, shows their correct size in the properties menu.

@ElectricRCAircraftGuy
Copy link
Author

ElectricRCAircraftGuy commented May 15, 2023

Update: this is when running on the Parted Magic Linux OS. This may be a Parted Magic problem. du shows all 0 bytes even when checking the Parted Magic running operating system root at du /.

@RJVB
Copy link

RJVB commented May 15, 2023 via email

@ElectricRCAircraftGuy
Copy link
Author

ElectricRCAircraftGuy commented May 15, 2023

Problem still persists with du and apfs-fuse

Alright, the problem does seem to be with apfs-fuse! I just re-mounted the same disk using an Ubuntu 20.04 live USB, on which I manually built and ran apfs-fuse, and the problem still persists. On this system, both ncdu and du work fine in any folder except the mounted APFS drive.

And in case anyone is wondering:

Side note: how to build apfs-fuse on a fresh Ubuntu 20.04 live USB

# See: https://askubuntu.com/a/227788/327339
sudo add-apt-repository universe

sudo apt install ncdu

# see my comment: https://github.com/sgan81/apfs-fuse/issues/101#issuecomment-1547206616
sudo apt install fuse libfuse3-dev bzip2 libbz2-dev cmake gcc g++ git libattr1-dev zlib1g-dev

git clone https://github.com/sgan81/apfs-fuse.git
cd apfs-fuse
git submodule update --init --recursive
mkdir build
cd build
cmake ..
time make

./apfs-fuse -h

# mount
mkdir -p ~/mount/macbook
sudo ./apfs-fuse /dev/sda2 ~/mount/macbook/
# unmount
sudo umount ~/mount/macbook

And to view the mounted files as root via the default Ubuntu nautilus file manager:

sudo nautilus /home/ubuntu/mount/macbook/

Or through the prettier nemo one:

sudo add-apt-repository universe
sudo apt update
sudo apt install nemo
sudo nemo /home/ubuntu/mount/macbook/

References:

  1. https://askubuntu.com/a/227788/327339
  2. [my answer] https://askubuntu.com/a/1173861/327339
  3. install instructions sudo apt install gcc-c++ library is invalid #101 (comment)
  4. [my answer] Unix & Linux: Mount doesn't give write permission to user

@ElectricRCAircraftGuy
Copy link
Author

ElectricRCAircraftGuy commented May 16, 2023

Confirmed. The problem is definitely apfs-fuse, not Parted Magic. I just posted this to the private (for paying members only, $15 for Parted Magic) Parted Magic forum, here: https://partedmagic.com/forums/viewtopic.php?p=8943#p8943

Alright, I confirmed that the 0 bytes were only displaying inside my APFS mount at ~/mount/macbook/. When I ran du /, it so rapidly entered that location, that all I could see were zeros. du in Parted Magic does indeed work fine, then. But inside the APFS-mounted drive, it's all zeros.

Note: for testing on Parted Magic, I just built apfs-fuse on my Ubuntu 20.04 desktop, then copied the whole built folders/files/binary over to Parted Magic on a thumb drive. It ran. Since I'm seeing the problem with the Ubuntu 20.04 live USB too, though, on which I manually built apfs-fuse, I'm sure the problem lies with apfs-fuse, not my hack.

@ElectricRCAircraftGuy
Copy link
Author

By the way, thank you for your work on this project. I really appreciate that you've made it, and I hope to see it continue to improve.

@eLMoMaNi
Copy link

eLMoMaNi commented Jan 7, 2024

hey @ElectricRCAircraftGuy I am having the same issue, filelight, du and ncdu shows 0KB for all files. However, I switched to baobab and it worked! Also qdirstat works, you have to run them as root and scan the mounted apfs folder.

@antgel
Copy link

antgel commented May 17, 2024

@sgan81 Do you think this will be worked on at any point? No pressure, just asking. :)

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

4 participants