linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* How file store when using Btrfs on multi-devices? What happen when a device fail?
@ 2012-05-03  6:46 Chu Duc Minh
  2012-05-03  6:56 ` Fajar A. Nugraha
  0 siblings, 1 reply; 3+ messages in thread
From: Chu Duc Minh @ 2012-05-03  6:46 UTC (permalink / raw)
  To: linux-btrfs

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? Btrfs has option to specify it
explicitly?
2. suppose i have a directory tree like that:
Dir_1
=A0|--> file_1A
=A0|--> file_1B
=A0|--> Dir_2
=A0=A0=A0=A0=A0=A0=A0=A0 |--> file_2C
=A0=A0=A0=A0=A0=A0=A0=A0 |--> file_2D

If Dir_2, file_2C=A0 on a failed device, can i still have access to fil=
e_2D?
If i use GlusterFS (mirror mode) on two nodes, each nodes run Btrfs on
multi-device. When a device on a node fail and I replace it, then
GlusterFS resync it, can i have troubles with data consistency?

Thanks in advance!
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" =
in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: How file store when using Btrfs on multi-devices? What happen when a device fail?
  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
  0 siblings, 1 reply; 3+ messages in thread
From: Fajar A. Nugraha @ 2012-05-03  6:56 UTC (permalink / raw)
  To: Chu Duc Minh; +Cc: linux-btrfs

On Thu, May 3, 2012 at 1:46 PM, Chu Duc Minh <chu.ducminh@gmail.com> wr=
ote:
> 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).
- in raid10 and raid0, it will always be spread, on a minimum of two de=
vices

> Btrfs has option to specify it
> explicitly?

Not that I know of.

> 2. suppose i have a directory tree like that:
> Dir_1
> =A0|--> file_1A
> =A0|--> file_1B
> =A0|--> Dir_2
> =A0=A0=A0=A0=A0=A0=A0=A0 |--> file_2C
> =A0=A0=A0=A0=A0=A0=A0=A0 |--> file_2D
>
> If Dir_2, file_2C=A0 on a failed device, can i still have access to f=
ile_2D?

Unless you're using raid10, my guess is you'll be screwed, as each
file will be spread on multiple devices (including the one that
fails).

> If i use GlusterFS (mirror mode) on two nodes, each nodes run Btrfs o=
n
> multi-device. When a device on a node fail and I replace it, then
> GlusterFS resync it, can i have troubles with data consistency?

This question might be more suitable on glusterfs list. My guess is
that glusterfs will discard all data on the failed node. After you
recreate the storage backend (the btrfs, on a new device), you can
tell glusterfs to copy everything from the good node.

Of course, if you use raid10 mode in btrfs, and only one device fail,
it should be transparent to end users.

--=20
=46ajar
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" =
in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: How file store when using Btrfs on multi-devices? What happen when a device fail?
  2012-05-03  6:56 ` Fajar A. Nugraha
@ 2012-05-03  7:35   ` Hugo Mills
  0 siblings, 0 replies; 3+ messages in thread
From: Hugo Mills @ 2012-05-03  7:35 UTC (permalink / raw)
  To: Fajar A. Nugraha; +Cc: Chu Duc Minh, linux-btrfs

[-- 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 --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-05-03  7:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 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).