linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hugo Mills <hugo@carfax.org.uk>
To: "Fajar A. Nugraha" <list@fajar.net>
Cc: Chu Duc Minh <chu.ducminh@gmail.com>, linux-btrfs@vger.kernel.org
Subject: Re: How file store when using Btrfs on multi-devices? What happen when a device fail?
Date: Thu, 3 May 2012 08:35:39 +0100	[thread overview]
Message-ID: <20120503073539.GD9860@carfax.org.uk> (raw)
In-Reply-To: <CAG1y0sdkgJ9y=1Y=A+n8QAU73TKeBAej9GFJ26w7czOtDNzQ2g@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1319 bytes --]

On Thu, May 03, 2012 at 01:56:10PM +0700, Fajar A. Nugraha wrote:
> On Thu, May 3, 2012 at 1:46 PM, Chu Duc Minh <chu.ducminh@gmail.com> wrote:
> > Hi, i have some questions when using Btrfs on multi-devices:
> > 1. a large file will always be stored wholely on a device or it may
> > spread on some devices/partitions?
> 
> IIRC:
> - in raid1 mode, it will be written on all disks (or was it TWO disks,
> regarless how many device in a mirror? can't remember which).

   Any given block of the file will appear on two disks. There's no
guarantee that all the blocks of a file will be stored on the same two
disks, though.

> - in raid10 and raid0, it will always be spread, on a minimum of two devices

   Again, any given block of a file will appear on precisely two disks
(for RAID-10), or precisely one disk (for RAID-0). However, for a
sufficiently large file (i.e. multiples of the stripe size, which is
64KiB, I think), the blocks will be spread across all disks. If the
file is highly fragmented, this is a statistical statement; if the
file is contiguous, it is a guarantee.

   Hugo.

-- 
=== Hugo Mills: hugo@... carfax.org.uk | darksatanic.net | lug.org.uk ===
  PGP key: 515C238D from wwwkeys.eu.pgp.net or http://www.carfax.org.uk
                   --- Ceci n'est pas une pipe:  | ---                   

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 190 bytes --]

      reply	other threads:[~2012-05-03  7:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-03  6:46 How file store when using Btrfs on multi-devices? What happen when a device fail? Chu Duc Minh
2012-05-03  6:56 ` Fajar A. Nugraha
2012-05-03  7:35   ` Hugo Mills [this message]

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=20120503073539.GD9860@carfax.org.uk \
    --to=hugo@carfax.org.uk \
    --cc=chu.ducminh@gmail.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=list@fajar.net \
    /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).