SMB and Time Machine

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
I'm having the same problem on 12.0-U8 (not 8.1) since 20 May. I can't recall having changed anything on the system (haven't even rebooted it; it's been up 43 days). I did restart a network switch on 20 May (the one in the server rack with my NAS), but I'm otherwise communicating fine with the NAS, including SMB working on other shares. /var/log/samba4/log.smbd shows absolutely nothing at the time of the attempt--here's what's there when I try a backup at 8:35 AM:
Code:
root@freenas2[~]# tail -f /var/log/samba4/log.smbd
[2022/06/05 13:56:15.164039,  4] ../../auth/auth_log.c:753(log_successful_authz_event_human_readable)
  Successful AuthZ: [SMB2,NTLMSSP] user [FREENAS]\[dan] [S-1-5-21-2413538992-2029167151-3841831621-1000] at [Sun, 05 Jun 2022 13:56:15.164013 EDT] Remote host [ipv4:192.168.1.203:56683] local host [ipv4:192.168.1.10:445]
[2022/06/05 22:00:53.213340,  3] ../../auth/auth_log.c:653(log_authentication_event_human_readable)
  Auth: [SMB2,(null)] user [FREENAS]\[dan] at [Sun, 05 Jun 2022 22:00:53.213291 EDT] with [NTLMv2] status [NT_STATUS_OK] workstation [DAN-MAC-MINI-2] remote host [ipv4:192.168.1.197:57876] became [FREENAS]\[dan] [S-1-5-21-2413538992-2029167151-3841831621-1000]. local host [ipv4:192.168.1.10:445]
[2022/06/05 22:00:53.217748,  4] ../../auth/auth_log.c:753(log_successful_authz_event_human_readable)
  Successful AuthZ: [SMB2,NTLMSSP] user [FREENAS]\[dan] [S-1-5-21-2413538992-2029167151-3841831621-1000] at [Sun, 05 Jun 2022 22:00:53.217717 EDT] Remote host [ipv4:192.168.1.197:57876] local host [ipv4:192.168.1.10:445]
[2022/06/06 05:44:03.674490,  3] ../../auth/auth_log.c:653(log_authentication_event_human_readable)
  Auth: [SMB2,(null)] user [FREENAS]\[dan] at [Mon, 06 Jun 2022 05:44:03.674439 EDT] with [NTLMv2] status [NT_STATUS_OK] workstation [DAN-MAC-MINI-2] remote host [ipv4:192.168.1.197:58130] became [FREENAS]\[dan] [S-1-5-21-2413538992-2029167151-3841831621-1000]. local host [ipv4:192.168.1.10:445]
[2022/06/06 05:44:03.679076,  4] ../../auth/auth_log.c:753(log_successful_authz_event_human_readable)
  Successful AuthZ: [SMB2,NTLMSSP] user [FREENAS]\[dan] [S-1-5-21-2413538992-2029167151-3841831621-1000] at [Mon, 06 Jun 2022 05:44:03.679049 EDT] Remote host [ipv4:192.168.1.197:58130] local host [ipv4:192.168.1.10:445]

Note that the last entry is almost three hours ago.

This is happening on two machines, a Mac Mini running macOS 12.1, and a Macbook Pro running macOS 10.15.7. Bouncing the SMB service doesn't help; the client machine still gives the same error ("Backup Disk Not Available"), and there's nothing in the SMB log. @anodos, IIRC, you're our resident SMB guru--any suggestions of what to look at from here?
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
There is a quota on the dataset, but there's still 900+GB capacity remaining before it hits the quota. But in hopes of narrowing down the issue further, I used the "Console" application to check the logs on the Mac. These appear to be the relevant entries:
Code:
error    10:49:14.927793-0400    backupd    NAConnectToServerSync failed with error: 65 (No route to host) for url: smb://dan@freenas2._smb._tcp.local./dan-tm
error    10:50:50.632977-0400    backupd    NAConnectToServerSync failed with error: 65 (No route to host) for url: smb://dan@freenas2._smb._tcp.local./dan-tm
error    10:52:26.457825-0400    backupd    NAConnectToServerSync failed with error: 65 (No route to host) for url: smb://dan@freenas2._smb._tcp.local./dan-tm
error    10:52:26.460076-0400    backupd    Backup failed (18: BACKUP_FAILED_TARGETVOL_NOT_FOUND - The backup disk could not be found.)

