Small Home Server : ZFS ? / Recovery options

Status
Not open for further replies.

kbarb

Dabbler
Joined
Feb 11, 2012
Messages
15
Small Home Server : use ZFS ? / Recovery options

1. First, I have question about whether to use ZFS or UFS on a single drive.

Sorry, I know this has prob. been asked a million times but I still couldn't understand the implications enough to make a decision.
I've read a lot of the ZFS docs and think I have filled in most of the known unknowns, now I'm just wondering about the unknown unknowns, as someone once said.

I've built a little home server to be used as a File server - basically all my docs and some video & audio files.
I wanted to make a low cost, low power server w/ one drive (poss. another one later), and back it up to a second drive - I hadn't thought about doing any kind of RAID in the beginning. I think I have very minimal requirements.

I have on the server box :
-- Atom230 cpu (1.6GHz, 64bit) + 4GB ram
-- 1/ 500GB Drv for Files (poss. another drv later for multimedia)
-- 1/ 1T Drv for Backup (using Rsync)

It seems to me that the real benefit from ZFS comes form Raidz1, which of course I can't do with my drives.
Maybe later, but drives are kind of expensive now after the Thailand flooding disaster.

So is there an advantage to having my single drives formatted as ZFS, vs UFS ?
I guess I get some data integrity but not the redundancy from Raidz1.
ZFS really seems like the next great thing, but you know, there's a bit of a learning curve with the adding, removing, replacing, etc.. I'm up for it though, if it's the right way to go.

2. Disaster Recovery question

Using ZFS . . . lets say I have a major hardware/mobo failure. I can't just pull the drives out and attach them to another computer because of the ZFS, right ?
So for quick access would the best plan be to have a virtual machine of Freenas on my workstation, which would then be able to import the drives and read them ?

Thanks a lot for any ideas.
 

xbmcg

Explorer
Joined
Feb 6, 2012
Messages
79
Welcome here!

I will try to sort it out a little. What is your main goal about using a self-built NAS?
Out there are cheep NAS you can buy, if you just want a basic network storage with no security.
You could plug in your backup drive in your PC and backup the files from time to time or automatically there (xcopy, rsync)

Let's talk about the purpose / advantages of freenas and other nas projects based on zfs.

1)
zfs is a transactional filesystem -

this means, before data is written to the disk, the data is written to a transaction log, then it goes to the disk and after success the log is cleared...
As you can see, there is some overhead compared to non - journaling fs like fat32, however NTFS, ext4, ufs and most high-end FS are journaling systems too

2.) zfs adds parity checks to each data sector in the chain
while this is another overhead, data integrity can be guaranteed, rotten bits are recognized and can be fixed automatically to a certain extent.

3.) zfs means zetabyte file system - there are almost no limits one can reach in terms of volume size / data size - in contrast to all other systems.

4.) zpools based on zfs implement their own flavour of RAID - there are
- striping (RAID 0), mainly for performance gain,
- Mirroring (RAID 1) even with multiple copies, tollerates errors of n-1 disks on a n-disk setup
- Striping with parity (RAID 5) = raidz - tolerates one failed disk per raidz pool
- Striping with double parity (RAID 6) = raidz2 tollerates 2 disks failures per pool
- Striping with tripple parity = raidz3, tollerates 3 disk failures per pool

- combination of them eg: raid10, raid 50, raid60, ...where two pools are striped

- supports multiple copies of a file to be kept in case of surface errors
- supports disk encryption, data compression, deduplication
- supports snapshots / shadow copies - so you can rollback to previous versions back in time
- supports fast recovery / integrity check / resilvering in contrast to standard raid
- supports volume management (disk pools, virtual devices, iSCSI Volumes, ...)

As you can see, this are high-end features to secure sensible data against data corruption, data loss.

The smallest setup, that would make sense, is probably a RAID1 mirror - if you want data integrity and recoverability.

