Linux Btrfs filesystem development
 help / color / mirror / Atom feed
From: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
To: Cedric.dewijs@eclipso.eu
Cc: Andrea Gelmini <andrea.gelmini@gmail.com>, linux-btrfs@vger.kernel.org
Subject: Re: Re: Raid1 of a slow hdd and a fast(er) SSD, howto to prioritize the SSD?
Date: Fri, 8 Jan 2021 09:00:17 -0500	[thread overview]
Message-ID: <20210108140017.GA31381@hungrycats.org> (raw)
In-Reply-To: <eb0f5e05a563009af95439f446659cf3@mail.eclipso.de>

On Fri, Jan 08, 2021 at 09:36:13AM +0100,   wrote:
> 
> --- Ursprüngliche Nachricht ---
> Von: Andrea Gelmini <andrea.gelmini@gmail.com>
> Datum: 08.01.2021 09:16:26
> An: Cedric.dewijs@eclipso.eu
> Betreff: Re: Raid1 of a slow hdd and a fast(er) SSD, howto to prioritize the SSD?
> 
> 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
> 
> Thanks Gelma.
> 
> What happens when I poison one of the drives in the mdadm array using
> this command? Will all data come out OK?
> dd if=/dev/urandom of=/dev/dev/sdb1 bs=1M count = 100?

mdadm doesn't handle data corruption, and (except for a /sys counter),
reads from mirror devices interchangeably, and silently propagates
data between devices during resync, so the array will almost certainly
be destroyed.

> When I do this test on a plain btrfs raid 1 with 2 drives, all the data
> comes out OK (while generating a lot of messages about correcting data
> in dmesg -w)
> 
> Cheers,
> Cedric
> 
> ---
> 
> Take your mailboxes with you. Free, fast and secure Mail &amp; Cloud: https://www.eclipso.eu - Time to change!
> 
> 

  reply	other threads:[~2021-01-08 14:01 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-05 19:19     ` Stéphane Lesimple
2021-01-07 22:11     ` Zygo Blaxell
2021-01-06  2:55   ` Anand Jain
2021-01-08  8:16 ` Andrea Gelmini
2021-01-08  8:36   `  
2021-01-08 14:00     ` Zygo Blaxell [this message]
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=20210108140017.GA31381@hungrycats.org \
    --to=ce3g8jdj@umail.furryterror.org \
    --cc=Cedric.dewijs@eclipso.eu \
    --cc=andrea.gelmini@gmail.com \
    --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