Register for the iXsystems Community to get an ad-free experience and exclusive discounts in our eBay Store.

Single Drive ZFS

Status
Not open for further replies.

Burador

Neophyte
Joined
Jul 6, 2015
Messages
10
Hi,

I know pretty well that FreeNAS/ ZFS is supposed to be used with multiple drives. But, I'm just curious and I've searched the web already for this one. What, if any, are the benefits that ZFS can provide to the user if the user is using only one drive?

Can the user take advantage of deduplication, compression and protection against bit-rot? Thanks.
 
Last edited:

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
Hi,

I know pretty well that FreeNAS/ ZFS is supposed to be used with multiple drives. But, I'm just curious and I've searched the web already for this one. What, if any, is the benefits that ZFS can provide to the user if the user is using only one drive?

Can the user take advantage of deduplication, compression and protection against bit-rot? Thanks.
Well, the CTO of iXsystems said something like "single disk ZFS is so pointless it's actually worse than not using ZFS".

Technically you can do deduplication and compression.

But there is no protection from corruption since there is no redundancy. So any error can be detected, but cannot be corrected. This sounds like an acceptable compromise, but its actually not. The reason its not is that ZFS' metadata cannot be allowed to be corrupted. If it is it is likely the zpool will be impossible to mount (and will probably crash the system once the corruption is found). So a couple of bad sectors in the right place will mean that all data on the zpool will be lost. Not some, all. Also there's no ZFS recovery tools, so you cannot recover any data on the drives. You cannot use the standard recovery tools that are designed for NTFS, FAT32, etc either. They don't work correctly.

So what does all of this mean? It means that you run the risk of everything being just fine, and then suddenly (and without warning) all of the data is irretrievably lost.

This is obviously much worse than using something like NTFS which, when faced with corruption, will simply delete the offending entries (so some data will be lost, but not necessarily everything). You can also do some amount of recovery with things like chkdsk (no equivalent exists in the ZFS world). You can also use some recovery tools that exist if things get really bad (no equivalent exists in the ZFS world).

So can you do what you want? Yep. But doing it is worse than simply using NTFS or whatever "legacy" file system you choose. I could easily argue that if your data is that unimportant you should simply delete it.
 

DrKK

FreeNAS Generalissimo
Joined
Oct 15, 2013
Messages
3,630
Short answer: yes.

