Hiding Time Machine Drives on the Desktop

Time Machine icon

New to Mac OS X 10.5 Leopard is an integrated backup solution called Time Machine. To use Time Machine, simply plug an external hard drive into your Mac and configure it as the Time Machine back-up volume. Time Machine will now automatically perform hourly back-ups of your files.

Mounted drive on Desktop

While the periodic back-ups run more-or-less transparently in the background, one slight annoyance I’ve had is with the icon of the Time Machine Volume  appearing on the Desktop, as shown in the figure to the left. The genius of Time Machine is its “out of sight, out of mind” approach, and the persistent Desktop icon (for a drive you should not care to have access to anyway) runs counter to the original intent. Apparently I am not alone, as this complaint has also been brought up on macosxhints.com. Here I’ll discuss two solutions for removing the Time Machine Volume  from the Desktop.


Rename the drive using diskutil

In Mac OS X, as in most Unix systems, hidden files or folders have a period or dot (“.”) as the first character of the item’s name. Most of the system files, for example, are kept invisible this way. Therefore, to make the Time Machine Volume  invisible, we simply need to prepend a dot to the volume name. The problem is, Finder does not let you do this.

It can be done from the command-line, however, using the diskutil command. To show you how it works, open up a Terminal window and look for the mounted volumes on your machine by typing ls -l /Volumes/:


% ls -l /Volumes/
total 8
drwxrwxr-t@ 32 Keith  Keith  1156 Mar 19 14:40 MacProBackup
lrwxr-xr-x   1 root   admin     1 Feb 27 09:23 Macintosh HD -> /

% ls -l /Volumes/
total 8
drwxrwxr-t@ 32 Keith  Keith  1156 Mar 19 14:40 MacProBackup
lrwxr-xr-x   1 root   admin     1 Feb 27 09:23 Macintosh HD -> /

The drive MacProBackup is the one we want to rename. We will rename it .MacProBackup by typing :

Test
% diskutil rename /Volumes/MacProBackup .MacProBackup
Volume on disk5s3 renamed to .MacProBackup

Now when you look for the mounted volumes, the back-up drive is no longer visible.

% ls -l /Volumes/
total 8
lrwxr-xr-x  1 root  admin  1 Feb 27 09:23 Macintosh HD -> /

To see the hidden volumes, use the ls -al command:

% ls -al /Volumes/
total 24
drwxrwxrwt@  5 root   admin   170 Mar 19 15:14 .
drwxrwxr-t  37 root   admin  1326 Feb 11 23:54 ..
-rw-rw-rw-@  1 Keith  admin  6148 Dec 20 13:04 .DS_Store
drwxrwxr-t@ 32 Keith  Keith  1156 Mar 19 14:40 .MacProBackup
lrwxr-xr-x   1 root   admin     1 Feb 27 09:23 Macintosh HD -> /

to confirm that the drive has been renamed.

Return now to the Finder. In order for the change to take effect, you may need to relaunch the Finder. Holding the Option key, click and hold the Finder icon in the Dock until the contextual menu appears and choose “Relaunch.” (There are several other ways to relaunch Finder as well). Note that the Time Machine Volume  is no longer on the Desktop, but the drive is still visible under “Devices” in the Finder sidebar:

Finder window

This is a nice feature, since you can conveniently eject the drive from the sidebar if/when you really want to unmount the volume. If you don’t want the drive appearing in the sidebar, you may manually drag it off the sidebar or use the AppleScript solution below.

Using AppleScript

As suggested in the macosxhints.com article, AppleScript can also be used to make our MacProBackup back-up volume invisible. Open Script Editor and run the following script:

quit application "Finder"
tell application "System Events" to set visible of disk "MacProBackup" to false
delay 1
launch application "Finder"
delay 1
tell application "System Events" to quit

Note that with this method, the volume is now removed from both the Desktop and the Finder sidebar. When you mount this volume on another machine, however, the drive will be visible. The volume .MacProBackup that was renamed with diskutil, on the other hand, will be invisible on all machines.

4 Responses to “Hiding Time Machine Drives on the Desktop”

  1. BrunoMCP says:

    I’ve been looking for a solution for this problem, and this is the better one I found.
    (because the drive still appears in the sidebar).

    I’m going to use it.
    It would be better if it doesn’t have the dot, but is good enough.

  2. BrunoMCP says:

    I got this:
    Disk Utility Tool
    Usage: diskutil rename MountPoint|DiskIdentifier|DeviceNode newName
    diskutil renameVolume MountPoint|DiskIdentifier|DeviceNode newName
    The new name is subject to file system-specific naming restrictions.
    Rename and renameVolume are synonyms.
    Ownership of the specified volume may be required.
    Example: diskutil rename /Volumes/SomeDisk SomeNewName

    What does it means?

  3. BrunoMCP says:

    I got it.
    I didn’t know that I have to write ‘\ ‘ instead of ‘ ‘…

  4. This seems to not work in Snow Leopard afaik. Trying to rename HFS+ drives gives this:

    bjeanes@Maccy ~ $ > sudo diskutil rename /Volumes/Drive .Drive
    .Drive does not appear to be a valid volume name for its file system

Leave a Reply

Top