If you're happy using the extra drive, then proceed similar (this being an adequate disclaimer!) to the following:
Code:
pvcreate <New_disk>
vgextend <VG_Name> <New_Disk_Path>
lvcreate --name <LV_Name> --size 10G [or whatever size you wish]
mke2fs -j <LV_Path>
Once you have created the LV's, you should mount them in /mnt somewhere, so create a directory in /mnt for them.
Then, one by one, mount a new LV at /mnt/newlv and copy all the data from the old mount point to the new LV. /var is going to be tricky as log files are continually used. /home and /opt are the easiest as the are the simplest to "not use" whilst copying the data.
Code:
mount <LV_Path> /mnt/newlv
rsync -av <source_dir> /mnt/newlv
A slightly tricky bit now comes where you're pretty sure the data is on the new LV, but do you want to just delete what was there before testing it?
You can go ahead and
if you are happy with the job that rsync does. I run rsync a few times to ensure it does absolutely nothing before deleting old data. If you're paranoid, you can move the data to a new directory (may not be possible with /var and /usr) and reboot the system with the new LV mounted in the appropriate place.
Your /etc/fstab should be edited to include lines similar to:
Code:
/dev/Volume00/usr /usr ext3 defaults 1 2
/dev/Volume00/var /var ext3 defaults 1 2
/dev/Volume00/home /home ext3 defaults 1 2
/dev/Volume00/opt /opt ext3 defaults 1 2
Once you've checked the data is OK, delete the old-copy directories to free up space. This is the "simple" part of it as now you want to recover that space and move the new LV's back to the original disk. You may have to use a rescue CD as ext3 partitions need to be unmounted to be reduced - I'm not 100% on this, but I had to do it this way on the RHEL 4 boxes I admin at work.
Once you've reduced the / filesystem, you can lvreduce the / LV. Make sure the LV stays slightly larger than the FS just in case. Once you're happy with the new sizes, run an ext2online to grow the filesystem to fill the LV.
With that done, you're only left needing to move the new LV's from the temporary disk to the original disk. This requires the pvmove command. You can just specify the temporary PV and it will move all physical extents off that PV and onto whatever PV's remain. This sounds like the best option for you, but I tend to move one LV at a time as this also has the benefit of "defragging" your LV's if you've got them spread all over the place. It's a bit manual, but it can be done.
A really handy command when messing with LVM is
which shows you all your PV's, but lists the usage of the physical extents (i.e. which part of each LV sits where). It's a bit manual, but you can do a LOT of work online with LVM - and it can be restarted if the system goes down in the middle of anything big.
Sorry this is just a description of what you need to do - I've done it several times at work and it seems to change slightly each time. If you're willing to give it a bash, create some dummy LV's on your new drive and play around with them. That'll give you the confidence to go for it with your live data.
Cheers
Duncan