First off, what is Logical Volume Management and why do you need it? LVM is basically a set of hard drives grouped into being seen by the system as one hard drive. It is different than RAID, because there is no redundancy. In addition, the drives that are "grouped" can be of any size or any interface. You can have SATA, SAS, and IDE all in the same LVM. I wouldn't recommend it, but you could.
But what is it used for? Gigantic volumes, of course! Right now the largest hard drive you can buy is 3TB. What happens when you need a volume larger than that? You can use a RAID setup that will add redundancy, but you will also need a better controller and a lot more drives. But a simpler, quicker solution is to use LVM.
Here's the overview to get LVM going within Webmin:
- Install LVM
- Refresh Webmin Modules
- Add a Volume Group
- Add drives to the Volume Group
- Add a Logical Volume within the Volume Group
- Create the file system within the Logical Volume
- Mount the newlycreated file system
Now for the nitty-gritty:
Give your new Volume Group a name and an initial drive to use. I chose archive and my first drive is /dev/sdb.
Now that the Volume Group has one drive, it's time to add any additional drives. Click on the Physical Volumes link to add more drives.
Under the Physical Volumes tab, click on the Add a physical volume to [volume group] link
Enter the next drive that you wish to use and then select the Add to volume group button. Mine was /dev/sdc, but yours may be different.
With both drives in the Volume Group, we are now ready to add a Logical Volume
Under the Logical Volumes tab, click on the Create a logical volume in [volume group] button
Give your Logical Volume a name. This can be different from your Volume Group name, but if you only have one LVM on the system it might as well be the same.
With your Logical Volume created, we are now ready to add the file system and mount it. Click on the icon for the Logical Volume to start this process.
If you wish to rename the Logical Volume, you can do it here. If not, select the type of file system you wish to create from the drop-down list and click on the Create Filesystem of Type: button. I chose ext4 for its journaling and speed capabilities.
If you wish to choose different options for your filesystem than the default, change them here. If you don't know what these mean, don't change them!
The command to create the file system will now be run, and it will take quite some time to create. For my 4TB volume it was about 20-30 minutes.
Success! We now have a working volume and are ready to mount!
Now we're ready to mount the Logical Volume. Create a folder on your computer. I chose /newdata/archive, but /media/[volume] or /home/[user]/[volume] works just as well. Under the Logical Volume tab, click on the icon for your LV. Just below the file system creation button you will see a button labeled Mount LV on:. In the box next to that, type the path that you want to mount on.
That's it- you should now have an LVM mounted that spans multiple drives and ready to house any large amount of data!