3 ms·
There are common RAID implementations that work pretty much how you want. The RAID spec only says that in RAID 1, any piece of data must be stored on two disks.
by bhaney 2y ago
There are common RAID implementations that work pretty much how you want. The RAID spec only says that in RAID 1, any piece of data must be stored on two disks. Everything past that is implementation dependent, including limitations on disk sizes or excess copies in arrays with more than two disks.
In particular, btrfs's RAID 1 works fine with disks of different sizes so long as it's physically possible to get every piece of data on two disks (obviously an array made of 1x2TB and 1x1TB cannot possibly have a RAID 1 volume of more than 1TB, but btrfs will happily present a 2TB RAID 1 volume on top of 2x1TB and 1x2TB). Btrfs also lets you add or remove disks at any time, even while the filesystem is in use (you do have to wait for it to copy data around to other disks before you physically detach a removed drive). I believe ZFS mirrors work similarly, but I'm less familiar with them.
You should also consider using raid5/6 (raidz1/raidz2 for zfs) instead of raid1. They can still survive disk failures without data loss, but you can get your storage efficiency better than 50% with them.
I'm not aware of anything that lets you pick the raid level per-file though.