« OpenSuse 10.2 with Sun w1100z | Main | Set a breakpoint at GNOME warning information »

June 14, 2007

HOWTO: Backup your Mac OS X to nfs

First, you need to set up a nfs sharing.
I'm using a Solaris server.
Here're my steps.
Create a user with uid 501 (it's the default uid for first user on Mac OS X).
Create /export/home/mac, chmod 777 /export/home/mac
You can figure out how to give a proper mod/owner for /export/home/mac.
Since I'm restricting nfs access from certain machine, I don't care.

su
sharemgr create mygroup
sharemgr add-share -s /export/home/mac/ -r MAC mygroup
sharemgr set -P nfs -S sys -p root=macbookpro -p rw=macbookpro mygroup
sharemgr show
svcadm enable svc:/network/nfs/server:default

macbookpro is hostname of the Mac OS X client.

Then, try to mount it on Mac OS X
create /private/mnt/

sudo mount_nfs -o -P your_Solaris_machine:/export/home/mac /private/mnt/

create MBP_BACKUP directory in /private/mnt for a test.

Now, use rsync to backup your Mac OS X.
I assuming you're using Mac OS X 10.4, your rsync supports -E.

Create backup_excludes.txt to exclude some files.
Here's my version: (may not need to be that long)

automount/*
proc/*
dev/*
.Spotlight-V100/*
.Spotlight-V100/.*
.Trash/*
.Trashes/*/*
.hotfiles.btree
.journal
.journal_info_block
.vol
Desktop DB
Desktop DF
Library/Caches
System/Library/Caches
System/Library/Extensions.kextcache
Temporary Items
Users/*/Library/Caches/*
Volumes/*
cores/*
mach
mach.sym
private/Network/*
private/_Network_/*
private/automount/*
private/var/automount/*
private/var/db/BootCache.playlist
private/var/db/NetworkInterfaces.xml
private/var/db/volinfo.database
private/var/run
private/var/tmp/*
private/tmp/*
private/var/run/*
private/var/spool/postfix/*
private/var/vm/*
private/mnt/*

Here we go!

sudo rsync -E -a -x -S --delete --progress --exclude-from=backup_excludes.txt / /private/mnt/MBP_BACKUP/

You may want add "-u" for update.
Check rsync manpage for details.
It took my several hours for the first time sync.

Good luck!

BTW: How to sync back?

Update: It crashed to 4 Languages (system hang, kernel panic) when I tried to re-sync my disk. Might be a bug of rsync or nfs? I don't know how to solve it yet. Don't use -E and don't sync large files (>2G) seems fine.

Posted by ginn at June 14, 2007 4:29 PM

Comments

I am currently trying to set up rsync over nfs to solaris on zfs (Intel Mac 10.4.9 and OpenSolaris Nevada b65). I did not experience kernel panic on the Mac. It also works with large files (9GB+). However, when using rsync with -E, it keeps copying ._* files (resource forks) every time I rsync. I am also noticing that on the server side, ._* files have current date, not date of original file. Any experience with this?

Options I used for rsync are -CaE. By the way, the same problem of re-syncing resource forks happens if the volume is mounted via netatalk.

Posted by: marko at June 27, 2007 8:05 AM

You can stop tar from creating the resource forks by settting the COPY_EXTENDED_ATTRIBUTES_DISABLE environment variable to true.

You might want to remove all the existing resource forks before trying again.

Posted by: Andre at October 16, 2007 7:50 PM

Post a comment




Remember Me?