BSD_Underground

A site to promote the use of FreeBSD

UFS Disk Setups


RAID10 Mirrored and Striped


# load your kernel modules
kldload geom_label
kldload geom_mirror
kldload geom_stripe

gpart create -s gpt ada0
gpart create -s gpt ada1
gpart create -s gpt ada2
gpart create -s gpt ada3

# RAID1 mirror ada0+ada1
gpart add -t freebsd-ufs -l ada0data ada0
gpart add -t freebsd-ufs -l ada1data ada1

gmirror label datastore01 /dev/gpt/ada0data /dev/gpt/ada1data

newfs -U /dev/mirror/datastore01

## ONLY FOR MIRROR TEST
## echo '/dev/mirror/datastore01 /data1 ufs rw,noatime 1 1' >> /etc/fstab
## mkdir /data1
## mount /data1
## REMOVE ABOVE AFTER TEST

# RAID1 mirror ada2+ada3
gpart add -t freebsd-ufs -l ada2data ada2
gpart add -t freebsd-ufs -l ada3data ada3

gmirror label datastore02 /dev/gpt/ada2data /dev/gpt/ada3data

newfs -U /dev/mirror/datastore02

## ONLY FOR MIRROR TEST
## echo '/dev/mirror/datastore02 /data2 ufs rw,noatime 1 1' >> /etc/fstab
## mkdir /data2
## mount /data2
## REMOVE ABOVE AFTER TEST

# RAID0 from both RAID1 mirrors

gstripe label -v datastore /dev/mirror/datastore01 /dev/mirror/datastore02

newfs -U /dev/stripe/datastore

echo '/dev/stripe/datastore /data ufs rw,noatime 2 2' >> /etc/fstab

mkdir /data
mount -a
df -h | grep datastore

/dev/stripe/datastore 7.0T 8.0K 6.5T 0% /data

In /boot/loader.conf:
Code:

geom_label_load="YES"
geom_mirror_load="YES"
geom_stripe_load="YES"