4 ms·
I found an old ZFS disk laying around the other day (a few years old.. from when I was playing with zevo community edition ZFS and I had forgotten what I had st
by po 12y ago
I found an old ZFS disk laying around the other day (a few years old.. from when I was playing with zevo community edition ZFS and I had forgotten what I had stored on it) and I was interested in trying https://openzfsonosx.org https://openzfsonosx.org so I installed it and mounted my disk up. It worked like a charm. I was pretty impressed.
I kind of screwed myself over though because I to do a bunch of file cleanup that I was hoping to perhaps roll back if it didn't go well so I created a snapshot and then got to work with some copying…
I wasn't paying attention and I ended up running out of space on the disk. The way ZFS snapshots work is that ZFS still does what it would normally do on a copy: writes data, then verifies the write is completed before deleting the old data. When there is a snapshot, it just skips the second step and leaves the old data around. This is how snapshots have zero performance impact on data write.
Turns out that I couldn't even delete the old snapshot (or rollback the new one) because I didn't have enough space to make any changes to the disk. I couldn't even delete files because they would stay in the snapshot.
Aha! I can add a disk to the pool! So I added a small disk to the zpool and then I could delete the snapshot ok. However, I forgot that you can't remove a disk from a zpool. I ended up having to move the data to another disk, drop the entire zpool and recreate it, and move it back.
Honestly, everything worked rather well except for forgetting a few of the limitations of ZFS. Given how often I have issues with HFS+ I really think it's pretty tempting for OS X.
- prakashsurya 12y agoThere is work in progress to add the ability to remove a device from a pool. So, hopefully in the not too distant future, that work will land in illumos and migrate to all the downstream implementations (e.g. linux, mac, and freebsd).
- ryao 12y agoThis issue was fixed in Illumos a few months ago, although the fix has not made its way to O3X yet: https://github.com/illumos/illumos-gate/commit/4bb73804952172060c9efb163b89c17f56804fe8 https://github.com/illumos/illumos-gate/commit/4bb7380495217... The workaround is to find a file that was written that is outside of a snapshot and truncate it. `zfs diff` can be used to do that. That allows you to delete an old snapshot.
- ryao 12y agoI ported this fix to ZoL and opened a pull request to get it merged into HEAD for the next release: https://github.com/zfsonlinux/zfs/pull/2784 https://github.com/zfsonlinux/zfs/pull/2784 O3X merges fixes from ZoL, so it should get this fix soon after it has been merged to ZoL.
- po 12y agoThat's great! Thanks for the info. edit: Didn't realize you meant you just ported it over and submitted the PR just now. Double thanks!