I have just been looking at the sizes of various partitions in my server and I see that it states;
/dev/xvda1 3.7G 2.9G 792M 79% /
/dev/mapper/vg00-usr 26G 3.7G 23G 14% /usr
/dev/mapper/vg00-var 72G 43G 30G 60% /var
/dev/mapper/vg00-home
17G 5.3G 12G 32% /home
none 512M 4.5M 508M 1% /tmp
Is it bad to have such big logical volumes? My var section has been used for 43GB!
My server disk space is 300GB, if I keep getting notices saying: Drive Warning: /dev/vg00/var (/var) is XX% full and I keep having to extend the partitions, then my available disk-space will rapidly decrease.
Anything I can do about this or is it something I've got to get used to and buy more disk-space?
Answers much appreciated,
James
Find out what's using the disk space!
Is this a mail server? Log server? It's entirely sensible in that case.
The tool
xdiskusage
is great for visualizing disk usage in scenarious like this./Var is where log-files generally end up being spooled (specifically /var/log), so that's a big one to take a look at. Make sure you're only keeping what you need and not everything for the last 3 years. That's the one universal thing I can think of. The rest are application-specific.
First, nomenclature: these are not partitions. These are filesystems that have been created on logical volumes. The logical volumes are carved out of volume groups, which themselves are built from block devices -- which may be partitions, or may simply be entire disks.
Having "large" filesystems is not by itself a problem. I put "large" in quotes because 43GB isn't particularly big. Multiple terabytes is "large" where I come from, so it all depends on your perspective.
If your filesystems are growing fast enough that you find yourself frequency resizing it, then you may have a problem:
You may have simply created the filesystem too small to begin with. In this case, you should at some point figure out what size it needs to be and things should stabilize.
You may have something that is erroneously using up disk space. Something logging too verbosely can do this, as can something logging to a file that nevers gets rotated. You can use tools like
du
to investigate where disk space is being used.You may simply be running services that as part of their normal operating consume additional disk space. Web sites with user-submitted content, email servers, databases, and other such services will tend to grow over time. Your job in this case is to figure out how fast things are growing and plan your storage expansion appropriately.
Without knowing (a) what services you're running and (b) what's causing the space to be consumed, we can't really provide any guidance on what represents an appropriate size and how to address the growth.
You can use
du
to find the space consumed by a paritcular directory like this:The
-s
gives you a grand total, and-h
gives you "human-readable" sizes (e.g., "21G" instead of "21998608".