bdrewery / zfstools

Various ZFS scripts. Most notably, zfs-auto-snapshot, a ruby clone of OpenSolaris auto snapshotting
Other
141 stars 29 forks source link

zvols no longer snapshotted? #32

Closed eborisch closed 9 years ago

eborisch commented 9 years ago

After upgrading (on FreeBSD; moved from 0.3.2 to 0.3.5), the zvols on my system are no longer being auto-snapshotted. This is due to do with the mounted check.

ZVOLs (at least on FreeBSD 10.1) output '-' for 'mounted' during the main 'zfs list' call (exposed via -d run), so they are not being snapshotted now. Changing line 116 of zfstools.rb from:

    if dataset.properties['mounted'] == "yes" and ["true","mysql","postgresql"].include? value

to

    if dataset.properties['mounted'] != "no" and ["true","mysql","postgresql"].include? value

Fixes the issue, and retains the "don't snapshot unmounted" option.

Thanks for the excellent software!

bdrewery commented 9 years ago

Thanks. This was an unintended bug. I'll get a fix out this weekend.

bdrewery commented 9 years ago

26