Questions about ZFS

319 views
Skip to first unread message

Guy Fontaine

unread,
Jan 31, 2013, 8:52:28 AM1/31/13
to funto...@googlegroups.com
Here are some questions about ZFS Install Guide :

  1. Why only /boot and swap are declared in /etc/fstab ?
  2. Why to use initramfs ?
  3. Why a swap 1GB > RAM ?
Guy

Richard Yao

unread,
Jan 31, 2013, 8:55:05 AM1/31/13
to funto...@googlegroups.com
On 01/31/2013 08:52 AM, Guy Fontaine wrote:
> Here are some questions about ZFS Install Guide :
>
>
> 1. Why only /boot and swap are declared in /etc/fstab ?
> 2. Why to use initramfs ?
> 3. Why a swap 1GB > RAM ?
>
> Guy
>

1. ZFS will mount ZFS datasets itself. You only need fstab for things
that are not ZFS datasets.
2. Currently, it is only possible to mount the rootfs through an
initramfs. I made an attempt at eliminating this requirement a while
back, but I did not finish it.
3. I cannot answer that. This is really a matter of preference.

signature.asc

Guy Fontaine

unread,
Jan 31, 2013, 9:05:13 AM1/31/13
to funto...@googlegroups.com
Thank's for this fast answer.

I plan to give it a try. 

Guy

2013/1/31 Richard Yao <ry...@gentoo.org>

Martin Scholz

unread,
Jan 31, 2013, 9:07:17 AM1/31/13
to funto...@googlegroups.com
hey guy,

zfs is really awesome. you will be surprised by it i think

greetings


--
--
To manage your subscription, visit this group at
http://groups.google.com/group/funtoo-dev?hl=en
---
Also be sure to check out:
Funtoo Forums: http://forums.funtoo.org
Planet Larry: http://larrythecow.org
 
---
You received this message because you are subscribed to the Google Groups "Funtoo" group.
To unsubscribe from this group and stop receiving emails from it, send an email to funtoo-dev+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Guy Fontaine

unread,
Jan 31, 2013, 9:14:53 AM1/31/13
to funto...@googlegroups.com
Sure it seems to be.

Currently I only have a laptop with 2 500GB DD's. Second DD is ready to welcome ZFS since it's completely blank. Just hope GRUB wil be able to use a /boot on second drive.

I plan to buy a new box next Fall. Does ZFS deal with SSD ?

Guy

2013/1/31 Guy Fontaine <aram...@gmail.com>

Bartosz Nitkiewicz

unread,
Jan 31, 2013, 9:08:44 AM1/31/13
to funto...@googlegroups.com
What's it advantage compared to btrfs?
Bartosz Nitkiewicz

From: Martin Scholz <schol...@gmail.com>
Date: Thu, 31 Jan 2013 15:07:17 +0100
Subject: Re: [funtoo] Questions about ZFS

Daniel Robbins

unread,
Jan 31, 2013, 11:21:36 AM1/31/13
to funtoo development mailing list
These answers should be added to the wikitext. There is a lack of "why" (explanations, context) in the current ZFS Install Guide which we should improve. Answering these questions helps users to be educated about the technology rather than someone who doesn't really understand but is just following a bunch of instructions. Our goal is always to educate during the install process.

Bartosz Nitkiewicz

unread,
Jan 31, 2013, 11:25:08 AM1/31/13
to funto...@googlegroups.com
Daniel,
I totally agree with you. I'm not sure why zfs is better than btrfs. Or if it's make any sense to use it in desktop environment.
Regards
Bartek
Bartosz Nitkiewicz

From: Daniel Robbins <drob...@funtoo.org>
Date: Thu, 31 Jan 2013 09:21:36 -0700
To: funtoo development mailing list<funto...@googlegroups.com>
Subject: Re: [funtoo] Questions about ZFS

Richard Yao

unread,
Jan 31, 2013, 11:47:32 AM1/31/13
to funto...@googlegroups.com
That is hard to enumerate, but the following comes to mind:

The current btrfs code in Linus' tree has known data corruption bugs
that Chris Mason has yet to fix. The current ZFS code has a solid track
record for data integrity.

On Linux, the ZFS code can be updated independently of the kernel to
obtain the latest fixes. btrfs is exclusive to Linux and you need to
build the latest kernel sources to get the latest fixes.

ZFS is supported on multiple platforms. The platforms with the best
support are Solaris, FreeBSD and Linux. Other platforms with varying
degrees of support are NetBSD, Mac OS X and Windows. btrfs is exclusive
to Linux.

