LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-19-2008, 05:43 AM   #1
brokenpromises
Member
 
Registered: Jan 2005
Location: NZ
Distribution: Fedora / Debian
Posts: 99

Rep: Reputation: 21
Help! Disk space being taken up but by what?


I was messing around in my shell today, on a Debian server.

I RAR'd several smaller files up into a large 3.5 GB file. Before I started, there was about 4.5GB free. But when I finished and deleted the source files, there was only ~800MB free on the 11GB HDD. How did this happen? I don't know.

Ho do I go about tracking what is taking up my space ?

Code:
$ df -H
Filesystem             Size   Used  Avail Use% Mounted on
/dev/sda1               11G   5.2G   4.4G  55% /
tmpfs                  135M      0   135M   0% /lib/init/rw
udev                   135M    21k   135M   1% /dev
tmpfs                  135M      0   135M   0% /dev/shm
none                   135M      0   135M   0% /dev/shm
Code:
$ cd / ; du -sh *
3.6M    DBz
3.0M    bin
4.0K    boot
20K     dev
2.0M    etc
12K     home
4.0K    initrd
82M     lib
16K     lost+found
4.0K    media
4.0K    mnt
4.0K    opt
0       proc
0       reboot
3.5M    root
2.8M    sbin
4.0K    srv
0       sys
4.0K    tmp
287M    usr
1023M   var
Note above nothing is being shown as a large file, meaning the files which are taking up the space are smaller ones, and are hiding somewhere, how do I find them?

Any help appreciated!

Last edited by brokenpromises; 01-19-2008 at 05:45 AM.
 
Old 01-19-2008, 07:07 AM   #2
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,877

Rep: Reputation: 350Reputation: 350Reputation: 350Reputation: 350
Here's a script I found one day while surfing the 'net, it's called diskhogs.sh. It searches for the four largest directories, and the four largest files in them.

You can edit the file to refine the search for the directory you were working in.

Code:
#/bin/bash
# diskhogs.sh, a script for finding large files.

for dirname in `du -s /* | sort -rn | cut -f2- | head -5`
 do
 echo ""
 echo Big directory: $dirname
 echo Four largest files in that directory are:
 find $dirname -type f -printf "%k %p\n" | sort -rn | head -4
 done
 exit 0
 
Old 01-19-2008, 07:38 PM   #3
brokenpromises
Member
 
Registered: Jan 2005
Location: NZ
Distribution: Fedora / Debian
Posts: 99

Original Poster
Rep: Reputation: 21
No success. The biggest file that this found is my access.log for lighttpd, which was 300kb or so.

And output of df -H:

Code:
 $ df -H
Filesystem             Size   Used  Avail Use% Mounted on
/dev/sda1               11G   4.5G   5.1G  47% /
tmpfs                  135M      0   135M   0% /lib/init/rw
udev                   135M    21k   135M   1% /dev
tmpfs                  135M      0   135M   0% /dev/shm
none                   135M      0   135M   0% /dev/shm
FIXED: I just rebooted and now my free space is back. I did check the /tmp folders etc, and there was nothing there. WIERD!

Last edited by brokenpromises; 01-19-2008 at 07:47 PM.
 
Old 01-19-2008, 08:10 PM   #4
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 15,037

Rep: Reputation: 1912Reputation: 1912Reputation: 1912Reputation: 1912Reputation: 1912Reputation: 1912Reputation: 1912Reputation: 1912Reputation: 1912Reputation: 1912Reputation: 1912
Not weird at all- files were still open, so can't be discarded. Check for threads on lsof.
 
Old 01-19-2008, 11:12 PM   #5
diabolical_mdog
LQ Newbie
 
Registered: Feb 2005
Posts: 2

Rep: Reputation: 0
Quote:
Originally Posted by brokenpromises View Post
No success. The biggest file that this found is my access.log for lighttpd, which was 300kb or so.

And output of df -H:

Code:
 $ df -H
Filesystem             Size   Used  Avail Use% Mounted on
/dev/sda1               11G   4.5G   5.1G  47% /
tmpfs                  135M      0   135M   0% /lib/init/rw
udev                   135M    21k   135M   1% /dev
tmpfs                  135M      0   135M   0% /dev/shm
none                   135M      0   135M   0% /dev/shm
FIXED: I just rebooted and now my free space is back. I did check the /tmp folders etc, and there was nothing there. WIERD!
It's not uncommon to have to`sync` (and wait!) for diskspace to become free according to df.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
add space to / when from spare space on disk ctsiow Linux - General 4 11-07-2007 08:55 AM
Cedega "Disk space required for the installation exceeds available disk space" Solved Spewdemon LinuxQuestions.org Member Success Stories 1 10-18-2007 07:19 PM
How to assign disk quota(disk space limited) to user and group. hocheetiong Linux - Newbie 1 08-24-2007 05:20 AM
3Gb of disk space lost! Disk space problem or mother board conflicts with HDD Mistreated Linux - Hardware 4 12-06-2004 04:58 PM
Disk space wastage 73 GB Hard disk rajgopalhg Linux - Hardware 2 10-18-2002 04:41 PM


All times are GMT -5. The time now is 11:43 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration