Assisting 13873676 developers since 2005.

Web Developer, Open Source, Loyal, Dad.  

Read More »

Lost Disk Space on Linux Due to Stop Command

Posted by David  •  May 9th, 2014 6:08:15 pm - Subscribe | Mood: good | Music: Reggie and the Full Effect - Merry Sexmas (feat. Fluxuation)

Lost Disk Space on Linux Due to Stop Command - Entry explains how I lost my disk space on my Linux CentOS Server by stopping a tar file in process.

AS I usually do, I create backups on my websites periodically on my webserver. I usually create these backups as yyyy-mm-dd-www.tar.gz well let me just say, be sure to check your allocated disk space before you begin a backup on the machine you are on. Or perhaps mnt another device and off load the file to that, then proceed with your back up strategy.

Well here is the issue. As my file was being tar'ed I forgot to check if I had enough disk for the file. Not knowing, I stopped / interrupted the file with a CTRL+C. I then proceeded to check my disk with a $df -ah. I was right! I had utilized 91% of my storage, and only had 4.2 gb's remaining. I proceeded to remove the file with a rm -rf yyyy-mm-dd-www.tar.gz but no reflection of my disk. Still 91% of my storage, and 4.2 gb remaining. Yikes!

The way I solved this was by starting with a few commands.

1. $sync
2. $lsof +L1
3. Find the PID of TAR
4. kill -9 PID

Once I had done this the issue was fixed! lsof is list of open files, and +L1 will select open files that have been unlinked. From there I simply found my tar files process id, then executed the kill command.

Thanks to my bud Jim for the assistance. If you have questions, leave a comment! Sorry for the lack of enthusiasm on this entry. It's my second time typing it up. happy.gif

Comments 0  •  May 9th, 2014 6:08:15 pm - Subscribe  •  Tweet this entry | Post a comment


Leave a Reply


Posting as anonymous Anonymous guest, why not register, or login now.

Image Gallery


Amazon Wishlist Stumble Upon Toolbar
Internet Blogs - Blog Top Sites Internet Blogs - Blog Top Sites Technology

About Me


iPhone: 29.513522,-98.565523 Web Designer, Open Source, Loyal, Dad. Learn more...