From: Andrea Gelmini <andrea.gelmini@gmail.com>
To: Cedric.dewijs@eclipso.eu
Cc: Linux BTRFS <linux-btrfs@vger.kernel.org>
Subject: Re: Raid1 of a slow hdd and a fast(er) SSD, howto to prioritize the SSD?
Date: Fri, 8 Jan 2021 09:16:26 +0100 [thread overview]
Message-ID: <CAK-xaQZS+ANoD+QbPTHwL-ErapA-7PDZe_z=OOWq_axAyR1KfA@mail.gmail.com> (raw)
In-Reply-To: <28232f6c03d8ae635d2ddffe29c82fac@mail.eclipso.de>
Il giorno mar 5 gen 2021 alle ore 07:44 <Cedric.dewijs@eclipso.eu> ha scritto:
>
> Is there a way to tell btrfs to leave the slow hdd alone, and to prioritize the SSD?
You can use mdadm to do this (I'm using this feature since years in
setup where I have to fallback on USB disks for any reason).
From manpage:
-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.
So you can do this:
(be carefull, this wipe your data)
mdadm --create --verbose --assume-clean /dev/md0 --level=1
--raid-devices=2 /dev/sda1 --write-mostly /dev/sdb1
Then you use BTRFS on top of /dev/md0, after mkfs.btrfs, of course.
Ciao,
Gelma
next prev parent reply other threads:[~2021-01-08 8:17 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-05 6:39 Raid1 of a slow hdd and a fast(er) SSD, howto to prioritize the SSD?
2021-01-05 6:53 ` Qu Wenruo
2021-01-05 18:19 `
2021-01-07 22:11 ` Zygo Blaxell
2021-01-05 19:19 ` Stéphane Lesimple
2021-01-06 2:55 ` Anand Jain
2021-01-08 8:16 ` Andrea Gelmini [this message]
2021-01-08 8:36 `
2021-01-08 14:00 ` Zygo Blaxell
2021-01-08 19:29 ` Andrea Gelmini
2021-01-09 21:40 ` Zygo Blaxell
2021-01-10 9:00 ` Andrea Gelmini
2021-01-16 1:04 ` Zygo Blaxell
2021-01-16 15:27 `
2021-01-18 0:45 ` Zygo Blaxell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAK-xaQZS+ANoD+QbPTHwL-ErapA-7PDZe_z=OOWq_axAyR1KfA@mail.gmail.com' \
--to=andrea.gelmini@gmail.com \
--cc=Cedric.dewijs@eclipso.eu \
--cc=linux-btrfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).