Reply
 
Thread Tools Display Modes
  #1  
Old 04-07-2007, 07:57 AM
antik's Avatar
antik antik is offline
Super Moderator
 
Join Date: Jul 2005
Location: Estonia
Posts: 3,610
Thanks: 0
Thanked 0 Times in 0 Posts
Default ZFS - quick start.
WARNING: This feature is available only in FreeBSD upcoming 7.0 release.

Quote:
From: Pawel Jakub Dawidek
Ok, ZFS is now in the tree, what's now? Below you'll find some
instructions how to quickly make it up and running.

First of all you need some disks. Let's assume you have three spare SCSI
disks: da0, da1, da2.

Add a line to your /etc/rc.conf to start ZFS automatically on boot:

Code:
# echo 'zfs_enable="YES"' >> /etc/r4c.conf
Load ZFS kernel module, for the first time by hand:

Code:
# kldload zfs.ko
Now, setup one pool using RAIDZ:

Code:
# zpool create tank raidz da0 da1 da2
It should automatically mount /tank/ for you.

Ok, now put /usr/ on ZFS and propose some file systems layout. *I know
you probably have some files already, so we will work on /tank/usr
directory and once we ready, we will just change the mountpoint to /usr.

Code:
# zfs create tank/usr
Create ports/ file system and enable gzip compression on it, because
most likely we will have only text files there. On the other hand, we
don't want to compress ports/distfiles/, because we keep compressed
stuff already in-there:

