From: Jim Paris <jim@jtan.com>
To: linux-raid@vger.kernel.org
Subject: Zeroing multiple superblocks
Date: Fri, 22 Jan 2010 15:09:24 -0500 [thread overview]
Message-ID: <20100122200924.GA29183@psychosis.jim.sh> (raw)
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
next reply other threads:[~2010-01-22 20:09 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-22 20:09 Jim Paris [this message]
2010-01-25 9:52 ` Zeroing multiple superblocks Andre Noll
2010-01-29 12:31 ` Neil Brown
2010-02-01 21:22 ` Bill Davidsen
2010-02-01 21:44 ` Neil Brown
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=20100122200924.GA29183@psychosis.jim.sh \
--to=jim@jtan.com \
--cc=linux-raid@vger.kernel.org \
/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).