-1

Im using a mdadm software raid system on my new server which runs 3x120GB ssd drives.

Currently, this is the preinstalled configuration that came with the server

cat /proc/mdstat
Personalities : [raid1] 
md2 : active raid1 sdb2[1] sda2[0] sdc2[2]
      96211904 blocks [3/3] [UUU]

md1 : active raid1 sda1[0] sdc1[2] sdb1[1]
      20478912 blocks [3/3] [UUU]

unused devices: <none>

I would like to have more space available than 120gb, because right now its using only 1 drive for the data, 1 in raid + the other 1 in spare backup.

My question goes as is : Is it possible to have 3 drives running a raid 1 ?

Example : 3x120GB = 360GB. Have 180GB available and 180GB in raid

Any help would be really appreciated.

For more information on my current setup to show the 120GB only

df -h
Filesystem      Size  Used Avail Use% Mounted on
devtmpfs         16G  208K   16G   1% /dev
tmpfs            16G     0   16G   0% /dev/shm
/dev/md1         20G  1.3G   17G   7% /
/dev/md2         91G  200M   86G   1% /vz
/dev/md1         20G  1.3G   17G   7% /var/named/chroot/etc/named
/dev/md1         20G  1.3G   17G   7% /var/named/chroot/var/named
/dev/md1         20G  1.3G   17G   7% /var/named/chroot/etc/named.conf
/dev/md1         20G  1.3G   17G   7% /var/named/chroot/etc/named.rfc1912.zones
/dev/md1         20G  1.3G   17G   7% /var/named/chroot/etc/rndc.key
/dev/md1         20G  1.3G   17G   7% /var/named/chroot/usr/lib64/bind
/dev/md1         20G  1.3G   17G   7% /var/named/chroot/etc/named.iscdlv.key
/dev/md1         20G  1.3G   17G   7% /var/named/chroot/etc/named.root.key
Stacknerd
  • 43
  • 5
  • It's quite sad that this is a rather well-written question, yet gets negatively voted without any commends on what voters thought is wrong with it. – chutz Mar 19 '16 at 08:05

2 Answers2

1

It sounds like you want a RAID10 with two mirrors on your three disks. Perfectly normal setup with Linux software RAID.

http://en.wikipedia.org/wiki/Linux_MD_RAID_10#Linux_MD_RAID_10

It does exactly what you described. You decide how many copies (mirrors) of each data block you want, and it will stripe the data to fill all the disks.

For example, if I have three devices (/dev/loop0, /dev/loop1, /dev/loop2), which are 100M each, I can accomplish what you suggested this way:

> sudo mdadm --create --level raid10 -n 3 -p f2 /dev/md/test /dev/loop{0..2}
mdadm: Defaulting to version 1.2 metadata
mdadm: array /dev/md/test started.

The -p f2 indicates that you want a "far" layout with "two" copies of each block device. And as you can see, the new RAID device is about 1.5 times the size of each disk:

> sudo blockdev --getsize64 /dev/md/test /dev/loop{0..2} 
157286400
105906176
105906176
105906176
chutz
  • 7,888
  • 1
  • 29
  • 59
  • The problem with this is that its a non standard RAID level (it is not raid 10, this is raid 1E). I wouldn't recommend this in an enterprise environment. Raid 10 requires 4 drives. Read the Wikipedia link supplied for details. – Jim B Jan 05 '15 at 15:16
  • 1
    Irrespective of what you call it, software RAID 10 is what the OP described, he just didn't know what to call it - hence the question. As for the recommended or not... that's not for me to decide. RAID10 on three or four disks - there isn't much practical difference. – chutz Jan 05 '15 at 15:35
  • And you did NOT provide raid 10, I suggest you learn from the docs on MD or even the link you provided. As far as recommended this is for enterprise solutions. – Jim B Jan 05 '15 at 16:57
  • 1
    @JimB, mdadm raid10 is used by plenty of enterprises quite happily -- there is no reason at all to avoid it. Calling it "1E" is something silly that like one vendor somewhere once did. It's also kind of silly to say he did not provide raid10 when it is right there in the command. – psusi Jan 07 '15 at 00:47
  • @psusi just because you are unable to read the docs doesn't make it so under the raid10 command (quoted above): The four-drive example is identical to a standard RAID 1+0 array, while the three-drive example is a software implementation of RAID 1E." just because it says raid10 in the command doesn't magically make it so. – Jim B Jan 07 '15 at 05:06
  • @JimB, to what docs do you refer? md(4) clearly states that it is raid10 and the number of drives need not be a multiple of the number of replicas. Just because someone wrote on wikipedia that this is called raid 1e doesn't make it so. It is raid10 because it combines striping and mirroring, plain and simple, but whatever you want to call it ( and semantic arguments are largely pointless ) it is what the OP is looking for and claiming it isn't "standard" or "enterprise grade" is simply FUD. – psusi Jan 07 '15 at 14:01
  • This is the layout as described in the man page:http://en.wikipedia.org/wiki/File:RAID_1E.png. It is not-by any stretch Raid 10. It uses a redundant copy but is not the same as raid 10. It is known as Raid 1e as the nonstandard raid type. I'm sure there are enterprises using software raid 10 on various platforms- this is not it. – Jim B Jan 07 '15 at 14:57
-1

No, raid 1 requires an even number of disks. http://en.wikipedia.org/wiki/Standard_RAID_levels#RAID_1

Jim B
  • 24,081
  • 4
  • 36
  • 60
  • Software RAID 1 requires an even number of *devices*. If the partitions had been the same size, then it would have been easy enough to fail sdb1 and sdc2 out of their respective arrays and create a third array using those two partitions to get that space back. – DerfK Jan 05 '15 at 05:39
  • No, it does not; `mdadm` can do a 3 disk raid1 just fine. – psusi Jan 07 '15 at 00:44
  • @psusi No, incorrect, your inability to read does not change the facts. – Jim B Jan 07 '15 at 05:34
  • To read what? Your inability to provide a rational argument does not change the facts. The fact is that I'm looking at a working mdadm 3 way raid1 right now so you are incorrect. – psusi Jan 07 '15 at 13:55
  • You are entitled to your own opinion, not your own facts, there is no such thing as a "3 way raid 10" as attested to by the man page. The MD raid 10 is defined as "Every datablock is duplicated some number of times, and the resulting collection of datablocks are distributed over multiple drives.". This is raid 10 http://www.thegeekstuff.com/2010/08/raid-levels-tutorial/ , this is not the layout described in the man page or the wiki. – Jim B Jan 07 '15 at 15:09