linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Roman Mamedov <rm@romanrm.net>
To: Veedar Hokstadt <veedar@gmail.com>
Cc: Marcus Sorensen <shadowsor@gmail.com>,
	stan@hardwarefreak.com, linux-raid <linux-raid@vger.kernel.org>
Subject: Re: Is a raid0 512 byte chunk size possible? Or is it just too small?
Date: Sat, 31 Aug 2013 13:10:09 +0600	[thread overview]
Message-ID: <20130831131009.4a1dfaad@natsu> (raw)
In-Reply-To: <CANb3qHfJ=5T6Oa0NgPdLsDhdjj4wMPorRtkZjwDjdh14oKjcsw@mail.gmail.com>

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

On Sat, 31 Aug 2013 01:05:44 -0400
Veedar Hokstadt <veedar@gmail.com> wrote:

> I am totally aware of the complications involved but if I can somehow
> build a raid0 / chunk 512B array with mdadm using the raw Lacie dives
> then I can take it from there to recover the data.

You can write a simple program to read in chunks of 512 bytes from one drive,
then from the other, piece this together and write to some third file. Here is
something quick that I modified from a tool I already had. Even though it's
doing the tight loop in PHP, it seems to do about 100 MB/sec reading from two
SATA drives and writing to a file on a RAID6 in my system.

--- merge.php ---

#!/usr/bin/php
<?php
  $f = array();
  array_shift($argv);
  foreach($argv as $arg) {
    if(($f[] = @fopen($arg, "rb"))===false) die("Unable to open file $arg.\n");
  }
  while(@$feof_cnt<2) {
    $feof_cnt=0;
    foreach($f as $file) {
      print(fread($file, 512));
      if(feof($file))$feof_cnt++;
    }
  }  
?>

---

Usage: ./merge.php /dev/sda /dev/sdb > image.img

And you will need somewhere to store this image.img that's has the free space
to fit the size of sda+sdb. Also check that you specify the drives in the
proper order (only 2 tries, really).

-- 
With respect,
Roman

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

  parent reply	other threads:[~2013-08-31  7:10 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-30 19:32 Is a raid0 512 byte chunk size possible? Or is it just too small? Veedar Hokstadt
2013-08-30 21:33 ` Stan Hoeppner
2013-08-31  0:58   ` Marcus Sorensen
2013-08-31  5:05     ` Veedar Hokstadt
2013-08-31  6:40       ` Stan Hoeppner
2013-08-31  7:10       ` Roman Mamedov [this message]
2013-09-07 19:57         ` Veedar Hokstadt

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=20130831131009.4a1dfaad@natsu \
    --to=rm@romanrm.net \
    --cc=linux-raid@vger.kernel.org \
    --cc=shadowsor@gmail.com \
    --cc=stan@hardwarefreak.com \
    --cc=veedar@gmail.com \
    /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).