Question on disk size and usage

Hello All, this may be a simple question but I wasn't sure how to word it to search for the answer. Have a look at the following:

/dev/mapper/vgdata-lvdata             626G  594G     0 100% /data01

As you can see the disk size 626GB of which 594G is used. There's 32GB difference there but the system shows amount available is 0 and 100% full. This is a RedHat 5 system and the filesystems are ext3.

  1. Why is so much of the disk being wasted?
  2. How can I fix it so more of the disk is actually used and not wasted?

You are talking of a around 5% reserved space, 5% isnt much you know...
That is a minimum for root to be able to access once full to guarantee possible cleanups and reorg...

  1. As vbe said 5% is not that much and when filesystems were smaller because disks were not the size they have today 5% was a reasonable choice.
  2. You can reduce the reserved space with tune2fs to, for example 1%.
tune2fs -m 1 /dev/mapper/vgdata-lvdata

Edit: do not tune your root filesystem this way - there those 5% may save your job some day...

Personally, I would leave the filesytem overhead to the OS default.

You need to look at clearing space more than anything. Be aware that your server may hang and may not complete the boot with such a full root filesystem.

  • Are you LVM? That gives us more options to consider, but as a first pass:-
  • What other filesystems do you have in the root volume group?
  • Are /opt, /tmp, /var & /usr separate filesystems?
  • Do you have any space left in the root volume group (whatever it's called)?
  • Can you show us the output from:-
    text vgdisplay
    then
    text vgdisplay -v <root_volume_group>

I've just spent a few hours of down-time to shrink and split our root filesystem to reduce the risk of:-

  • Someone creating a huge file in /tmp that fills the root filesystem.
  • A process looping and generating messages to the syslog (usually in /var) and filling the root filesystem

...so it can be done, but it's a bit messy.

You could also have a look at the output from:-

du -kx|sort -n

and explore where your space is consumed.

Thanks, in advance,
Robin

Thank you for the replies. I have a better understanding now. I know where the space is going and I can easily add more disks to the LV. I was just wondering about the space being "wasted" (which its not).

Thanks again.

Definitely not a waste. A completely full root disk can cause major, difficult-to-solve problems, to the point you can't run rm and people can't login. That you're not having problems like that right now means the reserved space is doing its job :slight_smile: