2

Can I create two LVMs with 2 drives each, totaling 4 drives, then set up RAID 1? The goal is to create two each 8 TB LVMs, then mirror them.

I've read the following post and several others all over and can't find anyone doing this with more than 2 physical drives, so maybe it can't be done & I'm nuts for trying it.

Install Ubuntu 18.04 desktop with RAID 1 and LVM on machine with UEFI BIOS

I have Ubuntu Server 18.04 on a live machine with four total drives: two each 2 TB SSD Hybrids, plus two each 6 TB HHDs.

I want to create an LVM using one 2 TB drive and one 6 TB drive and then repeat with the other two drives.

enter image description here

I have an SSD/Disk Hybrid for boot, the OS & the file system, save for one folder which will be mounted on the 6 TB HDD as dynamic storage. The 6 TB will have nothing else on it.

Then I want to implement RAID 1 to have a failover option.

If so, how? If not, how can I achieve the goal?

As an aside, I'll be backing up to an 8 TB external drive.

  • 1
    Have you considered using RAID 10? – Raffa Sep 5 '19 at 16:29
  • 1
    As I understand RAID 10, and maybe I don't, don't all 4 disks have to be the same size? – Lothius Sep 5 '19 at 16:41
  • 1
    No, they do not need to be identical but you might not be able to utilize all the space of the larger drives in the same raid array. I apologize, I guess I missed your point of that you want to utilize all the available space. I would go with lvmraid in this case. – Raffa Sep 5 '19 at 18:38
2

Yes, you can. Just use LVM RAID

Basically, you do the following:

  1. Create physical volumes of physical disk partitions. Do this the usual way using fdisk or if you prefer the graphical waya you can use Gnome disks or gparted. Then use pvcreate on the partitions.

  2. Create volume groups of the physical volums. Use the command below in the terminal:

sudo vgcreate VG_NAME /dev/sdb1 /dev/sdb2

use your VG_NAME --> this could be anything you like

use your partitions names in place of /dev/sdb1 and /dev/sdb2

  1. Create mirrored logical volumes.

raid1

   Also  called  mirroring,  raid1  uses  multiple devices to duplicate LV data.  The LV data
   remains available if all but one of the devices fail.  The minimum number of devices (i.e.
   sub LV pairs) required is 2.

   lvcreate --type raid1 [--mirrors Number] VG [PVs]

   --mirrors specifies the number of mirror images in addition to the original LV image, e.g.
          --mirrors 1 means there are two images of the data, the  original  and  one  mirror
          image.

   PVs  specifies  the devices to use.  If not specified, lvm will choose Number devices, one
   for each image.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.