linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Peter Rabbitson <rabbit+list@rabbit.us>
To: Chris Webb <chris@arachsys.com>
Cc: linux-raid@vger.kernel.org
Subject: Re: Trouble increasing md component size
Date: Wed, 18 Jun 2008 21:22:05 +0200	[thread overview]
Message-ID: <4859605D.90509@rabbit.us> (raw)
In-Reply-To: <20080618182622.GA29468@arachsys.com>

Chris Webb wrote:
> Hi. I'm having some trouble increasing the component size of arrays to match
> changes in the underlying block devices. I'm running mdadm 2.6.7 against a
> stock 2.6.24.4 kernel.
> 
> I'm seeing the problem in a cluster management application I'm writing, but I
> can reproduce it simply using two LV block devices, 150M each:
> 
>   2# blockdev --getsz /dev/disk.4/{one,two}
>   311296
>   311296
> 
> I build an array that only fills two thirds of the component disks:
> 
>   2# mdadm --create /dev/md4 --level=1 --raid-disks=2 --size 102400 \
>            --metadata=1.2 /dev/disk.4/{one,two}
>   mdadm: largest drive (/dev/disk.4/one) exceed size (102400K) by more than 1%
>   Continue creating array? y
>   mdadm: array /dev/md4 started.
>   2# blockdev --getsz /dev/md4
>   204800
> 
> When the array is fully synced and up [UU], I try to grow the array to use
> more of the component disks:
> 
>   2# mdadm --grow /dev/md4 --size max
>   2# blockdev --getsz /dev/md4
>   311272
> 
> and so this has worked fine.
> 
> However, if I increase the size of the underlying block devices:
> 
>   2# lvm lvresize -L 200M /dev/disk.4/one
>     Extending logical volume one to 200.00 MB
>     Logical volume one successfully resized
>   2# lvm lvresize -L 200M /dev/disk.4/two
>     Extending logical volume two to 200.00 MB
>     Logical volume two successfully resized
>   2# blockdev --getsz /dev/disk.4/{one,two}
>   409600
>   409600
> 
> and then try to grow the array:
> 
>   2# mdadm --grow /dev/md4 --size max
>   2# blockdev --getsz /dev/md4
>   311272
>   2# mdadm --grow /dev/md4 --size 155637 just 1kB more
>   mdadm: Cannot set device size for /dev/md4: No space left on device
> 
> it fails. Somehow, the change in the underlying component device sizes doesn't
> seem to be noticed even though the kernel's idea (as returned by blockdev/ioctl
> BLKGETSIZE[64]) has correctly changed. I can even remove and re-add both drives
> in turn without it noticing the size change and allowing me to grow the array.
> 
> Trying to do something like
> 
>   echo 155637 > /sys/block/md4/md/component_size
> 
> doesn't work either. It'll accept values up as far as the size of the block
> device when the array was created, but no larger.
> 
> The only recipe I've found which works is, for each drive in turn, to fail it,
> remove it, zero the superblock and then re-add it. This seems to mean the md
> driver sees is as a new component (e.g. different desc_nr in /proc/mdstat) and
> therefore re-reads its size? This isn't at all friendly to the raid array,
> though. While each device is out, any redundancy has gone. Is there some less
> drastic way to persuade the array to grow?
> 

Hi Chris,

I had exactly the same problem some months ago. The key is in the (obscure) 
assembly option --update=devicesize. Find it in the mdadm manpage and the 
whole picture will come together instantly. The wisdom is not very widespread 
as this affects only V1.1 and 1.2 superblocks.

Cheers

  reply	other threads:[~2008-06-18 19:22 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-18 18:26 Trouble increasing md component size Chris Webb
2008-06-18 19:22 ` Peter Rabbitson [this message]
2008-06-18 20:00   ` Chris Webb
2008-06-19  3:42     ` Neil Brown
2008-06-19 15:45       ` Chris Webb
2008-06-19 23:10         ` Chris Webb
2008-06-19 23:49         ` Chris Webb
2008-06-20 11:13           ` Chris Webb
2008-06-20 14:24             ` Chris Webb
2008-06-23  1:26               ` Neil Brown
2008-06-23 11:18                 ` Chris Webb
2008-06-23 22:53                   ` Neil Brown
2008-06-24 11:47                     ` Chris Webb
2008-06-24 23:19                       ` Chris Webb
2008-09-17 18:11                         ` [PATCH] md: Fix rdev_size_store with size = 0 Chris Webb
2008-10-07 12:40                         ` [Resend] " Chris Webb
2008-10-13  0:54                           ` Neil Brown
2008-06-24  2:40                   ` Trouble increasing md component size 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=4859605D.90509@rabbit.us \
    --to=rabbit+list@rabbit.us \
    --cc=chris@arachsys.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).