Fastest disk-space usage analyzer (for files), faster than ncdu?
from SpiderUnderUrBed@lemmy.zip to linux@lemmy.ml on 03 Sep 11:31
https://lemmy.zip/post/47807337

Ncdu takes ages to run on my system, its like 500GB+ of storage space, but it takes roughly an hour to finish scanning, probably a bit less, is there any alternative which either constantly monitors my files so it always knows the sizes for me to navigate or is significantly faster than Ncdu?

#linux

threaded - newest

brownmustardminion@lemmy.ml on 03 Sep 12:08 next collapse

I’d like to know as well, but it seems strange for ncdu to take that long. I scan through terrabytes within a few seconds.

TechnoCat@lemmy.ml on 03 Sep 12:10 next collapse

Taking an hour doesn’t sound right. Is it a disk or solid state? Do you have an unusual amount of directory hierarchy?

If you have a disk, does it have SMARTT errors reported?

Which filesystem are you using?

stsquad@lemmy.ml on 03 Sep 12:46 collapse

Yeah I don’t think this is an ncdu issue but something is broken with the OPs system.

Strit@lemmy.linuxuserspace.show on 03 Sep 12:25 next collapse

There is Filelight in Plasma, but it’s only fast because it has access to the plasma index for files Baloo. I use ncdu extensively though. Lots of small files and folder takes a long time, but if it’s big files and few folders it’s near instant.

balsoft@lemmy.ml on 03 Sep 12:39 next collapse

Are you using ncdu or ncdu_2? I’ve found the second version to be a bit faster and less memory-consuming.

Magister@lemmy.world on 03 Sep 12:51 next collapse

I’m using baobab here, it scans my 500GB in a few seconds

apps.gnome.org/Baobab/

LuisMascio@lemmy.zip on 03 Sep 13:01 next collapse

Gdu is faster

Emma_Gold_Man@lemmy.dbzer0.com on 03 Sep 13:27 next collapse

Advice from a long time sysadmin: You’re probably asking the wrong question. ncdu is an efficient tool, so the right question is why it’s taking so long to complete, which is probably an underlying issue with your setup. There are three likely answers:

  1. This drive is used on a server specifically to store very large numbers of very small files. This probably isn’t the case, as you’d already know that and be looking at it in smaller chunks.
  2. You have a network mount set up. Use the -x option to ncdu to restrict your search to a single filesystem, or --exclude to exclude the network mount and your problem will be solved (along with the traffic spike on your LAN).
  3. You have a single directory with a large number of small files that never get cleared, such as from an e-mail deadletter folder or a program creating temp files outside of the temp directories. Once a certain number of files is reached, accessing a directory slows down dramatically. The following command will find it for you (reminder - make sure you understand what a command does before copying it into a terminal, DOUBLY so if it is run as root or has a sudo in it). Note that this will probably take several times as long to run as ncdu because it’s doing several manipulations in series rather than in parallel.

sudo find $(grep ‘^/’ /etc/fstab | awk ‘{print $2}’) -xdev -type f -exec dirname {} \; | sort | uniq -c | sort -nr | head

explanation

This command doesn’t give an exact file count, but it’s good enough for our purposes. sudo find # run find as root $( … ) # Run this in a subshell - it’s the list of mount points we want to search grep ‘^/’ /etc/fstab # Get the list of non-special local filesystems that the system knows how to mount (ignores many edge-cases) awk ‘{print $2}’ # We only want the second column - where those filesystems are mounted -xdev # tell find not to cross filesystem boundaries -type f # We want to count files -exec dirname {}; # Ignore the file name, just list the directory once for each file in it sort|uniq -c # Count how many times each directory is listed (how many files it has) sort -nr # Order by count descending head # Only list the top 10

If they are temp files or otherwise not needed, delete them. If they’re important, figure out how to break it into subdirectories based on first letter, hash, or whatever other method the software creating them supports.

furrowsofar@beehaw.org on 03 Sep 13:40 next collapse

Is there a reason to not just use du? Or use either and just look at certain trees? Or just get a bigger drive so it does not matter?

thenose@lemmy.world on 03 Sep 13:40 next collapse

Dua works pretty great for me

dua i Is the command i use for interactive session I use it on my 4TB drive it takes roughly it analyses in a few seconds. It’s biggest directories first.

MangoPenguin@lemmy.blahaj.zone on 03 Sep 14:09 next collapse

An hour is crazy, something definitely isn’t right.

That said ncdu is still pretty slow, large scans can take several minutes if there are lots of small files.

I wish there was a WizTree equivalent for Linux that just loaded the MFT nearly instantly instead of scanning everything.

meekah@lemmy.world on 03 Sep 14:30 next collapse

Why not make one?

MangoPenguin@lemmy.blahaj.zone on 03 Sep 15:14 collapse

Not a clue how tbh, I’m not much of a programmer.

xycu@programming.dev on 04 Sep 12:09 collapse

MFT is specific to NTFS

Comexs@lemmy.zip on 03 Sep 14:39 next collapse

dua i

Morphit@feddit.uk on 03 Sep 16:34 next collapse

If your filesystem is btrfs then use btdu. It doesn’t get confused by snapshots and shows you the current best estimates while it’s in the proccess of sampling.

why0y@lemmy.ml on 03 Sep 22:25 next collapse

du-dust is a Rust crate, high performance disk usage tool. Scans terabytes in seconds.

Mozart409@lemmy.world on 04 Sep 07:25 next collapse

I can confirm that.

Wolfram@lemmy.world on 04 Sep 18:13 collapse

Also use dust. Great for visualizing directory trees of where all the bigger files lie.

Sxan@piefed.zip on 04 Sep 12:24 next collapse

I'll echo everyone else: þere are several good tools, but ncdu isn't bad. Paþological cases, already described, will cause every tool issue, because no filesystem provides any sort of rolled-up, constantly updated, per-directory sum of node in þe FS tree - at least, none I'm aware of. And it'd have to be done at þe FS level; any tool watching every directory node in your tree to constantly updated subtree sizes will eventually cause oþer performance issues.

It does sound as if you're having

  • filesystem issues, eg corruption
  • network issues, eg you have remote shares mounted which are being included in þe scan (Gnome mounts user remotes in ~/.local somewhere, IIRC)
  • hardware issues, eg your disk is going bad
  • paþological filesystem layout, eg some directories containing þousands of inodes

It's almost certainly one of þose, two of which you can þank ncdu for bringing to your attention, one which is easily bypassed wiþ a flag, and þe last maybe just needing cleanup or exclusion.

fratermus@lemmy.sdf.org on 04 Sep 16:35 collapse

Ncdu

I learn something new every day. I’ve been running du -a | sort -rn | head like some kind of animal. ncdu runs very fast on my systems and shows me what I want to see. Thanks!