LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Using mdadm with different capacity drives in RAID 5? (https://www.linuxquestions.org/questions/linux-server-73/using-mdadm-with-different-capacity-drives-in-raid-5-a-746522/)

lolhan 08-10-2009 02:42 PM

Using mdadm with different capacity drives in RAID 5?
 
Hi all,

I am going to soon setup a RAID 5 configuration for a server with mdadm.

However, I am hoping to use the following configuration:
4x1TB SATA 3Gb/s HDD
with
2x500GB SATA 3Gb/s HDD

in a RAID 5 configuration. If this works as I imagine it, I should be left with about 3.5TB of total space.

I am thinking it might be possible to create a striped array with the 2 500GB drives so the system sees 5x1TB HDDs.

The reason I want to do this is simple, to achieve the highest capacity while remaining some failure redundancy. I bought the 1TB drives to use in this configuration specifically and the 500GB drives would essentially be unused by me any longer, sitting in the closet or under-appreciated in a workstation somewhere.

Impossible? Please lend me your assistance!

Pearlseattle 08-22-2009 08:31 AM

Hello
It should be quite easy :D

Let's say you have the following HDDs:
=============
sda1: 500GB
sdb1: 500GB

sdc1: 1TB
sdd1: 1TB
sde1: 1TB
sdf1: 1TB
=============

You first create a raid0 using your two 500GB drives:
mdadm --create --verbose /dev/md0 --level=0 --raid-devices=2 /dev/sda1 /dev/sdb1

Then you create the raid5 using the four 1TB drives, plus your 1TB raid0:
mdadm --create /dev/md1 --level=5 --raid-devices=5 /dev/md0 /dev/sdc1 /dev/sdd1 /dev/sde1 /dev/sdf1

This should give you 4TB capacity.
Is this what you would like to do?
Greetings

Ah - and to assemble it after a reboot you start of course first the raid0 with...
mdadm --assemble /dev/md0 /dev/sda1 /dev/sdb1
...and then the raid5 with...
mdadm --assemble /dev/md1 /dev/md0 /dev/sdc1 /dev/sdd1 /dev/sde1 /dev/sdf1

MrAngel 10-27-2009 07:18 AM

An alternative solution - which may make things easier if you come to add more drives to the array at a later date - is to split the 1TB disks into 2 partitions, which would give you 10 partitions of 500GB each. Create a raid5 array with 6 members (/dev/sd*1) and another with 4 members (/dev/sd*2). As long as no array contains more than one partition from the same disk, you still have your redundancy.

This seems to be the most common way of using raid5 on disks of different sizes.

pamchi 07-05-2019 08:04 PM

Quote:

Originally Posted by MrAngel (Post 3734015)
An alternative solution - which may make things easier if you come to add more drives to the array at a later date - is to split the 1TB disks into 2 partitions, which would give you 10 partitions of 500GB each. Create a raid5 array with 6 members (/dev/sd*1) and another with 4 members (/dev/sd*2). As long as no array contains more than one partition from the same disk, you still have your redundancy.

This seems to be the most common way of using raid5 on disks of different sizes.

The problem on this is if you split the disk then you will have 2 partition per disk, and if a disk fail the full raid5 will be damage as it only have 1 disk (partitions on this case) loss tolerance... so probably is a bad idea.

syg00 07-05-2019 08:22 PM

That was posted 10 years ago - and it specifically covered that issue. Maybe better to let dead threads stay dead.

ehartman 07-06-2019 03:27 AM

Quote:

Originally Posted by pamchi (Post 6012366)
The problem on this is if you split the disk then you will have 2 partition per disk, and if a disk fail the full raid5 will be damage as it only have 1 disk (partitions on this case) loss tolerance...

Yeah, but each of those partitions then is in a different RAID 5 volume, so both the RAID 5 ones only are missing a single disk and will run on in degenerate mode.
You'll have the 6-disk volume with all of the "1" partitions and another 4-disk one with the 2nd partition of the 4 1TB disks. When a disk fails it will never have 2 partitions in the same volume.

pamchi 07-06-2019 01:37 PM

Quote:

Originally Posted by syg00 (Post 6012371)
That was posted 10 years ago - and it specifically covered that issue. Maybe better to let dead threads stay dead.

After 10 years yestarday google send me to your post... which means that the info on this post someone could take as reference; and if use the two partition in a single disk is a high risk conf.

JJJCR 07-08-2019 06:26 AM

Quote:

Originally Posted by pamchi (Post 6012571)
After 10 years yestarday google send me to your post... which means that the info on this post someone could take as reference; and if use the two partition in a single disk is a high risk conf.

Still provide a relevant info though. IMHO.

syg00 07-08-2019 06:33 AM

Read post #6 - and keep re-reading it until you understand what is being said.

sujitb 07-11-2019 06:47 AM

Why you configuring hardware RAID instead of software? Any specific reason?


All times are GMT -5. The time now is 07:05 AM.