软件 RAID 太小

软件 RAID 太小

我使用 5 个 4TB 驱动器创建了软件 RAID 6 mdadm --create /dev/md0 --chunk=256 --level=6 --raid-devices=5 /dev/sdb1 /dev/sdc1 /dev/sdd1 /dev/sde1 /dev/sdf1。在此之前,我已经在每个驱动器上创建了最大大小的分区。 “fdisk -l”显示以下输出。不过整体大小只有6TB。由于 Raid 6 有 2 个奇偶校验,难道不应该有 12TB 左右吗?

Disk /dev/sda: 525.1 GB, 525112713216 bytes, 1025610768 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
Disk label type: gpt


#         Start          End    Size  Type            Name
 1     46139392     83888127     18G  Microsoft basic
 2      8390656     46139391     18G  Microsoft basic
 3     87033856   1025610734  447.6G  Linux LVM
 4     83888128     84936703    512M  BIOS boot parti
 5         2048      8390655      4G  Microsoft basic
 6     84936704     87033855      1G  Linux swap

Disk /dev/sdb: 4000.8 GB, 4000787030016 bytes, 7814037168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk label type: dos
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1  4294967295  2147483647+  ee  GPT
Partition 1 does not start on physical sector boundary.

Disk /dev/sdc: 4000.8 GB, 4000787030016 bytes, 7814037168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk label type: dos
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1               1  4294967295  2147483647+  ee  GPT
Partition 1 does not start on physical sector boundary.

Disk /dev/sde: 4000.8 GB, 4000787030016 bytes, 7814037168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk label type: dos
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sde1               1  4294967295  2147483647+  ee  GPT
Partition 1 does not start on physical sector boundary.

Disk /dev/sdd: 4000.8 GB, 4000787030016 bytes, 7814037168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk label type: dos
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sdd1               1  4294967295  2147483647+  ee  GPT
Partition 1 does not start on physical sector boundary.

Disk /dev/sdf: 4000.8 GB, 4000787030016 bytes, 7814037168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk label type: dos
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sdf1               1  4294967295  2147483647+  ee  GPT
Partition 1 does not start on physical sector boundary.

Disk /dev/mapper/XSLocalEXT--b30a297a--410a--d586--640b--e10ac011aaf3-b30a297a--410a--d586--640b--e10ac011aaf3: 480.5 GB, 480537214976 bytes, 938549248 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

答案1

您的分区比完整磁盘小得多:

/dev/sdc1               1  4294967295  2147483647+  ee  GPT

仅占用 4294967295 个扇区(7814037168 个扇区),IE略低于 2TiB。

如果您打算在 RAID 阵列中使用整个磁盘,我建议您只使用整个磁盘,而不用担心分区。首先,将任何看起来像超级块的东西归零md

mdadm --zero-superblock /dev/sdb
mdadm --zero-superblock /dev/sdc
mdadm --zero-superblock /dev/sdd
mdadm --zero-superblock /dev/sde
mdadm --zero-superblock /dev/sdf

然后创建数组:

mdadm --create /dev/md0 --chunk=256 --level=6 --raid-devices=5 /dev/sdb /dev/sdc /dev/sdd /dev/sde /dev/sdf

如果您希望允许用扇区数稍少的驱动器替换出现故障的驱动器,您可能需要留出一些可用空间;您可以使用--size=需要大小(要占用的磁盘空间量)的选项来执行此操作使用)以千字节为单位,例如在您的情况下,大约为 3,907,018,300KiB(您的驱动器有 3,907,018,584KiB 总空间,其中 128KiB 需要保留用于 RAID 超级块)。

相关内容