All of lore.kernel.org
 help / color / mirror / Atom feed
* RAID without dev size prevents adding a new member
@ 2016-12-20  1:01 Robert LeBlanc
  2016-12-21  4:58 ` NeilBrown
  0 siblings, 1 reply; 5+ messages in thread
From: Robert LeBlanc @ 2016-12-20  1:01 UTC (permalink / raw)
  To: linux-raid

I have an array that failed to readd a member saying that the new
member was too small. After trying a few things including "--add",
"--force", zeroing out the superblock, clearing out the first 100 MB
to get rid of the partition table, I found that mdadm thinks the Used
Dev Size is unknown. I looked at the superblock and it appears to have
a valid used dev size. Both disks are exactly the same size. I'm not
sure how fix this.

# mdadm --version
mdadm - v3.3.2 - 21st August 2014

# mdadm --detail /dev/md_root
/dev/md_root:
       Version : 1.0
 Creation Time : Wed Sep  7 15:58:30 2016
    Raid Level : raid1
    Array Size : 5368708928 (5120.00 GiB 5497.56 GB)
 Used Dev Size : unknown
  Raid Devices : 2
 Total Devices : 1
   Persistence : Superblock is persistent

 Intent Bitmap : Internal

   Update Time : Mon Dec 19 17:05:29 2016
         State : clean, degraded
Active Devices : 1
Working Devices : 1
Failed Devices : 0
 Spare Devices : 0

          Name : 10.91.0.11-volume
          UUID : 2ea91e32:59b7806d:956803c6:00c410eb
        Events : 3691225

   Number   Major   Minor   RaidDevice State
      0       8       16        0      active sync   /dev/sdb
      2       0        0        2      removed

# mdadm --detail /dev/md_root
/dev/md_root:
       Version : 1.0
 Creation Time : Wed Sep  7 15:58:30 2016
    Raid Level : raid1
    Array Size : 5368708928 (5120.00 GiB 5497.56 GB)
 Used Dev Size : unknown
  Raid Devices : 2
 Total Devices : 1
   Persistence : Superblock is persistent

 Intent Bitmap : Internal

   Update Time : Mon Dec 19 17:05:29 2016
         State : clean, degraded
Active Devices : 1
Working Devices : 1
Failed Devices : 0
 Spare Devices : 0

          Name : 10.91.0.11-volume
          UUID : 2ea91e32:59b7806d:956803c6:00c410eb
        Events : 3691225

   Number   Major   Minor   RaidDevice State
      0       8       16        0      active sync   /dev/sdb
      2       0        0        2      removed

# hexdump -C -s 5497558130688 /dev/sdb
4ffffffe000  fc 4e 2b a9 01 00 00 00  01 00 00 00 00 00 00 00
|.N+.............|
4ffffffe010  2e a9 1e 32 59 b7 80 6d  95 68 03 c6 00 c4 10 eb
|...2Y..m.h......|
4ffffffe020  31 30 2e 39 31 2e 30 2e  31 31 2d 76 6f 6c 75 6d
|10.91.0.11-volum|
4ffffffe030  65 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
|e...............|
4ffffffe040  86 8d d0 57 00 00 00 00  01 00 00 00 00 00 00 00
|...W............|
4ffffffe050  80 fe ff 7f 02 00 00 00  00 00 00 00 02 00 00 00
|................|
4ffffffe060  a0 ff ff ff 00 00 00 00  00 00 00 00 00 00 00 00
|................|
4ffffffe070  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
|................|
4ffffffe080  00 00 00 00 00 00 00 00  e8 fe ff 7f 02 00 00 00
|................|
4ffffffe090  f0 ff ff 7f 02 00 00 00  00 00 00 00 00 00 00 00
|................|
4ffffffe0a0  00 00 00 00 00 00 00 00  4c 6c 99 5a bd 1a 4c 7d
|........Ll.Z..L}|
4ffffffe0b0  32 29 7a bc e2 45 89 dd  00 00 08 00 f8 ff ff ff
|2)z..E..........|
4ffffffe0c0  4f 66 58 58 00 00 00 00  7b 33 38 00 00 00 00 00
|OfXX....{38.....|
4ffffffe0d0  ff ff ff ff ff ff ff ff  33 f3 f0 e6 80 00 00 00
|........3.......|
4ffffffe0e0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
|................|
*
4ffffffe100  00 00 fe ff fe ff fe ff  fe ff fe ff fe ff fe ff
|................|
4ffffffe110  fe ff fe ff fe ff fe ff  fe ff fe ff fe ff fe ff
|................|
*
4ffffffe200  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
|................|
*
50000000000

# blockdev --report /dev/sd[a,b]
RO    RA   SSZ   BSZ   StartSec            Size   Device
rw   256   512  4096          0   5497558138880   /dev/sda
rw   256   512  4096          0   5497558138880   /dev/sdb

# mdadm /dev/md_root --add /dev/sda
mdadm: /dev/sda not large enough to join array

----------------
Robert LeBlanc
PGP Fingerprint 79A2 9CA4 6CC4 45DD A904  C70E E654 3BB2 FA62 B9F1

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: RAID without dev size prevents adding a new member
  2016-12-20  1:01 RAID without dev size prevents adding a new member Robert LeBlanc
@ 2016-12-21  4:58 ` NeilBrown
  2016-12-21 16:44   ` Robert LeBlanc
  0 siblings, 1 reply; 5+ messages in thread
From: NeilBrown @ 2016-12-21  4:58 UTC (permalink / raw)
  To: Robert LeBlanc, linux-raid

[-- Attachment #1: Type: text/plain, Size: 4506 bytes --]

On Tue, Dec 20 2016, Robert LeBlanc wrote:

> I have an array that failed to readd a member saying that the new
> member was too small. After trying a few things including "--add",
> "--force", zeroing out the superblock, clearing out the first 100 MB
> to get rid of the partition table, I found that mdadm thinks the Used
> Dev Size is unknown. I looked at the superblock and it appears to have
> a valid used dev size. Both disks are exactly the same size. I'm not
> sure how fix this.
>
> # mdadm --version
> mdadm - v3.3.2 - 21st August 2014

Try a newer mdadm.
 git clone git://git.kernel.org/pub/scm/utils/mdadm/mdadm.git
 cd mdadm
 make

your bug sounds familiar.  I think it has been fixed.

NeilBrown


>
> # mdadm --detail /dev/md_root
> /dev/md_root:
>        Version : 1.0
>  Creation Time : Wed Sep  7 15:58:30 2016
>     Raid Level : raid1
>     Array Size : 5368708928 (5120.00 GiB 5497.56 GB)
>  Used Dev Size : unknown
>   Raid Devices : 2
>  Total Devices : 1
>    Persistence : Superblock is persistent
>
>  Intent Bitmap : Internal
>
>    Update Time : Mon Dec 19 17:05:29 2016
>          State : clean, degraded
> Active Devices : 1
> Working Devices : 1
> Failed Devices : 0
>  Spare Devices : 0
>
>           Name : 10.91.0.11-volume
>           UUID : 2ea91e32:59b7806d:956803c6:00c410eb
>         Events : 3691225
>
>    Number   Major   Minor   RaidDevice State
>       0       8       16        0      active sync   /dev/sdb
>       2       0        0        2      removed
>
> # mdadm --detail /dev/md_root
> /dev/md_root:
>        Version : 1.0
>  Creation Time : Wed Sep  7 15:58:30 2016
>     Raid Level : raid1
>     Array Size : 5368708928 (5120.00 GiB 5497.56 GB)
>  Used Dev Size : unknown
>   Raid Devices : 2
>  Total Devices : 1
>    Persistence : Superblock is persistent
>
>  Intent Bitmap : Internal
>
>    Update Time : Mon Dec 19 17:05:29 2016
>          State : clean, degraded
> Active Devices : 1
> Working Devices : 1
> Failed Devices : 0
>  Spare Devices : 0
>
>           Name : 10.91.0.11-volume
>           UUID : 2ea91e32:59b7806d:956803c6:00c410eb
>         Events : 3691225
>
>    Number   Major   Minor   RaidDevice State
>       0       8       16        0      active sync   /dev/sdb
>       2       0        0        2      removed
>
> # hexdump -C -s 5497558130688 /dev/sdb
> 4ffffffe000  fc 4e 2b a9 01 00 00 00  01 00 00 00 00 00 00 00
> |.N+.............|
> 4ffffffe010  2e a9 1e 32 59 b7 80 6d  95 68 03 c6 00 c4 10 eb
> |...2Y..m.h......|
> 4ffffffe020  31 30 2e 39 31 2e 30 2e  31 31 2d 76 6f 6c 75 6d
> |10.91.0.11-volum|
> 4ffffffe030  65 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
> |e...............|
> 4ffffffe040  86 8d d0 57 00 00 00 00  01 00 00 00 00 00 00 00
> |...W............|
> 4ffffffe050  80 fe ff 7f 02 00 00 00  00 00 00 00 02 00 00 00
> |................|
> 4ffffffe060  a0 ff ff ff 00 00 00 00  00 00 00 00 00 00 00 00
> |................|
> 4ffffffe070  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
> |................|
> 4ffffffe080  00 00 00 00 00 00 00 00  e8 fe ff 7f 02 00 00 00
> |................|
> 4ffffffe090  f0 ff ff 7f 02 00 00 00  00 00 00 00 00 00 00 00
> |................|
> 4ffffffe0a0  00 00 00 00 00 00 00 00  4c 6c 99 5a bd 1a 4c 7d
> |........Ll.Z..L}|
> 4ffffffe0b0  32 29 7a bc e2 45 89 dd  00 00 08 00 f8 ff ff ff
> |2)z..E..........|
> 4ffffffe0c0  4f 66 58 58 00 00 00 00  7b 33 38 00 00 00 00 00
> |OfXX....{38.....|
> 4ffffffe0d0  ff ff ff ff ff ff ff ff  33 f3 f0 e6 80 00 00 00
> |........3.......|
> 4ffffffe0e0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
> |................|
> *
> 4ffffffe100  00 00 fe ff fe ff fe ff  fe ff fe ff fe ff fe ff
> |................|
> 4ffffffe110  fe ff fe ff fe ff fe ff  fe ff fe ff fe ff fe ff
> |................|
> *
> 4ffffffe200  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
> |................|
> *
> 50000000000
>
> # blockdev --report /dev/sd[a,b]
> RO    RA   SSZ   BSZ   StartSec            Size   Device
> rw   256   512  4096          0   5497558138880   /dev/sda
> rw   256   512  4096          0   5497558138880   /dev/sdb
>
> # mdadm /dev/md_root --add /dev/sda
> mdadm: /dev/sda not large enough to join array
>
> ----------------
> Robert LeBlanc
> PGP Fingerprint 79A2 9CA4 6CC4 45DD A904  C70E E654 3BB2 FA62 B9F1
> --
> To unsubscribe from this list: send the line "unsubscribe linux-raid" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: RAID without dev size prevents adding a new member
  2016-12-21  4:58 ` NeilBrown
