2

I would like to set up a Linux system to use one primary storage device, but copy all writes to that device to another secondary device without blocking for every write - e.g. an NVMe SSD as primary and spinning rust as secondary.

The only way I can think of doing this currently would be to either run a frequent rsync in the background, or something like a btrfs-send of the live stream of disk writes.

Steve
  • 470

1 Answers1

5

You can use a MD RAID1 with the option --write-mostly.

subsequent devices listed in a --build, --create, or --add command will be flagged as 'write-mostly'. This is valid for RAID1 only and means that the 'md' driver will avoid reading from these devices if at all possible. This can be useful if mirroring over a slow link.

I use this when I want a fast SSD but have the data on a second, spinning drive.

RalfFriedl
  • 8,981
  • 1
    Thanks, with that I did some more research and found the ability to use both --write-mostly and --write-behind. I'll mark my question as a duplicate of that answer. – Steve Sep 23 '18 at 14:23