mdadm 显示错误的数组大小,并且无法增长

mdadm 显示错误的数组大小,并且无法增长

我使用了 2 个分区来创建 RAID1 阵列。

两者都是967131168个扇区,每个扇区512字节。

所以raid数组大小应该是483564544。

但它显示:

     Array Size : 483433472 (461.04 GiB 495.04 GB)
  Used Dev Size : 483433472 (461.04 GiB 495.04 GB)

当我增加数组大小时,它说:

root@GalensSynology:~# mdadm --grow /dev/md2 --size=max
mdadm: component size of /dev/md2 unchanged at 483433472K

我尝试强制设置数组大小,但出现错误:

root@GalensSynology:~# mdadm --grow /dev/md2 --size=483564544
mdadm: Cannot set device size for /dev/md2: No space left on device

RAID 阵列信息:

root@GalensSynology:~# mdadm --query --detail /dev/md2
/dev/md2:
        Version : 1.2
  Creation Time : Thu Sep 26 14:46:34 2019
     Raid Level : raid1
     Array Size : 483433472 (461.04 GiB 495.04 GB)
  Used Dev Size : 483433472 (461.04 GiB 495.04 GB)
   Raid Devices : 2
  Total Devices : 2
    Persistence : Superblock is persistent

  Intent Bitmap : Internal

    Update Time : Thu Aug 11 21:49:15 2022
          State : active 
 Active Devices : 2
Working Devices : 2
 Failed Devices : 0
  Spare Devices : 0

           Name : GalensSynology:2  (local to host GalensSynology)
           UUID : ce0e9aff:a0d43a65:acbf6b7f:d9786045
         Events : 1217

    Number   Major   Minor   RaidDevice State
       0       8       51        0      active sync   /dev/sdd3
       1       8       19        1      active sync   /dev/sdb3

磁盘分区信息:

root@GalensSynology:~# fdisk -l /dev/sdb
Disk /dev/sdb: 465.8 GiB, 500107862016 bytes, 976773168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xbc7bdaae

Device     Boot   Start       End   Sectors   Size Id Type
/dev/sdb1          2048   4982527   4980480   2.4G fd Linux raid autodetect
/dev/sdb2       4982528   9176831   4194304     2G fd Linux raid autodetect
/dev/sdb3       9437184 976568351 967131168 461.2G fd Linux raid autodetect
root@GalensSynology:~# fdisk -l /dev/sdd
Disk /dev/sdd: 465.8 GiB, 500107862016 bytes, 976773168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x5f55e8f4

Device     Boot   Start       End   Sectors   Size Id Type
/dev/sdd1          2048   4982527   4980480   2.4G fd Linux raid autodetect
/dev/sdd2       4982528   9176831   4194304     2G fd Linux raid autodetect
/dev/sdd3       9437184 976568351 967131168 461.2G fd Linux raid autodetect

但另一个 raid 阵列在同一设备上运行良好:

root@GalensSynology:~# mdadm --query --detail /dev/md5
/dev/md5:
        Version : 1.2
  Creation Time : Thu Aug 11 21:17:31 2022
     Raid Level : raid1
     Array Size : 483564544 (461.16 GiB 495.17 GB)
  Used Dev Size : 483564544 (461.16 GiB 495.17 GB)
   Raid Devices : 1
  Total Devices : 1
    Persistence : Superblock is persistent

    Update Time : Thu Aug 11 21:20:33 2022
          State : clean 
 Active Devices : 1
Working Devices : 1
 Failed Devices : 0
  Spare Devices : 0

           Name : GalensSynology:5  (local to host GalensSynology)
           UUID : 90e5ba00:0ac44575:d3356c1a:4949e120
         Events : 1

    Number   Major   Minor   RaidDevice State
       0       8       35        0      active sync   /dev/sdc3

和磁盘信息:

root@GalensSynology:~# fdisk -l /dev/sdc
Disk /dev/sdc: 465.8 GiB, 500107862016 bytes, 976773168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xd0050b12