@ 2016-12-21 16:44   ` Robert LeBlanc
  2016-12-21 23:27     ` NeilBrown
  0 siblings, 1 reply; 5+ messages in thread
From: Robert LeBlanc @ 2016-12-21 16:44 UTC (permalink / raw)
  To: NeilBrown; +Cc: linux-raid

It looks like it is still there on the latest master.

# ./mdadm --version
mdadm - v3.4-88-gfa219dd - 22nd September 2016

# ./mdadm --detail /dev/md_root
/dev/md_root:
        Version : 1.0
  Creation Time : Wed Sep  7 15:58:30 2016
     Raid Level : raid1
     Array Size : 5368708928 (5120.00 GiB 5497.56 GB)
  Used Dev Size : unknown
   Raid Devices : 2
  Total Devices : 1
    Persistence : Superblock is persistent

  Intent Bitmap : Internal

    Update Time : Wed Dec 21 09:40:21 2016
          State : clean, degraded
 Active Devices : 1
Working Devices : 1
 Failed Devices : 0
  Spare Devices : 0

           Name : 10.91.0.11-volume
           UUID : 2ea91e32:59b7806d:956803c6:00c410eb
         Events : 3989416

    Number   Major   Minor   RaidDevice State
       0       8       16        0      active sync   /dev/sdb
       -       0        0        1      removed

