Chu Duc Minh
2012-May-03 06:46 UTC
How file store when using Btrfs on multi-devices? What happen when a device fail?
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 |--> file_1A |--> file_1B |--> Dir_2 |--> file_2C |--> file_2D If Dir_2, file_2C on a failed device, can i still have access to file_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
Fajar A. Nugraha
2012-May-03 06:56 UTC
Re: How file store when using Btrfs on multi-devices? What happen when a device fail?
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). - in raid10 and raid0, it will always be spread, on a minimum of two devices> Btrfs has option to specify it > explicitly?Not that I know of.> 2. suppose i have a directory tree like that: > Dir_1 > |--> file_1A > |--> file_1B > |--> Dir_2 > |--> file_2C > |--> file_2D > > If Dir_2, file_2C on a failed device, can i still have access to file_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 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?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. -- Fajar -- 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
Hugo Mills
2012-May-03 07:35 UTC
Re: How file store when using Btrfs on multi-devices? What happen when a device fail?
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 devicesAgain, 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: | ---
Apparently Analagous Threads
- [Bug 934] Traverse-only directories (e.g. chmod 110) break the cd command in sftp
- [Bug 934] Traverse-only directories (e.g. chmod 110) break the cd command in sftp
- Another "function does not return a value" problem
- samba-4.1.0 build failure -help with
- mapa provincial de España con googleVis