I noticed the root drive of my home server (Debian) is at 99% capacity, which was odd to be because I don’t store anything on the root ssd. sudo df -h confirms that 99% of my 256gb drive is full. But sudo du -sh * all added up, only comes to about 30gb.

This is a pc that only runs docker containers and one virtual machine for home assistant. And yes I have restarted, Any ideas as to how to find the missing 200+ gigabytes?

EDIT: sudo ncdu allowed me to find a 72gb [long string of characterless]-json.log file in /var/lib/docker/containers and many 1gb+ files in /var/lib/docker/overlay2. I’m not sure what to do with this information (or what’s safe to delete) but I’m getting somewhere.

  • One more puzzle piece here is that du won’t report on files that have been marked for deletion but are still held on to by some process. There’s an lsof incantation to list those, but I can’t recall it off the top of my head.

    It used to be part of sysadmin work to detect the processes that held on to large files if df reports that you’re running out of space, and restart them to make them let go of the file. But I haven’t done that in ages. And if you restarted the host OS that should have taken care of that.

    I assume you also know how to prune container resources.

    • Jediwan ( flork@lemy.lol ) OP
      link
      fedilink
      arrow-up
      5
      ·
      1 year ago

      Good call on the docker prune, I didn’t think about that. That accounted for about 25GB. Still not enough but at least I’m not at 99% anymore.

  • Ferk ( Ferk@lemmy.ml ) 
    link
    fedilink
    arrow-up
    5
    ·
    1 year ago

    What’s your filesystem?

    If you are using something like btrfs, for example, the usage reports can be misleading, and getting the exact size can be complicated… I’d recommend using more fs-specific tools, such as btdu.

      • Ferk ( Ferk@lemmy.ml ) 
        link
        fedilink
        arrow-up
        3
        ·
        edit-2
        1 year ago

        In theory, it can. One possible reason with Btrfs might be that you are only mounting a subvolume even though there might be other files in the same filesystem (such as snapshots/copies of the subvolume for backup) but that are not being mounted.

        Also some tools like gparted do not handle btrfs disk usage very well and will display it as if the whole partition is 100% full.

  • SayCyberOnceMore ( Cyber@feddit.uk ) 
    link
    fedilink
    English
    arrow-up
    5
    ·
    1 year ago

    du -hs * won’t find “hidden” (.) files and folders, you’ll need a slightly sifferent regx (which I will leave as an exercise for you / I don’t have that info here)

    And also both du and df show different results depending on the underlying filesystem, ie btrfs (and maybe ZFS?) won’t show how much deduplication is happening.

    Also, you might be looking at sparse files too, and from memory, you’ll need another option for du or df to report those correctly.

    • Jediwan ( flork@lemy.lol ) OP
      link
      fedilink
      arrow-up
      2
      ·
      1 year ago

      sudo ncdu allowed me to find a 72gb [long string of characterless]-json.log file and many 1gb+ files in /var/lib/docker/overlay2. I’m not sure what to do with this information or what’s safe to delete but I’m getting somewhere.

      • SayCyberOnceMore ( Cyber@feddit.uk ) 
        link
        fedilink
        English
        arrow-up
        3
        ·
        1 year ago

        Nice. Glad you’re on to something.

        I can’t help you with docker files as I don’t use it, but, there’s usually a way to find out who / what owns a file, so I hope docker utils can tell you if it’s safe to delete

      • Jediwan ( flork@lemy.lol ) OP
        link
        fedilink
        arrow-up
        2
        ·
        edit-2
        1 year ago

        UPDATE: sudo ncdu allowed me to find a 72gb [long string of characterless]-json.log file in /var/lib/docker/containers and many 1gb+ files in /var/lib/docker/overlay2. I’m not sure what to do with this information (or what’s safe to delete) but I’m getting somewhere.

    • Jediwan ( flork@lemy.lol ) OP
      link
      fedilink
      arrow-up
      2
      ·
      1 year ago

      Thanks that allowed me to clear up about 20GB! Also sudo ncdu allowed me to find a 72gb [long string of characterless]-json.log file and many 1gb+ files in /var/lib/docker/overlay2. I’m not sure what to do with this information or if it’s safe to delete but at least I’m getting somewhere.

  • I’d be curious to see du -i to see what’s going on with inodes. Alternatively I did have an issue long time ago with docker containers, sparse files and dirty disk. Force-running fsck resolved my issues in the past.

    • Jediwan ( flork@lemy.lol ) OP
      link
      fedilink
      arrow-up
      1
      ·
      edit-2
      1 year ago

      du -i gave invalid option and fsck gave command not found

      EDIT: sudo ncdu allowed me to find a 72gb [long string of characterless]-json.log file in /var/lib/docker/containers and many 1gb+ files in /var/lib/docker/overlay2. I’m not sure what to do with this information (or what’s safe to delete) but I’m getting somewhere.

  • lucas ( lucas@startrek.website ) 
    link
    fedilink
    English
    arrow-up
    1
    ·
    1 year ago

    Where are you running du -sh *? (I.e. what directory, are you definitely scanning the whole file system?) I’m sure it’s obvious, but can never hurt to check!

    What does du -sh / show? (Generally, the * glob pattern in the shell will not match hidden dot-files, so is it possible they are being excluded?)

    • Jediwan ( flork@lemy.lol ) OP
      link
      fedilink
      arrow-up
      1
      ·
      edit-2
      1 year ago

      EDIT sudo ncdu allowed me to find a 72gb [long string of characterless]-json.log file in /var/lib/docker/containers and many 1gb+ files in /var/lib/docker/overlay2. I’m not sure what to do with this information (or what’s safe to delete) but I’m getting somewhere.

      sudo du -sh / shows a list of three du: cannot access '/run/user/1000/gvfs' Permission denied and du: cannot access No such file or directory and a few cannot read directory invalid argument and at the end it shows 5.4T / which I assume is my root drive combined with what’s in mnt.