TimeMachine Snapshots

trollmar

Cadet
Joined
Oct 27, 2020
Messages
3
Hi,
im new to TrueNAS.

One thing i did is to create a ne Dataset for Apple TimeMachine Backup.
I created a "Multi User Time machine" SMB share for it.

Works.

But how could i prevent the auto creation of snapshots for this timemachine share.
I didnt set up any snapshot task for it.

Any hint for me?
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
Any hint for me?
I assume that you have a recursive snapshot task for the parent/pool, so you need to either make that snapshot task non-recursive or use the exclude field to list the dataset for exclusion.
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,554
With "enhanced time machine" preset we automatically snapshot the time machine dataset on clean share disconnect so that you have a stable point in time in which to roll back time machine in case of a corrupted backup (without having to generate a new sparsebundle volume).
 

trollmar

Cadet
Joined
Oct 27, 2020
Messages
3
aah ok. so its basicly a nice feature, not a bug :smile:
but how could i prevent if i want to?

1.delete the dataset.
2.create a new one with a "basic smb Share"?


THX
 

dak180

Patron
Joined
Nov 22, 2017
Messages
310
With "enhanced time machine" preset we automatically snapshot the time machine dataset on clean share disconnect so that you have a stable point in time in which to roll back time machine in case of a corrupted backup (without having to generate a new sparsebundle volume).
Conversely how would one setup this behavior on an existing share that is already being used for time machine and how would you control retention or is this already documented somewhere?
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,554
Conversely how would one setup this behavior on an existing share that is already being used for time machine and how would you control retention or is this already documented somewhere?

retention is controlled by:
tmprotect:retention = 7

Default is 7 day retention for auto-snapshots. VFS module is "tmprotect". Code is in our repo. You can enable via aux parameter, but ymmv. I kept it in a preset designed to break up users into separate datasets with the idea that separate user accounts will be used for different Macs. So when MacOS starts its first time machine backup, samba will auto-generate a ZFS dataset for it, and then will manage the automatic snapshots on clean disconnect. Keeping datasets separate allows rollback without affecting another Mac's backup.
 

dak180

Patron
Joined
Nov 22, 2017
Messages
310
Default is 7 day retention for auto-snapshots. VFS module is "tmprotect". Code is in our repo. You can enable via aux parameter, but ymmv.
Yes, I do not see any documentation for it though.
I kept it in a preset designed to break up users into separate datasets with the idea that separate user accounts will be used for different Macs. So when MacOS starts its first time machine backup, samba will auto-generate a ZFS dataset for it, and then will manage the automatic snapshots on clean disconnect. Keeping datasets separate allows rollback without affecting another Mac's backup.
Except I already have separate datasets for each mac that is backing up and I would rather not recreate them; also I prefer not to have autogenerated datsets.
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,554
Yes, I do not see any documentation for it though.

Except I already have separate datasets for each mac that is backing up and I would rather not recreate them; also I prefer not to have autogenerated datsets.
I haven't written documentation yet (since options aren't exposed via API or GUI), I will probably get around to it once I have more feedback / prepare for upstreaming.
 

seanm

Guru
Joined
Jun 11, 2018
Messages
570
I will probably get around to it once I have more feedback

2¢ of feedback:

I'm currently running FreeNAS 11.3 and have about 10 Macs using it as their Time Machine. Some of the Macs are employee workstations, some are shared laptops, some run conference room projectors, some are buildbots, some are servers, quite a mix. They all have a mix of *local* user accounts.

Each Mac has its own zfs dataset on the NAS already. The NAS has a single local user `timemachine` that is used by all 10 Macs for authentication to all the time machine shares.

I would love to have automatic snapshot creation upon completion of Time Machine backup.
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,554
2¢ of feedback:

I'm currently running FreeNAS 11.3 and have about 10 Macs using it as their Time Machine. Some of the Macs are employee workstations, some are shared laptops, some run conference room projectors, some are buildbots, some are servers, quite a mix. They all have a mix of *local* user accounts.

