Write-mostly

From Linux Raid Wiki
Revision as of 19:25, 12 March 2019 by Timothy W. Gravier, Jr. (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

This option is used to mark a participating volume as a "slow-performing" volume so that most of the reads from an array will come from other, faster, volumes. This option is most useful when creating a RAID-1 mirrored array where the participating volumes might be connected over a variety of media (i.e., network/USB) in combination with faster connections (SAS/SATA/fiber).


Example 1:

Lenny T. is building a computer that has lots and lots of video game ROMs and disk images. He also has lots of movies, music, and other files that take up lots of space. These would be time-consuming to re-download in the case of a drive failure. He has an off-site backup solution in place, but he really doesn't have time time/resources to recover from backup for something as simple as a failed hard drive. Meteor strike would be a different story, but he would prefer to keep his computer with maximum up-time. Lenny's computer has a single 2 TB SATA hard drive, and he has an external 2 TB hard drive connected via USB. Lenny wants to configure the 2 drives in a RAID-1 mirror so that if either of the 2 drives fails, his computer will remain functional until the failed hardware can be replaced. (Lenny is aware that RAID'ing a USB device is a bad idea, but he's got what he's got, and that RTX 2080ti wasn't cheap.)

Lenny can use the following command to configure the USB drive as a "write-mostly" drive so that when the computer boots and he does his computery stuff, most of the reads come from his internal drive:

$ sudo mdadm --create --verbose /dev/md0 --level=1 --raid-devices=2 /dev/sda --write-mostly /dev/sdb

In this example, /dev/md0 will be the new RAID-1 block device, /dev/sda is Lenny's internal SATA drive, and /dev/sdb is his USB-connected external drive.

Personal tools