Constipated Ibex

Ray Leventhal ubuntu at
Fri Apr 10 12:35:44 UTC 2009

Pete Clapham wrote:
> Hi, all --
> My server using Intrepid appears to have a constipated  root directory.  
> Here is the output from the df -h.  As you can see, the / drive is 100% 
> used.  I was able to get some stuff out of my home directory, but the 
> problem appears to be elsewhere.  Surely 129 Gb should be enough for an 
> sda disk when /all/ of the relevant collections are stored on sdb, sdc, 
> sdd, and sde. 
> Does anybody know a way to search through the root directory (and its 
> subalterns) to find out what's clogging the drive -- and then to 
> determine what can be deleted?
> Thanks for your help.
> Filesystem            Size  Used Avail Use% Mounted on
> /dev/sda1             129G  122G  707M 100% /
> tmpfs                 3.0G     0  3.0G   0% /lib/init/rw
> varrun                3.0G  440K  3.0G   1% /var/run
> varlock               3.0G     0  3.0G   0% /var/lock
> udev                  3.0G  2.8M  3.0G   1% /dev
> tmpfs                 3.0G  112K  3.0G   1% /dev/shm
> /dev/sdb1             1.4T  887G  420G  68% /archive
> /dev/sdc1             1.4T  883G  424G  68% /backup
> /dev/sdd1             1.4T  646G  661G  50% /Major_Collections
> /dev/sde1             1.4T  646G  661G  50% /backup_Major_Collections
> cheers,
> pete

Coming in late to this thread.

I had a similar issue on another distro, but the possibility of it 
happening here on Ubuntu exists, therefore my reply.

In my case, I was performing a backup via rsync to a USB attached drive. 
  Sadly, in the early incarnations of my script, I wasn't doing any 
checking to see if the USB drive was mounted before performing the rsync 
-av --delete /source /media/<drive-name>

Well, one night it wasn't mounted (due to a power failure from which the 
  USB drive didn't recover properly).  So...since the 
/media/<drive-name> wasn't mounted, rsync happily executed, saving files 
to the folder under /media as opposed to the physical drive itself. 
Result?  100% full / partition pretty damned quick.

The moral of my story is that if you're running a script or automated 
process which writes to physical media, check to see that its mounted 
prior to doing the writes, or risk this very issue.

I'm not sure this applies to the OP, but its worth a mention.

For clarity, my script now applies logic, as such:
varCheck=`mount | grep "/dev/sdd1 on /media/backup "`
if [[ ${#varCheck} > 0 ]]
    echo "Drive is mounted - proceeding with backup."
    rsync -av --delete /home/ /media/backup
    echo "Drive not mounted - attempting to mount."
    umount /dev/sdd1
    mount /dev/sdd1 /media/backup
    varCheck=`mount | grep "/dev/sdd1 on /media/backup "`
       if [[ ${#varCheck} > 0 ]]
                echo "Drive mounted on this attempt - proceeding with 
                rsync -av --delete /home/ /media/backup
             else "Drive failed to mount - aborting backup."
                exit 1

BTW, I truly love the subject...concise and very descriptive!


More information about the ubuntu-users mailing list