# ./mdadm /dev/md_root --add /dev/sda
mdadm: /dev/sda not large enough to join array

Any other ideas or information that I can provide that would be helpful?
----------------
Robert LeBlanc
PGP Fingerprint 79A2 9CA4 6CC4 45DD A904  C70E E654 3BB2 FA62 B9F1


On Tue, Dec 20, 2016 at 9:58 PM, NeilBrown <neilb@suse.com> wrote:
> On Tue, Dec 20 2016, Robert LeBlanc wrote:
>
>> I have an array that failed to readd a member saying that the new
>> member was too small. After trying a few things including "--add",
>> "--force", zeroing out the superblock, clearing out the first 100 MB
>> to get rid of the partition table, I found that mdadm thinks the Used
>> Dev Size is unknown. I looked at the superblock and it appears to have
>> a valid used dev size. Both disks are exactly the same size. I'm not
>> sure how fix this.
>>
>> # mdadm --version
>> mdadm - v3.3.2 - 21st August 2014
>
> Try a newer mdadm.
>  git clone git://git.kernel.org/pub/scm/utils/mdadm/mdadm.git
>  cd mdadm
>  make
>
> your bug sounds familiar.  I think it has been fixed.
>
> NeilBrown
>
>
>>
>> # mdadm --detail /dev/md_root
>> /dev/md_root:
>>        Version : 1.0
>>  Creation Time : Wed Sep  7 15:58:30 2016
>>     Raid Level : raid1
>>     Array Size : 5368708928 (5120.00 GiB 5497.56 GB)
>>  Used Dev Size : unknown
>>   Raid Devices : 2
>>  Total Devices : 1
>>    Persistence : Superblock is persistent
>>
>>  Intent Bitmap : Internal
>>
>>    Update Time : Mon Dec 19 17:05:29 2016
>>          State : clean, degraded
>> Active Devices : 1
>> Working Devices : 1
>> Failed Devices : 0
>>  Spare Devices : 0
>>
>>           Name : 10.91.0.11-volume
>>           UUID : 2ea91e32:59b7806d:956803c6:00c410eb
>>         Events : 3691225
>>
>>    Number   Major   Minor   RaidDevice State
>>       0       8       16        0      active sync   /dev/sdb
>>       2       0        0        2      removed
>>
>> # mdadm --detail /dev/md_root
>> /dev/md_root:
>>        Version : 1.0
>>  Creation Time : Wed Sep  7 15:58:30 2016
>>     Raid Level : raid1
>>     Array Size : 5368708928 (5120.00 GiB 5497.56 GB)
>>  Used Dev Size : unknown
>>   Raid Devices : 2
>>  Total Devices : 1
>>    Persistence : Superblock is persistent
>>
>>  Intent Bitmap : Internal
>>
>>    Update Time : Mon Dec 19 17:05:29 2016
>>          State : clean, degraded
>> Active Devices : 1
>> Working Devices : 1
>> Failed Devices : 0
>>  Spare Devices : 0
>>
>>           Name : 10.91.0.11-volume
>>           UUID : 2ea91e32:59b7806d:956803c6:00c410eb
>>         Events : 3691225
>>
>>    Number   Major   Minor   RaidDevice State
>>       0       8       16        0      active sync   /dev/sdb
>>       2       0        0        2      removed
>>
>> # hexdump -C -s 5497558130688 /dev/sdb
>> 4ffffffe000  fc 4e 2b a9 01 00 00 00  01 00 00 00 00 00 00 00
>> |.N+.............|
>> 4ffffffe010  2e a9 1e 32 59 b7 80 6d  95 68 03 c6 00 c4 10 eb
>> |...2Y..m.h......|
>> 4ffffffe020  31 30 2e 39 31 2e 30 2e  31 31 2d 76 6f 6c 75 6d
>> |10.91.0.11-volum|
>> 4ffffffe030  65 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
>> |e...............|
>> 4ffffffe040  86 8d d0 57 00 00 00 00  01 00 00 00 00 00 00 00
>> |...W............|
>> 4ffffffe050  80 fe ff 7f 02 00 00 00  00 00 00 00 02 00 00 00
>> |................|
>> 4ffffffe060  a0 ff ff ff 00 00 00 00  00 00 00 00 00 00 00 00
>> |................|
>> 4ffffffe070  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
>> |................|
>> 4ffffffe080  00 00 00 00 00 00 00 00  e8 fe ff 7f 02 00 00 00
>> |................|
>> 4ffffffe090  f0 ff ff 7f 02 00 00 00  00 00 00 00 00 00 00 00
>> |................|
>> 4ffffffe0a0  00 00 00 00 00 00 00 00  4c 6c 99 5a bd 1a 4c 7d
>> |........Ll.Z..L}|
>> 4ffffffe0b0  32 29 7a bc e2 45 89 dd  00 00 08 00 f8 ff ff ff
>> |2)z..E..........|
>> 4ffffffe0c0  4f 66 58 58 00 00 00 00  7b 33 38 00 00 00 00 00
>> |OfXX....{38.....|
>> 4ffffffe0d0  ff ff ff ff ff ff ff ff  33 f3 f0 e6 80 00 00 00
>> |........3.......|
>> 4ffffffe0e0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
>> |................|
>> *
>> 4ffffffe100  00 00 fe ff fe ff fe ff  fe ff fe ff fe ff fe ff
>> |................|
>> 4ffffffe110  fe ff fe ff fe ff fe ff  fe ff fe ff fe ff fe ff
>> |................|
>> *
>> 4ffffffe200  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
>> |................|
>> *
>> 50000000000
>>
>> # blockdev --report /dev/sd[a,b]
>> RO    RA   SSZ   BSZ   StartSec            Size   Device
>> rw   256   512  4096          0   5497558138880   /dev/sda
>> rw   256   512  4096          0   5497558138880   /dev/sdb
>>
>> # mdadm /dev/md_root --add /dev/sda
>> mdadm: /dev/sda not large enough to join array
>>
>> ----------------
>> Robert LeBlanc
>> PGP Fingerprint 79A2 9CA4 6CC4 45DD A904  C70E E654 3BB2 FA62 B9F1
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-raid" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: RAID without dev size prevents adding a new member
  2016-12-21 16:44   ` Robert LeBlanc
@ 2016-12-21 23:27     ` NeilBrown
  2016-12-21 23:58       ` Robert LeBlanc
  0 siblings, 1 reply; 5+ messages in thread
From: NeilBrown @ 2016-12-21 23:27 UTC (permalink / raw)
  To: Robert LeBlanc; +Cc: linux-raid

[-- Attachment #1: Type: text/plain, Size: 1436 bytes --]

On Thu, Dec 22 2016, Robert LeBlanc wrote:

> It looks like it is still there on the latest master.

Thanks for checking!

>
> # ./mdadm --version
> mdadm - v3.4-88-gfa219dd - 22nd September 2016
>
> # ./mdadm --detail /dev/md_root
> /dev/md_root:
>         Version : 1.0
>   Creation Time : Wed Sep  7 15:58:30 2016
>      Raid Level : raid1
>      Array Size : 5368708928 (5120.00 GiB 5497.56 GB)
>   Used Dev Size : unknown

This implies that mdadm is opening /dev/md_root/md/component_size ....

Ah-ha.  get_component_size() hasn't been updated to work with named
arrays. it will only open
			"/sys/block/md%d/md/component_size",
or
			"/sys/block/md_d%d/md/component_size",

Please try with the following patch.  I'll send a proper version to Jes.

Thanks,
NeilBrown

diff --git a/sysfs.c b/sysfs.c
index 84c7348526c9..b0657a04b3a3 100644
--- a/sysfs.c
+++ b/sysfs.c
@@ -400,14 +400,8 @@ unsigned long long get_component_size(int fd)
 	int n;
 	if (fstat(fd, &stb))
 		return 0;
-	if (major(stb.st_rdev) != (unsigned)get_mdp_major())
-		snprintf(fname, MAX_SYSFS_PATH_LEN,
-			"/sys/block/md%d/md/component_size",
-			(int)minor(stb.st_rdev));
-	else
-		snprintf(fname, MAX_SYSFS_PATH_LEN,
-			"/sys/block/md_d%d/md/component_size",
-			(int)minor(stb.st_rdev)>>MdpMinorShift);
+	snprintf(fname, MAX_SYSFS_PATH_LEN,
+		 "/sys/block/%s/md/component_size", stat2devnm(&stb));
 	fd = open(fname, O_RDONLY);
 	if (fd < 0)
 		return 0;

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: RAID without dev size prevents adding a new member
  2016-12-21 23:27     ` NeilBrown
@ 2016-12-21 23:58       ` Robert LeBlanc
  0 siblings, 0 replies; 5+ messages in thread
From: Robert LeBlanc @ 2016-12-21 23:58 UTC (permalink / raw)
  To: NeilBrown; +Cc: linux-raid

On Wed, Dec 21, 2016 at 4:27 PM, NeilBrown <neilb@suse.com> wrote:
> snprintf(fname, MAX_SYSFS_PATH_LEN,


Bingo! The size is now reported and I could add the drive. Hopefully
this can get added to Red Hat... Thanks for the fix.

----------------
Robert LeBlanc
PGP Fingerprint 79A2 9CA4 6CC4 45DD A904  C70E E654 3BB2 FA62 B9F1

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-12-21 23:58 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-20  1:01 RAID without dev size prevents adding a new member Robert LeBlanc
2016-12-21  4:58 ` NeilBrown
2016-12-21 16:44   ` Robert LeBlanc
2016-12-21 23:27     ` NeilBrown
2016-12-21 23:58       ` Robert LeBlanc

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.