Code:
# zfs create tank/usr/ports
# zfs set compression=gzip tank/usr/ports
# zfs create tank/usr/ports/distfiles
# zfs set compression=off tank/usr/ports/distfiles
(You do see how your life is changing, don't you?:))

Let's create home file system, my own home/pjd/ file system. I know we
use RAIDZ, but I want to have directory where I put extremly important
stuff, you I'll define that each block has to be stored in tree copies:

Code:
# zfs create tank/usr/home
# zfs create tank/usr/home/pjd
# zfs create tank/usr/home/pjd/important
# zfs set copies=3 tank/usr/home/pjd/important
I'd like to have directory with music, etc. that I NFS share. I don't
really care about this stuff and my computer is not very fast, so I'll
just turn off checksumming (this is only for example purposes! please,
benchmark before doing it, because it's most likely not worth it!):

Code:
# zfs create tank/music
# zfs set checksum=off tank/music
# zfs set sharenfs=on tank/music
Oh, I almost forget. Who cares about access time updates?

Code:
# zfs set atime=off tank
Yes, we set it only on tank and it will be automatically inherited by
others.

Will be also good to be informed if everything is fine with our pool:

Code:
# echo 'daily_status_zfs_enable="YES"' >> /etc/periodic.conf
For some reason you still need UFS file system, for example you use ACLs
or extended attributes which are not yet supported by our ZFS. If so,
why not just use ZFS to provide storage? This way we gain cheap UFS
snapshots, UFS clones, etc. by simply using ZVOLs.

Code:
# zfs create -V 10g tank/ufs
# newfs /dev/zvol/tank/ufs
# mount /dev/zvol/tank/ufs /ufs

# zfs snapshot tank/ufs@20070406
# mount -r /dev/zvol/tank/ufs@20070406 /ufs20070406

# zfs clone tank/ufs@20070406 tank/ufsok
# fsck_ffs -p /dev/zvol/tank/ufsok
# mount /dev/zvol/tank/ufsok /ufsok
Want to encrypt your swap and still use ZFS? Nothing more trivial:

Code:
# zfs create -V 4g tank/swap
# geli onetime -s 4096 /dev/zvol/tank/swap
# swapon /dev/zvol/tank/swap.eli
Trying to do something risky with your home? Snapshot it first!

Code:
# zfs snapshot tank/home/pjd@justincase
Turns out it was more stupid than risky? Rollback your snapshot!

Code:
# zfs rollback tank/home/pjd@justincase
# zfs destroy tank/home/pjd@justincase
Ok, everything works, we may set tank/usr as our real /usr:

Code:
# zfs set mountpoint=/usr tank/usr
Don't forget to read zfs(8) and zpool(8) manual pages and SUN's ZFS
administration guide:

http://www.opensolaris.org/os/commun...s/zfsadmin.pdf
__________________
"All parts should go together without forcing. Therefore, if you can't get them together again, there must be a reason. By all means, do not use a hammer." -- IBM maintenance manual, 1975
Reply With Quote
  #2  
Old 04-07-2007, 08:38 AM
nowax nowax is offline
Senior Member
 
Join Date: Jan 2006
Location: Poland
Posts: 275
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to nowax
Default
Nice. Antik have you tried this operation already? If yes, is everything is ok so far ?
Reply With Quote
  #3  
Old 04-07-2007, 09:42 AM
antik's Avatar
antik antik is offline
Super Moderator
 
Join Date: Jul 2005
Location: Estonia
Posts: 3,610
Thanks: 0
Thanked 0 Times in 0 Posts
Default
Originally Posted by nowax
Nice. Antik have you tried this operation already? If yes, is everything is ok so far ?
I tried earlier version of ZFS- upgrading now to latest one.
__________________
"All parts should go together without forcing. Therefore, if you can't get them together again, there must be a reason. By all means, do not use a hammer." -- IBM maintenance manual, 1975
Reply With Quote
  #4  
Old 04-07-2007, 06:12 PM
TerryP TerryP is offline
Senior Member
 
Join Date: Nov 2005
Location: Ga. USofA
Posts: 7,906
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to TerryP Send a message via AIM to TerryP Send a message via Yahoo to TerryP
Default
Very interesting and I think I like the snapshot idea hehehe.

Now if only I had some spare drives :-)
Reply With Quote
  #5  
Old 06-20-2007, 06:19 PM
kingneutron kingneutron is offline
Member
 
Join Date: May 2005
Posts: 51
Thanks: 6
Thanked 0 Times in 0 Posts
Default Re: ZFS - quick start.
I downloaded the pc-bsd 1.3.01 Vmware image from:

http://www.pcbsd.org/?p=download#vmware

--It looks like it doesn't have ZFS...

--How can I upgrade this image to latest BSD and get ZFS functionality? TIA

( I'm running all this in a vmware VM BTW )

Originally Posted by antik
WARNING: This feature is available only in FreeBSD upcoming 7.0 release.

Quote:
From: Pawel Jakub Dawidek
Reply With Quote
  #6  
Old 06-20-2007, 06:34 PM
antik's Avatar
antik antik is offline
Super Moderator
 
Join Date: Jul 2005
Location: Estonia
Posts: 3,610
Thanks: 0
Thanked 0 Times in 0 Posts
Default Re: ZFS - quick start.
Originally Posted by kingneutron
I downloaded the pc-bsd 1.3.01 Vmware image from:

http://www.pcbsd.org/?p=download#vmware

--It looks like it doesn't have ZFS...

--How can I upgrade this image to latest BSD and get ZFS functionality? TIA

( I'm running all this in a vmware VM BTW )
Yes, 1.3 version is based on FreeBSD 6.1 and don't have ZFS support. If you want to upgrade then you can from source but then you have to upgrade all installed ports too. I'd recommend to install latest FreeBSD snapshot release instead:
ftp://ftp.freebsd.org/pub/FreeBSD/snapshots/200706
__________________
"All parts should go together without forcing. Therefore, if you can't get them together again, there must be a reason. By all means, do not use a hammer." -- IBM maintenance manual, 1975
Reply With Quote
  #7  
Old 06-21-2007, 02:34 AM
kingneutron kingneutron is offline
Member
 
Join Date: May 2005
Posts: 51
Thanks: 6
Thanked 0 Times in 0 Posts
Default Re: ZFS - quick start.
Well, that was an exercise in frustration. 7.0snapshot didn't want to install 'cuz it couldn't find some distributions.

Anyhow:

When I finally got ZFS up and running with (3) 5.1GB SCSI vdisks and tried filling up the ZFS partition with a huge zero-byte file, the system panic'ed:

panic: kmem_malloc(131072): kmem_map too small: 788684480 total allocated
KDB: enter: panic

--I told it to "cont" and it rebooted.

--Increased VM RAM from 256MB to 384MB -- will see how well that works.

+ Update: Before RAM increase, Zero file used 9,808,896 of 11,514,368 ; 1,705,472 available ( 85% used. )

+ Update: With RAM @ 384MB, ZFS fillup completed OK.
~11.5 GB filled up in 406.9 sec (6m47s) @~28,995,312 bytes/sec.

--That's pretty respectable in my book, considering all 3 vdisks are on a single host SATA drive running JFS.
Reply With Quote
  #8  
Old 06-21-2007, 01:06 PM
kingneutron kingneutron is offline
Member
 
Join Date: May 2005
Posts: 51
Thanks: 6
Thanked 0 Times in 0 Posts
Default Re: ZFS - quick start.
FreeBSD 7--ZFS VM now available for download...

See:
http://www.vmware.com/community/thread. ... ID=677030&

--Feel free to PC-BSD-ize it and make it your own; it is a donation to teh community.

Originally Posted by kingneutron
Well, that was an exercise in frustration. 7.0snapshot didn't want to install 'cuz it couldn't find some distributions.

Anyhow:

When I finally got ZFS up and running with (3) 5.1GB SCSI vdisks and tried filling up the ZFS partition with a huge zero-byte file, the system panic'ed:

panic: kmem_malloc(131072): kmem_map too small: 788684480 total allocated
KDB: enter: panic

--I told it to "cont" and it rebooted.

--Increased VM RAM from 256MB to 384MB -- will see how well that works.

+ Update: Before RAM increase, Zero file used 9,808,896 of 11,514,368 ; 1,705,472 available ( 85% used. )

+ Update: With RAM @ 384MB, ZFS fillup completed OK.
~11.5 GB filled up in 406.9 sec (6m47s) @~28,995,312 bytes/sec.

--That's pretty respectable in my book, considering all 3 vdisks are on a single host SATA drive running JFS.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Quick guide Charles Documentation Project 23 04-12-2009 01:31 AM
Quick question... maxwas General Questions 1 09-28-2007 08:23 PM
HOW-TO: PBI Creation the Quick and Clean way youlle Creating PC-BSD Packages (.pbi files) 46 09-09-2007 01:53 AM
A Few Quick Questions Ireclan General Questions 2 07-01-2007 02:38 AM


All times are GMT. The time now is 11:52 AM.


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

Copyright 2005-2010, The PC-BSD Project. PC-BSD and the PC-BSD logo are registered trademarks of iXsystems.
All other content is freely available for sharing under the terms of the Creative Commons Attribution License.