Mdadm raid 5 阵列大小只有预期的一半

Mdadm raid 5 阵列大小只有预期的一半

我使用 mdadm 创建了一个由 4 x 4TB 驱动器组成的 Raid 5 阵列,我预计该阵列的总空间为 11-12Tb。

但在构建阵列后,我注意到它的实际大小只有预期大小的一半,只有 6TB。并且每个驱动器显示可用空间为 2TB。

突袭配置:

$ cat /proc/mdstat
Personalities : [raid6] [raid5] [raid4] [linear] [multipath] [raid0] [raid1] [raid10] 
md127 : active raid5 sdc1[1] sda1[4] sdd1[2] sdb1[0]
      6442051584 blocks super 1.2 level 5, 512k chunk, algorithm 2 [4/4] [UUUU]
      bitmap: 1/16 pages [4KB], 65536KB chunk

unused devices: <none>

$ mdadm --detail /dev/md127
/dev/md127:
           Version : 1.2
     Creation Time : Tue Jul 25 10:24:33 2023
        Raid Level : raid5
        Array Size : 6442051584 (6143.62 GiB 6596.66 GB)
     Used Dev Size : 2147350528 (2047.87 GiB 2198.89 GB)
      Raid Devices : 4
     Total Devices : 4
       Persistence : Superblock is persistent

     Intent Bitmap : Internal

       Update Time : Sat Aug  5 00:10:25 2023
             State : clean 
    Active Devices : 4
   Working Devices : 4
    Failed Devices : 0
     Spare Devices : 0

            Layout : left-symmetric
        Chunk Size : 512K

Consistency Policy : bitmap

              Name : explorer:0  (local to host explorer)
              UUID : bd6ea5b8:e20be480:40c7cf15:514e6dec
            Events : 2734

    Number   Major   Minor   RaidDevice State
       0       8       17        0      active sync   /dev/sdb1
       1       8       33        1      active sync   /dev/sdc1
       2       8       49        2      active sync   /dev/sdd1
       4       8        1        3      active sync   /dev/sda1

阵列中使用的所有磁盘

$ fdisk -l

Disk /dev/sdd: 3.64 TiB, 4000787030016 bytes, 7814037168 sectors
Disk model: HGST HUS724040AL
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: 0x93cf7f24

Device     Boot Start        End    Sectors Size Id Type
/dev/sdd1        2048 4294967295 4294965248   2T fd Linux raid autodetect


Disk /dev/sdb: 3.64 TiB, 4000787030016 bytes, 7814037168 sectors
Disk model: HGST HUS724040AL
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: 0x35a7a3cc

Device     Boot Start        End    Sectors Size Id Type
/dev/sdb1        2048 4294967295 4294965248   2T fd Linux raid autodetect


Disk /dev/sda: 3.64 TiB, 4000787030016 bytes, 7814037168 sectors
Disk model: HGST HUS724040AL
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: 0xfa31510a

Device     Boot Start        End    Sectors Size Id Type
/dev/sda1        2048 4294967295 4294965248   2T fd Linux raid autodetect


Disk /dev/sdc: 3.64 TiB, 4000787030016 bytes, 7814037168 sectors
Disk model: HGST HUS724040AL
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: 0x584e9ded

Device     Boot Start        End    Sectors Size Id Type
/dev/sdc1        2048 4294967295 4294965248   2T fd Linux raid autodetect


Disk /dev/md127: 6 TiB, 6596660822016 bytes, 12884103168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 524288 bytes / 1572864 bytes

这次突袭的规模为什么只有我预期的一半,这真是令人费解。

我如何才能弄清楚为什么会出现这种情况和/或获得预期的完整尺寸。

答案1

对于 RAID5,您使用大小为 2T 的分区(检查fdisk输出)

设备启动开始结束扇区大小ID类型/dev/sdb1
2048 4294967295 4294965248 2Tfd Linux raid 自动检测

所以这个大小是预期的。使用整个磁盘,您将获得更大的结果数组。

正如评论中提到的,您似乎使用了 MBR 表。切换到 GPT 以便能够创建更大的分区。

相关内容