All of lore.kernel.org
 help / color / mirror / Atom feed
* Questions about multi-device behavior
@ 2013-07-17 21:24 Florian Lindner
  2013-07-17 21:49 ` Chris Murphy
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Florian Lindner @ 2013-07-17 21:24 UTC (permalink / raw)
  To: linux-btrfs

Hello!

I create a btrfs volume comprised of two partitions:

# mkfs.btrfs -m dup -d single /dev/sdd1 /dev/sde1

metadata ist mirrored on each device, data chunks are scattered more or less 
randomly on one disk. 

a) If one disk fails, is there any chance of data recovery? 
b) If not, is there any advantage over a raid0 configuration.

Thanks and regards,

Florian

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

* Re: Questions about multi-device behavior
  2013-07-17 21:24 Questions about multi-device behavior Florian Lindner
@ 2013-07-17 21:49 ` Chris Murphy
  2013-07-18  2:00 ` Roger Binns
  2013-07-18 17:33 ` David Sterba
  2 siblings, 0 replies; 8+ messages in thread
From: Chris Murphy @ 2013-07-17 21:49 UTC (permalink / raw)
  To: Btrfs BTRFS


On Jul 17, 2013, at 3:24 PM, Florian Lindner <mailinglists@xgm.de> wrote:
> 
> a) If one disk fails, is there any chance of data recovery? 

Slim to none it seems so far. Maybe with more specialized tools.


> b) If not, is there any advantage over a raid0 configuration.

raid0 allocates equal chunks, so in order to maximize usable space the devices need to be the same size or space is wasted (not used). single allocated chunks based on availability so it's possible to maximally use all space on all devices even if they're significantly different in size.

Chris

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

* Re: Questions about multi-device behavior
  2013-07-17 21:24 Questions about multi-device behavior Florian Lindner
  2013-07-17 21:49 ` Chris Murphy
@ 2013-07-18  2:00 ` Roger Binns
  2013-07-18 17:33 ` David Sterba
  2 siblings, 0 replies; 8+ messages in thread
From: Roger Binns @ 2013-07-18  2:00 UTC (permalink / raw)
  To: linux-btrfs

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 17/07/13 14:24, Florian Lindner wrote:
> metadata ist mirrored on each device, data chunks are scattered more or
> less randomly on one disk.
> 
> a) If one disk fails, is there any chance of data recovery? b) If not,
> is there any advantage over a raid0 configuration.

I was using that exact configuration when one disk failed (2 x 2TB Seagate
drives).  The data was backed up in multiple ways, a lot of it was in
source control systems and the remainder was generated information.
Essentially the risk was worth taking since nothing would be lost.

One drive gave up mechanically - the controller still worked and it was
fun running SMART tests and having huge amounts of red text show up in
response.  The initial symptoms were that various programs crashed or
didn't launch with no diagnostics.  That is typical behaviour for Linux
apps when they get I/O errors on reads and writes.

Eventually I figured out the problem, and bought a new 4TB drive to
replace both originals and started recovery.  Out of ~750GB of original
data I could recover just over 2GB which represented files whose entire
contents were on the unfailed drive.

Having the metadata duplicated was however immensely helpful and I could
easily get a list of all directories and filenames, and used that to guide
what data I recovered/regenerated/reinstalled/checked out.

Meanwhile the performance improvement by having the data scattered across
both drives was noticeable.  I would often see it in iostat roughly evenly
balanced.

Roger
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iEYEARECAAYFAlHnTDgACgkQmOOfHg372QSTJwCeI17B4QhstkM4nnO0qOMDB1ae
WfwAoOBu6lBwZ+GyFwnZVGXC5ki7Oge/
=i+YN
-----END PGP SIGNATURE-----


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

* Re: Questions about multi-device behavior
  2013-07-17 21:24 Questions about multi-device behavior Florian Lindner
  2013-07-17 21:49 ` Chris Murphy
  2013-07-18  2:00 ` Roger Binns
@ 2013-07-18 17:33 ` David Sterba
  2013-07-18 20:05   ` Chris Murphy
  2 siblings, 1 reply; 8+ messages in thread
From: David Sterba @ 2013-07-18 17:33 UTC (permalink / raw)
  To: Florian Lindner; +Cc: linux-btrfs

On Wed, Jul 17, 2013 at 11:24:22PM +0200, Florian Lindner wrote:
> I create a btrfs volume comprised of two partitions:
> 
> # mkfs.btrfs -m dup -d single /dev/sdd1 /dev/sde1

DUP does not work on multiple devices, I assume you mean RAID1.

> metadata ist mirrored on each device, data chunks are scattered more or less 
> randomly on one disk. 
> 
> a) If one disk fails, is there any chance of data recovery? 
> b) If not, is there any advantage over a raid0 configuration.

Regarding data layout, raid0 will always place the small (64k) chunks on
multiple devices, with single this does not happen every time and the
data are spread in larger contiguous chunks on each of the device.
Rewriting data makes the placement unpredictable, so it may end up
random.

The missing data blocks return IO error and the valid data can be read.


david

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

* Re: Questions about multi-device behavior
  2013-07-18 17:33 ` David Sterba
