linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jules Bean <jules@jellybean.co.uk>
To: David Greaves <david@dgreaves.com>
Cc: NeilBrown <neilb@suse.de>, linux-raid@vger.kernel.org
Subject: Re: After partition resize, RAID5 array does not assemble on boot
Date: Wed, 04 Jun 2008 09:30:19 +0100	[thread overview]
Message-ID: <4846529B.1000809@jellybean.co.uk> (raw)
In-Reply-To: <48464B3A.7070206@dgreaves.com>

David Greaves wrote:
> Jules Bean wrote:
>> As to where my superblock has gone, the only theory I have is that the
>> MD layer knew that my partitions were 400G large while the kernel was
>> convinced they were 250G large, so the md layer tried to write the
>> superblock at (approx) +400G, and the kernel refused to do that.
> 
> I failed to do a similar grow operation recently and had to re-create.
> 
> I was using 0.9 sb which is stored at the end of the disk.
> I have no idea how this is supposed to work...
> 
> If I have sda1 at 250Mb then the sb is at 250-d Mb
> I'd like to stop the array, remove the partition, grow the partition to 400Mb
> and start the array.
> This won't work because md won't find an sb at 400-d Mb and so won't know that
> it's an md component.

That doesn't matter.

Just add it as a fresh component. The old SB is irrelevant.

1. Fail component
2. remove component
3. resize partition
4. FORCE KERNEL TO NOTICE NEW SIZE (that's what I got wrong!). Reboot is 
safest.
5. add component as new
6. watch as md layer rebuilds

If I hadn't screwed up step 4, I would have been fine. I have now done 
step 4 correctly and grown my array to used dev size 400 (up from 250).

Of course this does assume your RAID level has the redundancy required 
to remove a component (i.e. not RAID0).

 > in step 4 mdadm may want to call the reread pt ioctl (which is what
 > blockdev --rereadpt does)

Seems to me that whilst cfdisk makes no visible attempt, plain 'fdisk' 
does try to call this ioctl but nonetheless it doesn't work if some 
other partition on that disk is busy (e.g. involved in some other md 
device, or mounted elsewhere). I saw messages to this effect whilst 
experimenting with different partition sizes looking for my missing 
superblock.


> This approach, it seems to me, would avoid any reconstruction and would be a
> 'safer' way to grow the components.

It would avoid reconstruction which is good for the impatient.

I don't really see that it's "safer" though. I would have thought it was 
quicker but potentially less safe.

Jules

  reply	other threads:[~2008-06-04  8:30 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-03  6:49 After partition resize, RAID5 array does not assemble on boot Jules Bean
2008-06-03 21:19 ` Jules Bean
2008-06-03 21:27   ` NeilBrown
2008-06-04  6:31     ` Jules Bean
2008-06-04  6:36       ` Peter Rabbitson
2008-06-04  7:58       ` David Greaves
2008-06-04  8:30         ` Jules Bean [this message]
2008-06-04 11:51           ` David Greaves
2008-06-04 13:14             ` Jules Bean
2008-06-06 13:52               ` Bill Davidsen
2008-06-06 14:42                 ` David Greaves
2008-06-06 14:46                   ` Jules Bean
2008-06-12  3:59             ` Neil Brown
2008-06-03 21:46   ` Peter Rabbitson

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=4846529B.1000809@jellybean.co.uk \
    --to=jules@jellybean.co.uk \
    --cc=david@dgreaves.com \
    --cc=linux-raid@vger.kernel.org \
    --cc=neilb@suse.de \
    /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).