All of lore.kernel.org
 help / color / mirror / Atom feed
* Simple btrfs use case
@ 2013-01-22 12:08 Pavel Vasilyev
  2013-01-22 15:08 ` Calvin Walton
  0 siblings, 1 reply; 4+ messages in thread
From: Pavel Vasilyev @ 2013-01-22 12:08 UTC (permalink / raw)
  To: linux-btrfs

Hi

For example I have a bunch of various disks. I want to use them all as
one big storage:
mkfs.btrfs -m raid1 -d single /dev/sda /dev/sdb /dev/sdc ...
And someday one of my disks becomes dead. Disappears.
However, I can still mount fs in degraded,ro mode. All files that lays
on working disks are still available, but the only option to save
those files is to make a new fs on a new disk and copy them to it.
Why? Can I just drop files, whose chunks was on the dead disk?


How btrfs allocates files (file chunks) on physical disks? i.e. can I
lose all my files in -d single mode, when one of my disk becomes dead?

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

* Re: Simple btrfs use case
  2013-01-22 12:08 Simple btrfs use case Pavel Vasilyev
@ 2013-01-22 15:08 ` Calvin Walton
  2013-01-22 15:29   ` Pavel Vasilyev
  0 siblings, 1 reply; 4+ messages in thread
From: Calvin Walton @ 2013-01-22 15:08 UTC (permalink / raw)
  To: Pavel Vasilyev; +Cc: linux-btrfs

On Tue, 2013-01-22 at 16:08 +0400, Pavel Vasilyev wrote:
> Hi
> 
> For example I have a bunch of various disks. I want to use them all as
> one big storage:
> mkfs.btrfs -m raid1 -d single /dev/sda /dev/sdb /dev/sdc ...
> And someday one of my disks becomes dead. Disappears.
> However, I can still mount fs in degraded,ro mode. All files that lays
> on working disks are still available, but the only option to save
> those files is to make a new fs on a new disk and copy them to it.
> Why? Can I just drop files, whose chunks was on the dead disk?
> 
> 
> How btrfs allocates files (file chunks) on physical disks? i.e. can I
> lose all my files in -d single mode, when one of my disk becomes dead?

In "single" data mode, btrfs makes no special attempt to keep files
together on the same disk, but if a file is written linearly and never
modified there's a chance it might happen. (Each modification will COW
the file, putting the modified portion on a random disk.)

As a result, yes, you may lose a substantial number - even most - of
your files if one disk dies while in single data mode.

The failure mode you are describing would be interesting, and people
talk about it now and then, but there is no current support in btrfs for
it.

(One thing to note: small files are often stored in the metadata area
instead of data area, which would be raid1 in your setup. As a result,
those small files are more likely to be recoverable).

-- 
Calvin Walton <calvin.walton@kepstin.ca>


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

* Re: Simple btrfs use case
  2013-01-22 15:08 ` Calvin Walton
@ 2013-01-22 15:29   ` Pavel Vasilyev
  2013-01-23 13:23     ` David Sterba
  0 siblings, 1 reply; 4+ messages in thread
From: Pavel Vasilyev @ 2013-01-22 15:29 UTC (permalink / raw)
  To: Calvin Walton; +Cc: linux-btrfs

> In "single" data mode, btrfs makes no special attempt to keep files
> together on the same disk, but if a file is written linearly and never
> modified there's a chance it might happen. (Each modification will COW
> the file, putting the modified portion on a random disk.)
>
> As a result, yes, you may lose a substantial number - even most - of
> your files if one disk dies while in single data mode.

So, on highly fragmented fs reliability in single data mode is near to raid0?
Rhetorical question, actually.

> The failure mode you are describing would be interesting, and people
> talk about it now and then, but there is no current support in btrfs for
> it.

Is there any plans to support it?

> (One thing to note: small files are often stored in the metadata area
> instead of data area, which would be raid1 in your setup. As a result,
> those small files are more likely to be recoverable).

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

* Re: Simple btrfs use case
  2013-01-22 15:29   ` Pavel Vasilyev
@ 2013-01-23 13:23     ` David Sterba
  0 siblings, 0 replies; 4+ messages in thread
From: David Sterba @ 2013-01-23 13:23 UTC (permalink / raw)
  To: Pavel Vasilyev; +Cc: Calvin Walton, linux-btrfs

On Tue, Jan 22, 2013 at 07:29:47PM +0400, Pavel Vasilyev wrote:
> > In "single" data mode, btrfs makes no special attempt to keep files
> > together on the same disk, but if a file is written linearly and never
> > modified there's a chance it might happen. (Each modification will COW
> > the file, putting the modified portion on a random disk.)
> >
> > As a result, yes, you may lose a substantial number - even most - of
> > your files if one disk dies while in single data mode.
> 
> So, on highly fragmented fs reliability in single data mode is near to raid0?
> Rhetorical question, actually.

Correct. The difference against 'single' is that it does not spread the
data by default, depends on actual data layout and is unpredictable in
most cases.

> > The failure mode you are describing would be interesting, and people
> > talk about it now and then, but there is no current support in btrfs for
> > it.
> 
> Is there any plans to support it?

I've added a project to the wiki, if that counts :)

david

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

end of thread, other threads:[~2013-01-23 13:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-22 12:08 Simple btrfs use case Pavel Vasilyev
2013-01-22 15:08 ` Calvin Walton
2013-01-22 15:29   ` Pavel Vasilyev
2013-01-23 13:23     ` David Sterba

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.