LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   mdadm (lvm) expertise wanted. (https://www.linuxquestions.org/questions/linux-server-73/mdadm-lvm-expertise-wanted-681438/)

zaxonus 11-05-2008 11:56 PM

mdadm (lvm) expertise wanted.
 
Hi,

I am writing this post hoping that someone with a better understanding of LVM will make some comment.

Here is what I did. I started with four physical hard disks, each of them being 1TB.
Each of the HD had a single primary partition filling up all the available space.

In order to build a raid array, I ran the command :
mdadm -C /dev/md0 -l 5 -n 4 /dev/sd[a-d]1.

Then I ran mdadm -Q /dev/md0.
The report I get is :
/dev/md0: 2794.53GiB raid5 4 devices, 1 spare. Use mdadm --detail for more detail.

I have two questions at this point :
1) Why is there a spare device here ?
2) How can I get almost 3GB of space with only 3 active devices, each one of 1TB, combined in a RAID 5 array ?

*1 : For question one; I am surprised to see a spare device. Because when I did something similar a few years earlier, I did not get any spare device. On this present machine I have mdadm - v2.5.6. On the one I was using previously I had mdadm - v1.9.0. And also the four partitions I had at the time were much smaller than 1TB; they were around 200MB and did not use the full drives.

*2 : Concerning the second question I would expect around 3GB of space with 4 active devices, or around 2GB of space with 3 active devices.

Any comment helping to make things clearer will be welcome.

Bye

ljwobker 01-08-2009 05:23 PM

Did you mean someone with more mdadm experience? Because you don't mention LVM anywhere in your post. ;-)

I don't know why you're seeing 1 spare device... the array was built correctly using 4 devices (otherwise you wouldn't have 3GB available)... I just checked on my system which has 3 devices in the array, and it says "3 devices, 0 spares" as expected.

For question #2 -- are you asking why you only show 2794GiB instead of 3TB? The answer is that some of the math is done in decimal (i.e. a "gigabyte" is 1 billion bytes) while some of it is done in binary (i.e. a "gigabyte" is 2^30 bytes)...

the difference is about 7%, and if you reverse the calculation of "three terabytes" back into binary math, you get right at the 2.79 TB reported above...

Code:

name                          in power form        # of actual bytes
--------------                  --------------        --------------
binary gigabyte                  2^30                        1,073,741,824
decimal gigabyte          10^9                        1,000,000,000

"three TB in hard drive speak"                        3,000,000,000
"three TB in binary speak"                        2,793,967,724



All times are GMT -5. The time now is 12:51 PM.