A zpool containing only a single device can use deduplication (although, I can't envision a scenario where a system would be even remotely indicative of deduplication with only one drive), it can certainly use compression and/or encryption, and it can detect, but generally not correct, errors in the data pool. Note also, that it is possible to set "copies = 2" in the zfs properties for such a pool, in which case every file block is stored TWICE on the drive (obviously at the cost of half the capacity).
 

DrKK

FreeNAS Generalissimo
Joined
Oct 15, 2013
Messages
3,630
Right, so Cyberjock and I answered at the identical moment. He, of course, is totally right. There's not much point to using a single disk in a zpool. But you CAN do it, and most of the dataset functionalities (including, snapshotting, too) would be available.

But yes, basically, if anything goes south, you will have complete lossage. It's both worse, and better, than a single drive in something like NTFS. You pick your poison.
 

DrKK

FreeNAS Generalissimo
Joined
Oct 15, 2013
Messages
3,630
Also, I actually do have a single disk vdev. My jails are on a single Sandisk 64GB SSD. But, whatever. If that blows up in my face, I don't really care, I'll just rebuild it.
 

SirMaster

Member
Joined
Mar 19, 2014
Messages
241
Well, ZFS does technically have tools that you can repair pool damage with called zdb. It's just a much more difficult tool to use than what people have grown used to for filesystem repairing. You are going to have to read zfs internals documentation to understand what to repair.

I think there are still some great use cases for single disk zpools. For example, FreeNAS currently runs it's OS from a single disk zpool. I run my home server from a single disk zpool for the OS. I do use copies=2 though and I also utilize the snapshot functionality and zfs send to easily backup my OS disk to another RAID pool nightly.

It's certainly a lot better than using say EXT4 and trying to backup a live system without proper block level snapshots and using something like rsync rather than zfs send to perform the incremental backup extremely quickly, especially when sending it over the Internet with limited speeds.

Also the use case that DrKK game, of using a single disk for your jails is another good example.

ZFS does though by default keep 2 copies of all metadata and in the case of copies=2 for example then it will keep 3, so metadata corruption is at least more unlikely than on NTFS or EXT. Plus the copy on write nature makes ZFS less prone to unexpected corruption in case of crashes or power loss than NTFS or EXT, but you guys are right, it's not impossible for corruption to happen, and if it does, it's very difficult to recover from.
 

Arwen

Neophyte Sage
Joined
May 17, 2014
Messages
1,224
I use ZFS single disk pools. One is for my FreeNAS backups, (to a single 8TB disk). And the other is a miniture
media server, (master data is on my FreeNAS using RAID-Z2). Both have good reasons for their configuration.

A single disk pool is useful for;
  • Backup data
  • Bit-rot detection, (but not correction unless copies=2 or 3)
  • Low power data serving, (my miniture media server is <10 watts)
  • Encryption
  • De-duplication
Of course, using "copies=2", (or 3), does not mean you get full disk failure protection. Nor should backups be
ignored.

Last, I REALLY wanted to use a checksumming file system like ZFS, (or BTRFS), for my single 8TB disk
backups. It's a special Seagate disk using SMR, so I wanted to be able to perform validity checks before or after
each backup to detect firmware faults. (So far, no bit-rot / firmware faults.)
 

Burador

Neophyte
Joined
Jul 6, 2015
Messages
10
I use ZFS single disk pools. One is for my FreeNAS backups, (to a single 8TB disk). And the other is a miniture
media server, (master data is on my FreeNAS using RAID-Z2). Both have good reasons for their configuration.

A single disk pool is useful for;
  • Backup data
  • Bit-rot detection, (but not correction unless copies=2 or 3)
  • Low power data serving, (my miniture media server is <10 watts)
  • Encryption
  • De-duplication
Of course, using "copies=2", (or 3), does not mean you get full disk failure protection. Nor should backups be
ignored.

Last, I REALLY wanted to use a checksumming file system like ZFS, (or BTRFS), for my single 8TB disk
backups. It's a special Seagate disk using SMR, so I wanted to be able to perform validity checks before or after
each backup to detect firmware faults. (So far, no bit-rot / firmware faults.)
Hi arwen,

If checksumming is enable. What happens if it detects an error? What do you do? Thanks.
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
Well, ZFS does technically have tools that you can repair pool damage with called zdb. It's just a much more difficult tool to use than what people have grown used to for filesystem repairing. You are going to have to read zfs internals documentation to understand what to repair.
zdb is for ZFS debugging, not ZFS recovery. Granted you can do a very small amount of things that may be "recovery", but unless you're a coder with years and years of experience with ZFS, this "option" isn't really an option at all. Anyone could easily argue that if you didn't know what zdb was to start with they are wholly unqualified to ever use it in any significant fashion.
 

Arwen

Neophyte Sage
Joined
May 17, 2014
Messages
1,224
Hi arwen,

If checksumming is enable. What happens if it detects an error? What do you do? Thanks.
In the case of my 8TB Seagate SMR disk, it's for backups. So in theory the original data should still be
available on my FreeNAS. Remember, I run a scrub before each backup to get an integrity check of
my backups. So I hope to determine it's reliability for backups before I need to use it for restores. If it
EVER fails a scrub, then I will look at other backup options immediately.

For my miniture media server, the file systems that are checksummed but not redundant, (copies=1 on
a single mSATA SSD drive), I can;
  • Restore from backups, (including my movies, music, photos and eBooks)
  • Get replacement distribution files from the Internet for Gentoo Linux
  • Re-create Media files from optical discs, DVD, CD, or Blu-ray.
On Solaris 10, I experienced a double disk fault with a ZFS mirrored root pool. A "zpool status" told
me which file failed. It was a worthless file, one easily replaced, which I did. I then cleared the error,
and new scrubs found no problems. Server stayed up the whole time. (That said, I think a co-worker
had already replaced the disks... but did not know how to clear the error.)
 
Status
Not open for further replies.
Top