Saturday, March 14, 2009

FreeNAS 0.7 Torrents

There is a problem with the nightly builds of FreeNAS 0.7 (see FreeNAS-Forum). I've uploaded some torrents to TBP (see here).

Please help to seed...

If you have some other versions of 0.7 please let me know (harryd71@users.sourceforge.net)

Friday, February 27, 2009

How to resize ZFS - Part 2 (the real world)

As you can read here How to resize ZFS, it is possible to resize a zpool if you replace each disk of the pool with a bigger one. In my first post I used a virtual machine to test this. And... I've replaced one disk (eg. da0) with a different device (eg. da4).
In the real world I would like to replace one device with the same (but bigger one). I was able to get some very old SCSI Disks in an external SCSI enclosure. These disks are perfect for testing this...

Here we go...

My testsystem is a Sempron 2600+ with 1 GB RAM and several SCSI Disks connected via a DAWICONTROL DC-2976 UW controller. The FreeNAS Version I've used for this test is 0.7 Sardaukar (revision 4390)

I've created a testpool with three 2.1 GB SCSI-Disks (yes, it's true, just 2.1 GB ;-) ). And I've also created two filesystems (testfs1, compressed & testfs2), and some testfiles.

crusher:~# zpool list testpool0
NAME SIZE USED AVAIL CAP HEALTH ALTROOT
testpool0 5.91G 2.81G 3.09G 47% ONLINE -

As you can see, this pool has a size of 5.91 GB (remember this)

crusher:~# zfs list
NAME USED AVAIL REFER MOUNTPOINT
bigpool 100M 364G 25.3K /mnt/bigpool
bigpool/temp 100M 364G 100M /mnt/bigpool/temp
testpool0 1.87G 2.00G 28.0K /mnt/testpool0
testpool0/testfs1 640M 2.00G 640M /mnt/testpool0/testfs1
testpool0/testfs2 1.25G 2.00G 1.25G /mnt/testpool0/testfs2

crusher:~# zpool status testpool0
pool: testpool0
state: ONLINE
scrub: none requested
config:

NAME STATE READ WRITE CKSUM
testpool0 ONLINE 0 0 0
raidz1 ONLINE 0 0 0
da0 ONLINE 0 0 0
da1 ONLINE 0 0 0
da2 ONLINE 0 0 0

errors: No known data errors

First, I'd like to start with a scrub to be sure that the data is safe on these disks...

crusher:~# zpool scrub testpool

This will take a while. Check the status with:

crusher:~# zpool status testpool0
pool: testpool0
state: ONLINE
scrub: scrub in progress, 93.34% done, 0h0m to go
config:

NAME STATE READ WRITE CKSUM
testpool0 ONLINE 0 0 0
raidz1 ONLINE 0 0 0
da0 ONLINE 0 0 0
da1 ONLINE 0 0 0
da2 ONLINE 0 0 0

errors: No known data errors

crusher:~# zpool status testpool0
pool: testpool0
state: ONLINE
scrub: scrub completed with 0 errors on Fri Feb 27 21:40:16 2009
config:

NAME STATE READ WRITE CKSUM
testpool0 ONLINE 0 0 0
raidz1 ONLINE 0 0 0
da0 ONLINE 0 0 0
da1 ONLINE 0 0 0
da2 ONLINE 0 0 0

errors: No known data errors

Everything looks perfect... so lets start with the replace. This SCSI enclosure supports Hot-Swapping of the disks (more or less).

Ok, lets replace the first disk (da0)

Offline the first disk

crusher:~# zpool offline testpool0 da0
Bringing device da0 offline
crusher:~# zpool status testpool0
pool: testpool0
state: DEGRADED
status: One or more devices has been taken offline by the administrator.
Sufficient replicas exist for the pool to continue functioning in a
degraded state.
action: Online the device using 'zpool online' or replace the device with
'zpool replace'.
scrub: scrub completed with 0 errors on Fri Feb 27 21:40:16 2009
config:

NAME STATE READ WRITE CKSUM
testpool0 DEGRADED 0 0 0
raidz1 DEGRADED 0 0 0
da0 OFFLINE 0 0 0
da1 ONLINE 0 0 0
da2 ONLINE 0 0 0

errors: No known data errors

Replace the first disk (da0)

First physicaly ;-)

And then do the replace command

crusher:~# zpool replace testpool0 da0
crusher:~# zpool status testpool0
pool: testpool0
state: DEGRADED
status: One or more devices is currently being resilvered. The pool will
continue to function, possibly in a degraded state.
action: Wait for the resilver to complete.
scrub: resilver in progress, 14.79% done, 0h2m to go
config:

NAME STATE READ WRITE CKSUM
testpool0 DEGRADED 0 0 0
raidz1 DEGRADED 0 0 0
replacing DEGRADED 0 0 0
da0/old OFFLINE 0 0 0
da0 ONLINE 0 0 0
da1 ONLINE 0 0 0
da2 ONLINE 0 0 0

