LVM with raid1 mirror in Turris omnia

Hello, I’d like to ask if there is a way to create raid1 with LVM.

Motivation: I’d like to build NAS on turris and be able to easily recover data in case of HDD failure.
I can create lv of --type mirror, but this builds mirror log on one of the disks.

Is there a way to enable raid1 with lvm ?
Why is this not supported?

root@turris:~# lvcreate -m 1 -L 10M -n someLV -v someVG
    Executing: /sbin/modprobe dm-raid
  /sbin/modprobe: execvp failed: No such file or directory
  /sbin/modprobe failed: 2
  raid1: Required device-mapper target(s) not detected in your kernel.
  Run `lvcreate --help' for more information.

In lvcreate manpage it’s suggested to use raid1 instead of mirrorlog

   --mirrorlog core|disk
          Specifies the type of mirror log for LVs with the "mirror" type (does not apply to the "raid1"
          type.)  disk is a persistent log and requires a small amount of storage space, usually on a separate
          device from the data being mirrored.  core is not persistent; the log is kept only in memory.  In
          this case, the mirror must be synchronized (by copying LV data from the first device to others) each
          time the LV is activated, e.g. after reboot.  mirrored is a persistent log that is itself mirrored,
          but should be avoided. Instead, use the raid1 type for log redundancy.

Thanks for advice :slight_smile:

Well, I only have /usr/sbin/modprobe on my Omnia, not this other path. BTW, if you want to use btrfs, you can do raid1 directly without lvm (just in case you didn’t know).

Thanks for hint,

symlink to suggested location did get me a bit further

root@turris:~# ln -s /usr/sbin/modprobe /sbin/modprobe
root@turris:~# lvcreate -m 1 -L 10M -n someLV -v nas
    Executing: /sbin/modprobe dm-raid
failed to find a module named dm-raid
  raid1: Required device-mapper target(s) not detected in your kernel.
  Run `lvcreate --help' for more information.

And then uncle google found this older thread

So I guess no way around that unless I want to recompile the kernel modules…

I actually read somewhere that btrfs can do raid, but I don’t have experience with btrfs and various forums have mixed oppinions about this filesystem.

Maybe it’s crazy idea, but the original thought was to have

  • 2 pvs / 2 hdd
  • 1 volume group
  • 1 lv in raid1/mirror for important documents
  • 1 lv without any mirroring to not waste disk space for things which won’t hurt if lost in case of disk failure
  • resize logical volumes as needed

Is this doable with btrfs ?

You partition drives the usual way. Then you can build multiple independent btrfs filesystems from these. Resizing might not be as easy as with lvm, I suspect. In any case, I’m fairly confident there are more RAID-knowledgeable people on this forum than me.

BTW, personally I don’t feel like keeping very important things just on a single physical place (but yes, RAID is easier).