23
Aug
14

Configuring GEOM MIRROR on FreeBSD 10.0 from Installation

Choose “Shell” option on partition menu:
bsdinstall-partmenu

Create MBR schema (BIOS compatibility):

gpart create -s MBR <device>
gpart add -t freebsd -s 465G <device>
gpart set -a active -i 1 <device>
gpart bootcode -b /boot/boot0 <device>

 

After that, create BSD schema:

gpart create -s BSD -n 10 <device>s1 # -n 10 -> allow 10 slices to be created
gpart add -t freebsd-ufs -s 1G <device>s1 # Root partition
gpart add -t freebsd-ufs -s 1G <device>s1 # Var partition
gpart add -t freebsd-ufs -s 512M <device>s1 # Tmp partition
gpart add -t freebsd-swap -s 2G <device>s1 # Swap
gpart add -t freebsd-ufs <device>s1 # Usr partition
gpart bootcode -b /boot/boot <device>s1

 

Formatting slices:

newfs /dev/<device>s1a # Root
newfs -U /dev/<device>s1b # Var (Soft Update)
newfs -U /dev/<device>s1d # Tmp (Soft Update)
newfs -U /dev/<device>s1f # Usr (Soft Update)

 

Mirroring:

gmirror load
gmirror label -v root /dev/<device>s1a [<device_2>s1a]
gmirror label -v var /dev/<device>s1b [<device_2>s1b]
gmirror label -v tmp /dev/<device>s1d [<device_2>s1d]
gmirror label -v usr /dev/<device>s1f [<device_2>s1f]

 

Mount root partition:

mount /dev/mirror/root /mnt

Create directories before mount others slices:

mkdir /mnt/var
mkdir /mnt/tmp
mkdir /mnt/usr

Keep mounting:

mount /dev/mirror/var /mnt/var
mount /dev/mirror/tmp /mnt/tmp
mount /dev/mirror/usr /mnt/usr

 

Back to instalation to finish:
FreeBSD_10_2

After instalation, need to back to shell console, so exit again and then choosing Live CD option to continue configuration of mirror.

Load geom mirror on boot /mnt/boot/loader.conf:

geom_mirror_load=”yes”

Configuring /mnt/etc/fstab:

# DEVICE MOUNT FS OPT DUMP CHECK
/dev/mirror/root / ufs rw 1 1
/dev/mirror/usr /usr ufs rw 2 2
/dev/mirror/var /var ufs rw 2 2
/dev/mirror/tmp /tmp ufs rw 2 2
/dev/ada0s1e none swap sw 0 0

Reboot machine!!!

After reboot:

# gmirror status
Name Status Components
mirror/root COMPLETE ada0s1a (ACTIVE)
mirror/var COMPLETE ada0s1b (ACTIVE)
mirror/tmp COMPLETE ada0s1d (ACTIVE)
mirror/usr COMPLETE ada0s1f (ACTIVE)

Tá-Dá!!! 😀

Destroying a mirror:

gmirror remove root ada1s1a # Removing a mirror disk
gmirror deactivate root ada0s1a # Deactivate an active mirror withing one disk only
gmirror clear ada1s1a # Clearing gmirror metadata
gmirror clear ada0s1a # Clearing gmirror metadata

Tá-Dá²!!! =D


0 Responses to “Configuring GEOM MIRROR on FreeBSD 10.0 from Installation”



  1. Leave a Comment

Leave a comment


Calendar:

August 2014
S M T W T F S
 12
3456789
10111213141516
17181920212223
24252627282930
31  

Categories