Disk Space lost mysteriously upon breaking a process.

Hi All,

Today when I was working on a script to generate custom wordlist. So I ran a script and the output was directed to /tmp.

The disk space was around 19 gb. While the script was running, I decided to direct the o/p file to my 1TB drive. So I broke the run using Ctrl + C.

Now when I use df -h, I find only 14 gb free disk space. I have searched for the o/p file everywhere on the disk but it's nowhere to be found. Even the /tmp size has not increased.

Could anyone please suggest how I can identify the lost space and recover it?

/Thanks

Total space where? Where is it mounted?

If the file is being held open by anything, it will remain on disk until closed.

You can list all files modified n days ago or newer in /path by

find /path -mtime 2

hi Corona688,

I was running a script to create an output file in /tmp. No external mount was used.

I use the command

find /tmp -mtime 2

but there is no result.

I checked again n the input file is not being used by any other file or program.

/Thanks

We have no idea what you did exactly or what the program does. However consider this.

  1. program A opens a file
  2. program A deletes the file while it is still open
  3. file continues to exist until the last process holding it open exits.
  4. This means that nobody can see or touch or read the file, but it lives on the disk

I am assuming Corona is trying to rule out this scenario. If it is ruled out then the disk space was used by other program(s) or processes.

To rule out the above scenario, reboot your box. If the space is still missing then your program cannot be the problem, since you cannot see the file with ls.

then try:

find /tmp -size +10000 -exec ls -l {} \;

Hi Jim,

I rebooted the box and did df -h n here are the results

root@morningSun:/home/shine# df -h

Filesystem Size Used Avail Use% Mounted on
/dev/sda7 18G 13G 4.4G 75% /
tmpfs 996M 0 996M 0% /lib/init/rw
varrun 996M 248K 996M 1% /var/run
varlock 996M 0 996M 0% /var/lock
udev 996M 2.8M 993M 1% /dev
tmpfs 996M 104K 996M 1% /dev/shm
lrm 996M 2.2M 994M 1% /lib/modules/2.6.27-17-generic/volatile
/dev/sdb1 299G 235G 64G 79% /media/FreeAgent Drive

It seems the space has just disappeared!