# raid0 questions



## quakerdoomer (Jan 6, 2021)

I have 3 usb pen drives:

I have the FreeBSD installer on da2 (installer boots fine)
da0 and da1 are identical in disk size, make/vendor (32 GB each)

1] How do I use da0 and da1 as a single 64 GB disk and install FreeBSD onto it? (Any FS UFS2/ZFS will do.)
2] Do I have to use graid before I run the setup using the shell?

Any ideas??


----------



## Phishfry (Jan 6, 2021)

Using RAID0 across USB pen drives is a bad idea. Perhaps you meant RAID1? Redundant USB sticks?
USB sticks ares pretty flakey and I would not trust a pair for a RAID0 array.

gstripe(8) is UFS software RAID0


----------



## Phishfry (Jan 6, 2021)

We do have a graid module but it is meant for Motherboard BIOS RAID




__





						graid(8)
					






					www.freebsd.org


----------



## quakerdoomer (Jan 6, 2021)

Phishfry said:


> Using RAID0 across USB pen drives is a bad idea. Perhaps you meant RAID1? Redundant USB sticks?
> USB sticks ares pretty flakey and I would not trust a pair for a RAID0 array.
> 
> gstripe(8) is UFS software RAID0


I meant raid0 as mentioned


----------



## Phishfry (Jan 6, 2021)

I did a write-up for bootable gmirror(FreeBSD RAID1 for UFS) so maybe you can glean something from that:








						Install UEFI FreeBSD on gmirror
					

I wanted to post instruction for installing FreeBSD on a GEOM_MIRROR  -aka- gmirror(8). This is an advanced topic so I assume you are capable of determining that your two chosen disks are empty. UFS RAID1 on FreeBSD is enabled with the geom_mirror module. I am using ada0 and ada1 as examples...




					forums.freebsd.org
				




So you would need to do the same and drop out to a shell during installation and load gstripe and then build your raid array.

Unsure if you want to go UEFI or MBR/Legacy BIOS route.


----------



## im (Jan 6, 2021)

Raid0 with usb sticks it is a good way to lost all data. We will try to imagine only experimental (non-production) installation.



quakerdoomer said:


> How do I use da0 and da1 as a single 64 GB disk and install FreeBSD onto it?


Direct boot from software RAID0 seems to be impossible. But there is a lifehack:

You need to prepare your usb-sticks.
Both stick must be partitioned with identical scheme. For example 2Gb and 30GB.
Assuming BIOS and MBR, try to create partitions on 1st stick, and using fdisk copy the same scheme to 2nd stick.

Create gmirror from 2GB partitions on both usb sticks. For example:

```
gmirror label usbraid1 /dev/da0s1a /dev/da1s1a
```
It is a mirror for 'root filesystem', mountpoint is '/'.

Create gstripe from the both 30GB partitions. For example:

```
gstripe label usbraid0 /dev/da0s1d /dev/da1s1d
```
It is a stripe for other filesystems. mountpoint /usr might be a good choice.

Install FreeBSD to the loaded usb-sticks. (Or copy existing installation to these usb sticks)
Enable gmirror and gstripe in loader.conf
Enjoy!

How it works?
PC will boot kernel and root-fs from mirror of the 1st partitions. Other mount points (like /usr) are mounted from stripe.
Using fstab and nullfs you can place  /var /tmp /usr on a single stripe partition.
How to mount non-root filesystems from single partition:

```
/etc/fstab

# Device                Mountpoint      FStype  Options         Dump    Pass#
/dev/ufs/sataflash      /               ufs     rw              1       1
/dev/ada1p1             /media/wd3tbvkh ufs     rw              2       2
/media/wd3tbvkh/system.bsd/tmp /tmp     nullfs  rw              0       0
/media/wd3tbvkh/system.bsd/var /var     nullfs  rw              0       0
/media/wd3tbvkh/system.bsd/usr /usr     nullfs  rw              0       0
```


----------