Each Mac has its own zfs dataset on the NAS already. The NAS has a single local user `timemachine` that is used by all 10 Macs for authentication to all the time machine shares.

I would love to have automatic snapshot creation upon completion of Time Machine backup.
In this case in 12.0 you can run command "testparm -s", view the VFS objects currently on the share, and then copy that config line, prepend "tmprotect" to the string, and add as an auxiliary parameter. I'll look into possibly exposing this configuration option through the GUI.
 

seanm

Guru
Joined
Jun 11, 2018
Messages
570
In this case in 12.0 you can run command "testparm -s", view the VFS objects currently on the share, and then copy that config line, prepend "tmprotect" to the string, and add as an auxiliary parameter. I'll look into possibly exposing this configuration option through the GUI.

I'm looking forward to updating to 12! Just waiting for U1. :) Here's a ticket for the GUI https://jira.ixsystems.com/browse/NAS-108387
 

aviegas

Dabbler
Joined
Aug 14, 2011
Messages
16
Anyone that had an encounter with a corrupted sparsebundle file/directory/backup (view it as you like) can readly appreciate the auto-backup feature. Really cool feature. Combine it with exposing the snapshot (make it visible and add a symbolic link to it) and the user has immediate access to all previous versions of the sparsebundle.

I'm just curious on what's the definition of a clean share disconnect to deem the dataset "consistent" (as far as the sparsebundle directory is concened)?
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,554
Anyone that had an encounter with a corrupted sparsebundle file/directory/backup (view it as you like) can readly appreciate the auto-backup feature. Really cool feature. Combine it with exposing the snapshot (make it visible and add a symbolic link to it) and the user has immediate access to all previous versions of the sparsebundle.

I'm just curious on what's the definition of a clean share disconnect to deem the dataset "consistent" (as far as the sparsebundle directory is concened)?
SMB client sends SMB2 TREE_DISCONNECT request to the server for the share in question. https://docs.microsoft.com/en-us/op.../ms-smb2/a0a08d74-204e-464e-9db8-09fdaa6b3379

If limit our understanding of "bad things happening that break your sparsebundle" to powerloss, network disconnections, server restart, etc, the SMB server will not receive / process a tree disconnect request and therefore no snapshot taken. At some point in time I may review more time machine pcaps to improve heuristics for when an actual time machine backup is in progress.
 
Last edited:

JRM

Cadet
Joined
Jul 28, 2016
Messages
2
@anodos

Is there now existing documentation related to timemachine aux parameters? Aside from feature requests and links to threads such as these i'm having trouble finding anything organized.

Related to this issue, i've added "tmprotect:retention 1" to my smb parameters, verified that it is recorded in smb4.conf - yet i'm seeing auto snapshots lasting for multiple days. I appreciate the feature, but it would great to get a better understanding of how to manage these snapshots in more controlled ways and troubleshoot if needed. Is there something like tmprotect:max_snap option?
 

bearattack11

Dabbler
Joined
Jan 1, 2021
Messages
11
@anodos

Is there now existing documentation related to timemachine aux parameters? Aside from feature requests and links to threads such as these i'm having trouble finding anything organized.

Related to this issue, i've added "tmprotect:retention 1" to my smb parameters, verified that it is recorded in smb4.conf - yet i'm seeing auto snapshots lasting for multiple days. I appreciate the feature, but it would great to get a better understanding of how to manage these snapshots in more controlled ways and troubleshoot if needed. Is there something like tmprotect:max_snap option?
Did you ever find a solution to this? The tmprotect:retention flag isn’t working for me either.
 
Joined
Jan 27, 2020
Messages
577
With "enhanced time machine" preset we automatically snapshot the time machine dataset on clean share disconnect so that you have a stable point in time in which to roll back time machine in case of a corrupted backup (without having to generate a new sparsebundle volume).

So any additional snapshot tasks for that TM aren't exactly useful? Because retention is handled by that aux parameter? My TM dataset is getting inflated and I try to understand why...
 
Top