# RAID1 for system, RAID0 for the rest



## Breys (Feb 24, 2013)

Hello,

I'd like to know if it's possible to have a system with both RAID0 and RAID1? Let me explain:

I have a server, with FreeBSD 8.3 installed on 2 x 500 GB on RAID1. I have already 5 partitions:


```
1	-	ufs	  /boot	1	2000 Mo                                                 	
2	-	ufs	  /	1	2000 Mo                                                 	
3	-	swap	  none	-	2 x 4000 Mo                                                 	
4	-	ufs	  /usr	1	2000 Mo                                                 	
5	-	ufs	  /tmp	1	1000 Mo
```

As you can see, all are on RAID1. What I wish to do is configure a new partition with the rest on RAID0. I'm well aware that I'm not going to have any redundancy on this, but I really don't care. When I do *gpart show*, here is what I get:


```
=>       63  976773104  mirror/gm0  MBR  (465G)
         63  976768002           1  freebsd  [active]  (465G)
  976768065       5102              - free -  (2.5M)

=>        0  976768002  mirror/gm0s1  BSD  (465G)
          0    4096000             1  freebsd-ufs  (2G)
    4096000    4096000             2  freebsd-ufs  (2G)
    8192000    8192000             4  freebsd-swap  (3.9G)
   16384000    4096000             5  freebsd-ufs  (2G)
   20480000  956288002             6  freebsd-ufs  (456G)
```

Thank you for your help :\


----------



## wblock@ (Feb 24, 2013)

RAID 0 is actually negative redundancy, but it's not clear what you mean.  Are you adding new drives?  Or do you wish to have a mirror that uses only part of the two existing drives, and have some of the additional space available unmirrored?


----------



## Breys (Feb 24, 2013)

No, I'm not adding any drives. So yes, I wish to have a mirror for the system files, and have the rest unmirrored. 

So is it possible for RAID1 and RAID0 to coexist on the same hard drives?


----------



## wblock@ (Feb 24, 2013)

Yes.  However, it still sounds like it is not RAID 0 that you are talking about, but not a RAID at all.  RAID 0 is for combining several drives to make one larger drive.  Put another way, "RAID 0" does not mean "not RAID".

Anyway, yes it is possible to mirror some drive partitions instead of the whole drive.  The remaining partitions can then be used alone.  See gmirror With Disk Partitions.  Note that I do not use this technique any more.  Instead, I use small drives in a full mirror, or SSDs copied to a hard drive periodically, a "slow mirror".


----------



## Breys (Feb 25, 2013)

Thank you very much for your patience, what you are talking about is almost what I am looking for, but I can't find a way to apply it in my situation.  I'm leasing the server, so I can't really do what I want when I install the system. But what I want is to have /boot, / and /usr mirrored (so RAID1), and /home on RAID0, to be as big as possible, and not to "waste" 500 GB or so.

But I believe by seeing what gpart shows me that my entire disk is mirrored, right? So this might be impossible, after all.


----------



## wblock@ (Feb 26, 2013)

Using partitions instead of whole disks, you can probably use gstripe(8) or gconcat(8) (I've never used either).  You'll have to back up, destroy the mirror, create new devices and filesystems, and move data around, so it will almost certainly require support from the data center.  If either disk fails, the filesystem on the stripe or concat drive will likely not be recoverable.


----------



## SirDice (Feb 26, 2013)

Don't put /boot/ on a separate filesystem.


----------

