What units are the output of mdadm -D below (specifically the Array Size and Used Dev Size values)?
The answer is Kilobytes (1 byte = 1024 byte) for the number without units or KiB for short (not KB technically 1 KB = 1000 bytes). The numbers inside of the parenthesis are explained below.
Array Size : 976751424 (931.50 GiB 1000.19 GB) Used Dev Size : 244187856 (232.88 GiB 250.05 GB)
CheatSheet: ============ Array Size / Used Dev Size: <KiB> (<Smallest base2 KiB, GiB, TiB> <Smallest base10 KB, GB, TB>) <Smallest base2> = <KiB> / 1024 ... unit number is between 0 and 9999 (keep track of units with every division). You might do the /1024 more then once to get the number between 0 and 9999 <Smallest base10> = <KiB> * 1024 = <bytes> <bytes> / 1000 ... keep dividing by 1000 until number is between 0 and 9999 (keep track of units with every division) - First operation here is ALWAYS * 1024, but you only do that once, you might do /1000 more then once to get the number between 0 and 9999.
First number XXX GiB is in units of base 2, Second number is XXX GB is in units of base 1000 (or base 10). The numbers in the parenthesis exist for human readable output.
So going from the first unitless number we can convert to any of the numbers inside the parenthesis.
* To get first number in the parenthesis, just take the KiB value and divide by 1024 – keep doing so until you get a number between 0 to 9999 for human readability.
* To get second number take the KiB value and multiply by 1024 to get bytes then convert to base 10 units by dividing by 1000 until you get a number between 0 to 9999- keep track of the units logically)
To get first number (and confirm that the unitless number is that of KiB): So 976751424 KiB/1024/1024 = 931.50 GiB (Gigabytes base 2). First division by 1024 gives you MiB, second one gives you GiB. We dont have a 3rd division, but if we did it would be TiB
And to get to second number (and confirm that the unitless number is that of KiB): 976751424 KiB*1024/1000/1000/1000=1000.19 GB
GiB (where the i is in the middle) is in units of base2 (1 KiB = 1024 bytes and so on)
GB (where there is no i) is in units of base10 (1 KB = 1000 bytes)
Where does this discreptency come from: Essentailly drive manufacturers and history of humans simplifying things its easier to think in 1000s instead of 1024.
Full output below:
# mdadm -D /dev/md3 /dev/md3: Version : 1.2 Creation Time : Tue Mar 30 18:53:14 2010 Raid Level : raid6 Array Size : 976751424 (931.50 GiB 1000.19 GB) Used Dev Size : 244187856 (232.88 GiB 250.05 GB) Raid Devices : 6 Total Devices : 6 Persistence : Superblock is persistent Update Time : Sun Apr 27 11:26:06 2014 State : clean Active Devices : 6 Working Devices : 6 Failed Devices : 0 Spare Devices : 0 Layout : left-symmetric Chunk Size : 16K Name : 001F33EA4161:3 UUID : 0ef61c34:fdaa57a3:58551142:7d261ab8 Events : 3800 Number Major Minor RaidDevice State 0 8 38 0 active sync /dev/sdc6 1 8 54 1 active sync /dev/sdd6 2 8 70 2 active sync /dev/sde6 4 8 86 3 active sync /dev/sdf6 5 8 6 4 active sync /dev/sda6 6 8 22 5 active sync /dev/sdb6