errors: No known data errors

After a while, the resivering has finished

crusher:~# zpool status testpool
pool: testpool
state: ONLINE
scrub: resilver completed with 0 errors on Fri Feb 27 20:05:52 2009
config:

NAME STATE READ WRITE CKSUM
testpool ONLINE 0 0 0
raidz1 ONLINE 0 0 0
da0 ONLINE 0 0 0
da1 ONLINE 0 0 0
da2 ONLINE 0 0 0

errors: No known data errors

Lets replace the second and third disk...

crusher:~# zpool status testpool0
pool: testpool0
state: ONLINE
scrub: scrub completed with 0 errors on Fri Feb 27 22:57:19 2009
config:

NAME STATE READ WRITE CKSUM
testpool0 ONLINE 0 0 0
raidz1 ONLINE 0 0 0
da0 ONLINE 0 0 0
da1 ONLINE 0 0 0
da2 ONLINE 0 0 0

errors: No known data errors

crusher:~# zpool list
NAME SIZE USED AVAIL CAP HEALTH ALTROOT
bigpool 556G 150M 556G 0% ONLINE -
testpool0 5.91G 2.82G 3.09G 47% ONLINE -

crusher:~# zfs list
NAME USED AVAIL REFER MOUNTPOINT
bigpool 100M 364G 25.3K /mnt/bigpool
bigpool/temp 100M 364G 100M /mnt/bigpool/temp
testpool0 1.87G 2.00G 28.0K /mnt/testpool0
testpool0/testfs1 640M 2.00G 640M /mnt/testpool0/testfs1
testpool0/testfs2 1.25G 2.00G 1.25G /mnt/testpool0/testfs2

As you can see the size of the testpool hasn't changed. After exporting and importing the pool, the additional space is available!

crusher:~# zpool export testpool0
crusher:~# zpool import testpool0
crusher:~# zpool list
NAME SIZE USED AVAIL CAP HEALTH ALTROOT
bigpool 556G 150M 556G 0% ONLINE -
testpool0 12.0G 2.82G 9.15G 23% ONLINE -

The size has been changed to 12.0 GB...

Tuesday, January 13, 2009

FreeNAS 0.7 (rev. 3953) and ZFS - Update 2

In my previous post, I've written that the workaround for FreeNAS 0.7 rev. 3953 works, but after a reboot, the zpool is gone and has to be imported by hand (zpool import -f ...)
Stefan left a comment that his full installation works perfect...

I can confirm this! With a full installation and the workaround, the pool is available after a reboot... It's getting better :-)


Monday, January 12, 2009

Blank smbpasswd - FreeNAS


While I'm hitting this issue (again :-) ), so I want to document this here...

My problem was that I had a blank smbpasswd. Even when I added the passwd manually with 'smbpasswd'. After a reboot, the password settings in /var/etc/private/smbpasswd are gone.
With debugging /etc/rc.d/smbpasswd (with set -x) I've found a variable called 'smbpasswd_minuid=1001'. My UID's are bellow 1001 (I'm using the same as on my Mac).
So after some search, I've seen that this feature (Enable customizing of minimum UID for smbpasswd via rc.conf variable 'smbpasswd_minuid'.) was implemented with Build 3177.

It is easy to set this variable in -> System -> Advanced -> rc.conf

Variable = smbpasswd_minuid  ; Value = 500


After applying this, it is possible to run /etc/rc.d/smbpasswd. The users and the encrypted passwords are stored in /var/etc/private/smbpasswd.

Sunday, January 11, 2009

FreeNAS 0.7 (rev. 3953) and ZFS - Update

As I've written here, ZFS is not working with the latest available build (i386, 3953) of FreeNAS 0.7.

There is a workaround described in the forum (Re: ZFS issues? kernel: KLD zfs.ko: depends on opensolaris-not a)
I've tested this workaround, and it works... until the reboot :-(

After the reboot the zpool is gone and you have to import it again, or export it 'before' you want to reboot your NAS.

I'm really looking forward for a new build...

Thursday, December 18, 2008

Backup FreeNAS using rsync to a rsync-server

It is a little bit difficult to find out how to backup data from a FreeNAS-Server to a different rsync-server. In my case I have a QNAP TS-209 configured as a rsync-server. To this NAS device, I want to backup my data once a day.

The trick is to use the LOCAL rsync configuration of FreeNAS. The rsync-server is here called 'soulcube'. 


I've configured four backup jobs. Here is the example of my photo share.


Source share - the_directory_you_want_to_backup
Destination share - servername::rsync_share

Tuesday, December 9, 2008

FreeNAS 0.7 (rev. 3953) and ZFS

I've tried to use with the latest Nightly Buid of FreeNAS 0.7 (rev. 3953) ZFS. Unfortunately I was not able to import my ZFS-Pool.

The error message just showed the following...

kernel: KLD zfs.ko: depends on opensolaris - not available

Currently there is no solution for this problem :-(