Tag Archives: Storage

The Curious Case of Missing Quota Report on Volume

A week ago one of my old colleagues ask some help with an error he has on one of his servers, I was happy to oblige.

He had several servers all working exactly the same, same hardware, same OS and same configuration (apart from IP’s).
One of his server crashed and after the reboot one of his batch scripts stopped working specifically on this server.
The script tried to determind if a specific volume (for example: /mnt/volA) exist and have enougth free space,
This he did by invoking the “df” command and the “quota” command (Or their equivalent in the specific language).

What he found was:
While running: “df -k /mnt/volA” he got the correct line and response,
But on the other hand when he tried to run “quota -v |grep “/mnt/volA” the quota command didn’t return the volume.
This was particulary wierd because this volume was NFS volume with specified quota (set on the NFS server) – moreover the volume did apeer on the other servers when you looked for it when you’ve used “quota” Continue reading The Curious Case of Missing Quota Report on Volume

Google Drive – Where all my free space gone?

Few years ago after several critical storage catastrophes (that fortunately ended with no data lost) I’ve decides to move my most important files to the cloud (mainly my and my family photos)

After checking several cloud storage providers I’ve decided on Google (back then I think drive was non existent or at beta) to backup all my pictures to Picasa.
The plan was very good: Legacy Plan 80G for 20$ a year – for something with the features of the drive and more this price is very good.
After Google Drive was working on my desktop I’ve deserted Picasa as my photos backup and just save the directory to my Google Drive (I like to sort things my own way).

A few days ago I’ve added bunch of files to my drive and got an error: The space almost run out!
I was puzzled why no storage available – my drive isn’t 80G nor my mail or Picasa should be large enough.

Continue reading Google Drive – Where all my free space gone?

Storage handling with users in Linux – or – The Land of Forgotten Inodes

In my years in IT I’ve handled a lot of storage (proprietary and open source solutions).
But one of the main issues that I had (beside design of large storage and backup) is the rouge user/script/program – sometime one of them will act up and fill the storage with large amount of files or one massive file (for example a big log file).

From time to time someone comes to me and say “Well my script isn’t working” – one of the first things I do is running “quota -u <USERNAME>” and 90% of the time We both see that the user filled his size or inodes quota and hist script fail.
From time to time I collected a lot of scripts and one liners to help me search for the problematic dir/file that contain the issue.

Here are some nice one-liners that can help you find the culprit:

Beware! Using some of this one liners on a directory that have under it local or NAS mount (example: nfs) won’t yield the correct result!
Make sure you run this lines where the you only scan one “device” (local mount, nfs mount etc…) at a time!

  • ¬†Find the largest file amount in current directory (it will only show the current level of directories)
for x in .*/ */; do if [ "$x" != './' ] && [ "$x" != '../' ]; then x=${x#*\'}; x=${x%\'*}; y=`find "$x"|wc -l`; echo -e "$y\t $x";fi; done|sort -k1 -h
  • ¬†Find big directory under your current location (You will need to keep following the path deeper until you find the problematic directory)
du --block-size=1G --max-depth=2|sort -rh|head
  • Find large files:
    (Replace <path/to/dir/> with the path to the directory you want to search in)
find </path/to/dir/> -printf '%s %p\n'| sort -nr | head -10
  • Check your current location device free space (this work even if there is another mount under it):
df -h .