If you don't care about those stuff, you could be better off with a common file system like ufs, ntfs, ext3 / ext4
and a linux or windows box. - the advantage is, you can just read the drives everywhere.

Disaster recovery:
==============

we need to define, what a disaster is:

if your server hardware crashes, plug the drives to another machine and the usb boot stick and boot up your new nas.
if your disk crashes (you have only one) - use your backup - there is almost no chance to recover the data.
if your bootstick breaks, create a new one and upload the config backup, or import the zpools and configure the nas from scratch
you can prepare a "backup" bootstick - if you want - just in case...

yes, you can run the freenas in a vm, giving access to the physical drive - in most cases you may need a separate scsi or sata controller (read the posts)

you can also run a completely virtual freenas in a vm environment, where all disks are virtual. however this puts a lot of overhead on the system,
especially on the disks - and you have the limitations of the vm file system. But you can try the nas and all disaster scenarios safely in a vm, before
moving all your data to a physical nas.

To make it short: you will use almost nothing of the possibilities of a zfs based nas, if you use a single disk setup, but you may have some pain to
configure all this services, like samba, ftp etc.... Especially if you mainly use windows with user permissions - you will see it is a pain to get it running,
linux / unix is a little easier, because the authentication / authorization of freeBSD is Unix / Linux.
 

bubulein

Explorer
Joined
Jun 1, 2011
Messages
62
Moin,
even on a single drive you can have huge benefits. Beside data-integrity you have the possibility to create shares with quota, so user or backups cannot eat up your entire storage. Also you can benefit from compression, for example when backing up with rsync. With the ZFS-Snapshots you can use "Previouse Versions" in your Explorer.
-Christian
 

kbarb

Dabbler
Joined
Feb 11, 2012
Messages
15
@xbmcg :
Many thanks for taking the time to lay it all out. You might have even answered some questions I didn't know I had ;-)
And thanks Christian for your comments as well.

Ok, so remember, I'm planning on using this as a File Server for a centralized file repository.

And I'm just asking about ZFS on a single data drive (or two) and a backup drive, neither of which are the same size.
I think when the price of drives comes back down a bit I'd probably opt for a ZFS RAID1 mirrored system, as you recommend as the minimum.
But I'm just trying to figure out what to do for the interim, which could be a while possibly.

After I went over your comments I found also a really interesting post by Constantin Gonzalez, a consultant at Oracle :
Home Server: RAID-GREED and Why Mirroring is Still Best
http://constantin.glez.de/blog/2010/01/home-server-raid-greed-and-why-mirroring-still-best

Pretty good read - he likes mirroring.

Anyway, I had set up the system but never have finished the project. For Freenas7 I had the 1T drv formatted UFS, then switched to Freenas8 and formatted the 500GTB drv to ZFS (and was getting ready to reformat the 1T.) Then I realized it's not just a matter of acronyms but ZFS is a whole new world I'd have to become familiar with. I didn't find the Services or Shares too difficult, but I haven't tried Datasets yet.

About the recovery question . . .

So let's say I only have one other workstation, for the sake of argument, and on the Freenas box, the mobo dies - that's the situation I'm asking about.

What about if I make a virtual machine of FreeBSD on the workstation, then take the ZFS'd drives out and attach them.

How hard is it going to be to bring over either a single ZFS formatted drive, or even a ZFS RAID set.
I'm not necessarily asking for directions but is it possible and/or a big deal . . . a few commands on the CLI ?
One thing I'm thinking with that scenario is that the version of Zpool might be higher on FreeBSD, which might mean it would be difficult to bring the drives back to the repaired Freenas box, if the Zpool version on the drives gets updated.

Anyway, thanks again for your comments.

Eventually it'll be worth it all just to tell my friends I'm working on a Zetabyte file system. ;-)

Cheers,
Kent
 

xbmcg

