sunnuntai, joulukuuta 09, 2007

Time Machine internals

When I browsed the contents of my Time Machine backup, I saw lots of files which had a large link count. This led me to believe OS X 10.5 backs up files by making a single copy on the backup disk and the hourly backups only have a hard link to the file if it has not been modified.

Now I'm not sure anymore.

Take the stat of these two files, which probably do not change:

$ stat -f "dev=%d devnum=%r ino=%i links=%l" "/Volumes/Isolevy/Backups.backupdb/Sarah/2007-12-09-124244/Sarah/Applications/Address Book.app/Contents/Resources/Dutch.lproj/AddressBookHelp/gfx/border_top.gif" "/Volumes/Isolevy/Backups.backupdb/Sarah/2007-12-09-134304/Sarah/Applications/Address Book.app/Contents/Resources/Dutch.lproj/AddressBookHelp/gfx/border_top.gif"
dev=234881030 devnum=0 ino=236409 links=1
dev=234881030 devnum=0 ino=236409 links=1

The inode of the two files is the same but their link count is only 1. According to my understanding of the unix file system semantics, this should not be possible! Perhaps there is some HFS+ magic involved that is visible thru the "unix" disguise OS X is wearing. I think I read somewhere that hard links were a bit difficult to implement in HFS+ and they at least used to be very slow.

Anyone have any info?

1 kommentti:

Anonyymi kirjoitti...

I think this has something to do with OS X/HFS+ using something called 'Aliases', (instead of hard/soft-links;) - it's supposedly a whole different technique than the traditional one's, but I've yet to investigate it further.