ZFS has the Adaptive Replacement Cache replacement algorithm while btrfs
uses the linux kernel's Last Recently Used replacement algorithm. The
former often has an overwhelmingly superior hit rate, which means fewer
disk accesses.

ZFS has the ZFS Intent Log and SLOG devices, which accelerates small
synchronous write performance.

ZFS handles internal fragmentation gracefully, such that you can fill it
until 100%. Internal fragmentation in btrfs can make btrfs think it is
full at 10%. Btrfs has no automatic rebalancing code, so it requires a
manual rebalance to correct it.

ZFS has raidz, which is like RAID 5/6 (or a hypothetical RAID 7 that
supports 3 parity disks), except it does not suffer from the RAID write
hole issue thanks to its use of CoW and a variable stripe size. btrfs
has no equivalent.

ZFS send/receive implementation supports incremental update when doing
backups. btrfs' send/receive implementation requires sending the entire
snapshot.

ZFS supports data deduplication, which is a memory hog and only works
well for specialized workloads. btrfs has no equivalent.

ZFS datasets have a hierarchical namespace while btrfs subvolumes have a
flat namespace.

ZFS has the ability to create virtual block devices called zvols in its
namespace. btrfs has no equivalent and must rely on the loop device for
this functionality, which is cumbersome.

The only area where btrfs is ahead of ZFS is in the area of small file
efficiency. btrfs supports a feature called block suballocation, which
enables it to store small files far more efficiently than ZFS. It is
possible to use another filesystem (e.g. reiserfs) on top of a ZFS zvol
to obtain similar benefits (with arguably better data integrity) when
dealing with many small files (e.g. the portage tree).

On 01/31/2013 09:08 AM, Bartosz Nitkiewicz wrote:
> What's it advantage compared to btrfs?
> Bartosz Nitkiewicz
>
signature.asc

Richard Yao

unread,
Jan 31, 2013, 11:49:19 AM1/31/13
to funto...@googlegroups.com
I hate to say this, but I am not a huge wiki person. Jonathan Vasquez
and others have done a fairly good job of turning information that I
have provided into a usable wiki. I am certain that this will continue
and I encourage them to use my comments here as the basis of
improvements to the wiki.
signature.asc

Guy Fontaine

unread,
Jan 31, 2013, 11:51:20 AM1/31/13
to funto...@googlegroups.com
Hi Daniel,

That is why I want to try ZFS. I wish to add an installation guide to Funtoo Québec wiki. Doing so I need some information about the hows and whys. I also think that Bliss Initramfs Creator is a better approach than the standard genkernel. I,m not sure to include regular genkernel. 

ZFS Fun is a good source too.

ZFS Install Guide is a work in progress. No doubt that it will be improved in the short term.

Guy

2013/1/31 Bartosz Nitkiewicz <bar...@nitkiewicz.eu>

Guy Fontaine

unread,
Jan 31, 2013, 11:58:12 AM1/31/13
to funto...@googlegroups.com
Thank you Richard. Keep on doing the good job on the technical part. We'll take care of doc :-).

Guy

2013/1/31 Richard Yao <ry...@gentoo.org>
I hate to say this, but I am not a huge wiki person. Jonathan Vasquez

Daniel Robbins

unread,
Jan 31, 2013, 12:00:59 PM1/31/13
to funtoo development mailing list
I added this text to the install guide because I think it will help people understand why they may want to consider ZFS :)

Bartosz Nitkiewicz

unread,
Jan 31, 2013, 12:11:49 PM1/31/13
to funto...@googlegroups.com
Nice summary, but what about zfs and ssd disks. I'm using btrfs with my ssd and it's very nice with some mount options discard,relatime,ssd,compress=lzo.

Daniel Robbins

unread,
Jan 31, 2013, 12:17:27 PM1/31/13
to funtoo development mailing list
I'm also curious about suitability for desktops. As most of you probably know, we stopped recommending ext4 and started recommending XFS as a default filesystem for all Funtoo Linux installs. XFS has offered a massive performance improvement over ext4, but with some drawbacks:

"back in the old days", XFS had a habit of causing recently-modified files to be corrupt after an unexpected shutdown/reboot/crash. Technically, it followed the "rules" -- the metadata was fine, only the recently-written data was not OK. In talking to the Red Hat XFS filesystem developers, they assured me that this issue was resolved. However, in my own desktop testing, XFS does not seem nearly as able to prevent data (not metadata) corruption when the system crashes. This is fine for servers that have high uptimes, but not that great for desktops.

