FreeNAS 9.2.1.5 RAID1 boot

Status
Not open for further replies.

axae

Cadet
Joined
Jun 4, 2014
Messages
3
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.
 

solarisguy

Guru
Joined
Apr 4, 2014
Messages
1,125
Congratulation! No wonder there wasn't documentation about it... It looks fairly complex, and I would not it recommend to those who are not familiar with FreeBSD (Unix) system administration.

Could you please tell me, whether you had tried the mirror solution with two USB memory devices, as opposed with two (solid state) drives? Most PC cases severely limit the number of disks, but USB ports are plenty.
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
Two things:

1. UFS support has already been removed in the master branch of FreeNAS. This means you will not be able to upgrade FreeNAS to the 9.2.2 branch when it hits. You'll get bug fix releases for 9.2.1.x which probably has one more version. After that you won't be able to upgrade. This means you will be susceptible to security bugs found in the future, so you should consider switching to ZFS or going with a different OS now to prevent this eventuality in the future.

2. As a result of #1 above we will probably delete this guide because this method is probably not going to be used by many as it basically means the first version they use will also be their last version.
 

Ericloewe

Server Wrangler
Moderator
Joined
Feb 15, 2014
Messages
20,176
Alternative ideal-world solution that's much simpler and guaranteed to work until major changes are made to the FreeNAS installation process (that is, if FreeNAS didn't go crazy with this procedure, for mysterious reasons):

  1. Configure FreeNAS normally, to the desired extent.
  2. Shutdown FreeNAS and remove boot drive.
  3. Clone boot drive to second pen drive or store its image (not on the server, that'd be a dumb thing to do).
  4. Replace boot drive and turn on FreeNAS.

    Repeat steps 2-4 after updates or major config changes.
  5. Profit.
(No, it doesn't work for some reason)
-----

Edited to point out that it doesn't work.
 

axae

Cadet
Joined
Jun 4, 2014
Messages
3
Two things:

1. UFS support has already been removed in the master branch of FreeNAS. This means you will not be able to upgrade FreeNAS to the 9.2.2 branch when it hits. You'll get bug fix releases for 9.2.1.x which probably has one more version. After that you won't be able to upgrade. This means you will be susceptible to security bugs found in the future, so you should consider switching to ZFS or going with a different OS now to prevent this eventuality in the future.

2. As a result of #1 above we will probably delete this guide because this method is probably not going to be used by many as it basically means the first version they use will also be their last version.

The reason to post this fairly guide is to help others and contribute to the forum, it should be kept for other administrators that will keep versions older than 9.2.2 and are trying to implement boot mirror.

As I know UFS does not use to much RAM compared to ZFS, so those admins that have PCs/Servers with less than 4GB RAM will see this guide a good tool.

For versión 9.2.2 once it comes up stable, I'll try to post another guide but in this case using USB drives and using ZFS.
 

solarisguy

Guru
Joined
Apr 4, 2014
Messages
1,125
@Ericloewe, that is very fine and it should be in recommended procedures. However, unlike a mirror it does not provide continuity of service.
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
Alternative solution that's much simpler and guaranteed to work until major changes are made to the FreeNAS installation process:

...
Clone boot drive to second pen drive or store its image (not on the server, that'd be a dumb thing to do).
...

You shouldn't be cloning your FreeNAS install. It usually doesn't work, as I found out first hand after a week of desperate attempts 2 years ago. Haha.

You should be backing up your config file because that's what *really* matters.

@axae,

Well, that brings a new dillema to the table because we are pretty adamant about pushing out updates for security fixes. Choosing to willingly use an old version is just asking for trouble. If you showed up and said "I'm using 8.3.0 and have problem ABC" we'll tell you to upgrade before talking to us further. That's just the plain and simple truth. The problem is that when 9.2.2 comes out there will be no need to maintain UFS support related threads and guides and if we keep them around people will assume they are up to date and must work and complain when they won't.

I hate deleting guides that are well written because it's like giving the writer the middle finger too. "Thanks for your time, now bite off" is not a polite way to treat a forum member that took the time to post.
 

solarisguy

Guru
Joined
Apr 4, 2014
Messages
1,125

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
No, cloning doesn't work. Nobody really understand why. Because cloning doesn't work is precisely why the config file is so precious(and why it's so important for you to back it up!).

Also I wouldn't be buying that brand. That's not exactly a "name brand" in my book.
 

Ericloewe

Server Wrangler
Moderator
Joined
Feb 15, 2014
Messages
20,176
No, cloning doesn't work. Nobody really understand why.

I'll add that to my list of "Things that have no real reason to wreck FreeNAS but still do."
 
L

L

Guest
If it is ufs, won't dd work the same way? You just want a block level replication correct?
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
dd *should* work. just like you basically do a dd image to the USB stick to install FreeNAS. Nobody knows why it doesn't work, we just know it doesn't. One of my first threads in this forum was something like "spent 10 hours trying to duplicate this damn USB stick and it won't work.. why?" and the answer was "because you are an idiot and didn't RTFM and look at the FAQ". Both the manual and FAQ say not to try to duplicate the image.
 
L

L

Guest
I am sorry but I am not going to read a 280 page manual. I will try dd first. I understand now what the ars article was talking about.
 

solarisguy

Guru
Joined
Apr 4, 2014
Messages
1,125
Linda, I think we are dealing here with some misunderstanding.

Nobody would dispute the raw power of dd, however this is only one side of the story.

It appears to me that failures are due to the factors, that are sometimes difficult to avoid. The ones I know about are:
  • USB memory devices of different sizes (despite the model numbers being identical);
  • not copying the entire memory (not that there is any useful information beyond 2GiB, but on the copy there might be information beyond 2GiB mark that needs to be overwritten);
    • corollary to the above two: if writing to a larger device, zero it first;
  • making changes to the FreeNAS configuration, after a clone is already made.
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
I am sorry but I am not going to read a 280 page manual. I will try dd first. I understand now what the ars article was talking about.

Keep in mind if you make a post or two that make it obvious you don't try to feed yourself before expecting us to feed you you'll quickly find those "in the know" won't be answering your questions anymore.
 

gpsguy

Active Member
Joined
Jan 22, 2012
Messages
4,472
Perhaps you forgot who the trainer is for iXsystems Professional Training courses.

Intro to FreeNAS and ZFS
Taught by the reputable ZFS Educator Linda Kateley

Keep in mind if you make a post or two that make it obvious you don't try to feed yourself before expecting us to feed you you'll quickly find those "in the know" won't be answering your questions anymore.
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
Oh, that is irony to the maximum right there! Hi Linda! /wave
 
L

L

Guest
Sorry, feeling hurt, thought you were calling me an idiot :) Also want the classes to be an alternative to reading a 280 page manual.. When a person is a new user, 280 pages can be daunting...

So I actually am quite disturbed with the idea of not being able to mirror root. There has to be a way.. or at least an alternative. If nothing else need to have a fresh install with config uploaded onto another drive and force boot order, poor man's mirror.

I am also working on the content for Fault analysis workshop.. so will be poking around forums to find good problems to solve. If you know of anymore like this.. please let me know. linda@kateley.com
 

aufalien

Patron
Joined
Jul 25, 2013
Messages
374
I thought I'd post my take on this as I feel the subject is mute.

While I can't really replicate a USB going bad, I did unplug it and my server stayed up and continued to service the 300+ clients or so. I left this for several hours w/o issue.

I did this many moons ago before putting it into production as I wanted to be prepared for several scenarios.

I do have my configs backed up both locally on the system dataset as well as remotely which is very easy to do.

If your USB goes bad, simply wait for a an opportunity to reboot your server with a fresh USB, then re apply your config.

Now if you did not backup your config, you really shouldn't be building servers. And in terms of not wanting to read a manual, that's just plain silly. I've always found it a richer experience to read the manuals, attend seminars and attain certifications if applicable.

One builds a server and one has to act responsibly as its not like managing your iPhone.

This is an "appliance on a stick" and shouldn't be treated as a full blown OS, its not meant to be. If you want a traditional OS to apply traditional approaches, simply use a full blown traditional distro.

So in closing, mirroring the USB is irrelevant and I really hope the devs don't waste any time on this. There are other more pressing issues to deal with.
 

Arwen

MVP
Joined
May 17, 2014
Messages
3,600
About cloning the USB, (or other boot device, like SATA DOM in the FreeNAS Mini).

One thought that occured to me was that the WWN, (or what ever SATA calls the World Wide Number), would change with
the new USB device. I know that certain OSes require the WWN as part of the disk pathing, (specifically Solaris 10 and later,
in certain situations, like Solaris' builtin multi-pathing software). Just because FreeBSD / FreeNAS use generic device naming,
(like "/dev/ada1"?), does not mean that the disk device does not have an associated WWN for it that the OS expects.

So, as an alternative to this boot drive cloning:
1 - When installing or upgrading, make 2 USB flash drives or SATA DOMs of the original distribution.
2 - Install only 1 USB flash drive / SATA DOM
3 - Configure or restore configuration
4 - Copy configuration off box

If the installed USB flash drive / SATA DOM dies:
1 - Get your second USB flash drive / SATA DOM
2 - Copy it before you use it, (if you did not keep a copy of the original download)
3 - Install
4 - Restore configuration

Disclosure:
While I am a computer professional, (been in the business a LONG time, as my gray hairs will
attest :), I am very new to FreeNAS, and have yet to install my first. Basically still doing research.
 
Status
Not open for further replies.
Top