@ 2013-07-18 20:05   ` Chris Murphy
  2013-07-18 21:59     ` Roger Binns
  2013-08-02 14:10     ` David Sterba
  0 siblings, 2 replies; 8+ messages in thread
From: Chris Murphy @ 2013-07-18 20:05 UTC (permalink / raw)
  To: dsterba; +Cc: Florian Lindner, Btrfs BTRFS


On Jul 18, 2013, at 11:33 AM, David Sterba <dsterba@suse.cz> wrote:

> 
> The missing data blocks return IO error and the valid data can be read.

Sounds like if I have a degraded 'single' volume, I can simply cp or rsync everything from that volume to another, and I'll end up with a successful copy of the surviving data. True?


Chris Murphy

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

* Re: Questions about multi-device behavior
  2013-07-18 20:05   ` Chris Murphy
@ 2013-07-18 21:59     ` Roger Binns
  2013-07-18 22:03       ` Hugo Mills
  2013-08-02 14:10     ` David Sterba
  1 sibling, 1 reply; 8+ messages in thread
From: Roger Binns @ 2013-07-18 21:59 UTC (permalink / raw)
  To: linux-btrfs

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 18/07/13 13:05, Chris Murphy wrote:
> Sounds like if I have a degraded 'single' volume, I can simply cp or
> rsync everything from that volume to another, and I'll end up with a
> successful copy of the surviving data. True?

Not quite.  I did it with cp -a.  Because all the metadata survived, cp
would create the target file, but then get an i/o error on opening/reading
the source file.  It would print an error message, but not delete the
empty target file. Consequently I ended up with loads of zero length files
I had to go in and delete afterwards.

I briefly looked for an rsync option to keep going on source i/o errors
but didn't find one.

Roger
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iEYEARECAAYFAlHoZV4ACgkQmOOfHg372QRPFwCgob01TavS2qffBkxkuv0g9bl3
pC8An25Mgx+cRXb0Kds+GRnzaj2P0Acy
=UA5J
-----END PGP SIGNATURE-----


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

* Re: Questions about multi-device behavior
  2013-07-18 21:59     ` Roger Binns
@ 2013-07-18 22:03       ` Hugo Mills
  0 siblings, 0 replies; 8+ messages in thread
From: Hugo Mills @ 2013-07-18 22:03 UTC (permalink / raw)
  To: Roger Binns; +Cc: linux-btrfs

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

On Thu, Jul 18, 2013 at 02:59:58PM -0700, Roger Binns wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> On 18/07/13 13:05, Chris Murphy wrote:
> > Sounds like if I have a degraded 'single' volume, I can simply cp or
> > rsync everything from that volume to another, and I'll end up with a
> > successful copy of the surviving data. True?
> 
> Not quite.  I did it with cp -a.  Because all the metadata survived, cp
> would create the target file, but then get an i/o error on opening/reading
> the source file.  It would print an error message, but not delete the
> empty target file. Consequently I ended up with loads of zero length files
> I had to go in and delete afterwards.

   The odds of having an undamaged file from that process are much
better for single than for RAID-0 (and aren't affected by having tools
which will cope better with IO errors -- although you'll get more of
each damaged file if you do). As the file size goes up, the odds of it
being damaged increase.

   Hugo.

> I briefly looked for an rsync option to keep going on source i/o errors
> but didn't find one.
> 
> Roger
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.12 (GNU/Linux)
> 
> iEYEARECAAYFAlHoZV4ACgkQmOOfHg372QRPFwCgob01TavS2qffBkxkuv0g9bl3
> pC8An25Mgx+cRXb0Kds+GRnzaj2P0Acy
> =UA5J
> -----END PGP SIGNATURE-----
> 

-- 
=== Hugo Mills: hugo@... carfax.org.uk | darksatanic.net | lug.org.uk ===
  PGP key: 65E74AC0 from wwwkeys.eu.pgp.net or http://www.carfax.org.uk
  --- I am an opera lover from planet Zog.  Take me to your lieder. ---  

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

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

* Re: Questions about multi-device behavior
  2013-07-18 20:05   ` Chris Murphy
  2013-07-18 21:59     ` Roger Binns
@ 2013-08-02 14:10     ` David Sterba
  1 sibling, 0 replies; 8+ messages in thread
From: David Sterba @ 2013-08-02 14:10 UTC (permalink / raw)
  To: Chris Murphy; +Cc: Florian Lindner, Btrfs BTRFS

On Thu, Jul 18, 2013 at 02:05:31PM -0600, Chris Murphy wrote:
> 
> On Jul 18, 2013, at 11:33 AM, David Sterba <dsterba@suse.cz> wrote:
> 
> > 
> > The missing data blocks return IO error and the valid data can be read.
> 
> Sounds like if I have a degraded 'single' volume, I can simply cp or
> rsync everything from that volume to another, and I'll end up with a
> successful copy of the surviving data. True?

True.

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

end of thread, other threads:[~2013-08-02 14:10 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-17 21:24 Questions about multi-device behavior Florian Lindner
2013-07-17 21:49 ` Chris Murphy
2013-07-18  2:00 ` Roger Binns
2013-07-18 17:33 ` David Sterba
2013-07-18 20:05   ` Chris Murphy
2013-07-18 21:59     ` Roger Binns
2013-07-18 22:03       ` Hugo Mills
2013-08-02 14:10     ` 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.