比如,3个2G的磁盘组raid 5,那么:总空间是6G,可用空间是4G,校验数据占用空间是2G。
接着:
[root@testcentos65x64-1 ~]# mdadm -D /dev/md1
/dev/md1:
Version : 1.1
Creation Time : Sat Dec 19 07:49:09 2015
Raid Level : raid5
Array Size : 4189184 (4.00 GiB 4.29 GB)
Used Dev Size : 2094592 (2045.84 MiB 2144.86 MB)
Raid Devices : 3
Total Devices : 3
Persistence : Superblock is persistent
Intent Bitmap : Internal
Update Time : Tue Mar 1 10:33:54 2016
State : clean
Active Devices : 3
Working Devices : 3
Failed Devices : 0
Spare Devices : 0
Layout : left-symmetric
Chunk Size : 512K
Name : 1
UUID : 623f2e4d:aa69449e:31952d5a:4771d752
Events : 80
Number Major Minor RaidDevice State
0 8 65 0 active sync /dev/sde1
1 8 81 1 active sync /dev/sdf1
3 8 97 2 active sync /dev/sdg1
Used Dev Size显示为2G。这是什么意思呢?我搜了一下:
资料1:鸟哥的私房菜【http://vbird.dic.ksu.edu.tw/linux_basic/0420quota_2.php】,Ctrl + F定位到【Used Dev Size】,他的解释是【每个装置的可用容量】,这明显不对啊。
资料2:Linux Questions【http://www.linuxquestions.org/questions/red-hat-31/what-does-used-dev-size-mean-mdadm-detail-767177/】,需要翻墙,但我把最后一个答案粘贴过来:
Hmm, yes, on a second thought, I think I understand the real meaning of "Used Dev Size". It refers to "disk size that are not for data".
For RAID0, "Used Dev Size" does not exist.
For RAID1, "Used Dev Size" equals to half of total disks' size.
For RAID5, "Used Dev Size" equals to size that are used for parity.
Thanks for replying, Mr-Bisquit.
它这个回答,符合我上面的数据。
资料3:Server Fault【http://serverfault.com/questions/432963/raid10-in-mdadm-reports-incorrect-used-dev-size】,这个帖子又加深了我的疑惑,被采用的答案解释说:【Used Dev Size】是指组成阵列的磁盘中,最小磁盘的容量。
以上资料,每种资料对它的解释都不一样,所以:
mdadm -D /dev/mdX下的【Used Dev Size】到底是什么意思?
鸟哥的私房菜说得没错啊
raid5 ,3个硬盘,2个数据,1个校验备份,那么每个数据盘2G,总共的数据4G