Setting up RAID6 Questions

Carlosinfl

Loves the juice
Joined
Sep 25, 2002
Messages
6,633
I am going to get a RAID6 setup going on S-ATA and I'm using all identical drives.

I have four Seagate 250GB drives and I want to get them all running in a RAID6 array however I don't know how I should partition the drives. I have only used "Software RAID" to setup a RAID1 array which looked very simple:

/dev/sda
- sda1 512MB = SWAP
- sda2 248GB = Software RAID

/dev/sdb
- sdb1 512MB = SWAP
- sdb2 248GB = Software RAID

/dev/md
- md0 248GB (RAID1 = sda2 & sdb2) formated as Ext3 - Mounted on /

Now that I have 2 more drives, how would this work? Sorry if this seems like a stupid question but I am just asking as I have never done this before...

Thanks for any help!
 
How you choose to partition it is entirely up to you, just like with RAID1. You can either forgo the partitioning entirely and just build the array on the block device itself, or make 1 partition on each drive that uses the entire drive, or swaps and a / on each drive, etc etc. The options are almost endless.

Interesting choice with doing a RAID6 with 4 drives tho, quite a lot of space loss for only a 4 drive setup. I'd probably do a RAID5 instead if it was me, since the chances of 2 drives dying at the same time in 4 drive array is probably something I could live with.
 
I guess I would do this:
  1. break the mirror:
    Code:
    mdadm --manage /dev/md0 --fail /dev/sdb2
    mdadm --manage /dev/md0 -r /dev/sdb2
  2. create a RAID6 (or 5) array with a missing drive:
    Code:
    mdadm --create /dev/md1 --level=5[color=pink](or 6)[/color] -n=4 /dev/sd[bcd]2 missing
  3. create a filesystem
    Code:
    mkfs -t ext3 /dev/md1
  4. copy the data over from the old root partition
  5. change the entry in the grub menu from /dev/md0 to /dev/md1
    Code:
    nano /boot/grub/menu.lst
  6. change the fstab file on the new device to mount /dev/md1 on /
  7. reboot (test that it worked)
  8. remove last drive from md0 and add it to the new array
    Code:
    mdadm --manage /dev/md0 --fail /dev/sda2
    mdadm --manage /dev/md0 -r /dev/sda2
    mdadm --manage /dev/md1 -a /dev/sda2

I assume no responsibility for anything.

ps.: I don't think that RAID-6 is a good selection for a RAID level if you have only four drives. Why not go RAID-10 or 0+1 instead?
 
Thanks all for the input. So I guess RAID6 is perhaps not the best options w/ 4 drives so I am not sure if Linux built in software RAID supports 0+1...I will have to look into it.
 
according to this page, mdadm supports:
Code:
       -l, --level=
              Set raid level.  When used with --create, options  are:  linear,
              raid0,  0,  stripe, raid1, 1, mirror, raid4, 4, raid5, 5, raid6,
              6, multipath, mp, fautly.  Obviously some of these  are  synonymous.

RAID-10 and RAID-0+1 would require you to layer two raid layers on top of one another. In RAID-10 you would create a striped set across two disks and then a mirror with one missing device. After moving the data, you create a second striped set and then add that md device to the mirror you created before. With RAID-0+1 you will create two mirror sets (one complete, one will be missing a drive) and then stripe across them.


RAID-10
Code:
mdadm --create /dev/md1 --level=0 -n=2 /dev/sd[cd]2
mdadm --create /dev/md2 --level=1 -n=2 /dev/md1 missing
[color=pink]move your OS, edit grub etc.[/color]
mdadm --create /dev/md3 --level=0 -n=2 /dev/sd[ab]2
mdadm --manage /dev/md2 -a /dev/md3

RAID-0+1
Code:
mdadm --create /dev/md1 --level=1 -n=2 /dev/sd[cd]2
mdadm --create /dev/md2 --level=1 -n=2 /dev/sdb2 missing
mdadm --create /dev/md3 --level=0 -n=2 /dev/md[12]
[color=pink]move your OS, edit grub etc.[/color]
mdadm --manage /dev/md2 -a /dev/sda2
 
Back
Top