From owner-freebsd-questions@FreeBSD.ORG Tue Feb 7 18:34:55 2012 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C16F81065670 for ; Tue, 7 Feb 2012 18:34:55 +0000 (UTC) (envelope-from modulok@gmail.com) Received: from mail-qy0-f182.google.com (mail-qy0-f182.google.com [209.85.216.182]) by mx1.freebsd.org (Postfix) with ESMTP id 7F5B08FC0A for ; Tue, 7 Feb 2012 18:34:54 +0000 (UTC) Received: by qcmt40 with SMTP id t40so5871363qcm.13 for ; Tue, 07 Feb 2012 10:34:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=xeeFUc/TDOKmLDFhMLU1HQ5efBBxd0C0/NO50VsjRcQ=; b=f/tesEWjQGpHZbP60tYteKsgmDoWACFMJb0nasCL9g/6PhYIlq9emCMvBiiBx6C58O BV/L/ob2mACkqbPaws+5Xb1A1tKZY7GpcbWOtPutg+4g/WqzTNFiyWnfIYY2v4DqfeYn 8Y7fdOktF/1/Sp3xW8mJ4JvZpub1+GRHvRkVc= MIME-Version: 1.0 Received: by 10.229.78.165 with SMTP id l37mr9856793qck.142.1328639693915; Tue, 07 Feb 2012 10:34:53 -0800 (PST) Received: by 10.229.8.12 with HTTP; Tue, 7 Feb 2012 10:34:53 -0800 (PST) In-Reply-To: <4F315A0A.9020101@paz.bz> References: <4F315A0A.9020101@paz.bz> Date: Tue, 7 Feb 2012 11:34:53 -0700 Message-ID: From: Modulok To: Jim Pazarena Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-questions@freebsd.org Subject: Re: software raid X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 18:34:55 -0000 > Does FreeBSD support any type of software raid? > I have an old rack mount server which has 8 bays, but all SATA, > and NO raid. Sure would be nice to have a software raid > to create a NAS device. Yes! An example of setting up a 3 disk raidz might look like this: zpool create myfancyraid raidz ad4 ad6 ad8 zfs create myfancyraid/foo zfs set mountpoint=/usr/foo myfancyraid/foo zfs mount -a cd /usr/foo echo "hello world" > hello.txt Yay! Then edit /etc/rc.conf to enable zfs at boot time: echo 'zfs_enable="YES"' >> /etc/rc.conf How's my raid doing today? Cake: zpool status zfs list You can even mix and match raid and encryption. Below, I put a raidz on top a geli encryption layer on three devices. (There are other ways to do this too.) When it comes time to decommission disks, there's no company data leaks (depending on your needs): # Create the geli: geli init -b -e AES -l 256 /dev/ad4 geli init -b -e AES -l 256 /dev/ad6 geli init -b -e AES -l 256 /dev/ad8 # Attach it or reboot: geli attach ad4 geli attach ad6 geli attach ad8 # Make the zpool and Z file system: zpool create myfancyraid raidz ad4.eli ad6.eli ad8.eli zfs create myfancyraid/foo zfs set mountpoint=/usr/foo myfancyraid/foo zfs mount -a Then edit /boot/loader.conf to load geli at boot time:: echo 'geom_eli_load="YES"' >> /boot/loader.conf Finally, add the bit about ZFS to /etc/rc.conf:: echo 'zfs_enable="YES"' >> /etc/rc.conf You'll be asked for the password to each provider (disk) at boot time before the system enters multi-user mode. Make sure you have console access and a backup copy of the password somewhere! A word on graid3: For a multi-user file server, serving lots of small requests, graid3 is about the worst performance you can get due to its raid3 nature. Requests have to be served sequentially, using all disks in the array. Slow in my experience. Good luck! -Modulok-