After searching around on how to setup my first NAS solution I was very disapointed about simple tutorials that are not complete to follow , so I want to share the way I did to complete my scenario:
Credits go also to: ylchang and Adam Strohl
The procedure is currently working on FreeNAS 9.2.1.5, these are the steps I followed:
My scenario is:
ada0: boot disk (500GB)
ada2: boot disk mirror (the one I want to add to a mirror, 500GB).
Mirror name: osraid1
(You can complete mirror creation from GUI)
ada1: DATA disk (3TB).
ada3: DATA disk (mirror disk, 3TB).
Mirror name: DATA
Mirrors are located on: /dev/mirror
1- Insert installation Media into DVD/CD tray.
2- Choose to install FreeNAS 9.2.1.5.
3- Choose to install on the firs visible drive (ada0).
4- Proceed to follow standards steps during installation.
5- Reboot Server/PC by having the installation media on CD tray.
6- Choose SHELL option.
7- Make dir /tmp/disk0.
8- Make mirror for OS using disks ada0 and ada2:
# sysctl kern.geom.debugflags=16
# gmirror label -v -b round-robin osraid1 /dev/ada0
# gmirror insert osraid1 /dev/ada2
WAY UNTILL MIRRORS GET SYNCRONIZED.....
--Verify sync, by exec command: #gmirror status
9- Mount root partition on /tmp/disk0, this way: # mount -rw /dev/FreeNASs1a /tmp/disk0.
10- Change path to /tmp/disk0, this way: # cd /tmp/disk0
11- copy etc/fstab to etc/fstab-ori:
Original fstab:
/dev/ufs/FreeNASs1a / ufs ro 1 1
/dev/ufs/FreeNASs3 /cfg ufs rw, noauto 2 2
/dev/ufs/FreeNASs4 /data ufs rw, noatime 2 2
Modified etc/fstab:
/dev/ufs/osraid1s1a / ufs ro 1 1
/dev/ufs/osraid1s3 /cfg ufs rw, noauto 2 2
/dev/ufs/osraid1s4 /data ufs rw, noatime 2 2
12- Add to the following files:
/boot/loader.conf:
#Ensure that the gmirror module get loaded on boot
geom_mirror_load="YES"
/etc/periodic.conf
#Daily status reporting
daily_status_gmirror_enable="YES"
13- Remove CD from tray and boot-up PC/server and test, test and more test.
Now you should be able to run FreeNAS by having BOOT disk mirrored.
====Troubleshooting=====
A- To remove a failed disk from mirror, ex:
# gmirror remove osraid1 ada0
B- To insert a new disk to mirror, ex:
# gmirror insert osraid1 /dev/adaN
C- To tell mirror to forget any not present disk and add a new one:
# gmirror forget osraid1
# gmirror insert osraid1 /dev/adaN
D- To tell mirror to forget a disk that seems failed and relocate it:
# gmirror forget osraid1
# gmirror remove osraid1 adaN
# gmirror insert osraid1 /dev/adaN
Perhaps there are other ways to do it better, but the explanation above solved my needs, if you all have better way to do it, please share it.
Credits go also to: ylchang and Adam Strohl
The procedure is currently working on FreeNAS 9.2.1.5, these are the steps I followed:
My scenario is:
ada0: boot disk (500GB)
ada2: boot disk mirror (the one I want to add to a mirror, 500GB).
Mirror name: osraid1
(You can complete mirror creation from GUI)
ada1: DATA disk (3TB).
ada3: DATA disk (mirror disk, 3TB).
Mirror name: DATA
Mirrors are located on: /dev/mirror
1- Insert installation Media into DVD/CD tray.
2- Choose to install FreeNAS 9.2.1.5.
3- Choose to install on the firs visible drive (ada0).
4- Proceed to follow standards steps during installation.
5- Reboot Server/PC by having the installation media on CD tray.
6- Choose SHELL option.
7- Make dir /tmp/disk0.
8- Make mirror for OS using disks ada0 and ada2:
# sysctl kern.geom.debugflags=16
# gmirror label -v -b round-robin osraid1 /dev/ada0
# gmirror insert osraid1 /dev/ada2
WAY UNTILL MIRRORS GET SYNCRONIZED.....
--Verify sync, by exec command: #gmirror status
9- Mount root partition on /tmp/disk0, this way: # mount -rw /dev/FreeNASs1a /tmp/disk0.
10- Change path to /tmp/disk0, this way: # cd /tmp/disk0
11- copy etc/fstab to etc/fstab-ori:
Original fstab:
/dev/ufs/FreeNASs1a / ufs ro 1 1
/dev/ufs/FreeNASs3 /cfg ufs rw, noauto 2 2
/dev/ufs/FreeNASs4 /data ufs rw, noatime 2 2
Modified etc/fstab:
/dev/ufs/osraid1s1a / ufs ro 1 1
/dev/ufs/osraid1s3 /cfg ufs rw, noauto 2 2
/dev/ufs/osraid1s4 /data ufs rw, noatime 2 2
12- Add to the following files:
/boot/loader.conf:
#Ensure that the gmirror module get loaded on boot
geom_mirror_load="YES"
/etc/periodic.conf
#Daily status reporting
daily_status_gmirror_enable="YES"
13- Remove CD from tray and boot-up PC/server and test, test and more test.
Now you should be able to run FreeNAS by having BOOT disk mirrored.
====Troubleshooting=====
A- To remove a failed disk from mirror, ex:
# gmirror remove osraid1 ada0
B- To insert a new disk to mirror, ex:
# gmirror insert osraid1 /dev/adaN
C- To tell mirror to forget any not present disk and add a new one:
# gmirror forget osraid1
# gmirror insert osraid1 /dev/adaN
D- To tell mirror to forget a disk that seems failed and relocate it:
# gmirror forget osraid1
# gmirror remove osraid1 adaN
# gmirror insert osraid1 /dev/adaN
Perhaps there are other ways to do it better, but the explanation above solved my needs, if you all have better way to do it, please share it.