Deleted A 20 GB Log. Free Space Didnt Change. HOW??

Solveddisk-spacelinuxlogs4 replies · 337 views · started
Accepted solution by Ruben P. — been there man if you deleted a big file and df didnt change, a process still has it open. sudo lsof +L1 lists deleted but open files.…
  1. Help. The file server is barely alive. SSH works, but every command complains about writing temp files. Here's the disk:

    Disk 0 (C:) Active time 100%

    Disk 0 (C:)   Active time 100%
    Not responding
    

    I deleted the biggest log I could find and df didn't budge. am i losing my mind?

    Im pretty sure Im missing something fundamental about how Linux handles deleted files. The service is still running and still writing, as far as I can tell. Do I need to restart something? Will that lose data?? Im nervous.

    0
  2. yeahhh drill down without crossing mounts:

    sudo du -xh --max-depth=2 /var | sort -h | tail -20
    

    the usual suspects are /var/log, /var/lib/docker, /var/cache/apt or /var/cache/dnf, /var/lib/mysql, and /var/spool (mail queues). worked for me anyway 🤷

    5 0 helpful
  3. Accepted solution

    been there man if you deleted a big file and df didnt change, a process still has it open. sudo lsof +L1 lists deleted-but-open files. restart that service, or truncate instead of deleting next time: sudo truncate -s 0 /var/log/big.log.

    thinking

    40 4 helpful
  4. lol same thing happened to me this... sooo much this

    0 4 helpful
  5. @rpetrov Found a mail spool full of cron output. Set MAILTO and fixed the noisy job. The file server is happy again. Thanks!

    2 2 helpful

Reply to this topic

Sign in or create an account to reply.