From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-io0-f172.google.com ([209.85.223.172]:34468 "EHLO mail-io0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753542AbbKLR41 (ORCPT ); Thu, 12 Nov 2015 12:56:27 -0500 Received: by ioir85 with SMTP id r85so32070159ioi.1 for ; Thu, 12 Nov 2015 09:56:26 -0800 (PST) Subject: Re: Potential to loose data in case of disk failure To: Dmitry Katsubo , linux-btrfs References: <20151111202403.GA19245@wheatley.student.rit.edu> <56448A54.9020404@gmail.com> <5644CB2F.8010302@mail.ru> From: Austin S Hemmelgarn Message-ID: <5644D2AF.40904@gmail.com> Date: Thu, 12 Nov 2015 12:55:59 -0500 MIME-Version: 1.0 In-Reply-To: <5644CB2F.8010302@mail.ru> Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha-512; boundary="------------ms050804090207020101010007" Sender: linux-btrfs-owner@vger.kernel.org List-ID: This is a cryptographically signed message in MIME format. --------------ms050804090207020101010007 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable On 2015-11-12 12:23, Dmitry Katsubo wrote: > On 2015-11-12 13:47, Austin S Hemmelgarn wrote: >>> That's a pretty unusual setup, so I'm not surprised there's no quick = and >>> easy answer. The best solution in my opinion would be to shuffle your= >>> partitions around and combine sda3 and sda8 into a single partition. >>> There's generally no reason to present btrfs with two different >>> partitions on the same disk. >>> >>> If there's something that prevents you from doing that, you may be ab= le >>> to use RAID10 or RAID6 somehow. I'm not really sure, though, so I'll >>> defer to others on the list for implementation details. >> RAID10 has the same issue. Assume you have 1 block. This gets stored= >> as 2 copies, each with 2 stripes, with the stripes split symmetrically= =2E >> For this, call the first half of the first copy 1a, the second half = 1b, >> and likewise for 2a and 2b with the second copy. 1a and 2a have >> identical contents, and 1b and 2b have identical contents. It is full= y >> possible that you will end up with this block striped such that 1a and= >> 2a are on one disk, and 1b and 2b on the other. Based on this, losing= >> one disk would mean losing half the block, which would mean based on h= ow >> BTRFS works that you would lose the whole block (because neither copy >> would be complete). > > Does it equally apply to RAID1? Namely, if I create > > mkfs.btrfs -mraid1 -draid1 /dev/sda3 /dev/sda8 > > then btrfs will "believe" that these are different drives and mistakenl= y > think that RAID pre-condition is satisfied. Am I right? If so then I > think this is a trap, and mkfs.btrfs should at least warn (or require > --force) if two partitions are on the same drive for raid1/raid5/raid10= =2E > In other words, the only scenario when this check should be skipped is:= > > mkfs.btrfs -mraid0 -draid0 /dev/sda3 /dev/sda8 > Yes, BTRFS will assume you know what you are doing in that case and just = do it. We probably should have some kind of warning, but that gets=20 tricky when you throw in stuff like LVM (which can have any arbitrary=20 name for the logical volumes, and there isn't any way, even using the=20 tools, to easily figure out what disk a given LV is on). --------------ms050804090207020101010007 Content-Type: application/pkcs7-signature; name="smime.p7s" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="smime.p7s" Content-Description: S/MIME Cryptographic Signature MIAGCSqGSIb3DQEHAqCAMIACAQExDzANBglghkgBZQMEAgMFADCABgkqhkiG9w0BBwEAAKCC Brgwgga0MIIEnKADAgECAgMRLfgwDQYJKoZIhvcNAQENBQAweTEQMA4GA1UEChMHUm9vdCBD QTEeMBwGA1UECxMVaHR0cDovL3d3dy5jYWNlcnQub3JnMSIwIAYDVQQDExlDQSBDZXJ0IFNp Z25pbmcgQXV0aG9yaXR5MSEwHwYJKoZIhvcNAQkBFhJzdXBwb3J0QGNhY2VydC5vcmcwHhcN MTUwOTIxMTEzNTEzWhcNMTYwMzE5MTEzNTEzWjBjMRgwFgYDVQQDEw9DQWNlcnQgV29UIFVz ZXIxIzAhBgkqhkiG9w0BCQEWFGFoZmVycm9pbjdAZ21haWwuY29tMSIwIAYJKoZIhvcNAQkB FhNhaGVtbWVsZ0BvaGlvZ3QuY29tMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA nQ/81tq0QBQi5w316VsVNfjg6kVVIMx760TuwA1MUaNQgQ3NyUl+U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