* RAID 1 | Newbie Question
@ 2020-04-22 9:58 Stefanie Leisestreichler
2020-04-22 10:44 ` Hugo Mills
0 siblings, 1 reply; 7+ messages in thread
From: Stefanie Leisestreichler @ 2020-04-22 9:58 UTC (permalink / raw)
To: linux-btrfs
Hi.
I might be a first time user with btrfs for a new system I will set up.
Just want to make sure: As I read the docs, the note about RAID 1 and
that there will be no redundant data is true only, if the RAID, which is
possible, is set up to use only 1 physical device, right?
If RAID 1 using btrfs is defined to use two seperate disk, say /dev/sda2
and /dev/sdb2, I will have the same redundancy like using md. Is this
correct?
Thanks,
Steffi
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: RAID 1 | Newbie Question
2020-04-22 9:58 RAID 1 | Newbie Question Stefanie Leisestreichler
@ 2020-04-22 10:44 ` Hugo Mills
2020-04-22 10:55 ` Stefanie Leisestreichler
0 siblings, 1 reply; 7+ messages in thread
From: Hugo Mills @ 2020-04-22 10:44 UTC (permalink / raw)
To: Stefanie Leisestreichler; +Cc: linux-btrfs
On Wed, Apr 22, 2020 at 11:58:41AM +0200, Stefanie Leisestreichler wrote:
> Hi.
> I might be a first time user with btrfs for a new system I will set up.
>
> Just want to make sure: As I read the docs, the note about RAID 1 and that
> there will be no redundant data is true only, if the RAID, which is
> possible, is set up to use only 1 physical device, right?
You can't set up btrfs RAID-1 to use only one device. It's only
possible to end up like that if you set up a 2-device RAID-1 and then
unplug a device and mount it in degraded mode.
> If RAID 1 using btrfs is defined to use two seperate disk, say /dev/sda2 and
> /dev/sdb2, I will have the same redundancy like using md. Is this correct?
You'll have two copies, so one device redundancy, regardless of the
number of devices. Traditional RAID-1 will use as many copies as
devices; btrfs RAID-1 is two copies. (Although there are 3-copy and
4-copy variations in the latest kernels).
Hugo.
--
Hugo Mills | You can play with your friends' privates, but you
hugo@... carfax.org.uk | can't play with your friends' childrens' privates.
http://carfax.org.uk/ |
PGP: E2AB1DE4 | C++ coding rule
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: RAID 1 | Newbie Question
2020-04-22 10:44 ` Hugo Mills
@ 2020-04-22 10:55 ` Stefanie Leisestreichler
2020-04-22 11:06 ` Hugo Mills
0 siblings, 1 reply; 7+ messages in thread
From: Stefanie Leisestreichler @ 2020-04-22 10:55 UTC (permalink / raw)
To: Hugo Mills, linux-btrfs
On 22.04.20 12:44, Hugo Mills wrote:
> You can't set up btrfs RAID-1 to use only one device. It's only
> possible to end up like that if you set up a 2-device RAID-1 and then
> unplug a device and mount it in degraded mode.
It was this sentence in the btrfs wiki, what confused me, also comments
in the net that btrfs is not giving you RAID with redundant data
(https://btrfs.wiki.kernel.org/index.php/FAQ):
"It is possible with all of the descriptions below, to construct a
RAID-1 array from two or more devices, and have those devices live on
the same physical drive. This configuration does not offer any form of
redundancy for your data."
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: RAID 1 | Newbie Question
2020-04-22 10:55 ` Stefanie Leisestreichler
@ 2020-04-22 11:06 ` Hugo Mills
2020-04-22 11:34 ` Stefanie Leisestreichler
0 siblings, 1 reply; 7+ messages in thread
From: Hugo Mills @ 2020-04-22 11:06 UTC (permalink / raw)
To: Stefanie Leisestreichler; +Cc: linux-btrfs
On Wed, Apr 22, 2020 at 12:55:08PM +0200, Stefanie Leisestreichler wrote:
>
>
> On 22.04.20 12:44, Hugo Mills wrote:
> > You can't set up btrfs RAID-1 to use only one device. It's only
> > possible to end up like that if you set up a 2-device RAID-1 and then
> > unplug a device and mount it in degraded mode.
>
> It was this sentence in the btrfs wiki, what confused me, also comments in
> the net that btrfs is not giving you RAID with redundant data
> (https://btrfs.wiki.kernel.org/index.php/FAQ):
>
> "It is possible with all of the descriptions below, to construct a RAID-1
> array from two or more devices, and have those devices live on the same
> physical drive. This configuration does not offer any form of redundancy for
> your data."
There's a difference between "device" and "disk" here. If you make
two partitions on one device, and that device fails, then there's no
(disk) redundancy.
If you make two partitions on one disk and one partition on another
disk, and use all three partitions (block devices) to make a RAID-1,
then you're still going to lose the filesystem if the disk with two
partitions on it fails.
I'm not sure what the comments are about not giving redundant data
-- if you configure your FS to use one of the redundant RAID levels,
then that's what you get.
Hugo.
--
Hugo Mills | emacs: Eighty Megabytes And Constantly Swapping.
hugo@... carfax.org.uk |
http://carfax.org.uk/ |
PGP: E2AB1DE4 |
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: RAID 1 | Newbie Question
2020-04-22 11:06 ` Hugo Mills
@ 2020-04-22 11:34 ` Stefanie Leisestreichler
2020-04-22 21:13 ` Chris Murphy
0 siblings, 1 reply; 7+ messages in thread
From: Stefanie Leisestreichler @ 2020-04-22 11:34 UTC (permalink / raw)
To: Hugo Mills, linux-btrfs
On 22.04.20 13:06, Hugo Mills wrote:
>> "It is possible with all of the descriptions below, to construct a RAID-1
>> array from two or more devices, and have those devices live on the same
>> physical drive. This configuration does not offer any form of redundancy for
>> your data."
> There's a difference between "device" and "disk" here. If you make
> two partitions on one device, and that device fails, then there's no
> (disk) redundancy.
>
> If you make two partitions on one disk and one partition on another
> disk, and use all three partitions (block devices) to make a RAID-1,
> then you're still going to lose the filesystem if the disk with two
> partitions on it fails.
OK, this makes sense to me and cleared things up.
I still do not get the clue why it is explicitly mentioned in the wiki
that there will be no redundany for the data if one uses just one disk
in case of a disk failure. This is pretty obvious instead.
Thanks,
Steffi
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: RAID 1 | Newbie Question
2020-04-22 11:34 ` Stefanie Leisestreichler
@ 2020-04-22 21:13 ` Chris Murphy
2020-04-23 5:42 ` Andrei Borzenkov
0 siblings, 1 reply; 7+ messages in thread
From: Chris Murphy @ 2020-04-22 21:13 UTC (permalink / raw)
To: Stefanie Leisestreichler; +Cc: Hugo Mills, Btrfs BTRFS
I haven't looked at the wiki in a bit so I'm not sure if it points out
two common gotchas:
Mismatch between SCT ERC and SCSI driver (used by libata and maybe
also usb) timeouts. Btrfs needs explicit read errors on bad sectors to
do automatic fix ups, same as md.
https://raid.wiki.kernel.org/index.php/Timeout_Mismatch
There's no automatic degraded state for Btrfs. And it is not a good
idea to add the degraded mount option to fstab, as it can result in a
kind of "split brain" corruption. In the case of member device
failure, at startup time the mount will fail and you'll need to
manually mount degraded and fix the problem resulting in the need to
mount degraded. An alternative is maybe modifying the current btrfs
udev rule, to timeout after a decently long period of time to ensure
it's really a case of needing degraded mount, rather than merely a
slow or transient effect that just needs a delay so that all member
devices are available when mount is called. But I don't know if udev
has a concept of waiting. For mdadm this is done in the initramfs.
--
Chris Murphy
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: RAID 1 | Newbie Question
2020-04-22 21:13 ` Chris Murphy
@ 2020-04-23 5:42 ` Andrei Borzenkov
0 siblings, 0 replies; 7+ messages in thread
From: Andrei Borzenkov @ 2020-04-23 5:42 UTC (permalink / raw)
To: Chris Murphy, Stefanie Leisestreichler; +Cc: Hugo Mills, Btrfs BTRFS
23.04.2020 00:13, Chris Murphy пишет:
> I haven't looked at the wiki in a bit so I'm not sure if it points out
> two common gotchas:
>
> Mismatch between SCT ERC and SCSI driver (used by libata and maybe
> also usb) timeouts. Btrfs needs explicit read errors on bad sectors to
> do automatic fix ups, same as md.
> https://raid.wiki.kernel.org/index.php/Timeout_Mismatch
>
> There's no automatic degraded state for Btrfs. And it is not a good
> idea to add the degraded mount option to fstab, as it can result in a
> kind of "split brain" corruption. In the case of member device
> failure, at startup time the mount will fail and you'll need to
> manually mount degraded and fix the problem resulting in the need to
> mount degraded. An alternative is maybe modifying the current btrfs
> udev rule, to timeout after a decently long period of time to ensure
> it's really a case of needing degraded mount, rather than merely a
> slow or transient effect that just needs a delay so that all member
> devices are available when mount is called. But I don't know if udev
> has a concept of waiting. For mdadm this is done in the initramfs.
>
mdadm starts per-array systemd timer via udev rule when the first member
device is detected. When this timer triggers (it is expected to trigger
before normal systemd device wait timeout) timer starts service that
effectively calls "mdadm --run".
If btrfs exposed filesystem in sysfs immediately when the first member
device was detected and also checked "mountability" every time member
device is added, similar mechanism could be implemented. Or dedicated
service that makes decision ... the primary problem is that currently
there is no way to know how many devices are there or whether these
devices are enough to mount filesystem even though kernel does know this
information.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2020-04-23 5:42 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-04-22 9:58 RAID 1 | Newbie Question Stefanie Leisestreichler
2020-04-22 10:44 ` Hugo Mills
2020-04-22 10:55 ` Stefanie Leisestreichler
2020-04-22 11:06 ` Hugo Mills
2020-04-22 11:34 ` Stefanie Leisestreichler
2020-04-22 21:13 ` Chris Murphy
2020-04-23 5:42 ` Andrei Borzenkov
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).