[Swlug] using lvm for mirror

Matt Willsher matt at monki.org.uk
Wed Dec 1 20:35:09 UTC 2021


I always used md devices under lvm, setup up a raid1 md device then having the pv on that and adding it to vg and allocating simple lvs in that.
The md devices are set up by creating identical partitions on each disk then using mdadm to create a raid1 mirror
 This used to be the way the OS installers did it, though that may have changed (btrfs takes a different approach, for instance)
This raid 1 set up isn’t bullet proof and a failure can be awkward to recover.  You may be better off with rsyncing the data to the back disk or using something that wraps over it like duplicity. 
If you don’t mind a third part kernel module or are running Ubuntu I found zfs to be easier to manage than any other option,  but it can be RAM hungry. 

Sorry I can’t offer any assistance with lvm directly but I hope this is useful information.

M. 


> On 1 Dec 2021, at 19:46, bascule via Swlug <swlug at mailman.lug.org.uk> wrote:
> 
> i've just had my first ever sudden total failuer of a hard drive in decades, 
> in the past I always had some warning:)
> since this drive was a 1tb partition full of stuff, it wasn't really backed 
> up, on account of that taking forever!
> so,pending new drive arriving I thought i'd look at having my new drive 
> partition mirrored on a partition on another drive, the backup not being for 
> accidental deletion protection but device failure.
> i thought that lvm might help and indeed there are tutorials on how to do 
> this, but none of them make clear or otherwise that each separate partition is 
> a moirror of the other.
> all that is guaranteed is that there are two copies of the filesystem 
> somewhere in the logical volume.
> 
> assuming that i add two new identical physical volumes to a volume group and 
> make a logical volume using the -m 1 option, will each partition be a copy of 
> the other such that i can recover the data if one partition disappears due to 
> its device dying?
> 
> bascule
> 
> 
> 
> -- 
> Swlug mailing list
> Swlug at mailman.lug.org.uk
> https://mailman.lug.org.uk/mailman/listinfo/swlug



More information about the Swlug mailing list