Fix Time Machine Sparsebundle NAS Based Backup Errors

Time Machine

This is a modification of an original post for use when you have a corrupt sparsebundle backup on a NAS (as opposed to an external drive attached to a router) and it needs to be repaired. The NAS is likely a hardware product from the likes of Netgear, Synology, Buffalo or QNap – or for those of us with a home-grown backup server running FreeNAS.

The error you may see is “Time Machine completed a verification of your backups. To improve reliability, Time Machine must create a new backup for you.” This can be fixed by following the below.

From your Mac, connect to the network share that houses the sparsebundle.

At the top level of the drive are the various sparsebundles that make up your individual computer backups.

Do not double click on these sparsebundles or try to repair with Disk Utility.

Open Terminal and then switch to root by typing

sudo su -

and then enter your password.

The verication that has already run has marked your sparsebundle as bad, so first we need to make it look normal.

From the command line

chflags -R nouchg /Volumes/{name of your network share}/{name of}.sparsebundle

This may take a little while.

Now type

hdiutil attach -nomount -noverify -noautofsck /Volumes/{name of your network share/{name of}.sparsebundle

You will then see something like

/dev/diskx Apple_partition_scheme
/dev/diskxs1 Apple_partition_map
/dev/diskxs2 Apple_HFSX

Where x is the disk id for the external disk. You are interested in the one labeled Apple_HFSX or Apple_HFS. It might be 2, 3, 4 or higher.

At this point, I have found that the filesystem check is already happening. You can check for activity by tail’ing the fsck_hfs.log

tail -f /var/log/fsck_hfs.log

If fsck is going then in my experience it will be able to repair the sparsebundle. Go away for a few hours and let it chug away.

When it is done, you will either see

‘The Volume was repaired successfully’

or

‘The Volume could not be repaired’

If the latter you can run disk repair again:

fsck_hfs -drfy /dev/diskxs2

(Optionally if you have the available RAM, you can set a RAM cache in the command above to help speed up this command like so:

fsck_hfs -drfy -c 750 /dev/diskxs2

This will use 750MB of RAM – feel free to change this amount to best fit your system (amount of RAM vs size of your Time Machine Sparsebundle). If you are unsure about this, use the first command.

Make sure to replace x with whatever number your disk is from the output above.

The letters “drfy” tell the filecheck utility different things. d for ‘Show Debug’ – r for ‘Rebuild Catalog Tree’ – f for ‘Force’ and y for assume ‘yes’ to any prompts.

Now go do something for an hour or two. Come back and

tail -f /var/log/fsck_hfs.log

If all went well, the last output you will see is

‘The Volume was repaired successfully’

Now you need to type
hdiutil detach /dev/diskxs2

You can redo the above for any other Time Machine sparse bundles you have permission to modify while you have the network share attached to your computer.

Final step.

When complete, you need to edit an plist file within the sparsebundle that records the state of the backup. On the top level of the sparsebundle find a file called com.apple.TimeMachine.MachineID.plist. Edit it and remove these two nodes

<key>RecoveryBackupDeclinedDate</key>
<date>{whatever-the-date}</date>

Finally you want to change

<key>VerificationState</key>
<integer>2</integer>

to
<key>VerificationState</key>
<integer>0</integer>

Now you can eject the network share and have Time Machine give it another go. After the (long) verification step, backups should proceed once again.

Notes:

Ideally this should be done over a gigabit wired network connection. Do not attempt using Wi-Fi. You also want to make sure your machine does not go to sleep during the above operation.

[Update: 1.1.2013]

I appreciate all the warm feedback from people all over the world who have been helped by this post. This site helps to fund my hobbies, so if this post has helped you please consider a USD $1.99 donation to my hobby fund.

[paypal-donation]

[Update: 12.23.2012]

If after running the initial

fsck_hfs -drfy /dev/diskxs2

command you get a message in the fsck_hfs.log along the lines of

RebuildBTree – record x in node y is not recoverable.

then try

fsck_hfs -p /dev/diskxs2

followed by

fsck_hfs -drfy /dev/diskxs2

And see if that works.  It did for me today.

330 thoughts on “Fix Time Machine Sparsebundle NAS Based Backup Errors

  1. Hi Garth, would your sparse bundle fix help me fix some corrupt backup DMG files I have? I get the no mountable file system error on them.

  2. Thanks for this. I know this is an old thread, but it really works to recover a backup–make it possible to enter the Time Machine. However, when I try to use that recovered backup to continue backing up, I get an error that the file does not have write permissions. Since my NAS backup seems to need to be repaired about once a month (probably due to network connection issues), I need not only to be able to enter the Time Machine but keep using the repaired one rather than starting a fresh backup every month. I’ve posted on my NAS forum with no luck. Any idea what the permissions on the sparsebundle should be to make it write-able. Mine right now are drwx–S— MacbookProusername users

  3. For anyone who runs into the error “Time Machine cannot use the disk image because it read-only” at the end of the process, go back and rerun the “chflags -R nouchg” command from the beginning. It will fix any permissions that might’ve been changed in the repair process.

  4. Can you post some screen shots – or explain in more detail how to do these things
    From your Mac, connect to the network share that houses the sparsebundle.

    At the top level of the drive are the various sparsebundles that make up your individual computer backups.

    Do not double click on these sparsebundles or try to repair with Disk Utility.

    Open Terminal and then switch to root by typing

  5. That works great!
    I have been able to recover from my corrupted bundle a life of pictures.
    Thank you so much!

  6. Thanks so much Garth! This help guide me to resolve the problem.

    For those of you with the Seagate Business NAS product using Protect Job Manager > Local Backup note that the volume isn’t mounted until needed. I would recommend bookmarking this server location in the Finder: Go > Connect to Server…, then enter afp://@.local/.TMBACKUP and click the “+” button to add to your Favorite Servers. Of course if you want to real geeky you can just mount it from the command line.

  7. Thanks for sharing dude!

    You just saved me loads of time, and eventually my backups!

    Cheers!

  8. While waiting for fsck to finish, I wanted to share solutions to the problems that i had.
    I have TimeMachine backup on linux server with netatalk installed.

    First error with permissions for changing flags:

    # chflags -R nouchg /Volumes/TimeMachine/MacBook\ Air\ 13.sparsebundle
    chflags: /Volumes/TimeMachine/MacBook Air 13.sparsebundle: Permission denied

    Fixed with executing chmod on server:

    # chmod -R 777 MacBook\ Air\ 13.sparsebundle

    To be sure that permissions will be refreshed i restarted netatalk service and remounted volumes on my Mac.

    # service netatalk restart

    I attached sparsebundle, but in fsck_hfs.log my HFS disk was labeled with “NO WRITE”.

    # hdiutil attach -nomount -noverify -noautofsck /Volumes/TimeMachine/
    ...
    ** /dev/rdisk1s2 (NO WRITE)

    Fsck cannot repair readonly disk, so i tried executing hdiutil with -readwrite option, but still without success.

    # hdiutil attach -readwrite -nomount -noverify -noautofsck /Volumes/TimeMachine/MacBook\ Air\ 13.sparsebundle
    hdiutil: attach failed - Read-only file system

    I managed that changing permissions on root folder where sparsebundle files are saved on server fixed the problem.

    # chmod 777 TimeMachine/ # (note: not recursvie here)

    Now when i executed hdiutil with -readwrite option, fsck started and fixed everything automatically.

    I know that it’s not a good idea to set 777 everywhere, but it succeeded and after all i restored original permissions to all files.


    ** The volume Time Machine Backups was repaired successfully.

    After editing plist file, my TimeMachine is working like a charm.

  9. Any new updates on this for Mavericks? Or an app to do it or something? I am Using a Wd My Book Live Duo 6 TB and after a week of getting my initial backup done its asking to dart a new backup which is insane to go through again. ( and entering time machine seems still work fine) So I was trying this solution and I am having trouble with the formatting of the path for my sparse bundle. Tried using trial of Pathfinder to get it right but I still get no such file or directory error…very frustrating.

    Here is the normal path:
    /Volumes/TimeMachineBackup/Miles’s Mac Pro.sparsebundle

    any help would be greatly appreciated!!!

  10. Ran through this several times:
    – let fsck run itself (failed to repair)
    – ran -drfy with 1Gb cache (failed to repair)
    – ran -p with 1Gb cache (failed to repair)
    – ran -drfy with 1.5Gb cache, twice (failed to repair)

    getting the following:
    ** The volume {XXXXX} could not be repaired.
    volume type is pure HFS+
    primary MDB is at block 0 0x00
    alternate MDB is at block 0 0x00
    primary VHB is at block 2 0x02
    alternate VHB is at block 943718398 0x383ffffe
    sector size = 512 0x200
    VolumeObject flags = 0x03
    total sectors for volume = 943718400 0x38400000
    total sectors for embedded volume = 0 0x00
    CheckHFS returned 8, fsmodified = 0

    guess its off the start time machine from scratch… lucky I don’t really need the history.

    I think I will look at increasing the band size to see if this avoids the problem recurring.

    Thanks for the good suggestions though.

    Just as well I always do a SuperDuper! volume copy every month or so… so I still have a backup 🙂

  11. Am working through the recommendations now…
    and looking positive… only got “Incorrect number of hard links” in the log.

    but one question – has anyone tried using DiskWarrior or TechTool Pro? Could they fix it without the need for terminal? Just a thought…

  12. Great guide! However, when using tail to look at the progress in fsck_hfs.log I get the message “QUICKCHECK ONLY; FILESYSTEM CLEAN”.

    How do you suggest I proceed?

  13. Has anyone used this successfully with Mavericks? I have been unsuccessful and this is the output I get. It seems to still be running but has been sitting for about 6 hours now.

    andy-foards-mbp:~ root# hdiutil attach -nomount -noverify -noautofsck /Volumes/
    TM/Andy\ Foards\ MBP.sparsebundle/
    /dev/disk2 GUID_partition_scheme
    /dev/disk2s1 EFI
    /dev/disk2s2 Apple_HFS
    andy-foards-mbp:~ root# tail -f /var/log/fsck_hfs.log
    QUICKCHECK ONLY; FILESYSTEM CLEAN
    /dev/rdisk1s2: fsck_hfs completed at Fri Jan 24 17:51:30 2014

    /dev/rdisk2s2: fsck_hfs started at Fri Jan 24 18:46:43 2014
    /dev/rdisk2s2: /dev/rdisk2s2: ** /dev/rdisk2s2 (NO WRITE)
    /dev/rdisk2s2: Executing fsck_hfs (version hfs-226.1.1).
    QUICKCHECK ONLY; FILESYSTEM DIRTY
    /dev/rdisk2s2: fsck_hfs completed at Fri Jan 24 18:46:43 2014

    /dev/rdisk3s2: fsck_hfs started at Fri Jan 24 21:05:40 2014
    /dev/rdisk3s2: /dev/rdisk3s2: ** /dev/rdisk3s2 (NO WRITE)
    /dev/rdisk3s2: Executing fsck_hfs (version hfs-226.1.1).
    QUICKCHECK ONLY; FILESYSTEM CLEAN
    /dev/rdisk3s2: fsck_hfs completed at Fri Jan 24 21:05:40 2014

    /dev/rdisk3s2: fsck_hfs started at Fri Jan 24 21:05:51 2014
    /dev/rdisk3s2: /dev/rdisk3s2: ** /dev/rdisk3s2 (NO WRITE)
    /dev/rdisk3s2: Executing fsck_hfs (version hfs-226.1.1).
    QUICKCHECK ONLY; FILESYSTEM CLEAN
    /dev/rdisk3s2: fsck_hfs completed at Fri Jan 24 21:05:51 2014

    /dev/rdisk3s2: fsck_hfs started at Sat Jan 25 03:01:52 2014
    /dev/rdisk3s2: /dev/rdisk3s2: ** /dev/rdisk3s2 (NO WRITE)
    /dev/rdisk3s2: Executing fsck_hfs (version hfs-226.1.1).
    QUICKCHECK ONLY; FILESYSTEM CLEAN
    /dev/rdisk3s2: fsck_hfs completed at Sat Jan 25 03:01:52 2014

    /dev/rdisk3s2: fsck_hfs started at Sat Jan 25 03:02:03 2014
    /dev/rdisk3s2: /dev/rdisk3s2: ** /dev/rdisk3s2 (NO WRITE)
    /dev/rdisk3s2: Executing fsck_hfs (version hfs-226.1.1).
    QUICKCHECK ONLY; FILESYSTEM CLEAN
    /dev/rdisk3s2: fsck_hfs completed at Sat Jan 25 03:02:03 2014

    /dev/rdisk3s2: fsck_hfs started at Sat Jan 25 04:00:38 2014
    /dev/rdisk3s2: /dev/rdisk3s2: ** /dev/rdisk3s2 (NO WRITE)
    /dev/rdisk3s2: Executing fsck_hfs (version hfs-226.1.1).
    QUICKCHECK ONLY; FILESYSTEM CLEAN
    /dev/rdisk3s2: fsck_hfs completed at Sat Jan 25 04:00:38 2014

    /dev/rdisk3s2: fsck_hfs started at Sat Jan 25 04:00:38 2014
    /dev/rdisk3s2: /dev/rdisk3s2: ** /dev/rdisk3s2 (NO WRITE)
    /dev/rdisk3s2: Executing fsck_hfs (version hfs-226.1.1).
    QUICKCHECK ONLY; FILESYSTEM CLEAN
    /dev/rdisk3s2: fsck_hfs completed at Sat Jan 25 04:00:38 2014

    /dev/rdisk3s2: fsck_hfs started at Sat Jan 25 04:55:17 2014
    /dev/rdisk3s2: /dev/rdisk3s2: ** /dev/rdisk3s2 (NO WRITE)
    /dev/rdisk3s2: Executing fsck_hfs (version hfs-226.1.1).
    QUICKCHECK ONLY; FILESYSTEM CLEAN
    /dev/rdisk3s2: fsck_hfs completed at Sat Jan 25 04:55:17 2014

    /dev/rdisk3s2: fsck_hfs started at Sat Jan 25 04:55:17 2014
    /dev/rdisk3s2: /dev/rdisk3s2: ** /dev/rdisk3s2 (NO WRITE)
    /dev/rdisk3s2: Executing fsck_hfs (version hfs-226.1.1).
    QUICKCHECK ONLY; FILESYSTEM CLEAN
    /dev/rdisk3s2: fsck_hfs completed at Sat Jan 25 04:55:17 2014

  14. Hey Garth,
    I wanted to take a second and thank you for the detailed step-by-step instructions. They worked great, and my TimeMachine.sparsebundle was recovered. I really do appreciate the post!

  15. This has been immensely useful. Like some other commenters, my sparsebundle seems to get corrupted again occasionally, to the point where I got fed up and wrote a script. For those interested, you can grab it at http://pastebin.com/iw5nYFb0 but note that it does only the barest of error-checking and will abort on the first failure. YMMV, but it works great for me. You must supply the location of your sparsebundle file to the script.

  16. Hello, I’ve tried this fix, but I still get the ‘The Volume could not be repaired’ error after repairing a few times. There also aren’t any files in the sparsebundle, only a ‘bands’ folder, info.bckup and info.plist, and ‘token’.
    Hope you can help!

  17. Hi Garth
    i used your amazing guide from start to end and the sparsebundle now is clean.
    But trying to mount the sparsebundle still giving the “no file system mountable”

    have you suggestions?
    thank you
    davide

  18. Hi,

    Thank you for post a detailed fix,

    I have unfortunately been struggling at the first stage for days,

    I enter terminal and follow the instructions;

    Last login: Wed Dec 4 15:38:11 on ttys000
    JakesMacBook:~ jakespurgeon$ /bin/zsh
    JakesMacBook% sudo su –
    JakesMacBook:~ root# chflags -R nouchg//Volumes/TimeMachine/JakesMacBook.sparsebundle
    usage: chflags [-fhv] [-R [-H | -L | -P]] flags file …
    JakesMacBook:~ root# hdiutil attach -nomount -noverify -noautofsck//Volumes/TimeMachine/JakesMacBook.sparsebundle
    hdiutil: attach: unknown option “-noautofsck//Volumes/TimeMachine/JakesMacBook.sparsebundle”
    Usage: hdiutil attach [options]
    hdiutil attach -help
    JakesMacBook:~ root#

    I don’t seem to have anything relating to what should happen,

    Any advise would be greatly appreciated.

    Thanks

    Jake

  19. Thanks so much for these instructions. I just wonder – after typing
    tail -f /var/log/fsck_hfs.log
    it has been running now for almost a week and has been giving feedback a few times but for the last few times it was always the same:
    /dev/rdisk3s2: fsck_hfs run at Wed Nov 6 16:57:11 2013
    /dev/rdisk3s2: ** /dev/rdisk3s2 (NO WRITE)
    /dev/rdisk3s2: Executing fsck_hfs (version diskdev_cmds-491.6~3).
    QUICKCHECK ONLY; FILESYSTEM CLEAN

    /dev/rdisk3s2: fsck_hfs run at Fri Nov 8 06:13:07 2013
    /dev/rdisk3s2: ** /dev/rdisk3s2 (NO WRITE)
    /dev/rdisk3s2: Executing fsck_hfs (version diskdev_cmds-491.6~3).
    QUICKCHECK ONLY; FILESYSTEM CLEAN

    /dev/rdisk3s2: fsck_hfs run at Fri Nov 8 06:13:07 2013
    /dev/rdisk3s2: ** /dev/rdisk3s2 (NO WRITE)
    /dev/rdisk3s2: Executing fsck_hfs (version diskdev_cmds-491.6~3).
    QUICKCHECK ONLY; FILESYSTEM CLEAN

    /dev/rdisk3s2: fsck_hfs run at Sat Nov 9 10:16:37 2013
    /dev/rdisk3s2: ** /dev/rdisk3s2 (NO WRITE)
    /dev/rdisk3s2: Executing fsck_hfs (version diskdev_cmds-491.6~3).
    QUICKCHECK ONLY; FILESYSTEM CLEAN

    /dev/rdisk3s2: fsck_hfs run at Sat Nov 9 19:12:19 2013
    /dev/rdisk3s2: ** /dev/rdisk3s2 (NO WRITE)
    /dev/rdisk3s2: Executing fsck_hfs (version diskdev_cmds-491.6~3).
    QUICKCHECK ONLY; FILESYSTEM CLEAN

    /dev/rdisk3s2: fsck_hfs run at Sun Nov 10 01:06:32 2013
    /dev/rdisk3s2: ** /dev/rdisk3s2 (NO WRITE)
    /dev/rdisk3s2: Executing fsck_hfs (version diskdev_cmds-491.6~3).
    QUICKCHECK ONLY; FILESYSTEM CLEAN

    /dev/rdisk3s2: fsck_hfs run at Sun Nov 10 01:27:53 2013
    /dev/rdisk3s2: ** /dev/rdisk3s2 (NO WRITE)
    /dev/rdisk3s2: Executing fsck_hfs (version diskdev_cmds-491.6~3).
    QUICKCHECK ONLY; FILESYSTEM CLEAN

    /dev/rdisk3s2: fsck_hfs run at Sun Nov 10 17:00:56 2013
    /dev/rdisk3s2: ** /dev/rdisk3s2 (NO WRITE)
    /dev/rdisk3s2: Executing fsck_hfs (version diskdev_cmds-491.6~3).
    QUICKCHECK ONLY; FILESYSTEM CLEAN

    I usually switch the computer off during the night to save power etc, so I wonder whether I can stop these runs now since they do not seem to change anything?

    1. … just now a new one appeared:
      /dev/rdisk4s2: fsck_hfs run at Mon Nov 11 15:31:28 2013
      /dev/rdisk4s2: ** /dev/rdisk4s2 (NO WRITE)
      /dev/rdisk4s2: Executing fsck_hfs (version diskdev_cmds-491.6~3).
      QUICKCHECK ONLY; FILESYSTEM CLEAN

      So maybe I should indeed let it finish since now it has moved on .

      1. Hi there, I have the exact same situation as Susanne. Have typed tail -f /var/log/fsck_hfs.log and waited for almost a week. There are coming feedback once a day, roughly at the same time… just as Susanne has posted. I have a 1.8 TB sparse bundle, but this is long time. I stopped the process and have not done anything more yet. TM is tuned off (living in danger without back up), and waiting for time to try again, but would really like to know if it worth the waiting or am I on the wrong track here…

        Geir

    2. Hi Garth
      Firstly thanks a lot for the easy guide. I got the fail repeatedly the last months always restarting the back-up and now tried your approach. I do get a problem though:
      After I used the command

      tail -f /var/log/fsck_hfs.log

      I get this:

      QUICKCHECK ONLY; FILESYSTEM CLEAN
      /dev/rdisk0s3: fsck_hfs completed at Tue Mar 11 12:26:27 2014

      /dev/rdisk1s2: fsck_hfs started at Tue Mar 11 12:44:20 2014
      /dev/rdisk1s2: /dev/rdisk1s2: ** /dev/rdisk1s2 (NO WRITE)
      /dev/rdisk1s2: Executing fsck_hfs (version hfs-226.1.1).
      QUICKCHECK ONLY; FILESYSTEM DIRTY
      /dev/rdisk1s2: fsck_hfs completed at Tue Mar 11 12:44:20 2014

      /dev/rdisk2s2: fsck_hfs started at Tue Mar 11 12:45:31 2014
      /dev/rdisk2s2: /dev/rdisk2s2: ** /dev/rdisk2s2 (NO WRITE)
      /dev/rdisk2s2: Executing fsck_hfs (version hfs-226.1.1).
      QUICKCHECK ONLY; FILESYSTEM CLEAN
      /dev/rdisk2s2: fsck_hfs completed at Tue Mar 11 12:45:31 2014

      /dev/rdisk2s2: fsck_hfs started at Tue Mar 11 12:45:31 2014
      /dev/rdisk2s2: /dev/rdisk2s2: ** /dev/rdisk2s2 (NO WRITE)
      /dev/rdisk2s2: Executing fsck_hfs (version hfs-226.1.1).
      QUICKCHECK ONLY; FILESYSTEM CLEAN
      /dev/rdisk2s2: fsck_hfs completed at Tue Mar 11 12:45:31 2014

      – it seems stuck in a loop, so I went out with Ctrl+c and ran your suggested

      fsck_hfs -drfy /dev/disk1s2

      The system reply was the following:


      journal_replay(/dev/disk1s2) returned 0
      ** /dev/rdisk1s2
      Using cacheBlockSize=32K cacheTotalBlock=32768 cacheSize=1048576K.
      Executing fsck_hfs (version hfs-226.1.1).
      ** Checking Journaled HFS Plus volume.
      ** Detected a case-sensitive volume.
      The volume name is Time Machine Backups
      ** Checking extents overflow file.
      ** Checking catalog file.
      ** Rebuilding catalog B-tree.
      Extent records for rebuilt file 4:
      [ 6586142, 43264 ]
      [ 720897, 0 ]
      [ 0, 0 ]
      [ 0, 0 ]
      [ 0, 0 ]
      [ 0, 0 ]
      [ 0, 0 ]
      [ 0, 0 ]
      hfs_UNswap_BTNode: invalid node height (1)
      btree file 4: 1000 records
      btree file 4: 2000 records
      btree file 4: 3000 records
      btree file 4: 4000 records
      btree file 4: 5000 records
      btree file 4: 6000 records
      btree file 4: 7000 records
      btree file 4: 8000 records
      btree file 4: 9000 records
      btree file 4: 10000 records
      btree file 4: 11000 records
      RebuildBTree - InsertBTreeRecord failed with err 35 0x23
      RebuildBTree - numRecords = 11176
      RebuildBTree - record 0 in node 229 is not recoverable.

      xxxxxxxx BTreeKey (length 30) xxxxxxxx
      1C 00 9B 15 00 00 0B 00 4E 00 65 00 77 00 20 00 ........N.e.w. .
      69 00 6E 00 20 00 43 00 53 00 20 00 36 00 i.n. .C.S. .6.

      xxxxxxxx BTreeData (length 248) xxxxxxxx
      02 00 8E 00 00 00 00 00 9C 15 00 00 D9 60 87 CB .............`..
      38 F3 00 CE C0 25 36 CF F4 04 37 CF 00 00 00 00 8....%6...7.....
      00 00 00 00 50 00 00 00 00 00 B4 81 01 00 00 00 ....P...........
      00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
      00 00 00 00 53 10 75 40 00 00 00 00 00 00 00 02 ....S.u@........
      00 00 00 00 00 00 00 00 5A 7C 00 00 00 00 00 00 ........Z|......
      00 00 00 00 04 00 00 00 73 5C 03 00 04 00 00 00 ........s\......
      00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
      00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
      00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
      00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
      00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
      00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
      00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
      00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
      00 00 00 00 00 00 00 00 ........
      ** The volume Time Machine Backups could not be repaired.
      volume type is pure HFS+
      primary MDB is at block 0 0x00
      alternate MDB is at block 0 0x00
      primary VHB is at block 2 0x02
      alternate VHB is at block 5763761094 0x1578c03c6
      sector size = 512 0x200
      VolumeObject flags = 0x07
      total sectors for volume = 5763761096 0x1578c03c8
      total sectors for embedded volume = 0 0x00
      CheckHFS returned 8, fsmodified = 1

      There are a lot of errors in that message,

      hfs_UNswap_BTNode: invalid node heigh


      RebuildBTree - InsertBTreeRecord failed with err 35 0x23


      RebuildBTree - record 0 in node 229 is not recoverable.

      Was that the final hurray for my backup (meaning it is completely gone) or am I just doing something wrong here?
      I appreciate any help
      Cheers
      Paul

  20. Alas, for the second time in a few months, I get the verify problem, and the hdiutil/fsck shows:

    : tail -f /var/log/fsck_hfs.log
    QUICKCHECK ONLY; FILESYSTEM CLEAN
    /dev/rdisk1s2: fsck_hfs completed at Sat Nov 9 09:47:03 2013

    /dev/rdisk1s2: fsck_hfs started at Sat Nov 9 16:17:49 2013
    /dev/rdisk1s2: /dev/rdisk1s2: ** /dev/rdisk1s2 (NO WRITE)
    /dev/rdisk1s2: Executing fsck_hfs (version hfs-226.1.1).
    QUICKCHECK ONLY; FILESYSTEM DIRTY
    /dev/rdisk1s2: fsck_hfs completed at Sat Nov 9 16:17:49 2013

    1. BTW: Forgot to mention that I’ve migrated to Mavericks, OSX 10.9. Is it possible things have changed and the routine no longer works?

  21. I can’t get past this step;

    chflags: /Volumes/mybooklive/TimeMachineBackup/TimeMachine/BryanBazemoresMacBook.sparsebundle: No such file or directory

  22. fsck_hfs -c 750M gives 750M cache, -c 750 gives something funny

  23. Ok – ran through the fsck and it found some errors and corrected them. However trying Migration utility it keeps saying No Volumes found in Backup and a dialog saying Some Backups cannot be opened – the only ones being the one I’m interested in – the others report Last Backup today 18:57 etc but No Volumes found in backup on the one for my Macbook. Help….

  24. After I type tail -f /var/log/fsck_hfs.log it give me this:

    /dev/rdisk1s2: fsck_hfs run at Tue Oct 22 21:46:24 2013
    /dev/rdisk1s2: ** /dev/rdisk1s2 (NO WRITE)
    /dev/rdisk1s2: Executing fsck_hfs (version diskdev_cmds-557.3.1~5).
    QUICKCHECK ONLY; FILESYSTEM DIRTY

    /dev/rdisk2s2: fsck_hfs run at Fri Oct 25 09:22:46 2013
    /dev/rdisk2s2: ** /dev/rdisk2s2 (NO WRITE)
    /dev/rdisk2s2: Executing fsck_hfs (version diskdev_cmds-557.3.1~5).
    QUICKCHECK ONLY; FILESYSTEM DIRTY

    Then i re-typed tail -f /var/log/fsck_hfs.log twice just because it’s now been 4h and thought it should be finished but nothing happens…

    Any thoughts?

  25. Am sure this works, but I can’t access the sparsebundle, there’s an accent on a letter “á” which I cannot type in terminal. Therefore it doesn’t find the directory.

    Am kind of new to terminal. I’ve been searching all over the web for this, but can’t seem to find an answer. Any chance you could help out, or point me in the right direction?

    Cheers. Ciarán

  26. Hi. I’m having trouble at the 2nd step. How long is “a little while” after this step:

    chflags -R nouchg /Volumes/{name of your network share}/{name of}.sparsebundle

    Should it be 1 minute? 5 minutes? 30 minutes? 1 hour+?

    Terminal seems to accept the command (doesn’t respond with an error), but also no the root# prompt. I’m connecting via WiFi to a 2TB Seagate GoFlex Home network storage system…

    Thank you!

  27. Hey man that totally worked – saved my bacon big time. Thanks and donation on the way!

  28. Hi there, I can’t seem to get past step 2! I get this message from Terminal:

    chflags: /Volumes/The Goods/Joe’s MacBook Pro.sparsebundle: No such file or directory

    In Terminal, I’ve typed it out like: chflags -R nouchg /Volumes/The\ Goods/Joe\’s\ MacBook\ Pro.sparsebundle

    What am I doing wrong? I’m connected, the shared network is running fine.

    Thanks.
    Joe

    1. Joe, I had the same problem which I worked around by changing the name to remove the apostrophe. I used the “Finder” GUI to do this. At the end of the process I changed the name back again.

      1. Terminal wont let me type a password. Besides that what password do I use?

    2. I have the same problem

      My backup named /Backups/Luis Diego’s MacBook and i put the command:
      chflags -R nouchg /Volumes/Backups/Luis\ Diego\’\s\ MacBook.sparsebundle
      chflags: /Volumes/Backups/Luis Diego’s MacBook.sparsebundle: No such file or directory

      How knows what is the problem??

      How can i change the backup name?

    3. Everything worked fine for me, as far as I can tell, until I tried to run another backup. This now fails with, “TimeMachine cannot use the disk image because it read-only”.

      I have rebooted my ReadyNAS NV+ II, which has a TimeMachine share defined. This share has its own authentication, where the username is ReadyNAS and it cannot be changed.

      I still get the same write-permission error. I will try running through the steps again to see if it helps.

    4. Type the the first part of the command then drag the sparsebundle out of the finder into the terminal window to fill in the filename and path. The easiest way to make sure you are typing the name correctly is to not TYPE it at all.

  29. Hello.

    I have a sparsebundle file that I cannot restore from my Time Machine Capsule. However, I get the response (from Terminal) that there is no file of the name given. I suspect that I have put it in incorrectly and wonder if you could advise me as to what the correct address would be for your line:

    chflags -R nouchg /Volumes/{name of your network share}/{name of}.sparsebundle

    It is external to my system and the information from the sparsebundle file is as follows:

    Where: /Volumes/Data
    Server: afp://SMB_Capsule._afpovertcp._tcp.local/Data/Stephen Brookes’s MacBook Pro

    1. Further to the last post, this is what the Terminal returns:

      sh-3.2# chflags -R nouchg /Volumes/Data/Macbook Pro.sparsebundle
      chflags: /Volumes/Data/Macbook: No such file or directory
      chflags: Pro.sparsebundle: No such file or directory
      sh-3.2#

      1. @Stephen Brooks – you need to escape that space between Macbook and Pro – something like

        chflags -R nouchg “/Volumes/Data/Macbook Pro.sparsebundle”

        or

        chflags -R nouchg /Volumes/Data/Macbook\ Pro.sparsebundle

        1. Dear Garth,

          Thanks a lot for your guide. Please help me with following. My sparse bundle is called Macbook Pro (4).sparsebundle. Space should be replaced by \, but what about ( and ) (brackets)? Which sign should replace them? Is the proper syntax “chflags -R nouchg /Volumes/TimeMachine/Macbook\Pro???.sparsebundle? network share/drive is called MyBookLive. Should this name also appear in string?

          Thx in advance for your effort and reply.

          Merry Xmas!

  30. Thanks for this – managed to verify that the sparsebundle was ok using the terminal commands but when I modified the .plist I got an error saying that the disk could not be written to (I am using a Synology NAS and I switched to an ethernet connection for the fix). When I reverted to the original .plist, TM was able to find the disk again.
    Here is what I changed the .plist from and to. Did I do something wrong?
    FROM:

    RecoveryBackupDeclinedDate
    2013-09-02T08:48:53Z
    VerificationDate
    2013-08-12T16:20:53Z
    VerificationExtendedSkip

    VerificationState
    2
    com.apple.backupd.HostUUID
    1859708A-52AF-5F72-8ED5-198730475AA8

    TO:

    VerificationDate
    2013-08-12T16:20:53Z
    VerificationExtendedSkip

    VerificationState
    0
    com.apple.backupd.HostUUID
    1859708A-52AF-5F72-8ED5-198730475AA8

    Thanks.

  31. Thanks for great instructions. I had two issues while trying to follow them. Firstly the filesystem check was read only – it said (NO WRITE) for the disk. After looking on other sites I read that the Mac often keeps a old connection to the NAS and so this new connection thinks it is already ‘in-use’. I restarted the NAS and then immediately followed the instructions and it worked. My second issue was the ‘fsck_hfs -drfy /dev/diskxs2’ command said the disk was not repairable even though I tried many times. Then I tried ‘fsck_hfs -p /dev/diskxs2’ as mentioned by another comment above and this fixed the disk which is happily running again.

    My NAS trouble started when I shut down the NAS for a day while decorating. In future I will make sure any Macs that use the NAS are shut down before stopping the NAS. To be sure none of them are running Time Machine back-ups.

  32. Another re-iteration of “Thanks again!”. Saved a lot of backups! Merci Beaucoup

    1. Bonjour “Len”. Je m’appelle Hocine KERZAZI. J’ai trouvé ton message de remerciement en français au sujet d’une résolution de problème liée à une sauvegarde Time Capsule corrompue.
      Je voulais savoir si tu parlais français auquel cas j’aimerais comprendre la manie qui est décrite pour résoudre mon problème car je ne pige pas très bien les consignes.
      Je t’en serai infiniment reconnaissant.

  33. Wooow, this works for me, I copied the .Sparsebundle ( 340G) into my MacPro and ran all this scripts, after 32 hours I was able to fix & mount the .Sparsebundle and copy my files.
    now i need assemble& find the screws and see if my TC works
    Sir Excellent job!

  34. Thanks, great! It worked for me. MacBookPro running Mountain Lion 10.8.4 and a QNAP TS219 as a NAS.
    With a fsck I saved my TM Backup history. Hopefully, I found your post!

  35. This works for about a week and then regresses back. Any way to make this more permanent?

  36. Dear Gareth

    I have followed your instruction but when I run the tail command I have the terminal stop at
    /dev/rdisk4s2: primary MDB is at block 0 0x00
    /dev/rdisk4s2: alternate MDB is at block 0 0x00
    /dev/rdisk4s2: primary VHB is at block 2 0x02
    /dev/rdisk4s2: alternate VHB is at block 3900400750 0xe87b646e
    /dev/rdisk4s2: sector size = 512 0x200
    /dev/rdisk4s2: VolumeObject flags = 0x07
    /dev/rdisk4s2: total sectors for volume = 3900400752 0xe87b6470
    /dev/rdisk4s2: total sectors for embedded volume = 0 0x00
    /dev/rdisk4s2: CheckHFS returned 7, fsmodified = 0

    and remain there for more than 9 hours, considering that I am connected to my drive through a Gig port….

    however when i ran fsck i get the error
    FD:~ root# fsck_hfs -drfy /dev/disk4s2
    Unable to open block device /dev/disk4s2: Resource busyjournal_replay(/dev/disk4s2) returned 16
    ** /dev/rdisk4s2 (NO WRITE)
    Using cacheBlockSize=32K cacheTotalBlock=32768 cacheSize=1048576K.
    Executing fsck_hfs (version diskdev_cmds-557.3.1~5).
    Journal is empty
    ** Checking Journaled HFS Plus volume.
    ** Detected a case-sensitive volume.
    The volume name is Time Machine Backups
    ** Checking extents overflow file.
    ** Checking catalog file.
    ** The volume Time Machine Backups was found corrupt and needs to be repaired.
    volume type is pure HFS+
    primary MDB is at block 0 0x00
    alternate MDB is at block 0 0x00
    primary VHB is at block 2 0x02
    alternate VHB is at block 3900400750 0xe87b646e
    sector size = 512 0x200
    VolumeObject flags = 0x07
    total sectors for volume = 3900400752 0xe87b6470
    total sectors for embedded volume = 0 0x00
    CheckHFS returned 7, fsmodified = 0

    Can you please advise and I promise I will donate,

    Thanks man

  37. So not a time machine back up for me. Instead I was using sparsebundles to create .dmg’s for FCP X. I think a network connection interruption lead to corrupting the .dmg. I get the “resource temporarily unavailable” message when I try and mount the image. I’m going to try and use this info to try and repair said volume tomorrow. I’m running mountain lion on a 27″ imac and the sparse bundle is located on an attached 32tb Raid 5 via thunderbolt. Nervous as all get out that I lost this volume and tips or tricks before I start this would be greatly appreciated.

    Cheers,
    s

  38. Thanks for this guide.

    I found that there’s backup of MachineID plist file in sparsebundle – com.apple.TimeMachine.MachineID.bckup

    This file also contains BackupDeclinedDate and VerificationState keys. I made the same changes to this file as to main MachineID plist file.

    Now TimeMachine works again.

  39. Tried the above but was not successful. Anything else to try?

    root# fsck_hfs -drfy -c 750 /dev/disk1s2journal_replay(/dev/disk1s2) returned 0
    ** /dev/rdisk1s2
    Using cacheBlockSize=32K cacheTotalBlock=128 cacheSize=4096K.
    Executing fsck_hfs (version diskdev_cmds-540.1~34).
    ** Checking Journaled HFS Plus volume.
    ** Detected a case-sensitive volume.
    The volume name is Time Machine Backups
    ** Checking extents overflow file.
    ** Checking catalog file.
    ** Rebuilding catalog B-tree.
    hfs_UNswap_BTNode: invalid node height (1)
    hfs_swap_BTNode: invalid forward link (0xCB645BD9)
    hfs_swap_BTNode: invalid backward link (0xCB645BD9)
    hfs_swap_BTNode: record #-1 invalid offset (0x0006)
    Invalid node structure
    (4, 19853)
    ** The volume Time Machine Backups could not be repaired.
    volume type is pure HFS+
    primary MDB is at block 0 0x00
    alternate MDB is at block 0 0x00
    primary VHB is at block 2 0x02
    alternate VHB is at block 4216996270 0xfb5a41ae
    sector size = 512 0x200
    VolumeObject flags = 0x07
    total sectors for volume = 4216996272 0xfb5a41b0
    total sectors for embedded volume = 0 0x00

  40. Dude – 1000 thank yous. Saved me a ton of time. Worked perfectly!!

Comments are closed.