I have a half-dozen SMB shares mounted on this computer right now, including the Time Machine share, but it's giving "no route to host."
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
I'm thinking this has something to do with mDNS discovery, but I'm not sure what. Here's what I get on one of the client machines:
Code:
 dan@Dan-MacBook-Pro-2013  ~  dns-sd -B _smb._tcp.
Browsing for _smb._tcp.
DATE: ---Mon 06 Jun 2022---
16:39:13.282  ...STARTING...
Timestamp     A/R    Flags  if Domain               Service Type         Instance Name
16:39:13.283  Add        3   4 local.               _smb._tcp.           omv - SMB/CIFS
16:39:13.283  Add        3   4 local.               _smb._tcp.           fntest
16:39:13.283  Add        2   4 local.               _smb._tcp.           VOLUMIO
^C

Notably absent is the primary TrueNAS box.
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,554
Time machine relies on _adisk._tcp. records as well as SMB ones for discovery. Also check for _user_ quota on dataset and not just regular dataset quota.
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
...and about 10 minutes after I posted, despite it not working for over two weeks and me changing nothing, it's now started working. Good that it's working, frustrating to have no idea why. Thanks for the suggestions, I'll keep them in mind in case of future trouble. There's no user quotas on the dataset in question at this time.
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,554
...and about 10 minutes after I posted, despite it not working for over two weeks and me changing nothing, it's now started working. Good that it's working, frustrating to have no idea why. Thanks for the suggestions, I'll keep them in mind in case of future trouble. There's no user quotas on the dataset in question at this time.
There are typically only a few causes for time machine to fail:
* lack of space
* lack of permissions
* mDNS issues (_smb.tcp. and _adisk.tcp. records should be visible)
* time machine not enabled on share
* auxiliary parameters in one or more shares that breaks time machine. (MacOS determines whether we're an OSX server based on first share it connects to. We automatically configure things correctly, but auxiliary parameters can break this).
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
* mDNS issues (_smb.tcp. and _adisk.tcp. records should be visible)
In Monday's test, I didn't see _smb._tcp for my FreeNAS box. Today, I do. Puzzling.

As I look through my shares for aux parameters, though, I do see some with aux parameters set, though there are no aux parameters on the Time Machine shares. I don't remember setting them, but this machine has been running since 9.3, so maybe they were recommended at one point. Here are the ones I'm seeing:
Code:
vfs objects = zfs_space zfsacl streams_xattr

hide dot files = no
vfs objects = zfs_space zfsacl streams_xattr

vfs objects = 

vfs objects = zfs_space zfsacl streams_xattr


They seem to belong to "older" shares (shares I've created more recently don't have these), though I can't identify an exact point in time for when they stopped showing up.
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,554
In Monday's test, I didn't see _smb._tcp for my FreeNAS box. Today, I do. Puzzling.

As I look through my shares for aux parameters, though, I do see some with aux parameters set, though there are no aux parameters on the Time Machine shares. I don't remember setting them, but this machine has been running since 9.3, so maybe they were recommended at one point. Here are the ones I'm seeing:
Code:
vfs objects = zfs_space zfsacl streams_xattr

hide dot files = no
vfs objects = zfs_space zfsacl streams_xattr

vfs objects =

vfs objects = zfs_space zfsacl streams_xattr


They seem to belong to "older" shares (shares I've created more recently don't have these), though I can't identify an exact point in time for when they stopped showing up.
Yeah, this is migration of old shares. In the olden days we used to allow users to pick and choose vfs_objects which led to varying misconfigurations. At some point we removed them and if the vfs_objects weren't precisely our defaults at the time of the migration we put them into an auxiliary parameter (the only safe move since we couldn't guarantee the change wouldn't affect on-disk data).

So basically with your setup, whether MacOS sees us as an OSX server depends on which share it connects to first. Those particular auxiliary parameters should be safe to comment-out.
 

fastzombies

Explorer
Joined
Aug 11, 2022
Messages
57
On TrueNAS-13.0-U1.1 and also cannot get SMB TimeMachine working. I have a dataset and add as SMB TM share and restart SMB service. On MacOS TM client finds it right away. Of I don't add ACL I get

Time Machine can't connect to the backup disk
The operation couldn’t be completed. (OSStatus error -1073741275.)

If I add a samba user with password or samba group I get

The selected network backup disk does not support the required capabilities.
Please choose a different network backup disk.

What am I missing? Thanks for any help.
 

fastzombies

Explorer
Joined
Aug 11, 2022
Messages
57
I took a guess and added Guest access and was able to connect that way. Not sure if that is the real solution or if that is a hack workaround. If there is a better way I am open to suggestions.
 
Top