Most
(but not all) of the information that makes your Mac seem
uniquely yours resides in your Home folder. Discover how to take this
folder with you everywhere you go so that any Mac feels (almost) like
home.
Take the case of the mysterious Mac Guy A. He had a problem: he was
constantly using different Macs. He might use one of 20 different Macs in
his school’s computer lab, give a lecture using yet another Mac or, even
worse, he might find himself in front of his girlfriend’s laptop for an
extended period of time.
“No big deal,” you argue, “he can use iCloud. Store his documents
there and he can access them everywhere.” A seemingly sure solution—until
the network gets iffy (like it is at more than one place he visits) or he
runs up against his data limit (iCloud storage isn’t unlimited).
So the problem remains. He doesn’t want to haul his Mac Pro around
in a heavy-duty backpack (plus think how long the extension cord would
have to be!), he can’t use his iPad for all his computing needs, and
carrying both the iPad
and
a laptop seems overly
burdensome. He does have one thing going for him: he’s around a lot Macs,
a lot of the time. If he could just make all those Macs his, he would be
in computing nirvana!
The good news is that you can make any Mac you meet yours. The bad
news? You’ll need some portable storage—something with more space than
your current Home folder but that’s easy to carry around. This could be an
SSD drive, a high-speed flash drive connected to your keychain, etc.
Whatever you’re comfortable carrying that is of sufficient size will fit
the bill.
To
decide how big of a chip or drive you need to take your
preferences anywhere you go, first find out how big your Home folder is.
In a Finder window, select Go→Computer (or press Shift-Command-C); then,
select your startup drive and double-click the Users folder (
Figure 1-13
).
Inside the Users folder, click your specific user folder. Then see
how much space the Home folder currently demands by selecting File→Get
Info (or pressing Command-I). The size of your user folder appears right
near the top of the Get Info window. Base your purchase decision on this
number. If the amount of data seems overly large, you can selectively
leave out folders like Photos, Music, and Movies (the usual
culprits).
Your
Home folder houses everything that you like and have
customized about your Mac: your music, your photos, and the veritable
morass of preferences that tell your applications just how you like them
to behave.
Warning: Your Home folder is crucially important—it’s one
collection of files you really,
really
don’t want
to lose. So before you try this hack (or any potentially dangerous
hack) make sure your Home folder is safely backed up. (See
[Hack #1]
for tips on backing up.)
Of
course, not
everything
travels with
your Home folder. Your Application folder houses the applications you
use and they won’t go for the ride unless you manually copy them to a
folder on the memory stick you’re using. You’ve got two choices: either
make sure the applications you want to use are on the Macs you’ll be
using, or take your unusual applications with you.
Turns
out there’s an Application folder right in your Home
folder. Usually this is reserved for apps that are installed for a
single user, but there’s no reason you can’t copy the apps you want to
travel with to this folder. It won’t work for every app, but most apps
don’t mind travelling like this.
Not every application is a good traveler. While most OS X
applications enjoy drag-and-drop functionality, some very important
applications do not. Mail and Safari are two examples; they store
preference files in your System Library, so even if you copy Mail to
your portable Home folder, you won’t be able to fire up Mail and use
it as though you were on your main machine. But
all is not lost: a bevy of portable versions of popular
Mac apps are available from
Sourceforge. See
this list of OS X portable
applications
to get
started.
The
first obstacle to deal with is the fact that your
drive/chip/whatever you’re using probably didn’t come formatted with
Macs in mind. Your Mac prefers a Mac OS Extended Journaled format. So
fire up Disk Utility (Applications→Utilities→Disk Utility), select the
device in the lefthand column (
Figure 1-14
), and then click
Erase and let Disk Utility do the hard work. When it’s done, you’ll have
a blank drive ready to hold your Home folder.
Using Macs is easy, right? So slapping your Home folder on
another drive is as simple as a dragging and dropping it, right? Well
it is—with one caveat: turns out that a Mac needs to know where to
look for your Home folder in order to use it, and telling a Mac where
to look for your Home folder isn’t a trivial task. First, you have a
decision to make: do you want the portable media to house your current
Home folder and rely solely on said media for all your Home-folder
storage needs, or do you want your media to contain a
copy
of your Home folder? There’s no right answer
here: if you’re going to spend a lot more time at your home computer
consider using a copy; if your time is equally spent between machines,
consider using the portable media as your standalone Home folder. The
difference isn’t huge, but it also isn’t negligible. Depending on the
steps you take, you can create a Home folder you use all the time (on
your main machine and all the other Macs you use) or one that you’ll
use
only
when you’re on a Mac that’s not
yours.
Whether you’ve decided to go with a new Home folder or just go
portable media all the time, the process is the same. First, locate
the Home folder you want to use on the go and copy it to the media you
are going to use. This will duplicate the data from the chosen folder
to your destination (you’ll be asked to authenticate during the
process). Don’t worry, copying data is nondestructive, so you won’t
lose any data doing this.
Note: If
you decide to copy the contents of your Home folder
one folder at a time, you’ll miss the Library folder because it’s
invisible. To temporarily make invisibles visible, open Terminal and
type:
defaults write com.apple.finder AppleShowAllFiles TRUE
And
then press Return. This command tells the Finder to
show the hidden files. Next, type:
killall Finder
This command restarts the Finder. Now you can see the Library
folder and copy it over to your portable media. Once you’re done,
head back to Terminal and type:
defaults write com.apple.finder AppleShowAllFiles FALSE
This re-hides the Library folder and other invisibles.
Finally, type:
killall Finder
This restarts the Finder and makes everything normal
again.
The
Users folder is located at the root of your
computer’s directory, which is a geeky way of saying that the Users
folder can be found by selecting Go→Computer from the Finder’s menu
bar (or pressing Shift-Command-C). Inside the Users folder are
folders for each account on your machine. Your active Home
folder—also called your User folder—looks like a house; all the rest
look like folders (
Figure 1-15
).
Once you have the Home folder copied to your chosen destination,
you’ve got to tell the Mac you’re using as your main machine where to
look for the Home folder. Yeah, your computer is smart, but it isn’t
psychic (though Google might be).
The
deliciously easy procedure to tell your Mac where your
new Home folder resides? Head over to the Accounts preference pane
(System Preferences→Users & Groups), click on the lock to make
changes and then authenticate. Once authenticated you’ll need to
explore the Advanced options, which Apple has cleverly hidden from
view. To get to them, in the lefthand column, right-click the account
you want to change, and an Advanced Options item will magically appear
(
Figure 1-16
).
Once you’ve accessed the Advanced Options pane, you’ll see a
scary warning message. Don’t worry, what we’re doing won’t hurt
anything. Look for the Choose button next to the “Home directory”
field. Simply click that button and navigate to where your new Home
folder resides (
Figure 1-17
).
As mentioned earlier, Macs aren’t psychic. So you’ll have to run
through this process on each Mac you’re planning to use.
So
you want your Home folder to go but you don’t
always
want to rely on your portable drive for
your Home folder. In other words, you want your Home folder on your
keychain when you’re away but when you’re in your dorm or apartment
you want your Mac to rely on the internal hard drive. That
configuration makes a lot of sense—why not use the built-in hard drive
when you’re using your home computer?
Of course, if the latest files aren’t at your fingertips, that
defeats the purpose of having a portable Home folder (convenience).
For example, if you modified a Final Cut Pro movie while you were
working on a Mac using your portable drive as the Home folder, when
you want to work on the same presentation at home, you won’t want to
manually dig through your USB drive to find the latest version.
What you need is a way to keep the Home folder on your portable
media synced up with the Home folder on your main Mac. There are many
ways to get this done, either using a command line and something like
rsync or a third-party application. There’s no single “right” method
for keeping the folders synced, but one of the easiest is using Automator.
You
could start from scratch and create your very own
Automator workflow (see
[Hack #23]
for instructions), but
why reinvent the wheel when someone else has done most of the legwork?
On
your home Mac, point your browser to
the Sync Folders
download page
to grab a copy of it. Sync Folders is a very
handy Automator action written by Ben Long that can take the contents
of two folders and make sure the folders exactly mirror each other
while ensuring the newest version of each file overwrites the older
files. Once you’ve downloaded the Sync Folders action, double-click
the file and a window will pop up asking if you want to install the
“Sync Folders” action. Of course you do, so click Install.
Sync Folders then needs to know what you want synced (in this
case, the two versions of your Home folder), and that we want the
folder synced both ways with the newest version of each file in both
folders. The first thing to do is drag your Mac’s Home folder from a
Finder window (just grab it in the sidebar) into Automator’s workflow
pane (the upper-right pane). Then do the same with the Home folder
you’ve created on your portable storage. Make sure the pop-up menu
next to Pass On is set to Both Folders, and you’re ready to try it
out. Click the Play button and witness the results of the
workflow.
You
probably don’t want to fire up Automator
every
time you want to sync your portable Home
folder and the Home folder on your main machine. No problem: one of
the great things about Automator is that it lets you save a workflow
as an application so you can just launch the application instead of
mucking about with Automator. To save Sync Folders as an application,
choose File→Save As (you may have to press the Option key to make this
menu item appear), name the workflow something meaningful, and choose
Application in the File Format menu (
Figure 1-18
); then click
Save. Once the file is saved you can sync the two folders anytime
simply by launching your
new
application.