0

I currently have a raid 0 array consisting of several SSD drives for increased capacity and to some degree speed. This is set up via mdadm and has worked fine until a drive recently crashed. The array is up again and running but I am considering if it is feasible to recreate the array and in the process add a large HDD drive for redundancy.

The array is mainly used to either write or read a lot of data. Rarely is it accessed for reading or writing parts of the data.

Would this asymmetry even be possible to set up via mdadm?

raid 0 between these drives ->  |---SSD---|---SSD---|---SSD---|    raid 1 between the SSD
                                |-------------HDD-------------|    drives and the HDD drive

Is this possible without slowing down the write speed of the SSD drives?

I was hoping that the array would write to the SSD drives at their maximum speed and then fill the HDD as fast as it can when it can?

1 Answer 1

2

You can have an asymmetric array where writes go to the SSDs by preference and a limited tail of events will be written to the HDD as fast as it can cope. See the --write-mostly and --write-behind N options for mdadm,

-W, --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.

--write-behind= Specify that write-behind mode should be enabled (valid for RAID1 only). If an argument is specified, it will set the maximum number of outstanding writes allowed. The default value is 256. A write-intent bitmap is required in order to use write-behind mode, and write-behind is only attempted on drives marked as write-mostly.

You may find it's better to use the HDD as a separate filesystem and backup from the SSD to the HDD on an automatic regular and frequent basis. FOSS tools like rsnapshot (rsync) or proprietary ones like Veeam Free Agent can help to manage this for you.

Remember, RAID is a not a backup, so by having the HDD as a separate filesystem you're actually getting the benefit of a backup. An extra option to consider is that you could keep the HDD in a USB caddy that's stored physically separately from the computer so that you have air-gapped backups. Have a trigger so that when the drive is connected a backup is performed automatically. The downside of this is that you have to remember to connect the drive periodically otherwise backups don't happen.

1
  • Then I will probably go with the more manual approach of rsync. Out of curiosity - if there is a maximum number of outstanding writes for --write-behind, even a very high one, would copying terabytes worth of files not eventually slow down the array to wait for the HDD? I.e. the --write-behind feature only keeps the write performance high for smaller intermittent writes? Thanks
    – johs42
    Feb 18, 2021 at 6:23

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .