linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: NeilBrown <neilb@suse.de>
To: Dan Williams <dan.j.williams@intel.com>
Cc: linux-raid@vger.kernel.org, marcin.labun@intel.com,
	ed.ciechanowski@intel.com
Subject: Re: [PATCH 9/9] mdadm: 'dump' support
Date: Tue, 30 Aug 2011 12:58:03 +1000	[thread overview]
Message-ID: <20110830125803.19ad660b@notabene.brown> (raw)
In-Reply-To: <20110826021445.28015.63357.stgit@localhost6.localdomain6>

On Thu, 25 Aug 2011 19:14:45 -0700 Dan Williams <dan.j.williams@intel.com>
wrote:

>   mdadm -E /dev/sda --dump=foo
> 
> Creates a sparse file image of /dev/sda named foo with a copy of the
> metadata instance found by -E.
> 
> When used in the opposite direction:
> 
>   mdadm -E foo --dump=/dev/sda
> 
> ...can restore metadata to a given block device, assuming it is
> identical size to the dump file.


I like this functionality - I've thought about doing something like this
before but never quite done it.

I'm not convinced of the interface yet - especially the lack of checks.  If
it can be misused it will be misused and we should try to avoid that.

Using a sparse file is probably a good idea - it removes the need to try to
invent a format for storing non-consecutive metadata and recording the offset.

dmraid has a --dump-metadata (-D) option which creates a directory and stores
one file per device there.  I like that as it make it easy to get everything
in the right place.

Maybe the arg to --dump could be a directory name to store dump files in ...
but then we lose the pleasing symmetry of using the same command to dump and
restore.  But is that symmetry only pleasing to us and would it be confusing
to new users?

Suppose we did have a separate 'restore' function - what would it look like?
An option to create?

  mdadm --create --restore=some-directory /dev/sda /dev/sdb

Then the names of the dump files would need to indicate which array and which
position in the array...  And this would make it hard to restore the metadata
to a single device.

So probably just
  mdadm -E /dev/sda --restore=some-file
would restore the metadata then report it??  Maybe keeping the old metadata
as a backup.
Or maybe drop the -E and just have '--dump' and '--restore' as top-level
Misc options.

It would be good if --restore would create a backup of the in-disk metadata
if there is any - to "some-file.bak" maybe ??

So how about this:

 - allow --examine to work on a file.
 - new misc option --dump=foo will create directory foo and store an image of
   any metadata on each device listed - filename matches basename of device.
 - new misc option --restore=bar.  For each device listed restore metadata
   from bar (if it is a file, in which case only one device) or bar/basename
   (if it is a directory).  In either case if there is metadata on the device,
   save it to the file + ".bak".  If ".bak" exists and there is metadata -
   abort.

Does that seem reasonable?

Thanks,
NeilBrown


  reply	other threads:[~2011-08-30  2:58 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-26  2:13 [PATCH 0/9] recovering an imsm raid5 array Dan Williams
2011-08-26  2:14 ` [PATCH 1/9] imsm: fix max disks per array Dan Williams
2011-08-26  2:14 ` [PATCH 2/9] imsm: fix, stop metadata updates to newly failed devices Dan Williams
2011-08-26  2:14 ` [PATCH 3/9] imsm: fix display spares Dan Williams
2011-08-26  2:14 ` [PATCH 4/9] sysfs: fix sysfs_disk_to_scsi_id Dan Williams
2011-08-26  2:14 ` [PATCH 5/9] imsm: fix reserved sectors for spares Dan Williams
2011-08-26 19:51   ` Williams, Dan J
2011-08-30  2:20     ` NeilBrown
2011-09-06 20:42       ` Williams, Dan J
2011-09-19 12:57         ` Czarnowska, Anna
2011-09-21  4:45           ` NeilBrown
2011-08-26  2:14 ` [PATCH 6/9] mdmon: fix, close spare activation race Dan Williams
2011-08-26  2:14 ` [PATCH 7/9] imsm: support 'missing' devices at Create Dan Williams
2011-08-30  2:26   ` NeilBrown
2011-08-26  2:14 ` [PATCH 8/9] util: allow regular files through test_partition() Dan Williams
2011-08-26  2:14 ` [PATCH 9/9] mdadm: 'dump' support Dan Williams
2011-08-30  2:58   ` NeilBrown [this message]
2011-08-30 10:12     ` Alexander Kühn
2013-05-16  5:11       ` NeilBrown
2011-08-26 11:06 ` [PATCH 0/9] recovering an imsm raid5 array linbloke
2011-08-30  3:13 ` NeilBrown

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=20110830125803.19ad660b@notabene.brown \
    --to=neilb@suse.de \
    --cc=dan.j.williams@intel.com \
    --cc=ed.ciechanowski@intel.com \
    --cc=linux-raid@vger.kernel.org \
    --cc=marcin.labun@intel.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).