Home  >  Q&A  >  body text

linux - mdadm -D /dev/mdX下的【Used Dev Size】到底是什么意思?

比如,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】到底是什么意思?

天蓬老师天蓬老师2764 days ago637

reply all(1)I'll reply

  • 迷茫

    迷茫2017-04-17 14:25:42

    Brother Niao’s private dish is right
    raid5, 3 hard drives, 2 data, 1 verification backup, then each data disk is 2G, and the total data is 4G

    reply
    0
  • Cancelreply