I have a 5GB root partition on one of my ESX Hosts, that is at 98% full. This has caused problems with vm migration to the ESX Host due to the lack on space on the root. I am new to linux and I am not quite sure what un-necessary data can be remove from that partiton to free-up space. You assistance with this is greatly appreciated. Tahnks in advance for your response.
A few more UNIX commands that are helpful with troubleshooting file system space issues:
In the top directory of the file system:
du -xsk * (this will give you recursive sizes of all items in the current directory)
find . -mount -size +10000000c -ls (this will show you ls -l for all files with size > 10,000,000 characters - i.e. bytes)
These two can usually help locate large space usage rather quickly.
REad man pages for du and find for more details.
Cheers,
Milos
Do you have more partitions, for "/var" for example? You can check it with "mount" or better "dh -h" (shows the usage). Post it please.
Do you have some space left on you local harddisk? Maybe you have to rehome some files...
AWo
Filesystem Size Used Avail Use% Mounted on
/dev/sda3 4.9G 4.5G 125M 98% /
/dev/sda1 198M 29M 159M 16% /boot
none 131M 0 131M 0% /dev/shm
/dev/sda5 2.0G 89M 1.8G 5% /var/log
/dev/sda2 5.0G 1.9G 2.8G 41% /vmimages
Before we're thinking about resizing partitions ore moving files, do you have any space left on accessible drives?
Gentlemen, a closer look at the root partition with the ls -al command, revealed that I was a vmdk file sitting there. I removed it and my partition is now 38% used. My problem is solved, but from a sys admin perspective, how does one go about maintaining adequate space on the root partition?
Dan,
Its best to create a couple more partitions in ESX than it comes with by default. You can look at this thread for a poll of what sizes people are using but I will summarize further below:
http://www.vmware.com/community/thread.jspa?threadID=46345&start=0&tstart=0
In sum, you will want partitions with sizes close to these:
/boot 250
/ 4096
swap 1024
/home 2048
/opt 2048
/tmp 2048
/usr 2048
/var 2048
/var/log 4096
/vmkcore 102
\[vmfs3] all remaining storage
After that, create accounts for anyone logging into an ESX console, but discourage people from working in the console and working under root privileges. Hopefully that way you can avoid someone dumping big files in the wrong places.
And remember with Linux/Unix you can always mount more space. So if your /var is getting too large you can add a drive/partition/slice and mount /var to it (mount it as /tmp/var first, copy your files to it and then mount it.
A few more UNIX commands that are helpful with troubleshooting file system space issues:
In the top directory of the file system:
du -xsk * (this will give you recursive sizes of all items in the current directory)
find . -mount -size +10000000c -ls (this will show you ls -l for all files with size > 10,000,000 characters - i.e. bytes)
These two can usually help locate large space usage rather quickly.
REad man pages for du and find for more details.
Cheers,
Milos