ZFS vs existing filesystem for SD-card

1

1

I'm thinking that micro SD-cards, because of their high storage density, are probably especially susceptible to bit rot. So I thought I might give ZFS a try. (I'm open to alternatives..) However, I also read somewhere (can't find the link anymore) that SD-cards often come with somehow specially aligned filesystem formats from the vendor and therefore should never be formatted if not absolutely needed.

(I read this question about flash filesystems but in the comments it says it makes only sense to use block-level filesystems on SD-cards, since they emulate a block-level device in hardware.)

Any advice or links? I'm on Mac OS X and my Kingston micro SD-card is currently exFAT formatted by the vendor. I'll use to hold my iTunes library and a few rarely-accessed files.

mb21

Posted 2014-02-25T12:10:09.643

Reputation: 223

@MikeFitzpatrick You could also use a zraid 1 on the two cards. zpool scrub detects and corrects any bit rot. – FUZxxl – 2017-07-18T19:56:14.113

@FUZxxl, a ZFS mirror pool of 2 SD cards is also possible and zpool scrub would work as you say. RAIDZ1 uses parity and requires a minimum 3 devices. – Mike Fitzpatrick – 2017-07-19T00:04:47.283

I don't exactly remember where, but I found some "tuning" guides for SD cards, to determine the erase block size and the like. Still, ZFS is copy-on-write, so you'll waste quite some write cycles. – Daniel B – 2014-02-25T12:27:50.613

ZFS is not properly supported by OS X (the best I have seen is beta level - as of feb-2014). – Ouki – 2014-02-25T13:53:54.000

@Daniel B yeah, you know a filesystem better suited for SD-cards? – mb21 – 2014-02-25T14:25:45.510

@Ouki https://code.google.com/p/maczfs ?

– mb21 – 2014-02-25T14:29:14.840

1Sure, FAT32. It's in the specs, so it must be good, right? ;) I presume SD cards are too high-level for most of the more (flash-)specific file systems out there. Not that OS X supports any of them, mind you. – Daniel B – 2014-02-25T14:31:03.033

@mb21: I don't call that recent: "zpool version 8 and zfs version 2". The best I have seen so far is github.com/zfs-osx. This is still far from end user level.

– Ouki – 2014-02-25T17:57:11.433

1Assuming that ZFS can operate on an SD card (I don't know) then it will be able to detect bit rot but it will only be able to repair it if your SD card is part of a redundant pool (multiple SD cards?) or you have set copies=2 on a non-redundant single-drive pool. – Mike Fitzpatrick – 2014-02-25T23:08:07.240

@Ouki I'm more interested in a stable filesystem, not the most recent dev-version. But Mike is right, I didn't think about copies=2 halving the space on the drive 8) – mb21 – 2014-02-26T10:18:39.657

@mb21 Either way, the best you can got around here for Mac OS X and ZFS is beta. If you want stable ZFS, go for Solaris-like, FreeBSD or maybe Linux. – Ouki – 2014-02-26T11:23:14.333

@MikeFitzpatrick This might sound stupid, but what about splitting the SD card into several VDEVs and doing RAIDZ on those? – mb21 – 2014-03-03T11:19:35.230

1That might be feasible but RAIDZ will increase the amount of writing to the SD card which may reduce their lifespan. If the data won't change often this this might not be an issue. Personally I wouldn't go down this path. If I was going to use ZFS on SD cards then I'd use simple ZFS pools and use two cards, each an independent copy of the other (synced occasionally with rsync or zfs send). If any bit rot was detected with zpool scrub then I'd simply copy the offending file(s) from the other card. – Mike Fitzpatrick – 2014-03-03T22:29:02.660

No answers