Project

General

Profile

Support #319

Setting Up a RAIDZ2 File Server With Snapshots on FreeNAS

Added by Daniel Curtis over 6 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Network Attached Storage
Target version:
Start date:
01/21/2014
Due date:
% Done:

100%

Estimated time:
4.00 h
Spent time:

Description

After installing a baseline FreeNAS installation, the spare drives must be configured. This tutorial will cover using 4x hard disks to create a RAIDZ2, which is the ZFS equivalent to RAID6 with 2 parity disks. This will allow for 2 drive to fail simultaneously while retaining data integrity.

Create RAIDZ2 Volume

RAIDZ2: double-parity ZFS software solution that is similar to RAID-6. It also avoids the write-hole and does not require any special hardware, meaning it can be used on commodity disks. RAIDZ2 allows you to lose one drive without any degradation as it basically becomes a RAIDZ1 until you replace the failed drive and restripe. At this time, RAIDZ2 on FreeBSD is slower than RAIDZ1.

Once logged into the FreeNAS admin panel go to Storage -> Volumes -> ZFS Volume Manager. Now give the volume a name, this example uses the name corefiles. Then in the Volume Layout, drag the slider to add the 4 storage hard disks; the Volume Layout will automagically choose the optimal layout for using 4 disks, which is RAIDZ2. This can be overridden, however that is beyond the scope of this guide. Once the configuration is finished, click Add Volume. This will create the mount point /mnt/corefiles on FreeNAS, this is where the file server will be service files from.

Create Windows File Server

Currently, Windows CIFS file sharing protocol is the dominant (albeit inferior to NFS over SSH) file serving protocol.

Once logged into the FreeNAS admin panel go to Sharing -> Windows (CIFS) Shares -> Add Windows (CIFS) Share. This guide will use the following settings:
  • Name: corefiles
  • Comment: Windows Core File Server
  • Path: /mnt/corefiles
  • Browsable to Network Clients: [X]

When the configuration is completed, click Ok. When asked "Would you like to enable this service?", click Yes.

Create Periodic Snapshot

One of the many awesome features of ZFS is periodic snapshots. This feature provides a clever way of keeping a history of files, should you need to recover an older copy or even a deleted file.

Once logged into the FreeNAS admin panel go to Storage -> Periodic Snapshot Tasks -> Add Periodic Snapshot. This guide uses the following configuration:
  • Volume/Dataset: corefiles
  • Lifetime: 2 Year(s)
  • Interval: 15 Minutes

At this point a Windows File Server has been setup, with periodic snapshots every 15 minutes for 2 years and RAIDZ2 level fault tolerance. This can all done on commodity hardware, no special RAID controller needed.

Resources

http://doc.freenas.org/index.php/Volumes#ZFS_Volume_Manager
http://doc.freenas.org/index.php/Windows_(CIFS)_Shares
http://doc.freenas.org/index.php/Periodic_Snapshot_Tasks
http://doc.freenas.org/index.php/Hardware_Requirements#RAID_Overview
http://forums.freenas.org/threads/what-is-the-best-raidz-configuration-and-how-to-set-it-up.312/
http://forums.freenas.org/threads/should-i-raid-z1-or-raid-z2.221/

History

#1 Updated by Daniel Curtis over 6 years ago

  • Status changed from Feedback to Closed
  • % Done changed from 90 to 100

#2 Updated by Daniel Curtis over 5 years ago

  • Target version set to 5

#3 Updated by Daniel Curtis over 5 years ago

  • Category set to Network Attached Storage
  • Target version changed from 5 to FreeNAS 9.x

Also available in: Atom PDF