Device     Boot   Start       End   Sectors   Size Id Type
/dev/sdc1          2048   4982527   4980480   2.4G fd Linux raid autodetect
/dev/sdc2       4982528   9176831   4194304     2G fd Linux raid autodetect
/dev/sdc3       9437184 976568351 967131168 461.2G fd Linux raid autodetect

感谢霜舒兹。

是的,数据偏移量不同。

root@GalensSynology:/volume2/homes/galenzhao# mdadm --examine /dev/sdb3
/dev/sdb3:
          Magic : a92b4efc
        Version : 1.2
    Feature Map : 0x0
     Array UUID : ce0e9aff:a0d43a65:acbf6b7f:d9786045
           Name : GalensSynology:2  (local to host GalensSynology)
  Creation Time : Thu Sep 26 14:46:34 2019
     Raid Level : raid1
   Raid Devices : 2

 Avail Dev Size : 966866976 (461.04 GiB 495.04 GB)
     Array Size : 483433472 (461.04 GiB 495.04 GB)
  Used Dev Size : 966866944 (461.04 GiB 495.04 GB)
    Data Offset : 264192 sectors
   Super Offset : 8 sectors
   Unused Space : before=264112 sectors, after=32 sectors
          State : clean
    Device UUID : 4d219454:64cd59fa:8e469f08:992bdf59

    Update Time : Thu Aug 11 22:58:13 2022
  Bad Block Log : 512 entries available at offset 16 sectors
       Checksum : 38317e71 - correct
         Events : 1220


   Device Role : Active device 1
   Array State : AA ('A' == active, '.' == missing, 'R' == replacing)
root@GalensSynology:/volume2/homes/galenzhao# mdadm --examine /dev/sdd3
/dev/sdd3:
          Magic : a92b4efc
        Version : 1.2
    Feature Map : 0x0
     Array UUID : ce0e9aff:a0d43a65:acbf6b7f:d9786045
           Name : GalensSynology:2  (local to host GalensSynology)
  Creation Time : Thu Sep 26 14:46:34 2019
     Raid Level : raid1
   Raid Devices : 2

 Avail Dev Size : 966866976 (461.04 GiB 495.04 GB)
     Array Size : 483433472 (461.04 GiB 495.04 GB)
  Used Dev Size : 966866944 (461.04 GiB 495.04 GB)
    Data Offset : 264192 sectors
   Super Offset : 8 sectors
   Unused Space : before=264112 sectors, after=32 sectors
          State : clean
    Device UUID : 5fc2ee9a:1ea9ba1c:bc415760:777f9c01

    Update Time : Thu Aug 11 22:58:51 2022
  Bad Block Log : 512 entries available at offset 16 sectors
       Checksum : a0624a6d - correct
         Events : 1220


   Device Role : Active device 0
   Array State : AA ('A' == active, '.' == missing, 'R' == replacing)
root@GalensSynology:/volume2/homes/galenzhao# mdadm --examine /dev/sdc3
/dev/sdc3:
          Magic : a92b4efc
        Version : 1.2
    Feature Map : 0x0
     Array UUID : 90e5ba00:0ac44575:d3356c1a:4949e120
           Name : GalensSynology:5  (local to host GalensSynology)
  Creation Time : Thu Aug 11 21:17:31 2022
     Raid Level : raid1
   Raid Devices : 1

 Avail Dev Size : 967129120 (461.16 GiB 495.17 GB)
     Array Size : 483564544 (461.16 GiB 495.17 GB)
  Used Dev Size : 967129088 (461.16 GiB 495.17 GB)
    Data Offset : 2048 sectors
   Super Offset : 8 sectors
   Unused Space : before=1968 sectors, after=32 sectors
          State : clean
    Device UUID : 72b8d726:e6002116:fc1a33af:5332d72a

    Update Time : Thu Aug 11 21:20:33 2022
       Checksum : 2dd6b7e2 - correct
         Events : 1


   Device Role : Active device 0
   Array State : A ('A' == active, '.' == missing, 'R' == replacing)

相关内容