Sun 27 Dec 2009
A little while ago I rebuilt the home Linux server, it used to have two 160GB Sata drives arranged as a software RAID 1, 2 2GHz Xeon Processors, 2Gb of RAM and was running Fedora Core 3 so you can see when it was last rebuilt.
I went for Centos 5, as I wanted longer term support for the OS, and upgraded the hard disks to a pair of 500GB Sata drives, had a bit of an incident with the 160GB drives which resulted in one of them dead, which is another story, but wanted more space anyway.
After getting it all set up with software RAID1 and LVM I then wanted to allocate more space to /var partition which is one of the LVM volumes. After looking around a bit it is actually quite simple, just two commands, which you need to be root to run. lvresize then resize2fs, below are examples of how I used them to add another 103GB to what is my /var partition, I had already added 200GB to this using this method and then decided to add the rest of the available disk space to this partition.
/usr/sbin/lvresize -L +103G /dev/VolGroup00/LogVol01
If you attempt to add more than is available with lvresize it simple gives you an error message saying how blocks are available and how many you asked for, so you can adjust your request and simply try again.
man lvresize and man resize2fs will show you all the options available for these commands.