Mirror Linux disk writes to secondary disk

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
1
down vote

favorite












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.










share|improve this question





















  • Possible duplicate of Can I get SSD rw performance while keeing data security if I combine SSD & HDD in btrfs RAID1
    – Steven Davies
    9 mins ago














up vote
1
down vote

favorite












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.










share|improve this question





















  • Possible duplicate of Can I get SSD rw performance while keeing data security if I combine SSD & HDD in btrfs RAID1
    – Steven Davies
    9 mins ago












up vote
1
down vote

favorite









up vote
1
down vote

favorite











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.










share|improve this question













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.







linux raid storage software-raid






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked 25 mins ago









Steven Davies

21319




21319











  • Possible duplicate of Can I get SSD rw performance while keeing data security if I combine SSD & HDD in btrfs RAID1
    – Steven Davies
    9 mins ago
















  • Possible duplicate of Can I get SSD rw performance while keeing data security if I combine SSD & HDD in btrfs RAID1
    – Steven Davies
    9 mins ago















Possible duplicate of Can I get SSD rw performance while keeing data security if I combine SSD & HDD in btrfs RAID1
– Steven Davies
9 mins ago




Possible duplicate of Can I get SSD rw performance while keeing data security if I combine SSD & HDD in btrfs RAID1
– Steven Davies
9 mins ago










1 Answer
1






active

oldest

votes

















up vote
3
down vote



accepted










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.






share|improve this answer




















  • 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.
    – Steven Davies
    12 mins ago











Your Answer







StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: false,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f470878%2fmirror-linux-disk-writes-to-secondary-disk%23new-answer', 'question_page');

);

Post as a guest






























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
3
down vote



accepted










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.






share|improve this answer




















  • 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.
    – Steven Davies
    12 mins ago















up vote
3
down vote



accepted










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.






share|improve this answer




















  • 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.
    – Steven Davies
    12 mins ago













up vote
3
down vote



accepted







up vote
3
down vote



accepted






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.






share|improve this answer












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.







share|improve this answer












share|improve this answer



share|improve this answer










answered 21 mins ago









RalfFriedl

3,8551624




3,8551624











  • 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.
    – Steven Davies
    12 mins ago

















  • 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.
    – Steven Davies
    12 mins ago
















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.
– Steven Davies
12 mins ago





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.
– Steven Davies
12 mins ago


















 

draft saved


draft discarded















































 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f470878%2fmirror-linux-disk-writes-to-secondary-disk%23new-answer', 'question_page');

);

Post as a guest













































































Comments

Popular posts from this blog

What does second last employer means? [closed]

Installing NextGIS Connect into QGIS 3?

One-line joke