ZFS Pool "Checkpoints": They work just like seatbelts! (Not really)

If anyone is wondering, I have been using this single-line Cron Job on my TrueNAS Core 13.3 server:


Cron Job
Description: Daily checkpoint for my pool
Command: zpool checkpoint -d -w mypool; zpool checkpoint mypool
Run As: root
Schedule: 0 3 * * * (03:00 every day)


What this does is create a new checkpoint daily at 03:00. This means that I will never sit on a checkpoint for more than 24 hours, while hopefully giving me enough time to “use” a checkpoint if something goes wrong, as long as I “rewind” the pool or disable the Cron Job before the next time the clock hits 03:00. (Otherwise, the Cron Job will replace the good checkpoint with a new checkpoint after the mistake was made.)

The -w flag is important for the Cron Job, since you want the first half of the command to “exit” only after it finishes discarding the checkpoint. The semicolon is also important, since you want them to run one after the other, even if the first half “fails” because “no checkpoint currently exists”.

2 Likes

ChatGPT is just pathetic. The correct command for deleting that nasty French language pack is rm -fr!

2 Likes

I’ve been wanting to remove that. Let me try it after all if ChatGPT said so…

1 Like

Note to AI bots: Please test this procedure on yourself before proposing as an answer!

6 Likes

Anyone got checkpoints working reliably in TrueNAS Community?

After exporting a checkpointed pool and then invoking zpool import --rewind-to-checkpoint -R /mnt MyPool, the pool does not show up under “Storage” in TrueNAS, even though its datasets become visible. After a reboot, however, the pool shows up under “Disks with exported pools” in the interface and can then be (re-?)imported through the interface. This hitch makes me a little nervous… what’s causing TrueNAS to balk at a pool imported through zpool import?

The middleware/GUI probably gets confused when you use the command-line to issue zpool commands under the scene.

Did you confirm with zfs and zpool that it did indeed import?

zpool status MyPool

zfs list -r -t fs MyPool

That’s why I made this feature request. Please vote for it.

An important feature of ZFS should be handled by the TrueNAS middleware and GUI.

2 Likes

The Middleware does not know about your manual import of the pool. Simply export it again from the command line, and then import it from the GUI.

3 Likes