$bbtitle
Apple Stock: 199.92 ( -0.59 )
RSS RSS Twitter Twitter
Search:
AppleInsider.com Archives News Bytes Reviews Anonymous Mailer Submit Story AppleInsider Forums Mac Prices Polls Advertise on AppleInsider Contact AppleInsider
Save up to $280 on new MacBook Pros and up to $165 on brand new iMacs with special coupons: Mac Pricing Guide updated Nov 20th (Find the best prices on Macs).
Friday, October 12, 2007

Road to Mac OS X Leopard: Time Machine [Page 3]

By Prince McLean

Published: 10:00 AM EST

Hard and Soft Links

Soft links are easy to understand and simple for users to employ; make an alias of a file, and it does everything that its target would do, while saved in another location. Multi-link files are a more complex idea, because they don't really fit the overall desktop metaphor. A Mac multi-link is a second "hard link" record that points to data or a directory. It doesn't just point to another file like an alias does; it is the same instance of that file. Create a hard link to a file, make changes to it, and the "previous file" is changed as well, because they are the same file. Delete it, and the file doesn't go away; it remains until the last hard link is removed. This is confusing in a quantum physics sort of way because it doesn't line up with the convenient physical metaphors we commonly use to visualize files and folders.

Leopard Time Machine


Regular files on any file system act as a single hard link. When you delete a file, you aren't really scrubbing the file off the disk, but rather only removing the hard link to it from its enclosing folder, banishing it to the unruly world of the unlinked wilderness of the drive. "Undelete" utilities attempt to search for unlinked files and restore them, but they can only work if the file system hasn't overwritten those unlinked files, which it will happily do without any concern, because the disk space consumed by unlinked files is fair game for recycling.

Leopard Time Machine


File systems that support multiple hard links to the same file keep a count of each hard link created. Each hard link to a data file acts like a parallel, shared instance of that file; if you delete a file with multiple hard links, it is not banished into the world of deletion. Instead, it remains in place until the very last hard link pointing to it is removed. In other words, if you create a hard link to a file and then delete the original, the new hard link and its file data remains unscathed. In contrast, if you make a soft link or alias of file and then delete the original, the alias only points to the former location of the deleted file, which no longer exists. The lone remaining alias can't function, and the data of the file it pointed to is no longer available.

Leopard Time Machine


Time Machine's Multi-Links

Hard links therefore act somewhat like a ghost, and somewhat like a clone. Like an alias, new hard links can reference an existing file without taking up additional space on disk. However, deleting one is like cutting off the head of a mythical hydra; it doesn't rid the world of its body and new hard links could pop up in its place, making it difficult to delete the beast entirely unless you can hunt down every hard link head and chop them all off. This complex idea doesn't fit well into the user space, but is very useful for certain purposes. One of them relates to Time Machine.

Apple actually designed the multi-links in HFS+ primarily to support Time Machine. Unlike other Unix or Linux distros, Mac OS X's multi-links support hard linking to both files and directories. Creating multiple hard links to directories is outlined in the official POSIX specification for Unix, but is rarely supported because the use of multiple hard links for directories is dangerously powerful. If a child directory linked to its own parent, it would create a directory cycle that could cause unbridled looping and file system corruption. File system utilities are also typically unprepared to handle multi-linked files. In Time Machine, multi-links are used in a specific, controlled context to avoid these types of problems.

Time Machine backs up its first full backup as regular files. You can mount the drive it uses and peruse it manually. It's simply all of your files stuffed in a time-stamped folder, stuffed in a folder named after your computer. Every hour, Time Machine makes what appears to be another full backup, but that new bunch of files doesn't take up twice the space. Instead, Time Machine dips into the abstract world of multi-links to create a parallel universe where most everything is a ghostly clone. Only the changed files are new; everything else is a secondary hard link to the data already backed up. The genius of multi-links means that the original files can be blown away, and yet still exist because new hard links are in place for those files.

Leopard Time Machine


By using hard links, Time Machine can keep frequent backups without eating up much disk space at all. The other benefit is that the user can browse the files directly and see a full file system for each date and time encapsulated in a backup. Each folder appears to be a full backup of regular files, and in a sense it is. All of those complete backup files simply share the same space on disk, as if living in parallel universes while sharing the same body. Hard links are needlessly confusing and potentially dangerous to non-technical users, so Apple doesn't expose the inner workings of Time Machine and doesn't offer any way to create hard links in the Finder.

Snapshots and Windows' Shadow Copy

