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. Thanks for this. Any idea how patient I should be for the first chflags command?

    1. @lee mikles – i have seen it take about 30 minutes for large sparsebundles and slow networks. Make sure your machine is not set to sleep.

    1. This really helped. Like some others my disk passed the fsck_hfs check — the disk was OK. After editing the plist file made the backup useful. I just wish that I found this in September 2012 when I wiped out all my backups going back to 2008. The new time machine sparse bundle worked from Sept until Jan before giving this message.

  2. Thanks, helped for QNap TS-559 Pro II with a similar issue in OSX 10.6. Although the fsck_hfs.log didn’t say “volume repaired successfully”, but that it appears to be OK. After the final steps the Time Machine worked though.

  3. I started to follow the instructions, and it has been running the first fsck_hfs for more than 20 hours now! The first chflags and hdiutil seemed to work as expected, but then after tailing fsck_hfs, soon it quickly said:

    /dev/rdisk2s2: fsck_hfs run at Fri Dec 28 18:35:09 2012
    /dev/rdisk2s2: ** /dev/rdisk2s2 (NO WRITE)
    /dev/rdisk2s2: Executing fsck_hfs (version diskdev_cmds-540.1~25).
    QUICKCHECK ONLY; FILESYSTEM DIRTY

    and then the prompt keeps blinking in Terminal, with no further answer. Should I still wait ?

    FWIW, I am running 10.7.5 on a MacBook Air, connected over Ethernet to a 1TB Time Capsule, where the offending sparsebundle resides.

    I would appreciate any help.

    1. @pepito (and others)

      If you see “QUICKCHECK ONLY; FILESYSTEM DIRTY” in the fsck_hfs.log – that means that the volume has mounted and you can proceed with the “fsck_hfs -drfy …” command

  4. Marvelous ! You saved my backup 🙂 Now, I must find the reason why this TM is continuously crashing…

  5. With it being the holidays, I doubt I will get a reply soon, so I decided to fiddle. Not sure of what to do, I decided to type the following into the Terminal root prompt:

    “fsck_hfs -drfy /dev/disk1s2”

    After about a 10 second wait, it started work. Then after about an hour it finished. Here is all the data feedback it gave me:

    journal_replay(/dev/disk1s2) returned 0
    ** /dev/rdisk1s2
    Using cacheBlockSize=32K cacheTotalBlock=32768 cacheSize=1048576K.
    Executing fsck_hfs (version diskdev_cmds-557~393).
    ** 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.
    CreateNewBTree returned 5
    ** 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 1949330718 0x74306d1e
    sector size = 512 0x200
    VolumeObject flags = 0x07
    total sectors for volume = 1949330720 0x74306d20
    total sectors for embedded volume = 0 0x00
    CheckHFS returned 5, fsmodified = 1

    So my question at this point is no doubt the same as countless others out there who like me want to know the same: what do the “5” and “1” codes mean at the end? (I Googled for this but found no answers.)

    Thanks.

    1. Sorry, but I am impatient. I continued experimenting, this time using your “Update: 12.23.2012” advice:

      fsck_hfs -pd /dev/disk1s2

      A few seconds later, Terminal reported the following to me:

      /dev/rdisk1s2: starting
      journal_replay(/dev/disk1s2) returned 5
      Using cacheBlockSize=32K cacheTotalBlock=32768 cacheSize=1048576K.
      Executing fsck_hfs (version diskdev_cmds-557~393).
      could not get volume block 2, err 5
      could not get alternate volume header at 1949330718, err 5
      /dev/rdisk1s2: volumeType is 0
      0000: 00c0 9808 0100 0000 0000 0000 0000 0000 |…………….|
      0010: 0000 0000 0000 0000 0000 0000 0000 0000 |…………….|
      . . .
      01f0: 0000 0000 0000 0000 0000 0000 0000 0000 |…………….|
      unknown volume type
      primary MDB is at block 0 0x00
      alternate MDB is at block 0 0x00
      primary VHB is at block 0 0x00
      alternate VHB is at block 0 0x00
      sector size = 512 0x200
      VolumeObject flags = 0x01
      total sectors for volume = 1949330720 0x74306d20
      total sectors for embedded volume = 0 0x00
      CheckForClean – unknown volume type
      CheckHFS returned 6, fsmodified = 0

      What should I do now?

      Thanks.

  6. Pingback: Anonymous
  7. Why do you advise not to use Disk Utility?
    I can get it working again with Disk Utility.
    is there a difference in the way it is fixing the sparsebundle?

  8. Garth, your post seems to be really useful. However, I am stuck at the first command. I have a Synology DiskStation and my backup is on DiskStation\TimeMachineBackup\Gastons MacBook Air.sparsebundle.
    What’s the exact syntax for chflags -R nouchg /Volumes/??? to get there?
    Thanks a lot in advance!

  9. Garth,
    I gotta say that your post saved my backup! I couldn’t believe that I pulled this off after searching for an answer for weeks!
    Thanks!!!
    Score: Garth 1 Apple 0
    Amazingly this is one (very common) problem that after having searched almost the whole http://www…….all the roads led me to this blog!! You Sir…are THE man…!!
    10,00000000000 thanks!

    Cheers

    Ricardo A Davidson
    Vancouver, Canada

  10. Hi, thanks for this post. I’m sure it will work for me like it does everyone else if I can get past the 2nd instruction!

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

    I can not get past this point as I am being told:

    “chflags: MacBook: No such file or directory
    chflags: Air.sparsebundle: No such file or directory”

    Do I need to include the IP address? The share is on my Synology DiskStation and the share itself is called “Time_Machine_Synology”. It appears in my network as “DiskStation” and the share is there as soon asI click on DiskStation from my network.

    I am typing:

    “chflags -R nouchg /Volumes/DiskStation/Time_Machine_Synology/Bens MacBook Air.sparsebundle”

    I dont have a clue where im going wrong…
    Any help would be greatly appreciated! 🙂

  11. That did the trick! Thanks for sharing your findings with the rest of us.

  12. Thanks so much for this post! It allowed me to repair my backup on my qnap-nas instead of starting over again like I have done in the past.

    Cheers!

    David.

  13. How to find out “name of your network share”
    and “name of sparse bundle” to be inserted here:

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

    ?

    Thank you!

  14. FWIW, changing the name of my backup solved the quotations problem…

  15. Is is possible to cheat this process, copy the bundle file from your server to hard drive, and have an app…like Disk Warrior…fix this problem?

    Thanks in advance,

    MMC

  16. Everything seems to work, except that I don’t get a “Repair complete” message. Instead it rebuilds B-tree, then rechecks volume and then prompts:

    ** Checking extended attributes file.
    Invalid allocation block start
    (8, 110900)
    ** The volume Time Machine Backups could not be verified completely.
    volume check failed with error 7

    What could be the problem? Thanks in advance

  17. Interesting. I got the dreaded failed-verify-create-newbackup. My TM server is an OpenIndiana box with netatalk 2.2.3. However, when I do the above, it actually said the volume was OK and no lines in the fsck log show anything getting fixed. So I updated the plist and things are back to normal. Thanks for the concise instructions!

    1. Chad, I had the same thing happen today when I went to repair the backup for my wife’s macbook that’s backing up a Netgear ReadyNAS.

  18. For some reason this isn’t working for me with Mountain Lion. The fsck works fine and I edit the plist, but when I attempt another backup it pops up the dreaded dialog and if I have a look at the plist, the keys are back with the current date.

  19. hi,
    thanks for this tutorial.
    question though: when u say ‘it might take a while’ for the chflags command….. how long is that?

    thanks

  20. Garth, great article, hat off.I believe that a comment is in order, as I have an addition which might be helpful.
    On Mountain Lion 10.8.2, I followed your guid up to the point where you suggest the use of fsck_hfs. It kept saying it couldn’t repair the disk. From the tip of another user on internet, i tried diskutil RepairVolume /dev/diskXs2 which worked. I now can see all the directories pointing to the backups I did.

    On the final step…
    I didn’t have the key RecoveryBackupDeclinedDate
    but I don’t bother on it.
    the key VerificationState which you suggest to change from 2 to 0, was instead 1.
    I’ve changed it to 0, but, apparently I’m not able to restart the TimeMachine software on it. Not bad anyway, as long as I have my data back. I’m now restoring manually my data. Will try to finish your procedure afterwards and, eventually, give the updates here.
    Thanks, thanks, again
    Elio

  21. Excellent! I have been having periodic issues with my Synology Diskstation. In the past, I’ve just wiped out my prior backups and started over (not good). The original fsck ran overnight and was repeating the same thing over and over ending in quick check, file system clean. I cntl-c’d out of that and finished your process. Kicked off a backup and TM ran, completed and did a verification which also completed.

    Thanks for the info!

  22. Hi Garth,
    Thank you so much for your excellent and simple solution!
    I just wonder why it happened, and if/when it will happen again…

    Best wishes,
    michael

  23. Oops, I think I posted to your other archive on this topic – sorry!

    As requested:

    ls -l /Volumes

    lrwxr-xr-x 1 root admin 1 30 Sep 02:18 Macintosh HD -> /
    drwxr-xr-x 6 jeff staff 408 5 Aug 00:58 Time Machine Backups
    drwx—— 1 jeff staff 296 28 Sep 00:17 Untitled

    (please do remove my posts…once you’ve seen them. you’re welcome to email me replies – thanks!)

  24. Also…

    when I perform an ls on the /Volumes/Untitled….it lists my sparsebundle name as Jeff???s MacBook Pro.sparsebundle – Odd! (as its definitely called Jeff’s MacBook Pro.sparsebundle)

    (PS Could I kindly ask you to remove my posts from public view please? I’m only using this medium to contact you for assistance – if there is another way to contact you directly, please do say, many thanks!)

  25. Hi, I did try full quoting, without \escaping…as you suggested, but unfortunately still no success oddly?

  26. Thank you for this Garth, it rescued my Time Machine backup on a QNAP NAS and saved me having to start all over again.

    My Mac refused to mount the TM location from the Finder, so I had to do it from the command line, using a command line like this:

    sudo mount_afp afp://TimeMachine:(password)@(IP address)/TMBackup /Volumes/TMBackup

    Replace (password) with the “TimeMachine” user’s password and (address) with the IP address of the device. I also had to create /Volumes/TMBackup manually.

    1. Hi W,
      Looks like I also have to create the /Volumes/TMBackup manually. I can see the sparsebundles that I need to fix but cannot mount the drive.

      Could you please help a linux novice by telling me what I need to do to create the TmBackup manually?
      Regards

  27. Hi Garth,

    Apologies for troubling you.

    I’m having difficulty with a minor issue following your article instructions. My fault, not yours! Possibly I could contact you to clarify the problem please?

    My sparsebundle has one apostrophe and two spaces in it (Jeff’s MacBook Pro.sparsebundle)

    Regardless of what I try, eg ‘\’ escape characters, all in “quotes” etc – I cannot manage to get the terminal code executed.

    Naturally its very frustrating, although I fully appreciate its because of my lack of knowledge! If only I could rename it even (eg to Jeff.sparsebundle) that would be ideal.

    I’m using OS X 10.8.2 with a 3rd Gen Time Capsule.

    Thank you in advance, Jeff

    1. @Jeff – you need to quote the entire path for the sparsebundle so

      “/Volumes/path/to/Jeff’s MacBook Pro.sparsebundle.”

      When you quote, don’t also escape.

  28. Hi,

    when I type the line fsck_hfs -drfy /dev/disk1s2, I have the error below.

    Does-it mean that my backup is not fixable?

    Thank you in advance for your reply.

    SpiderMac:~ root# fsck_hfs -drfy /dev/disk1s2
    journal_replay(/dev/disk1s2) returned 0
    ** /dev/rdisk1s2
    Using cacheBlockSize=32K cacheTotalBlock=16384 cacheSize=524288K.
    Executing fsck_hfs (version diskdev_cmds-557~393).
    ** Checking Journaled HFS Plus volume.
    ** Detected a case-sensitive volume.
    The volume name is Backup di Time Machine
    ** Checking extents overflow file.
    ** Checking catalog file.
    ** Rebuilding catalog B-tree.
    Extent records for rebuilt file 4:
    [ 262018, 216320 ]
    [ 0, 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
    RebuildBTree – InsertBTreeRecord failed with err 5 0x05
    RebuildBTree – numRecords = 2416
    RebuildBTree – record 1 in node 58 is not recoverable.

    xxxxxxxx BTreeKey (length 32) xxxxxxxx
    1E 00 AE 04 00 00 0C 00 4D 00 61 00 69 00 6E 00 ……..M.a.i.n.
    4D 00 65 00 6E 00 75 00 2E 00 6E 00 69 00 62 00 M.e.n.u…n.i.b.

    xxxxxxxx BTreeData (length 248) xxxxxxxx
    02 00 8E 00 00 00 00 00 C0 04 00 00 70 48 10 CB …………pH..
    EC 1B 53 CB 68 18 5F CC 69 18 5F CC 00 00 00 00 ..S.h._.i._…..
    00 00 00 00 00 00 00 00 00 20 A4 81 01 00 00 00 ……… ……
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 …………….
    00 00 00 00 50 38 B1 C9 00 00 00 00 00 00 00 00 ….P8……….
    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 C0 4C 00 00 00 00 00 00 ………L……
    00 00 00 00 05 00 00 00 88 11 12 00 05 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 Backup di Time Machine 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 838860734 0x31ffffbe
    sector size = 512 0x200
    VolumeObject flags = 0x07
    total sectors for volume = 838860736 0x31ffffc0
    total sectors for embedded volume = 0 0x00
    CheckHFS returned 8, fsmodified = 1

      1. may want to try the tip added in the above comment:

        diskutil RepairVolume /dev/rdiskXsX

  29. I am trying your kinstructions out but I keep having problems with the name of the sparsebundle (I have tried both the reported name which includes the “???” and the name that Finder reports (including an apostrophe). This is a transcript of the session (the netdrive is a Qnap 456 and I use Mountain Lion). :

    FPMacBook:~ his047$ sudo su –
    Password:
    Sorry, try again.
    Password:
    FPMacBook:~ root# cd TMBackup
    -sh: cd: TMBackup: No such file or directory
    FPMacBook:~ root# cd /Volumes/TMBackup
    FPMacBook:TMBackup root# ls -l
    total 0
    drwxrwxrwx@ 1 root wheel 264 Sep 23 06:11 Frederik???s MacBook Pro.sparsebundle
    drwxrwxrwx@ 1 root wheel 264 Mar 13 2011 Network Trash Folder
    drwxrwxrwx@ 1 root wheel 264 Mar 13 2011 Temporary Items
    drwxrwxrwx@ 1 root wheel 264 Sep 4 22:42 Thomas???s MacBook Air.sparsebundle
    FPMacBook:TMBackup root# chflags -R nouchg “/Volumes/TMBackup/Frederik Pedersen’s MacbookPro.sparsebundle

    Could you help with this?

    Thanks

    1. @f.pedersen – I think your Terminal encoding is set to something other than UTF-8. Goto Terminal->Preferences->Settings and then the Advanced tab of the profile you are using. In the International section, it should be UTF-8.

  30. I enter the following: chflags -R nouchg “/Volumes/c/.timemachine/Richard Harsell’s MacBook Pro.sparsebundle”
    I get the error:
    chflags: /Volumes/c/.timemachine/Richard Harsell’s MacBook Pro.sparsebundle: No such file or directory

    My volume name seem different from those above or too complex. When I enter the name of volume as ReadyNAS (how it shows in finder), the same thing happens.

    What am I missing?

    1. I’m having the same problem: chflags: Backups/xxxMBP.sparsebundle: No such file or directory

      Did you have any luck fixing the issue? If so, please share.

    2. Exact same issue here, and dragging and dropping the fiel name wont work. I also am using a ReadyNAS!

  31. Hi Garth, thank you very much !!! This has finally worked. I had already 2x deleted the backup and started again. Neither Synology nor Apple offer a solution. Garth saves the Universe, as Apple Marketing would phrase it.

    1) report on how it worked:
    After the ‘volume repaired’ I did not get the prompt again, so I inserted the eject command too early. Anyway, I logged out and back in again and then did the “sudo su -” command followed by “hdiutil detach /dev/diskxs2” (after finding out what ‘x’ is).

    And 2) a tip to help less experienced users:
    In order to modify the .plist, you need to right/ctrl-click on the .sparsebundle then select “Show Package Contents” and then you will see the .plist and can edit it. – To edit I used TextEdit through PathFinder.

    Having said this, PathFinder 6 has been very useful in this whole operation because it shows easily where I am and I can use the Terminal in the same window. Made my life easier.

    Thank you so much again! This is great!!!

    Best wishes,

    Daniel :))

  32. Dude, you’re a rock star!

    This worked for me, although I was momentarily confused by the following, even after doing fsck_hfs:
    hdiutil: attach failed – no mountable file systems

    The ‘chflags -R nouchg /Volumes/Backup 1/My-Backup.sparsebundle’ mojo was what I needed in the end. I thought I had already done this once before the ‘fsck_hfs’. But doing it again and things got better.

    Thanks!

  33. Awesome – thank you so much – this really helped me out in a pinch! I wish I had googled and found this site much earlier – before I lost a bunch of backups.. :/

  34. If we are already getting dirty with the terminal, why not just edit the plist files directly with “defaults” commands:

    defaults delete MyFile.sparsebundle/com.apple.TimeMachine.MachineID.plist RecoveryBackupDeclinedDate

    and

    defaults write MyFile.sparsebundle/com.apple.TimeMachine.MachineID.plist RecoveryBackupDeclinedDate VerificationState 0

  35. Hello,

    Hopefully you can help…I am trying the above however I have no clue how to find the correct path to my TM backup on my QNAP NAS for the following terminal command from your guide above:

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

    So I keep getting ‘no such file or directory’

    Thanks for your advise!

    Regards,

    Dablo

    1. @Dablo

      You can run

      ls -l /Volumes

      from the command line, after you have connected to your network share in the Finder in order to find the name of your network share

  36. Hi Garth,

    I am having this exact problem. like Billy above, I have a space and an apostrophe in the filename. When I run the first line of text, I get no results:

    See below:
    Austins-MacBook:~ root# chflags -R nouchg /Volumes/SynoVolume1/Austin’s MacBook.sparsebundle
    >

    When I try to run this command with quotes like you suggest above, I get the no file or directory like Billy.

    Any ideas?

  37. Thanks a lot for these instructions. It fixed my backup several times! I can report it also works for Mountain Lion although I had to use the above already two times in one week. I started off with a new backup sparsebundle.

  38. Well, this never-ending problem recurred again this month.

    I finally got around to trying to fix it, and much to my surprise this time another slight new change to what I was doing made it work again.

    Every time the fsck failed I detached and then re-attached the virtual disk. This seemed to allow the fsck to produce a new result, and eventually it all worked OK.

    I think this may also hint at why so many layers of abstraction are a really bad idea and how hard it is to make everything work correctly, with all caches consistent, and all writes in order, etc.

  39. Followed these instructions exactly and they worked perfectly. Looks like my problem started because the NAS didn’t properly support AFP 3.3 (used by Lion and Time Machine). So I’ll probably have to do this again in a couple months unless that gets fixed.

  40. Hi Garth,
    I tried as per your instructions and I get the following error after the 3 attempt. It looks like this cannot be repaired ? Please advice ?

    sh-3.2# fsck_hfs -drfy /dev/disk3s2
    ** /dev/rdisk3s2
    Using cacheBlockSize=32K cacheTotalBlock=32768 cacheSize=1048576K.
    Executing fsck_hfs (version diskdev_cmds-491.6~3).
    ** Checking non-journaled HFS Plus Volume.
    ** Checking extents overflow file.
    ** Checking catalog file.
    ** Rebuilding catalog B-tree.
    hfs_UNswap_BTNode: invalid node height (1)
    ** Rechecking volume.
    ** Checking non-journaled HFS Plus Volume.
    ** Checking extents overflow file.
    ** Checking catalog file.
    ** Checking multi-linked files.
    ** Checking catalog hierarchy.
    ** Checking extended attributes file.
    Overlapped extent allocation (id = 2540126, /Music/iTunes/iTunes Media/iTunes U/Financial Markets (2011)/Introduction.m4v)
    extentType=0x0, startBlock=0xc43add, blockCount=0x5, attrName=(null)
    ** Checking volume bitmap.
    ** Checking volume information.
    Invalid volume free block count
    (It should be 343638048 instead of 343638053)
    Verify Status: VIStat = 0x8800, ABTStat = 0x0000 EBTStat = 0x0000
    CBTStat = 0x0000 CatStat = 0x00000000
    ** Repairing volume.
    Look for links to corrupt files in DamagedFiles directory.
    ** Rechecking volume.
    ** Checking non-journaled HFS Plus Volume.
    ** Checking extents overflow file.
    ** Checking catalog file.
    ** Checking multi-linked files.
    ** Checking catalog hierarchy.
    ** Checking extended attributes file.
    Overlapped extent allocation (id = 2540126, /Music/iTunes/iTunes Media/iTunes U/Financial Markets (2011)/Introduction.m4v)
    extentType=0x0, startBlock=0xc43add, blockCount=0x5, attrName=(null)
    ** Checking volume bitmap.
    ** Checking volume information.
    Invalid volume free block count
    (It should be 343638048 instead of 343638053)
    Verify Status: VIStat = 0x8800, ABTStat = 0x0000 EBTStat = 0x0000
    CBTStat = 0x0000 CatStat = 0x00000000
    ** Repairing volume.
    Look for links to corrupt files in DamagedFiles directory.
    ** Rechecking volume.
    ** Checking non-journaled HFS Plus Volume.
    ** Checking extents overflow file.
    ** Checking catalog file.
    ** Checking multi-linked files.
    ** Checking catalog hierarchy.
    ** Checking extended attributes file.
    Overlapped extent allocation (id = 2540126, /Music/iTunes/iTunes Media/iTunes U/Financial Markets (2011)/Introduction.m4v)
    extentType=0x0, startBlock=0xc43add, blockCount=0x5, attrName=(null)
    ** Checking volume bitmap.
    ** Checking volume information.
    Invalid volume free block count
    (It should be 343638048 instead of 343638053)
    Verify Status: VIStat = 0x8800, ABTStat = 0x0000 EBTStat = 0x0000
    CBTStat = 0x0000 CatStat = 0x00000000
    ** The volume manbalas could not be repaired after 3 attempts.
    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 2928282862 0xae8a0cee
    sector size = 512 0x200
    VolumeObject flags = 0x07
    total sectors for volume = 2928282864 0xae8a0cf0
    total sectors for embedded volume = 0 0x00

Comments are closed.