Fix Time Machine Sparsebundle Network Backup Errors

[UPDATE - The post below is mostly for people using a USB hard drive attached to an Airport Extreme - if your sparsebundle is on a network drive or NAS, please see my modified post here.]

I use an external hard drive attached via USB to an Airport Extreme N for my Time Machine backups. This effectively works for the four household computers.

Occasionally though, things go wrong – very wrong. You will be stuck with ‘Making Disk Available’ or ‘Invalid Sibling Link’ … but there is a fix.

Another 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 also be fixed by following the below.

First, disconnect the external disk from the Airport Extreme and attach to your Mac via Firewire (or USB).

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.

We are going to use the same underlying tools as Disk Utility but from the command line.

Second, open Terminal and then switch to root by typing

sudo su -

and then enter your password. Now type

hdiutil attach -nomount -noverify -noautofsck /Volumes/{name of your disk}/{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.

Depending on the state of the disk, the filesystem check might run anyway. If you see or hear disk activity after running this command, just wait for it to finish, or type

tail -f /var/log/fsck_hfs.log

and wait until you see it give up. Type Control-C to exit the tail command.

Now type

fsck_hfs -drfy /dev/diskxs2

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. When you come back 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 sparsebundles while you have the disk attached to your computer, or now you can eject the external disk from your computer the normal way and re-attach the external disk to your Airport.

One final thing. Since 10.6.3, Time Machine will verify backups and if a problem is found will prompt you to erase the old backup and start a new one. The above procedure will recover the backup. You need to do a couple things first.

1. The sparsebundle will be locked, and you cannot unlock it from the Finder. Once again, as root from the command line type

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

If the sparsebundle failed verification, it was also renamed to the date of verification failure. You can rename it with the command line as well

mv /Volumes/{name of your disk}/{name of}_YYYY-MM-DD.sparsebundle /Volumes/{name of your disk}/{name of}.sparsebundle

Then proceed as above. 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 reconnect the drive to your Airport Extreme and start up Time Machine. It will do a Verification and then proceed with backups as normal.

66 thoughts on “Fix Time Machine Sparsebundle Network Backup Errors

  1. Tried the “fsck_hfs” without any luck for my case…

    here’s my report:

    George-MBA:~ root# fsck_hfs -drfy /dev/disk2
    journal_replay(/dev/disk2) returned 0
    ** /dev/rdisk2
    Using cacheBlockSize=32K cacheTotalBlock=32768 cacheSize=1048576K.
    Executing fsck_hfs (version diskdev_cmds-557.3.1~1).
    Block 2 is not an MDB or Volume Header
    CheckForClean – could not get VHB/MDB at block 1949330782
    ** Checking Journaled HFS Plus volume.
    Invalid B-tree node size
    (3, 0)
    ** The volume could not be verified completely.
    volume check failed with error 7
    volume type is pure HFS+
    primary MDB is at block 0 0×00
    alternate MDB is at block 0 0×00
    primary VHB is at block 2 0×02
    alternate VHB is at block 1949330782 0x74306d5e
    sector size = 512 0×200
    VolumeObject flags = 0×05
    total sectors for volume = 1949330784 0x74306d60
    total sectors for embedded volume = 0 0×00
    CheckForClean – could not get VHB/MDB at block 1949330782
    CheckHFS returned -1317, fsmodified = 0

    Could this “Invalid B-tree node size” be fixed somehow?

    Thank you.
    G

  2. Hi Garth,

    Thank’s for a great writeup. It saved my bacon. I maanged it over wifi but it was hairy. Needs must and all that.

    Cheers,

    Tom.

  3. Hi,
    Thanks for the help in advance…
    i’ve just got the “Time Machine completed a verification…” error message.
    My setup… i have a MacMini onto which is attached a 2TB WD hard drive that i use for TM. Both my MacBook and Mini backup to this HD. My MacBook connects to this drive across the network. So i basically connect to the Mini, and the mini shares its drives across the network. My Macbook is the one getting the error.
    My question is … will the above set of instructions work for such a setup?

    Also i tried the above instructions anyway… so here’s what i did below…
    Parvezs-MacBook-Pro:~ Silver$ sudo su
    Password:
    sh-3.2#
    sh-3.2# chflags -R nouchg /Volumes/TimeMachine/Parvez’s MacBook Pro.sparsebundle
    >
    >
    sh-3.2#
    sh-3.2#
    sh-3.2# hdiutil attach -nomount -noverify -noautofsck /Volumes/TimeMachine/Parvez’s MacBook Pro.sparsebundle
    >
    sh-3.2#

    So that didn’t work… my next question is what am i doing wrong? Why do i get a > prompt when i type in hdiutil command?

    Again … thanks so much for your help….

    Kind Regards
    Parvez

  4. Hello,

    Thank you for tips. I have found this error and can’t repair backup. Can you help me?

    # chflags -R nouchg /Volumes/bkp/DBQ\ Air.sparsebundle/
    # hdiutil attach -nomount -noverify -noautofsck /Volumes/bkp/DBQ\ Air.sparsebundle/
    /dev/disk1 GUID_partition_scheme
    /dev/disk1s1 EFI
    /dev/disk1s2 Apple_HFS
    # fsck_hfs -drfy /dev/disk1s2
    /dev/rdisk1s2: fsck_hfs run at Tue Jul 2 00:08:29 2013
    /dev/rdisk1s2: Unable to open block device /dev/disk1s2: Resource busyjournal_replay(/dev/disk1s2) returned 16
    /dev/rdisk1s2: ** /dev/rdisk1s2 (NO WRITE)
    /dev/rdisk1s2: Can’t open /dev/rdisk1s2: Resource busy

    Thanks

  5. Thank you!! This saved 2 years worth of backups for me. One thing though, I did have trouble locating the .plist file I needed to edit, maybe calling out its location more blatantly (I didn’t know that an unmounted sparebundle acted like a folder) using an example would help that step be more clear? And as an earlier user also mentioned, it took me a while to figure out how to open the file for editing (I don’t use command line often on my Mac, just on Unix systems, and didn’t know how to call TextEdit command line, had to google for that) so maybe a really explicit “here’s how to edit the .plist file,” including an example path would avoid future readers having to hunt down the same info. But still, incredibly useful info and I’m so glad I was able to save my time machine backups even though my computer was ready to trash them as if it was no big deal!

  6. I am not getting anywhere with this. The problem seems to be with the “name” of my drive and/or the sparsebundle. After I meticulously enter the “hdiutil attach -nomount -noverify -noautofsck /Volumes/{name of your disk}/{name of}.sparsebundle” I get errors like no such file or directory, or “unexpected token”. I have tried manually entering what I think the name of the sparsebundle is and dragging and dropping the sparsebundle into terminal to no avail. Unfortunately I have characters like ‘ and () in my sparsebundle name and I do not think it likes that.

    I am trying to repair a Western digital external drive connected to a Time Machine. Is there some what to rename the sparse bundle and drive etc? or do you have other thoughts on the matter? Thanks a lot.

  7. for everybodies information:

    Apple apparently found the reason, see rrichard’s post in the apple support forum (who recieved a little bit of help from apple care):

    “Corrupted sparsebundles are caused “any interruption” during a FIRST (total) backup. This interruption can be caused by the computer going to sleep during this total backup. The damage to the sparsebundle may not become apparant untill a long time in the future …..disable timed sleep when performing a total backup. Computer sleep is the most likely cause…Apple is aparantly aware of this, but did not explicitly lable it as a bug.”

    full discussion at:
    https://discussions.apple.com/thread/3684176?start=90&tstart=4

    i achieved to solve my problem with the above method. did the problem reoccur to anyone after fixing it like described above by garth?

  8. Oh, also, for the name entering issues …

    Terminal in MacOS X is incredibly well integrated. Copy & paste this minus the quotes:
    “hdiutil attach -nomount -noverify -noautofsck ”
    then drag the sparseimg file/folder thingy to the terminal window. It will automatically insert the proper path.

  9. *sadface*

    I tried it & the fsck ended with “Abort trap: 6″. I guess that means it’s really borked. Oh well. Time to start fresh I guess. :^/ Even if I just did less than a month ago.

  10. Just a followup to say this worked. Took ages but it did come up clean. Really having my doubts about internal Time Capsule disks, starting to think externals that can be used centrally but detached and managed like this in an emergency makes more sense.

  11. This might be just what I need. Running fsck_hfs across the network is s-l-l-o-o-o-o-w. My wishlist for a Time Capsule upgrade would be the ability to run diskutil and friends on the Time Capsule itself (surely it wouldn’t add much to the internals?). Shipping the bits around, even over the gigabit ethernet I’m not actually getting (more like a solid 100Mbit), is tedious.

  12. My Time Machine backups sometimes break when let the Mac connect via WiFi to my Synology NAS.
    Your instructions worked very well.
    Thanks for the post

  13. Having a slight problem. My drive is called Windows Partition. The space is throwing off the string. Help?

  14. Thanks so much Garth. I had that problem a few times and just accepted to redo a new backup. But now I found your site and it worked like a charm. Took me an hour or so.

    Since I am not accustomed working in Terminal it took me a while to find out how to edit the plist-File at the end.
    I finally found it easiest to type in Terminal:

    nano /Volumes/x/x.sparsebundle/com.apple.TimeMachine.MachineID.plist

    and follow the onscreen instructions.

    Thanks again. This was indeed very helpful.

  15. Hi! My problem is that the sparse image is marked as readonly. When I try to attach it read-write I get an error message similar to ‘ressource temporaily busy’ (it’s in german so I don’t know what it looks like exactly…). I didn’t manage to get the image attached read-write.

    1. Ah, I found the problem: I have forgotten the -nomount option.

      hdiutil attach -nomount -noverify -noautofsck /Volumes/Drobo-Backup-2/Shared\ Items/Backups/iMac27thin.sparsebundle

  16. I have the same problem as Josh.

    Does it matter that the name of my sparsebundle has spaces in it?

    Thanks,

    Vince

  17. Great help this thread!!

    I first had a problem attaching the sparseimage (file not found like error, from reading other posts it is likely because the volume is accessed over AFP instead of samba). Anyway, as I could still open time machine, the volume mounted automatically when opening time machine. In time machine, pressed cancel, then in finder I ejected the time machine image. It turns out that at that point, the volume stays mounted, and i could proceed as above:

    sudo su -

    chflags -R nouchg “/Volumes/TimeCapsule/XXX.sparsebundle”

    hdiutil attach -nomount -readwrite -noautofsck -noverify “/Volumes/TimeCapsule/XXX.sparsebundle”

    the command still automatically triggered a fsck_hfs, the process could be followed with the command:

    tail -f /var/log/fsck_hfs.log

    The image was fixed from the first run of fsck (message: the image appears to be OK)

    modify the plist as mentioned above

    reboot

  18. I of course replace the field with my name if the items. I suspect i don’t put the correct name though. could someone please post an example of how it should look.

  19. The reason for this problem is perhaps a problem in Apples (W)LAN: I own the Airport Extreme base station with an iMac 27″ attached via ethernet cable to it. And sometimes the connection to the base station will get lost and come back after some seconds. I can see this when a Quicktime live stream freezes or iChat is loosing the connection.

    I think that this network interruptions will damage the backup again and again.

    I have these interruptions since a couple of years, but I thought that the connection to my network provider is stalling, but it seems to be the cable connection to the base station is stalling. When I switch to WLAN, the network does not stall.
    Hmm … :-/

  20. Why can i not get passed the first step?
    when i type
    hdiutil attach -nomount -noverify -noautofsck /Volumes/{name of your disk}/{name of}.sparsebundle

    i only get:
    hdiutil attach [options]
    hdiutil attach -help

    what am i doing wrong?

      1. I am in the same boat. I replaced the {xx} but get the same results. This is what I am typing:

        hdiutil attach -nomount -noverify -noautofsck /Volumes/Time Capsule 2/27i7.sparsebundle

        Time Capsule 2 is the name of the external USB drive, and 27i7 is the name of the lone file within the drive.

  21. Thanks for this informative article. I am part way through but I get the following message in Terminal. How should I now proceed please? Happy New Year BTW from New Zealand

    sh-3.2# fsck_hfs -drfy /dev/disk7s2
    Unable to open block device /dev/disk7s2: Permission deniedjournal_replay(/dev/disk7s2) returned 13
    ** /dev/rdisk7s2 (NO WRITE)
    Using cacheBlockSize=32K cacheTotalBlock=49152 cacheSize=1572864K.
    Executing fsck_hfs (version diskdev_cmds-540.1~34).
    Non-empty journal: start = 136646656, end = 136941568
    Journal need to be replayed but volume is read-only
    ** Checking Journaled HFS Plus volume.
    ** Detected a case-sensitive volume.
    The volume name is iMac TimeMachine Backup
    ** Checking extents overflow file.
    ** Checking catalog file.
    ** The volume iMac TimeMachine Backup was found corrupt and needs to be repaired.
    volume type is pure HFS+
    primary MDB is at block 0 0×00
    alternate MDB is at block 0 0×00
    primary VHB is at block 2 0×02
    alternate VHB is at block 3906357278 0xe8d6481e
    sector size = 512 0×200
    VolumeObject flags = 0×07
    total sectors for volume = 3906357280 0xe8d64820
    total sectors for embedded volume = 0 0×00

    1. Desmond – it looks like the volume is not being mounted with read/write permissions – check to make sure you entered all the commands exactly.

      1. Garth,

        First of all, thanks a MILLION for posting this procedure. I’ve been using a USB drive connected to my Airport Extreme and have successfully been doing backups for a couple years; however I’ve had two corruptions since upgrading to Mountain Lion.

        Regarding the Permission deniedjournal_replay error, I received this message also. I am not sure what causes it but I was able to clear the error by detaching the drive (hdiutil detach /dev/diskxsx), and fixing user flags ( chflags -R nouchg /Volumes/[VolumeName]/[SparsebundleName].

        After doing that I was able to re-attach the drive and fix it – in this most recent case I had to run fsck_hfs twice, but eventually it succeeded and I have backups going again. Hooray!

        1. I have done the same but I got this:

          server:~ 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.
          BTree rebuild requested but writing disabled

  22. Thaks Garth.
    I solved the problem, but I think my volume is dead because the sfck says:
    ** The volume Copias de Time Machine could not be verified completely.
    volume check failed with error 7
    volume type is pure HFS+
    primary MDB is at block 0 0×00
    alternate MDB is at block 0 0×00
    primary VHB is at block 2 0×02
    alternate VHB is at block 1952828350 0x7465cbbe
    sector size = 512 0×200
    VolumeObject flags = 0×07
    total sectors for volume = 1952828352 0x7465cbc0
    total sectors for embedded volume = 0 0×00

  23. Hi, and thanks for this post.

    I have a problem:
    after run the fsck_hfs -drfy /dev/disk2s2 comand the terminal says:
    iMac:~ root# fsck_hfs -drfy /dev/disk2s2
    Unable to open block device /dev/disk2s2: Permission deniedjournal_replay(/dev/disk2s2) returned 13
    ** /dev/rdisk2s2 (NO WRITE)
    Using cacheBlockSize=32K cacheTotalBlock=16384 cacheSize=524288K.
    Executing fsck_hfs (version diskdev_cmds-540.1~25).
    Journal is empty
    ** Checking Journaled HFS Plus volume.
    ** Detected a case-sensitive volume.
    The volume name is Copias de Time Machine
    ** Checking extents overflow file.
    ** Checking catalog file.
    ** The volume Copias de Time Machine was found corrupt and needs to be repaired.
    volume type is pure HFS+
    primary MDB is at block 0 0×00
    alternate MDB is at block 0 0×00
    primary VHB is at block 2 0×02
    alternate VHB is at block 1952828350 0x7465cbbe
    sector size = 512 0×200
    VolumeObject flags = 0×07
    total sectors for volume = 1952828352 0x7465cbc0
    total sectors for embedded volume = 0 0×00
    iMac:~ root#

    Do you have any idea to recover my TM volume or all is lost?
    Thanks a lot from Spain.
    Juan

    1. Juan – the (NO WRITE) message means (I think) that you did not copy the initial mounting message correctly – you need to mount the drive via the command line not by double clicking it.

  24. Unfortunately, this din’t word for me.

    After running 2 times the fsck, i got a “could not be repaired” message.
    Further fsck had no luck.

    Got to scratch my backup, again…. MyBook World with Lion, this happens every 2 weeks… :(
    No solutions from Western Digital.

    Just burnt 200 €.

    1. Teejay – is this disk connected normally via USB to an Airport Extreme? I have another post (similar but different) for repairs in that case.

      1. Garth – I had the same message as Teejay – connected via USB to an Time Capsule. Any help is appreciated.

  25. Garth, great effort putting this together. I’ve just gone through your procedure successfully on a Lion Macbook Pro, against a Time Machine backup on a QNAP-410 NAS. I had recently had a similar problem on my wife’s Snow Leopard machine, then in the middle of starting a new TM backup, that machine crashed and so we had no backup to recover from.

    It might be worth making it clearer that the two things that should be done to the ~.plist file within the sparsebundle will likely need to be done in almost all cases (as I read the instructions above, it looked like they were only related to the sparsebundle-being-locked case).

  26. Brilliant!

    It worked for me as well.

    The plist file can also be shown/edited by right-clicking the sparse bundle and showing the package contents.

    Many thanks for the write up.

  27. I had to run

    chflags -R nouchg /Volumes/XXX.sparseimage

    first, before I could repair the volume. Otherwise I got a permission denied error and the disk mounted as Read Only, which prevented repairs. Other than, this worked great to fix my Time Machine error. Thanks!

  28. I’m pretty sure I’m using the correct path.

    I’m writing it something like this:

    …/Volumes/Drive/Dave\’s\ MacBook\ Pro_08-09-2011_142620.sparsebundle OR
    …/Volumes/Drive/”Dave’s MacBook Pro_08-09-2011_142620.sparsebundle”

    I even tried going through the steps on other sparse bundles on the drive and they work fine.

    Any other ideas?

  29. Failure before I even got started. I tried the first step and got:

    hdiutil: attach failed – No such file or directory

    Any ideas?

  30. Fixed it – it was still a permissions problem; I used a tool called desktoputility to reveal the hidden files, changed the pemissions in finder, made your changes and then reset permissions -> good to go. This technique is GREAT help;thanks

  31. I’ve run into a problem right at the end – I am unable to edit the plist – when I open the file in textwrangler it appears to be blank. The ls reports -rw-rw-rw- 1 root wheel 519 Oct 10 13:45 com.apple.TimeMachine.MachineID.plist

    This is really frustrating because your procedure has worked so well to this point. What am I missing?

  32. So I came to this blog from another Time Machine repair blog, the command that they used was:

    hdiutil attach -nomount -readwrite -noautofsck -noverify /Volume/etc/etc

    However, the above command resulted in a “hdiutil: attach failed – Permission denied”. I rebooted several times and did execute the command as root. I also made sure that I owned and am able to rw to the file (the file is 755). I then took out the -readwrite flag from the hdiutil command (per the instructions on your blog:

    hdiutil attach -nomount -noverify -noautofsck /Volume/etc/etc

    This time, the image was able to be mounted but I only see the following:

    /dev/disk1

    The strange thing is, I am able to manually load the sparsebundle and browse my previous backups. Any thoughts? Cheers.

  33. Thanks ! This worked at the first attempt. I am wondering if there is a reason why the backup disk gets corrupted so frequently since 10.6.6 was released. Does this only affect network backups ? I am backing up to a USB drive connected to a Netgear router over Samba.

  34. So thanks for all the information, both on this page and in the comments.

    I was unable to move forward with just this information, I kept getting “Operation Not Permitted” when I attempted to attach using “-readwrite”. When I ran it without readwrite, or with “-readonly” it would work fine- but obviously the fsck would be limited by the dreaded “(NO WRITE)”. But it worked. I could also manually mount the file system (even though hdiutil and Disk Utility refused, citing “No Filesystems”).
    However I think I found one of the problems. I have it running right now- even though I specified “noautofsck” it’s running anyway- which is fine with me, it’s progress and I’m letting it run.

    So here is the key- I had to change directories into the sparsebundle directory, and inside was the “token”. This token had “uchg” flag set! Take a look like so:

    ls -lO /path/to/name.sparsebundle/token

    If you see the “uchg” flag, this could be your problem if you are getting “Operation Not Permitted” when running “hdiutil”.

    To correct it, I ran: “chflags nouchg token” while inside the sparsebundle directory.
    I was then getting “Resource Not Available”. A new confusing error message, but progress! I had to reboot, and now fsck is running!

    Thanks again everyone!

  35. I’m getting the same error as Belal:

    iSenberg:~ root# fsck_hfs -drfy /dev/disk4s2
    ** /dev/rdisk4s2 (NO WRITE)
    Using cacheBlockSize=32K cacheTotalBlock=20480 cacheSize=655360K.
    Executing fsck_hfs (version diskdev_cmds-491.3~2).
    ** Checking Journaled HFS Plus volume.
    ** Detected a case-sensitive volume.
    ** 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 0×00
    alternate MDB is at block 0 0×00
    primary VHB is at block 2 0×02
    alternate VHB is at block 3906357278 0xe8d6481e
    sector size = 512 0×200
    VolumeObject flags = 0×07
    total sectors for volume = 3906357280 0xe8d64820
    total sectors for embedded volume = 0 0×00

    Is there any hope? Should I just stop using my airport for backups and use an external disk on my computer instead?

  36. Thank you!!! Finally, a clear, cogent presentation of how to fix this common problem. Thank you for taking the time to write such a clear presentation of the solution. You Saved My Backup!!!

  37. Well, I inspected the bundle and found the plist. However, Time Machine still reports the sparsebundle and corrupted. And for some reason, now I’m back to (NO WRITE) when I try to fsck the disk. I can see that the sparsebundle is attached but not mounted, as when I check in Disk Utility it’s there, but greyed out. I’ve tried restarting, the volume isn’t listed using df, and I’ve reset the permissions and ownerships using chmod and chown, and it’s still (NO WRITE). I’m thinking it’s a problem about my permissions on the network drive I’m using.

  38. Thanks for the idea. I restarted, and fsck worked this time, and the sparsebundle was repaired successfully. I unlocked the sparsebundle and renamed it successfully. However, there doesn’t appear to be plist file in the sparsebundle after I mount it:

    XXXX:Time Machine$ ls -a
    . .Spotlight-V100 Backups.backupdb
    .. .Trashes lost+found
    .DS_Store .fseventsd

    Is there a way to open the ‘bundle other than with DiskImageMounter to root around inside it?

    1. the plist file is not something you will find in Finder. The whatever.sparsebundle is actually a folder so you can

      cd /path/to/whatever.sparsebundle/

      and then ls -la

      to see the com.apple.timemachine plist file.

  39. You’re right, I didn’t read the instructions closely enough. Unfortunately, the result for /dev/disk1s2 (Apple_HFS) didn’t give much of a different result. Immediate:
    /dev/disk1 GUID_partition_scheme
    /dev/disk1s1 EFI
    /dev/disk1s2 Apple_HFS
    aero:~ root# fsck_hfs -drfy /dev/disk1s2
    ** /dev/rdisk1s2 (NO WRITE)
    Using cacheBlockSize=32K cacheTotalBlock=16384 cacheSize=524288K.
    Executing fsck_hfs (version diskdev_cmds-491.3~2).
    ** Checking Journaled HFS Plus volume.
    ** Checking extents overflow file.
    ** Checking catalog file.
    ** The volume Time Machine was found corrupt and needs to be repaired.
    volume type is pure HFS+
    primary MDB is at block 0 0×00
    alternate MDB is at block 0 0×00
    primary VHB is at block 2 0×02
    alternate VHB is at block 104185774 0x635bfae
    sector size = 512 0×200
    VolumeObject flags = 0×07
    total sectors for volume = 104185776 0x635bfb0
    total sectors for embedded volume = 0 0×00

    Any ideas? Thanks for the help, by the way. I can’t find anyone else even talking about this.

    1. You shouldn’t be seeing that (NO WRITE) message. Because it can’t write, it can’t do repairs.

      Are you sure you typed the hdiutil attach command properly and that you are running all this as root?

      You also need to make sure that the sparsebundle is not previously mounted in the Finder or not completely unmounted.

      Check with the ‘df’ command first and make sure that the sparsebundle is not listed – or just reboot – before you start.

  40. I also am having trouble. After fsck_hfs -drfy /dev/disk1s2
    I get:
    ** /dev/rdisk1s2 (NO WRITE)
    Using cacheBlockSize=32K cacheTotalBlock=16384 cacheSize=524288K.
    Executing fsck_hfs (version diskdev_cmds-491.3~2).
    ** Checking Journaled HFS Plus volume.
    ** Checking extents overflow file.
    ** Checking catalog file.
    ** The volume Time Machine was found corrupt and needs to be repaired.
    volume type is pure HFS+
    primary MDB is at block 0 0×00
    alternate MDB is at block 0 0×00
    primary VHB is at block 2 0×02
    alternate VHB is at block 104185774 0x635bfae
    sector size = 512 0×200
    VolumeObject flags = 0×07
    total sectors for volume = 104185776 0x635bfb0
    total sectors for embedded volume = 0 0×00
    I rant fsck 3 times, with the same output. Any ideas? My sparsebundle isn’t attached to an airport Extreme, but rather on a network drive. Ever since 10.6.6 dropped, every two weeks I have to throw out my backups and start again..

    1. Hi Joe,

      You aren’t repairing the correct partition. After you run hdiutil -attach you want to run the repair on the partition number with the Apple_HFS or Apple_HFSX label. probably a higher number in your case.

      -Garth

  41. I can’t seem to find anything that looks like com.apple.TimeMachine.* anywhere in the sparsebundle.
    And after I do the fsck, and try to use the sparsebundle, Time Machine still says its bad..

  42. I am still having problems when I run the fsck_hfs -drfy /dev/disk2s2 command I get this:

    bash-3.2# fsck_hfs -drfy /dev/disk2s2
    ** /dev/rdisk2s2 (NO WRITE)
    Using cacheBlockSize=32K cacheTotalBlock=16384 cacheSize=524288K.
    Executing fsck_hfs (version diskdev_cmds-491.3~2).
    ** Checking Journaled HFS Plus volume.
    ** Detected a case-sensitive volume.
    ** 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 0×00
    alternate MDB is at block 0 0×00
    primary VHB is at block 2 0×02
    alternate VHB is at block 1946783422 0x74098ebe
    sector size = 512 0×200
    VolumeObject flags = 0×07
    total sectors for volume = 1946783424 0x74098ec0
    total sectors for embedded volume = 0 0×00
    and it stops, any ideas?
    Thank you

  43. Thank you very much! Your technique worked perfectly — sparsebundle is fixed and verified, all backups are available and TM is happily working fine. This is the only article I’ve found on the web that offers a solution to the corruption problem, a problem that I’ve encountered at least two times previously. This article deserves to be re-posted and linked to widely. Great work and much appreciated.

  44. Thanks for the tip on how to make the sparsebundle writeable again.

    Unfortunately, the fsck didn’t work for me. What messages did you get for a successful repair? I got the following, and I’m wondering if there’s a non-repair check one could do first to determine whether the volume is repairable before possibly corrupting if further:

    ** /dev/rdisk5s2
    Using cacheBlockSize=32K cacheTotalBlock=16384 cacheSize=524288K.
    Executing fsck_hfs (version diskdev_cmds-491.2~2).
    Journal replay returned error = 6
    ** Checking Journaled HFS Plus volume.
    ** Checking extents overflow file.
    ** Checking catalog file.
    ** Rebuilding catalog B-tree.
    hfs_UNswap_BTNode: invalid node height (1)
    hfs_swap_HFSPlusBTInternalNode: catalog key #18 invalid length (0)
    Invalid key length
    (4, 11406)
    ** The volume Backup of XXX could not be repaired.
    volume type is pure HFS+
    primary MDB is at block 0 0×00
    alternate MDB is at block 0 0×00
    primary VHB is at block 2 0×02
    alternate VHB is at block 2894151166 0xac813dfe
    sector size = 512 0×200
    VolumeObject flags = 0×07
    total sectors for volume = 2894151168 0xac813e00
    total sectors for embedded volume = 0 0×00

  45. Thank you! This is the only site I could find that actually addresses the problem. Most others just babble. TM is verifying now again, it should go through OK. I appreciate the help.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>