![两个阵列的阵列大小略有不同,且磁盘/分区大小相同,为什么?](https://linux22.com/image/51940/%E4%B8%A4%E4%B8%AA%E9%98%B5%E5%88%97%E7%9A%84%E9%98%B5%E5%88%97%E5%A4%A7%E5%B0%8F%E7%95%A5%E6%9C%89%E4%B8%8D%E5%90%8C%EF%BC%8C%E4%B8%94%E7%A3%81%E7%9B%98%2F%E5%88%86%E5%8C%BA%E5%A4%A7%E5%B0%8F%E7%9B%B8%E5%90%8C%EF%BC%8C%E4%B8%BA%E4%BB%80%E4%B9%88%EF%BC%9F.png)
一年前,我使用 CentOS 6.3 附带的 mdadm v3.2.x 创建了一个软件 RAID 5 阵列,几个月后,我将阵列移动/组装到 Fedora 19(现在的 Fedora 20)中。
它有三个 3TB 磁盘(希捷ST3000DM001),它几乎已满,所以我添加了 2 个磁盘,并将阵列增长到 4 个磁盘 + 1 个热备用磁盘。现在它的大小是8383.55 GiB。
# mdadm -D /dev/md127
/dev/md127:
Version : 1.2
Creation Time : Fri Jan 11 17:56:18 2013
Raid Level : raid5
Array Size : 8790792192 (8383.55 GiB 9001.77 GB)
Used Dev Size : 2930264064 (2794.52 GiB 3000.59 GB)
Raid Devices : 4
Total Devices : 5
Persistence : Superblock is persistent
Update Time : Tue Mar 25 11:04:15 2014
State : clean
Active Devices : 4
Working Devices : 5
Failed Devices : 0
Spare Devices : 1
Layout : left-symmetric
Chunk Size : 512K
Name : RecordBackup01:127 (local to host RecordBackup01)
UUID : dfd3bbe7:4b0231fe:9007bc4a:e106acac
Events : 7264
Number Major Minor RaidDevice State
0 8 17 0 active sync /dev/sdb1
1 8 33 1 active sync /dev/sdc1
3 8 49 2 active sync /dev/sdd1
5 8 81 3 active sync /dev/sdf1
4 8 65 - spare /dev/sde1
然后,我使用 mdadm v3.3(从 Fedora 20 附带)和 5 个 3TB 磁盘(东芝)创建了另一个阵列 (RAID 6)DT01ACA300),但它的大小是8383.18吉布,略小于 8383.55 GiB。
# mdadm -D /dev/md127
/dev/md127:
Version : 1.2
Creation Time : Fri Mar 21 18:12:00 2014
Raid Level : raid6
Array Size : 8790402048 (8383.18 GiB 9001.37 GB)
Used Dev Size : 2930134016 (2794.39 GiB 3000.46 GB)
Raid Devices : 5
Total Devices : 5
Persistence : Superblock is persistent
Intent Bitmap : Internal
Update Time : Tue Mar 25 11:18:51 2014
State : active
Active Devices : 5
Working Devices : 5
Failed Devices : 0
Spare Devices : 0
Layout : left-symmetric
Chunk Size : 512K
Name : RecordBackup02:127 (local to host RecordBackup02)
UUID : 923c9658:12739258:506fc8b0:f8c5edf3
Events : 8172
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
3 8 65 3 active sync /dev/sde1
4 8 81 4 active sync /dev/sdf1
两个阵列中每个磁盘的分区大小是相同的(所有分区都有5860531087个逻辑扇区,见下面的分区信息),那么为什么阵列大小不同呢?是由不同的 mdadm 版本或不同的数组级别还是其他原因引起的?
阵列 1 (RAID 5) 磁盘/分区信息
# LANG=en parted /dev/sdb "unit s print all"
Model: ATA ST3000DM001-1CH1 (scsi)
Disk /dev/sdb: 5860533168s
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
1 2048s 5860533134s 5860531087s pri
Model: ATA ST3000DM001-1CH1 (scsi)
Disk /dev/sdc: 5860533168s
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
1 2048s 5860533134s 5860531087s ext4 primary
Model: ATA ST3000DM001-1CH1 (scsi)
Disk /dev/sdd: 5860533168s
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
1 2048s 5860533134s 5860531087s ext4 primary
Model: ATA ST3000DM001-1CH1 (scsi)
Disk /dev/sde: 5860533168s
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
1 2048s 5860533134s 5860531087s primary
Model: ATA ST3000DM001-1CH1 (scsi)
Disk /dev/sdf: 5860533168s
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
1 2048s 5860533134s 5860531087s primary
Model: Linux Software RAID Array (md)
Disk /dev/md127: 17581584384s
Sector size (logical/physical): 512B/4096B
Partition Table: loop
Disk Flags:
Number Start End Size File system Flags
1 0s 17581584383s 17581584384s xfs
阵列 2 (RAID 6) 磁盘/分区信息
# LANG=en parted /dev/sdb "unit s print all"
Model: ATA TOSHIBA DT01ACA3 (scsi)
Disk /dev/sdb: 5860533168s
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
1 2048s 5860533134s 5860531087s primary
Model: ATA TOSHIBA DT01ACA3 (scsi)
Disk /dev/sdc: 5860533168s
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
1 2048s 5860533134s 5860531087s primary
Model: ATA TOSHIBA DT01ACA3 (scsi)
Disk /dev/sdd: 5860533168s
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
1 2048s 5860533134s 5860531087s primary
Model: ATA TOSHIBA DT01ACA3 (scsi)
Disk /dev/sde: 5860533168s
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
1 2048s 5860533134s 5860531087s primary
Model: ATA TOSHIBA DT01ACA3 (scsi)
Disk /dev/sdf: 5860533168s
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
1 2048s 5860533134s 5860531087s primary
Model: Linux Software RAID Array (md)
Disk /dev/md127: 17580804096s
Sector size (logical/physical): 512B/4096B
Partition Table: loop
Disk Flags:
Number Start End Size File system Flags
1 0s 17580804095s 17580804096s xfs
答案1
明显的区别是:
Intent Bitmap : Internal
对于是否启用意图位图,mdadm 版本是否有不同的默认值?
据我了解,内部意图位图使用磁盘的一部分来存储它将要写入的内容,因此当您更换故障磁盘时重建时不需要验证每个块。
mdadm --bitmap=none ...
尝试使用或显式创建 RAIDmdadm --bitmap=internal ...
答案2
你问的是尺寸……所以是的尺寸开销。我最好的猜测是,额外的奇偶校验需要某种额外的索引或其他东西(不了解 RAID6 的内部情况)。我们谈论的是 8.3 TB 的 370+ MB ...这不到总空间的 0.005%!