lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <17935.33905.934360.22271@notabene.brown>
Date:	Sun, 1 Apr 2007 20:07:45 +1000
From:	Neil Brown <neilb@...e.de>
To:	"Florian D." <flockmock@....at>
Cc:	linux-kernel@...r.kernel.org
Subject: Re: cannot add device to partitioned raid6 array

On Sunday April 1, flockmock@....at wrote:
> Neil Brown wrote:
> > On Saturday March 31, flockmock@....at wrote:
> >> hi list!
> >>
> >> in short:
> >> I created a partitioned raid6 array with 2 missing drives. Now, I want to add a device. It fails with:
> >> flockmock ~ # mdadm -a /dev/md_d4 /dev/sdb2
> >> mdadm: add new device failed for /dev/sdb2 as 4: Invalid argument
> > 
> > Thanks for the detailed problem report.
> > 
> > I think the cause of the error is that /dev/sdb2 is too small.
> > It needs to be at least 490030594 sectors. How big is it?
                                      ^^^^^^^
I should have said 490030594 sectors or 245015297 KB, which would have
made it clearer, sorry.

> 
> but the *device* size should be only ~250GB, so the array size is ~500GB, no?
> 
> flockmock ~ # mdadm --detail /dev/md_d4
> /dev/md_d4:
>          Version : 00.90.03
>    Creation Time : Sat Mar 31 19:48:58 2007
>       Raid Level : raid6
>       Array Size : 490030464 (467.33 GiB 501.79 GB)
>    Used Dev Size : 245015232 (233.66 GiB 250.90 GB)
>                    ^^^^^^^^^^
> 
> these disks are all 250 GB harddisks, formatted in the same way -- but they are from different 
> vendors! The block sizes from the partitions vary a little bit (taken from /sbin/fdisk):
> 
> /dev/sda2: 245015347
> /dev/sdc2: 245015347
> /dev/sdb2: 244099642  -> different vendor
> 
> do you think that may be the cause?

Definitely the cause.  If you really need to add this array, you may
be able to reduce the usage of the array, then reduce the size of the
array, then add the drive.
Depending on how you have partitioned the array, and how you are using
the partitions, you may just need to reduce the filesystem in the last
partition, then use *fdisk to resize the partition.  Then something
like:

   mdadm --grow --size=243000000 /dev/md_d4

Is is generally safer to reduce the filesystem too much, resize the
device, then grow the filesystem up to the size of the device.  That
way avoids fiddly arithmetic and so reduces the chance of failure.

NeilBrown

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