Ghost Disk Usage
Reclaim disk space from a deleted file still held open by a running process.
A advanced Linux challenge worth 20 points. Solve it hands-on in a real Linux environment in your browser - no local setup, no fake shells.
The Challenge
df -h shows /var at 98%. du -sh /var/* accounts for only 40 GB of a 100 GB partition. A deleted log file is still held open by a process, keeping the blocks allocated.
Your tasks:
- Confirm the gap between df and du output
- Find the deleted-but-open file: lsof +L1
- Identify the PID and file descriptor number from lsof output
- Truncate the fd without closing it: > /proc/<PID>/fd/<FD>
- Verify df shows space reclaimed
- Write the reclaimed info to /tmp/reclaimed.txt
- Run check to validate