So I have a server that is going to be set up to be a FOG server. The problem is we cannot do a RAID 5 but we have four 1 TB hard drives to use. The first two are in a Raid 0 and will run the OS but what i need is the second two to be combined VIA LVM to act as one volume so I can then mount it as a sub folder into the /images, and be able to use it as extra space. The problem is I have very limited experience with LVM and there is no GUI. I also can't find many pages that explain a way to do anything sort of like this. It may be that I'm just not looking in the right places, but regardless any help would be appreciated! Also I'm running Ubuntu 16.04.
1 Answer
Say the two drives that are to be combined are /dev/sdc1
and /dev/sdd1
. If you have any data on the disks back it up before combining the disks into a LVM volume group. To make one big logical volume named ExtraSpaceLV
out of them make sure that they are not mounted and not registered to be mounted in /etc/fstab
, then:
sudo pvcreate /dev/sdc1 # Initialize /dev/sdc1 as a LVM physical disk
sudo pvcreate /dev/sdd1 # Initialize /dev/sdd1 as a LVM physical disk
vgcreate ExtraSpaceVG /dev/sdc1 /dev/sdd1 # Combine them into a LVM volume group
lvcreate -l 100%FREE -n ExtraSpaceLV ExtraSpaceVG # Create a logical volume
If you would like to leave some space free (for example, to be able to make snapshots later) you can use 95%FREE
or other percentage.
After this the volume will be at /dev/mapper/ExtraSpaceLV
and you can mkfs
and mount it, register it in /etc/fstab
and so on.
-
Ok the situation changed a little bit, this would have worked i believe but know we are doing 4 hard drives in 2 Raid 0 setups. No i just need both Raid 0 setups in an lvm group. I believe i have messed up because it keeps putting the boot partition on the second Raid 0 and making it so i cant it to an lvm group but im not sure.– K. SyahDec 23, 2016 at 20:32
-
I suggest that you close this question and open a new one with the new setup.– AlexPDec 23, 2016 at 20:37