Re: zeroing old superblocks & upgrading...

2 messages, 2 authors, 2006-07-07 · open the first message on its own page

Re: zeroing old superblocks & upgrading...

From: Neil Brown <hidden>
Date: 2006-07-06 23:09:08

On Thursday July 6, john@stoffel.org wrote:
Neil,

First off, thanks for all your hard work on this software, it's really
a great thing to have.

But I've got some interesting issues here.  Though not urgent.  As
I've said in other messages, I've got a pair of 120gb HDs mirrored.
I'm using MD across partitions, /dev/hde1 and /dev/hdg1.  Works
nicely.

But I see that I have an old superblock sitting around on /dev/hde
(notice, no partition here!) which I'd like to clean up.
...
I can't seem to zero it out:

  # mdadm --misc --zero-superblock /dev/hde
  mdadm: Couldn't open /dev/hde for write - not zeroing

Should I just ignore this, or should I break off /dev/hde from the
array and scrub the disk and then re-add it back in?
You could ignore it - it shouldn't hurt.
But if you wanted to (and were running a fairly recent kernel) you
could
  mdadm --grow --bitmap=internal /dev/md0
  mdadm /dev/md0 --fail /dev/hde1 --remove /dev/hde1
  mdadm --zero-superblock /dev/hde
  mdadm /dev/md0 --add /dev/hde1
  mdadm --grow --bitmap=none /dev/md0

and it should work with minimal resync...

Though thinking about it - after the first --grow, check that the
unwanted bitmap is still there.  It is quite possible that the
internal bitmap will over-write the unwanted superblock (depending on
the exact size and aligment of hde1 compared with hde).
If it is gone, then don't bother with the rest of the sequence. 

Also, can I upgrade my superblock to the latest version with out any
problems?
The only problem with superblock version numbers is that they are
probably confusing.  If you don't worry about them, they should just
do the right thing.

NeilBrown

Re: zeroing old superblocks & upgrading...

From: John Stoffel <hidden>
Date: 2006-07-07 13:10:34

quoted
quoted
quoted
quoted
"Neil" == Neil Brown [off-list ref] writes:
quoted
I can't seem to zero it out:

# mdadm --misc --zero-superblock /dev/hde
mdadm: Couldn't open /dev/hde for write - not zeroing

Should I just ignore this, or should I break off /dev/hde from the
array and scrub the disk and then re-add it back in?
Neil> You could ignore it - it shouldn't hurt.

Ok.

Neil> But if you wanted to (and were running a fairly recent kernel) you
Neil> could
Neil>   mdadm --grow --bitmap=internal /dev/md0

Did this.  And now I can do mdadm -X /dev/hde1 to examine the bitmap,
but I think this totally blows.  To create a bitmap, I add it to an
md# device, but to examine it, I have to know which sub-devices to
query?  That's really not what I would expect.

I do see that 

	mdadm -q --detail /dev/md0

shows the bitmap status (though not the size or parameters of the
bitmap), which is good. 

Neil>   mdadm /dev/md0 --fail /dev/hde1 --remove /dev/hde1
Neil>   mdadm --zero-superblock /dev/hde
Neil>   mdadm /dev/md0 --add /dev/hde1

Worked wonderfully!  Cleaned out the old superblock nicely, which I
think is a good thing here. 

Neil>   mdadm --grow --bitmap=none /dev/md0

Neil> and it should work with minimal resync...

So why would I want to remove the bitmap?  The re-sync happened pretty
much quickly enough that I didn't even see any non-in-sync status when
I did the --add of the device back in.  Very very cool...

Though... if I was paranoid, I'd disable the bitmap because there's no
way to be sure that I didn't write some garbage at a random block N
somewhere in the array.  Hmm... can't make that guarrentee now either,
so it's probably a moot point.  

In any case, I'm planning on keeping the bitmap.  

Neil> Though thinking about it - after the first --grow, check that
Neil> the unwanted bitmap is still there.  It is quite possible that
Neil> the internal bitmap will over-write the unwanted superblock
Neil> (depending on the exact size and aligment of hde1 compared with
Neil> hde).  If it is gone, then don't bother with the rest of the
Neil> sequence.

It was still there after the addition of the bitmap.  

Thanks Neil!

John
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help