TimeMachine backup issue


Recommended Posts

Been using TimeMachine for a month or so without any major issues, but one has popped up a couple of times.

 

I get a 'Backup in use' or similar message which stops time machine from running. I click more info and it say's the sparse bundle is being used. The only way I can resolve the issue is to restart unraid.

 

Anyone any ideas what may be causing the issue and how I can resolve, hopefully without having to restart the server?

 

Thanks.

Link to comment

There's a wealth of Time Machine information here.

 

EDIT: The above URL is no longer valid. The author of the site died a number of years ago and the domain registration has since expired. However it is archived here. Although the information is several years old now most of it is still relevant.

 

Edited by John_M
Update of URL
Link to comment
  • 6 months later...

@jademonkee,

Timely coincidence. I just had this happen on my system for the first time that I can remember (been using unRAID as a Time Machine target for at least 2 years) and remember seeing this post.

Decided to do some troubleshooting.

From the unRAID console, I ran this command to find all files opened on my Time Machine share (named "TimeMachine"):

lsof | grep TimeMachine

Which gave me this (abbreviated, there were about 50 very similar lines owned by these three processes):

shfs       7747  7749       root    7u      REG                9,4    8388608 5255019797 /mnt/disk4/TimeMachine/Jorgen’s MacBook Pro.sparsebundle/bands/169
afpd      24546           jorgen   11ur     REG               0,30    8388608     110480 /mnt/user/TimeMachine/Jorgen’s MacBook DIR               0,30       4096        Pro.sparsebundle/bands/169
cnid_dbd  25478           nobody  cwd       DIR               8,17        169  470203911 /mnt/cache/system/TimeMachine/.AppleDB

Which all looks normal for an AFP share being in use by Time Machine. Three processes have files open: shfs (unRAID share system), afpd (AFP, Apple's fileshare protocol) and cnidb (also part of AFP). You can see that the afpd process is started by the user name that my MacBook is using to connect to the TimeMachine share. The other two are unRAID system accounts.

I suspect the files in use by either the afpd or the cnid_dbd are the ones that the error messages refers to.

 

Now the problem is of course that the share ISN'T actually in use by the MacBook or any other Mac on my network.

My best guess is that something interrupted the previous TimeMachine backup in a way that prevented the process to exit cleanly on the unRAID side. In my case, I suspect the MacBook was put to sleep mid-backup. Easy to do if you don't pay attention to the Time Machine status when you shut the laptop lid. Naturally I'd blame other family members for this... :) 

 

Anyhow, with a bit of research I figured out that I could kill the afpd and cnid_dbd processes by restarting AFP on unRAID. So I made sure I ejected all unRAID shares from the Macs on my network, then in the unRAID web UI went to Settings / AFP, changed Enable AFP to No and clicked Apply.

I then ran the lsof command again and it came back with no results, as expected. Good, whatever had the files in use was gone.

Went back to Settings and enabled AFP again.

Then I kicked off another Time Machine backup form my MacBook and it completed successfully. No error message, happy days.

 

So I don't know for sure what caused the problem, but at least I found a workaround that helped in my case.

 

Hope this helps

 

  • Upvote 1
Link to comment

It happened to me again today.

Further testing is needed, but I suspect it might be related to me changing network interfaces - ie moving from wifi to ethernet.

I know that Timemachine should only run when it's connected to power, though, and if I connect my laptop to power, it's also going to be connected to ethernet, so Timemachine should never run while it's on wifi. But nonetheless, I suspect that when I remove my Macbook from ethernet and run it on wifi for a time, then later plug it into power + ethernet, it will then cause the 'disk in use error.'

I just tried your workaround and it worked, thanks.

I'll keep an eye on the happenings and see if I can nail down the cause.

Cheers.

Link to comment
  • 1 year later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.