Fisslefink
April 11th, 2008, 12:32 PM
My setup:
I use Time Machine on Mac OS X Leopard 10.5.2 (with latest updates) to back up to an hfsplus (non-journaled) partition on my Ubuntu Feisty box, which I have shared over AFP (here's how (http://www.macosxhints.com/article.php?story=20071110145136486)) using Netatalk and Avahi (here's how (http://ubuntuforums.org/showthread.php?t=347019)).
The sparsebundle destination is encrypted with AES-128 (here's how (http://forums.macrumors.com/showthread.php?t=434960)), so my sensitive work data is encrypted via File Vault on my Mac, and it backs up to a secure destination, even while I'm logged in. It's great!
-----------------------
The issue:
Backups usually work marvelously, mounting the share automatically and performing the backup in the background while I am logged in. It doesn't unmount it quite as gracefully (afpd on the Ubuntu box still sees a user logged in), but I can live with that.
This morning, I got a mysterious error from Time Machine:
Time Machine Error
The backup disk image could not be mounted
Oh no, I thought... there go all of my backups! Reading this thread (http://discussions.apple.com/message.jspa?messageID=6032779) made me even more concerned.
However, there is a solution.
Taking a look in dmesg using "dmesg|grep hfs" on the Ubuntu box, I discovered this error:
"hfs: Filesystem was not cleanly unmounted, running fsck.hfsplus is recommended. mounting read-only."
Curiously, running "mount" on the Ubuntu box reports that the hfsplus partition was mounted with the "rw" flag ... so it looks like it's read/write, but it's really not, for the safety of your data. Just something to watch out for.
So I figured maybe if I repaired the filesystem and remounted it read/write again, it would get rid of the Time Machine error. I'll cut to the punchline: Once the hfsplus filesystem was repaired, Time Machine backed up to it over AFP with no problems at all, just like it used to
--------------------------
Adventures in compiling fsck.hfsplus:
This requires the program "fsck.hfsplus" which some people claim comes in the hfsutils and hfsprogs packages, but I haven't found that to be the case. Indeed, I found a bug report that would suggest it really is missing. (#135070 (http://www.google.com/url?sa=t&ct=res&cd=1&url=https%3A%2F%2Flaunchpad.net%2Fbugs%2F135070&ei=moT_R-SJJYiYoQSSy4zhBw&usg=AFQjCNFYkkeA4GxT75JCQOS7K8Q-ZENlQg&sig2=LO0Qv0ODr9rJ9TwNMF_4ZQ))
So I had to compile fsck.hfsplus myself.
I found these two forum topics (#1 (http://ubuntuforums.org/showthread.php?t=392287), #2 (http://ubuntuforums.org/showthread.php?t=392287)) very useful guides, except that the links for the source and the patch didn't work (see below):
Since the links for the source and the patch are broken now, I had to dig around to find links that work. As of April 11, 2008, these links work:
http://gentoo.osuosl.org/distfiles/diskdev_cmds-332.14.tar.gz
ftp://ftp.fi.debian.org/pub/gentoo/distfiles/diskdev_cmds-332.14.patch.bz2
With these links and the directions in the topics referenced above, I was able to build and compile fsck.hfsplus on Feisty Fawn on a 32-bit system, with no problems. There is even a post later on in thread #1 that explains how to build fsck.hfsplus on 64-bit systems (http://ubuntuforums.org/showpost.php?p=4591297&postcount=27).
Hopefully putting all this info in one place will make this task easier on the next guy.
I use Time Machine on Mac OS X Leopard 10.5.2 (with latest updates) to back up to an hfsplus (non-journaled) partition on my Ubuntu Feisty box, which I have shared over AFP (here's how (http://www.macosxhints.com/article.php?story=20071110145136486)) using Netatalk and Avahi (here's how (http://ubuntuforums.org/showthread.php?t=347019)).
The sparsebundle destination is encrypted with AES-128 (here's how (http://forums.macrumors.com/showthread.php?t=434960)), so my sensitive work data is encrypted via File Vault on my Mac, and it backs up to a secure destination, even while I'm logged in. It's great!
-----------------------
The issue:
Backups usually work marvelously, mounting the share automatically and performing the backup in the background while I am logged in. It doesn't unmount it quite as gracefully (afpd on the Ubuntu box still sees a user logged in), but I can live with that.
This morning, I got a mysterious error from Time Machine:
Time Machine Error
The backup disk image could not be mounted
Oh no, I thought... there go all of my backups! Reading this thread (http://discussions.apple.com/message.jspa?messageID=6032779) made me even more concerned.
However, there is a solution.
Taking a look in dmesg using "dmesg|grep hfs" on the Ubuntu box, I discovered this error:
"hfs: Filesystem was not cleanly unmounted, running fsck.hfsplus is recommended. mounting read-only."
Curiously, running "mount" on the Ubuntu box reports that the hfsplus partition was mounted with the "rw" flag ... so it looks like it's read/write, but it's really not, for the safety of your data. Just something to watch out for.
So I figured maybe if I repaired the filesystem and remounted it read/write again, it would get rid of the Time Machine error. I'll cut to the punchline: Once the hfsplus filesystem was repaired, Time Machine backed up to it over AFP with no problems at all, just like it used to
--------------------------
Adventures in compiling fsck.hfsplus:
This requires the program "fsck.hfsplus" which some people claim comes in the hfsutils and hfsprogs packages, but I haven't found that to be the case. Indeed, I found a bug report that would suggest it really is missing. (#135070 (http://www.google.com/url?sa=t&ct=res&cd=1&url=https%3A%2F%2Flaunchpad.net%2Fbugs%2F135070&ei=moT_R-SJJYiYoQSSy4zhBw&usg=AFQjCNFYkkeA4GxT75JCQOS7K8Q-ZENlQg&sig2=LO0Qv0ODr9rJ9TwNMF_4ZQ))
So I had to compile fsck.hfsplus myself.
I found these two forum topics (#1 (http://ubuntuforums.org/showthread.php?t=392287), #2 (http://ubuntuforums.org/showthread.php?t=392287)) very useful guides, except that the links for the source and the patch didn't work (see below):
Since the links for the source and the patch are broken now, I had to dig around to find links that work. As of April 11, 2008, these links work:
http://gentoo.osuosl.org/distfiles/diskdev_cmds-332.14.tar.gz
ftp://ftp.fi.debian.org/pub/gentoo/distfiles/diskdev_cmds-332.14.patch.bz2
With these links and the directions in the topics referenced above, I was able to build and compile fsck.hfsplus on Feisty Fawn on a 32-bit system, with no problems. There is even a post later on in thread #1 that explains how to build fsck.hfsplus on 64-bit systems (http://ubuntuforums.org/showpost.php?p=4591297&postcount=27).
Hopefully putting all this info in one place will make this task easier on the next guy.