I'm wondering how ZFS does in this area. Is it more like XFS where you could lose some blocks of data but maintain metadata integrity, or does it "feel" more like an ext4 or typical Windows/Mac filesystem that tends to be tolerant of unexpected reboots?

Daniel Robbins

unread,
Jan 31, 2013, 12:20:44 PM1/31/13
to funtoo development mailing list
As an example of what kind of minor data corruption I'm talking about -- after my last desktop crash, my skype preferences file was corrupted on XFS and needed to be recreated. On a server system, a crash could result in some daemons, etc. not starting until some manual intervention is done. This seems to be caused by in-transit filesystem writes resulting in metadata hitting the disk first, but sometimes clobbering the data integrity since new data blocks are not written in time.

Oleg Vinichenko

unread,
Jan 31, 2013, 12:23:08 PM1/31/13
to funto...@googlegroups.com
some remarks.  I tested ZFS for some time with 2.6.32 openvz kernel. 
1. 64-bit only recommended.
2. It uses LOT of RAM cache, so newcomers will be really surprised. This is not so big issue, because cache is honored, if applications need cache, it's cleared accordingly.
3. OpenVZ kernel panics randomly with ZFS, i was unable (had not time) to debug those panics.
4. git routine (clone, commits, etc) is extermely slow with ZFS.
Overall impression is very positive, it works great. I was very sceptical at first.

Oleg Vinichenko

unread,
Jan 31, 2013, 12:26:08 PM1/31/13
to funto...@googlegroups.com
I had numeorus issues with XFS last 6 monthes, it is very sensitive to power loss. 

UNIXgod

unread,
Jan 31, 2013, 12:48:19 PM1/31/13
to funto...@googlegroups.com
I worked with zfs on bsd for a short stint last year with a bunch of
hard drives and a ssd for L2ARC. It was a single server install with 4
1tb drive a single 2tb drive set up as a raidz2. Though I used a ssd
for L2ARC I still ran into problems with memory (I only had 12GB and
also ran memory filesystems). It was when zfs was still considered
"experimental" on BSD but also could have been my over zealous nature
to tweak and tune the OS and filesystem so I wouldn't rule out user
error and PEBKAC.

With that said consider this. ssd's should be used for L2ARC to expand
memory limitations of the hardware. for ZIL two ssds can be striped
for offloading logs. Battery backed SLC based drives are recommended
for ZiL. The size of L2ARC will be dependent on how much hard drive
space is in the pool.

I haven't run this on linux and though had run it on a server deploy
wouldn't consider that the basis nor starting point for anyone who
plans to set up a server farm. With that said if anyone has any
general questions about the z file system I would be more than happy
to help where relevant.

~

Pavol Cupka

unread,
Jan 31, 2013, 3:51:42 PM1/31/13
to funto...@googlegroups.com
hi,

my personal experience with ZFS on Funtoo Linux is about 6 months old. I installed it on my notebook and used it only for my /backup and /home partitions. 

I didn't tweak the setting very much and didn't try any exotic settings either. All I can say that logging into the X was very slow and starting chromium with couple of tabs open was very very slow. So I moved away from it and use XFS for my data partitions and JFS on my root partition and having portage in squashfs + aufs mounts.

I find JFS more error prone to power failures and didn't have any issue with it since. I like XFS for its ability to defragment the filesystems. According to some test from phoronix 



jfs performs nicely on SSD and since kernel 3.7 it supports also TRIM function (http://www.phoronix.com/scan.php?page=news_item&px=MTE5ODY)

So I think for a a normal system there are better filesystems than ZFS at least for a notebook where the chance that you will have multiple harddrives in one system is very small. 

The one think ZFS excels is probably data integrity, so if you are willing to sacrifice speed for data safety then you should consider ZFS, but don't underestimate the value of backups :)

Currently I would probably go just with plain ext4 as btrfs comes with ext3/4 conversion support and once it matures it will probably be faster and safer (it is already faster) than ZFS. :)

My 2 cents 

Pavol (palica) Cupka

Pavol Cupka

unread,
Jan 31, 2013, 4:16:42 PM1/31/13
to funto...@googlegroups.com

Guy Fontaine

unread,
Feb 2, 2013, 10:20:42 AM2/2/13
to funto...@googlegroups.com
Do you recommend to create /var and /usr partitions apart of ZFS and to format them with reiserFS in order to have a performing Portage ?

Guy

