installing ubuntu on windows and LVM option [duplicate]
I'm installing (L)Ubuntu using Ubiquity from a LiveUSB, and I want to use LVM, since I've read that it can organize my three hard drives to work as a single unit.
If I check the box "Use LVM with the new Ubuntu installation", does this utilize all my hard drives, or do I have to do manual partitioning/configuration?
I've searched around, and found some potentially helpful sites, but I can't find anywhere that discuss how Ubiquity uses LVM. Most other sites are quite old (>1yr), and so they all mention that manual setup of LVM is the only method since Ubiquity doesn't utilize LVM yet.
After a little bit of experimenting, and help from the LVM HOWTO, I figured out how to do what I was looking for.
These steps will work for any number of hard drives, you will just have to modify how many times you do each step. Additionally, these steps can be done either in a LiveUSB or while using the installed OS itself.
Before you begin, make sure you know the "name" of each of your drives. These can be found using the command sudo fdisk -l
. Each drive name will look something like /dev/sda
Initial Installation
If you select "Use LVM with the new Ubuntu installation", it will install Ubuntu on a single drive, with volume group (VG) ubuntu-vg
, physical volume (PV) /dev/sdx5
(where "x" is the letter of the drive used by the installer, usually "a"), and logical volumes (LV) /dev/ubuntu-vg/root
and /dev/ubuntu-vg/swap_1
.
Initialising Additional Drives for LVM
Before your additional hard drives can be used for LVM, you need to turn them into physical volumes. To do so:
-
sudo pvcreate /dev/sdx
, where x is the letter of whatever drive you're adding.
Adding New Physical Volumes to your Volume Group
You then need to add each new physical volume (read, each additional drive) to your volume group. To do so:
sudo vgextend ubuntu-vg /dev/sdx
Extending the Logical Volume and your Filesystem
The last step is to extend the LV and your filesystem over the newly-added PVs. To do so:
sudo lvextend -l+100%FREE /dev/ubuntu-vg/root -r
Explanation of command: -l+100%FREE
extends the LV over all free space in the VG, /dev/lubuntu-vg/root
specifies which LV to expand, and -r
expands your filesystem to fill the newly-expanded LV.
After all this, you should be ready to rock-and-roll with your now-large-and-single hard drive.