linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Zeroing multiple superblocks
@ 2010-01-22 20:09 Jim Paris
  2010-01-25  9:52 ` Andre Noll
  0 siblings, 1 reply; 5+ messages in thread
From: Jim Paris @ 2010-01-22 20:09 UTC (permalink / raw)
  To: linux-raid

Should --zero-superblock be changed to clear all superblocks,
or at least warn when not all superblocks are cleared?

I ran into a problem a year ago where I had a disk with both 0.90 and
1.0 format metadata.  The wrong one was scanned at boot, causing a
"doesn't match others - assembly aborted" error.  At the time, I
thought I fixed it by doing a --zero-superblock and re-adding the
disk, but it turns out the disk still had two, causing the same
problem (reboots are rare on this machine).

For example:
  # dd if=/dev/zero of=diskimage bs=1M count=8
  # losetup -fv diskimage
  Loop device is /dev/loop0
  # mdadm --create /dev/md0 --level=1 --metadata=0.90 --raid-devices=2 /dev/loop0 missing
  mdadm: array /dev/md0 started.
  # mdadm --stop /dev/md0
  mdadm: stopped /dev/md0
  # mdadm --create /dev/md0 --level=1 --metadata=1.0 --raid-devices=2 /dev/loop0 missing
  mdadm: /dev/loop0 appears to be part of a raid array:
      level=raid1 devices=2 ctime=Fri Jan 22 14:55:26 2010
  Continue creating array? y
  mdadm: array /dev/md0 started.
  # mdadm --stop /dev/md0

Now notice how --zero-superblock has to be run twice before it starts
complaining that no superblock was found:
  # mdadm --zero-superblock /dev/loop0
  # mdadm --zero-superblock /dev/loop0
  # mdadm --zero-superblock /dev/loop0
  mdadm: Unrecognised md component device - /dev/loop0

I guess the only way to be fully safe with the current approach is to
do a zero-superblock over and over until it complains.

-jim

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

end of thread, other threads:[~2010-02-01 21:44 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-22 20:09 Zeroing multiple superblocks Jim Paris
2010-01-25  9:52 ` Andre Noll
2010-01-29 12:31   ` Neil Brown
2010-02-01 21:22     ` Bill Davidsen
2010-02-01 21:44       ` Neil Brown

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).