2013/1/31 Oleg Vinichenko <ol...@funtoo.org>

Oleg Vinichenko

unread,
Feb 2, 2013, 10:24:01 AM2/2/13
to funto...@googlegroups.com
I never was a fan of separate partition layout. I guess setting /var on separate good (easy to make backups, /var is important. Separate /usr make no real sense.

Guy Fontaine

unread,
Feb 2, 2013, 10:43:57 AM2/2/13
to funto...@googlegroups.com
So leaving /usr part of / as ZFS and having /var on top of ZFS formated as ext4 or reiserFS won't decrease Portage performance to much ? 

I prefer ext4 over reiserFS because of the story behind Reiser.

Guy

2013/2/2 Oleg Vinichenko <ol...@funtoo.org>

Oleg Vinichenko

unread,
Feb 2, 2013, 10:48:34 AM2/2/13
to funto...@googlegroups.com
I meant a /var ZFS mountpoint (subvolume). There is no real benefit in having /usr/ separate but it can potentially give problems. There many packages that installing binaries in /, in /usr and libraries in /usr. Separating /usr in such cases is not recommended. Separate /usr in Gentoo is inspired by BSD, in BSD /usr is somewhat different and can't be compared with Linux.

Adrien Dessemond

unread,
Feb 2, 2013, 11:46:41 AM2/2/13
to funto...@googlegroups.com
On Sat, Feb 2, 2013 at 10:20 AM, Guy Fontaine <aram...@gmail.com> wrote:
Do you recommend to create /var and /usr partitions apart of ZFS and to format them with reiserFS in order to have a performing Portage ?


No, for a desktop usage the only thing I would do is to keep  /home aside from the rest, having multiple subvols on a desktop machine tends to add complexity with no real "added value"  at the end. What you must know about ZFS is that this filesystem does aggressive checksumming and it tends to eat a huge RAM amount for its cache (on Solaris I can cap it, I didn't played a lot with ZFS On Linux... yet), on slow machines it can have significant impact but as you have a quite powerful setup you shouldn't see major performance issue.


Thinking about using several filesystems is a clever and interesting approach. In the case of XFS, it is good when working with large files/concurrent access (I should try to use it for QEmu virtual machine since Qemu uses a lots of small I/O operations in parallels), however it has its drawbacks (corruption in case of powerloss and awful performance on small and scattered files) just as ZFS has its own. At date of writing ZFS is unable to handle defragmentation and using duplication requires amazing amounts of free memory.


ResiserFS is another interesting topic, ~10 years ago the de facto choice for Linux users was ext/ext2 with static inodes tables and several other joys (no journaling and so on), here is where ReiserFS made it way to mitigate the drawbacks of ext filesystems. Does it make sense to use ReiserFS in 2013? Yes, if you find it useful for you even if you have several other more modern options. Old filesystems are just like old radios for hams, they are good as long at they does the job and you are happy with them. And just like no single antenna exist for a universal usage (Hams are still working on it worldwide since more than one century), no filesystem can do the job in an perfect and universal manner, some are better than others in some domains.


Cheers,


Guy Fontaine

unread,
Feb 2, 2013, 12:08:37 PM2/2/13
to funto...@googlegroups.com
If it's a good move to keep /var within /, then it's important not to use ZFS on SSD since Portage writes a lot of messages to /var/log. Risk to damage your SSD quickly is high.

Guy

2013/2/2 Adrien Dessemond <adess...@funtoo.org>

Daniel Robbins

unread,
Feb 2, 2013, 12:27:33 PM2/2/13
to funtoo development mailing list
I don't think Portage writes a significant amount to /var/log. It does write a significant amount to /var/tmp/portage.

Guy Fontaine

unread,
Feb 2, 2013, 12:33:15 PM2/2/13
to funto...@googlegroups.com
Sorry, my mistake.

One can mount /var/tmp to RAM. If you have something like 16GB of RAM, /var/tmp can have a size of 12GB which is enough to emerge libreoffice.

Guy

2013/2/2 Daniel Robbins <drob...@funtoo.org>

Guy Fontaine

unread,
Feb 4, 2013, 9:09:54 PM2/4/13
to funto...@googlegroups.com
Another question about fstab example:

It is said that you don't have to create /boot when you let ZFS creates partitions. Does it mean that /etc/fstab example in the ZFS Install Guide only deals with manual partitioning ? 


2013/2/2 Guy Fontaine <aram...@gmail.com>
Reply all
Reply to author
Forward
0 new messages