DaveLevy
Posts: 12
Joined: Sun Feb 17, 2019 9:56 am

Virtual Disk Management (Mirroring)

Fri Nov 22, 2019 11:32 am

Is there a disk mirroring package for Raspbian?

I want to mirror two external HDDs. On querying the forums, people recommend rsync, which doesn't do the same thing.

Any help?

User avatar
topguy
Posts: 7313
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: Virtual Disk Management (Mirroring)

Fri Nov 22, 2019 12:14 pm

No final solution from me, just reading material.
https://en.wikipedia.org/wiki/Disk_mirroring

RonR
Posts: 3193
Joined: Tue Apr 12, 2016 10:29 pm
Location: US

Re: Virtual Disk Management (Mirroring)

Fri Nov 22, 2019 10:51 pm

DaveLevy wrote:
Fri Nov 22, 2019 11:32 am
I want to mirror two external HDDs. On querying the forums, people recommend rsync, which doesn't do the same thing.

I'm not aware of any RAID type disk mirroring solutions available for a Raspberry Pi, but rsync is a viable alternative.

image-backup will incrementally update an image file after an initial full backup. A cron job running at frequent intervals will permit you to have an image file suitable for restoring with Etcher that's as up to date as the last incremental update. image-backup uses rsync and incremental updates are very fast, don't interrupt other activities, and have little noticeable effect on system performance while running in the background..

swampdog
Posts: 1041
Joined: Fri Dec 04, 2015 11:22 am

Re: Virtual Disk Management (Mirroring)

Sat Nov 23, 2019 12:39 am

I've been using LVM (Logical Volume Manager) on my rpi4 without issue. It supports mirroring and there's no reason mirroring wouldn't work because it's just a component of LVM. Setting up LVM is not trivial. You'll need an "initrd" if you want to boot using it and that means you'll need a custom update script.

Life could be easier if it was only used for data. Do bear in mind it's an enterprise product. You'd be advised to create a linux virtual machine and play with breaking that: no point having the mirroring if you don't know what to do when a disk does fail! :-)

DaveLevy
Posts: 12
Joined: Sun Feb 17, 2019 9:56 am

Re: Virtual Disk Management (Mirroring)

Sat Nov 23, 2019 11:58 am

Thank you all.

@swampdog thanks for the pointers, I'll read up on LVM (again). The plan is not to mirror the boot or root partitions.

Return to “Beginners”