Explorer
Joined
Feb 6, 2012
Messages
79
yep. You can run a vmware player on your pc and dedicate a whole disk to a virtual machine. So you can have a virtual 2.2G "drive" on you windows partition as a file, where you will install the freenas from stick, and an additional drive - the real zfs disk as a second drive to the very same vm. than maybe you will be able to read the zfs (by running a parallel freeNAS in the VM).

However, if you intent to use ESXi from VMWare for virtualization you definitely will need a separate controller, because this uses the whole hardware for the virtualization, you cannot dedicate part of it (a sata port) in total to one of the VM's (I have not verified this, but read a lot about similar setup issues).
 

kbarb

Dabbler
Joined
Feb 11, 2012
Messages
15
Christian - Thanks a lot. I had been looking for a live FreeBSD cd but couldn't find one.
Pc-bsd actually has a VMWare disk image for download. But I burned the DVD live image and gave it a try - looks nice.

I could get access to my UFS drive after booting, but not the ZFS drive. I mounted it w/
"zpool create tank ada0"
but still couldn't see any test files.
I know this is probably pretty elementary but I haven't had time to really study it.

Of course, a live cd isn't going to help with a faulty mobo, but the VMware image seems like it would.

Btw, what is this cXtXdX naming convention, as in "c2t1d0". Is that a Freenas thing ? - I couldn't find an explanation anywhere.

xbmcg, thanks . . . actually asking about a FreeBSD live cd though. ;-)
 

survive

Behold the Wumpus
Moderator
Joined
May 28, 2011
Messages
875
Hi kbarb,

The cXtXdX naming convention means controller-X tray-X disk-x.

It's a way of locating an exact disk on a system with multiple controllers & drive bays. It's the x,y & z coordinates of the storage world.

-Will
 

bubulein

Explorer
Joined
Jun 1, 2011
Messages
62
Moin,
I could get access to my UFS drive after booting, but not the ZFS drive. I mounted it w/
"zpool create tank ada0"
but still couldn't see any test files.
The reason is simple, the command you used wipe the drive and create a new pool named tank out of ada0. To make it short - Recover your backups - I'm sure you have one.

The correct command would be
"zpool import tank"

FreeBSD Live-CD/USB can be found on the FreeBSD FTP
ftp://ftp.freebsd.org/pub/FreeBSD/ISO-IMAGES-amd64/8.2/

the memstick is for the USB and contain a livefs too

-Christian
 

kbarb

Dabbler
Joined
Feb 11, 2012
Messages
15
Moin,

The reason is simple, the command you used wipe the drive and create a new pool named tank out of ada0.

-Christian

Lol.
I only put a two word text file on there - that's the only file on the drive - I'm just experimenting to see how it works - good thing it wasn't a production drive.
But actually it didn't delete it for some reason.

I did make another similar text file while the drive was mounted under PC-bsd, and it was gone when I started up Freenas again. Mysterious.

Anyway, I'll try it again with "zpool import tank".

At this point, from what little I know, I'm not sure how much of all the zpool "structural" information (that it's part of a pool, RAIDz, whatever) is on the drive, and how much is only known and kept by the OS, separate from the drive.
So it's a bit of a mystery to me what any Freebsd system will know when I mount or import a drive. (Probably not using the right terminology.)
In other words, does the drive just have a bunch of data on it, or does it have some structural information on it to tell any OS that it was part of some pool arrangement.

I'll have to do some more reading - it's kind of black box stuff when you're new at it, just typing in commands.

Thanks for the help though.
-Kent
 

xbmcg

Explorer
Joined
Feb 6, 2012
Messages
79
Hi, you have to ensure you use the same version of zfs, zfs is not compatible downwards.

this means, if you create a zpool in fn8.0.3 (v15) it would be readable on freeBSD, if it supports v15...28.
If you create a v28 zpool in freeBSD, you CANNOT read it in freeNAS 8.0.3 (only v15.), but you may have
a chance with freeNAS 0.7.5 alpha (also v28) or openindiana / open solaris.
 
Status
Not open for further replies.
Top