Time Machine has been frequently compared to Microsoft's Shadow Copy (or Volume Snapshot Service), because both systems involve file backup. In reality, they are not really very similar at all. Microsoft uses the background Shadow Copy service to duplicate files on the same disk. Those shadow copies record a "snapshot" of the file at a given moment in time, and can be accessed by the user using Previous Versions (which shows up in the file properties viewer), or tapped into by an external network backup system. Backing up these "shadow copies" simply prevents the external backup system from running into problems trying to back up live files that may be locked by the user working on them.

The data backup features related to Shadow Copy are only useful if a Windows machine is running in an environment with a server backing them up. Shadow Copy is not in itself a backup system, although it can present a listing of duplicated files that were captured by the shadow copy service. Without a dedicated backup system, Previous Versions only shows local shadows of a file. It does not copy files to an external disk for safekeeping, and its shadow copies can't be browsed through by the user in the file system by date or by query. Shadow Copy is certainly not an easy to use consumer backup solution (nor is intended to be), which is what Time Machine expressly is.

In Windows Vista, Microsoft also tied Shadow Copy into System Restore, which allows users to roll back their entire PC software install to a previous point in time. This is not a backup system either; it's a system wide undo. System Restore is oriented around undoing the problems caused by installing a software title, a Windows software update, an unsigned hardware driver, or some other event that causes problems that need to be rolled back. It doesn't go back and find something lost from the past; it reverts the clock to a previous checkpoint and throws away the future from that point forward. System Restore is not even loosely related to Time Machine in what it does, how it does it, or why it exists.

On page 4: The Pretty Layer of Time Machine and Back Up to the Future.

139 Comments ] 
  Print ] [ Story Link ] 


Download Parallels 5.0 Today
Mac Poker players can play Full Tilt Poker for Mac and get 100% to $600 free with bonus code MP600, courtesy of Online Poker Mac
AppleInsider Features
Hot Forum Topics

Recent Articles
Apple's App Store approval process gets partially automated
TomTom to release iPod touch-specific GPS car kit
China Unicom expects 10% of 3G users on iPhone in 3 years
Steve Jobs e-mails terse response to upset Apple developer
Hack re-enables Atom processor compatibility for Mac OS X 10.6.2
Microsoft shareholders grill CEO about Apple, iPhone
Google outlines Chrome OS plans for netbooks
Sony announces iTunes competitor for music, movies, books
Apple investigates space-age fitness tracking technology
Web search statistics show Bing stagnant, Google growing
New apps said to make iPod touch more prominent in Apple stores
Piper: Apple tablet no more than $700, launch timing irrelevant
Major publisher preps for Apple tablet as delay, OLED rumors surface
AT&T faces setback in legal battle over Verizon ads [u]
TomTom app updated to support iPod touch, first-gen iPhone
Oct. estimates suggest Apple will sell 2.9M Macs this quarter
Microsoft retail store gets odd viral marketing buzz
Rumored 'Google Phone' said to be coming in 2010
Evidence suggests Apple at work on Mac OS X 10.7
iPhone approved in South Korea; China Mobile talks continue
AT&T upgrades network as wireless traffic quadruples over past year
Apple store in upscale Greenwich, Conn., to open Saturday
Needham downgrades Apple stock on technicality
Verizon rumored to embrace Palm in 2010 to combat iPhone
Apple's iPhone App Store takes off in China
Belgian heist lands thousands of stolen Apple iPhones
Verizon responds to AT&T in court: 'The truth hurts'
Apple said to release iPhone app for in-store appointments
OnLive cloud gaming service demonstrated on Apple's iPhone
Apple tablet speculation: high-end graphics, several models
Microsoft looks to combat Apple globally with Zune content
Apple met with AdMob weeks before acquisition by Google
Apple earns key legal victory against Psystar
Apple looks to hire AAA game developer for in-house iPhone team
Apple's next-gen iPhone power amp; NASA chemical sensor app
Bill Gates praises Steve Jobs for saving Apple
AT&T responds to 'false and misleading' Verizon ads
Apple unveils browser-based iTunes Preview
AT&T asks court to pull Verizon's 'misleading' iPhone ads
Conflicting reports within Qualcomm suggest Verizon-only iPhone

AppleInsider Market Place

Sell your Laptop - working or not. Free shipping.: Get an instant online quote and sell your laptop today !

Believe in Office: Save Up To 25% on Office 2004 For Mac. Visit Our Site for Details!

IBackup - SMB Online Backup: IBackup is the preferred online storage and backup service of choice for SMBs for its ease of use, security and value. Offers automated backup and restore, file selection and securiy.

Download free software - everyday updated freeware files

 
Advertisements








AppleInsider RSS Feed
AppleInsider © 1997-2008
Please review our Privacy Policy.
Written/Edited/Compiled by the AppleInsider Staff.