Practicing Good Housekeeping


As with any disk-based operating system, debris accumulates and storage space becomes fragmented over time. A few basic maintenance operations, performed on a regular basis, provide improved performance and stability.

The most critical of these is to back up your data. We cannot stress enough how important a regular backup routine can be — the first time you accidentally delete or overwrite some file(s) you need, you’ll be very glad to have a backup from which to restore them. Data recovery is one of the most expensive propositions a company or individual can face. In this case, an ounce of prevention is definitely worth a pound of cure.

Backups

A computer user who doesn’t make backups is like a parachutist who doesn’t check his or her equipment before jumping — they may be lucky for a while, but their luck runs out eventually, usually at a really inopportune time. It’s not a matter of if you will encounter a problem with one of your files it’s merely a matter of when.

Software and media

At one time, personal computer users could back up all their files on diskettes — in fact, the first IBM PCs and the first Macs didn’t even have hard disks, and everything was kept on floppies. Now that multiple gigabytes are required merely for the Mac OS X system, backing up to floppy is no longer practical or even possible. Even the use of Zip disks is becoming impractical as a general backup medium when you take into consideration the files generated by programs like iMovie. Tape drives, CD-RW, and DVD-R drives are becoming the media of choice. Long the leading purveyor of backup software, Dantz Development (www.dantz.com) produces Mac OS X versions of their Retrospect backup for the casual desktop user to the enterprise. Apple provides .Backup software as part of its .Mac package. .Backup (www.mac.com) allows you to automate backup to CD and DVD, as well as to your .Mac storage space. Roxio Toast 6 (www.roxio.com) now includes D j Vu, a Preference pane which provides unattended backup to CDs and DVDs through Toast. There are a number of different backup programs, of which the previously mentioned ones are but a small selection, explore the Web sites indicated in Chapter 22, and you can find a package that suits your needs.

Regardless of the hardware and software you choose, it can’t be repeated enough that you should perform backups regularly, and often. A month-old copy of your magnum opus won’t be of much use if you’ve been updating it steadily over the past few weeks, all those changes and additions are lost, and the deadline is tomorrow.

Backup rotation

A useful backup strategy includes regular rotation of your media and periodic archiving of your backups. Writing repeatedly to the same media can frequently be problematic — not only does media degrade under frequent use, but you could easily be overwriting a good copy of a file with a corrupted copy.

If you’re backing up data that is of the utmost importance to you or your employer, you’ll want to make your plan as fail-safe as possible. Because there is no such thing as a single solution that is completely foolproof, having multiple solutions in place, where each has a minimal chance of failure is best. A good plan requires quite a few sets of backup media, and is only one facet of the overall plan to secure your data. When the data is irreplaceable, there’s no such thing as too many backups. Some facets of a good backup are shown in the following sections; use them as a starting guide:

Backing up important data daily is best. You can reuse media for a while, but it is recommended that you archive and replace your media every so often to ensure you’ve got a good copy. It is a complete waste of time to be backing up your data to a disk that doesn’t actually work.

A good reason for using multiple tapes or disks is to be able to keep a copy of your data somewhere else. If you are a business owner, think about what would happen to your company if you walked in one morning and the building had fallen down or flooded. Would you be able to continue without any of your files? If you had a copy at home, even if it was a week old, you could turn around, and get things back up in a matter of hours or days, rather than declaring bankruptcy.

You can use incremental backups for daily backups, but creating a full backup to brand new media is best for archival purposes. Think about how far back you want your archive to reach. At a certain point, you can reuse some of your archival media, since they don’t get as much wear as daily media.

If you receive a virus or notice disk corruption at some point, you have a number of backups to choose from, including backups that are one day old, three days old, a week old, two weeks old, and so on. (If you find corruption on Thursday, you have Wednesday’s backup, Tuesday’s backup, Monday’s backup, and the previous Friday’s archive on top of any previous week’s archives you’ve kept. Hopefully, there is a recent version that lacks the corruption. If your data is less mission critical, you can scale things back to every other day, and possibly only once a week.

For personal backup, the scheme can be a little less arduous depending on the number of files you generate and work on daily. We still recommend that you backup once or twice a week, rotating between at least two different disks or tapes, and archiving your data every month or so, depending on the sensitivity of the data. Entering two weeks worth of Quicken checkbook data is a time-consuming task.

Generally, you don’t need to back up applications and system software, because these items are easily reinstalled and replaceable. However, backing up your user’s home folders is a good idea because these folders usually contain application preferences, email storage, stickies database, Internet bookmarks, and user documents. A backup of the Classic preferences folder is good to have in the event of a disk crash (/System Folder/Preferences). You should also know where your applications keep their data, so you can be sure that you’re backing up what you think you’re backing up. You may want an archive of application updates and software downloaded from the Internet, just so you can get to those patches and updates quickly if you need to reinstall. Archive data periodically and keep at least two different backup tapes or disks active at once for some measure of redundancy.

Maintaining the file system

Although Mac OS X can read and write a wide variety of disk formats, it (at least currently) can only start up from two different formats, Mac OS Extended (also known as HFS Plus or HFS+ for hierarchical file system plus) and UFS (Unix File System, sometimes called ffs for fast file system). Apple recommends the use of the Mac OS Extended format, and so do we. The Classic application environment does not operate from a UFS formatted disk. Most Carbon applications perform better in the Mac OS Extended format because the file system does not have to translate the files to emulate the multiform files to which many Mac applications are accustomed.

Mac OS X comes with a basic disk diagnostic and disk-directory repair tool — Disk Utility, which is covered in depth in Chapter 21. Other vendors of well-regarded disk utilities include Micromat with Drive 10 and TechTool Pro (www.micromat.com), Alsoft with DiskWarrior (www.alsoft.com), and Symantec with Norton Utilities and Norton System Works (System works is a bundle of Utilities and AntiVirus) (www.symantec.com). So far, Alsoft and Norton have shipped Mac OS X versions of their disk utilities, and Micromat promises that TechTool Pro will be released any day now (Drive 10 was the first native Mac OS X disk utility).

Note

If you restart in single-user mode (hold down z-S during startup), you can run the Unix command-line tool fsck (File System ChecK), with the –y option, to repair many problems with the directory structures. If you choose this route, you should rerun it repeatedly until it comes back with no errors found.

The directory, sometimes referred to as the catalog of your hard drive, is like a library’s card catalog; it is a list of items that provides information to the user regarding where everything in the library can be found. In ideal use, the directory would never have a problem, but with power outages, crashes, reboots, or brownouts, sometimes things in your disk’s directory structure get out of order or even broken. Depending on the location of the damage, an incorrect directory structure can cause your computer to act up, lose files, or even refuse to boot to the desktop.

This is where the disk utility software comes in. Norton Utilities, Alsoft DiskWarrior, and Micromat’s tools read through the directory structure and compare it to what is actually found in the places they are told to look. If a miscompare occurs, it is noted, and you are prompted to repair it. Norton and Micromat’s philosophy of disk repair is to patch the directory — if there is a problem area of the directory, they will remove the incorrect entries and replace just those errors with the correct data. Alsoft on the other hand believes that it is better to create a brand new directory structure from scratch, avoiding any problems that could be created by the patching process. DiskWarrior is generally regarded as the most reliable of the repair tools listed here, though TechTool pro and Norton Utilities have more tools in their bags of tricks, and fix more than just directory damage. You will want to have a few tools at your disposal — sometimes even the most reliable tool will not be able to solve a problem you encounter, and a different utility with a different approach may get the job done.

Note

There is a third philosophy when it comes to disk damage — hard drives are cheap these days but your data is expensive to replace, and even a successful repair of the directory doesn’t exclude the possibility of further damage. Two companies, Prosoft Engineering (www.prosoftengineering.com) and BinaryBiz (www.www.binarybiz.com), make disk tools that focus on the recovery of your data rather than the repair of your disk. DataRescue X (ProSoft) and VirtualLab Data Recovery (BinaryBiz) will even scour a disk that is beyond recovery using the disk utilities listed above, and find your files for you, allowing you to copy them to a new drive, and throw away or replace the damaged disk.

Invisible files and folders

Apple and the graphical user interface try very hard to conceal the sometimes cryptic Unix underpinnings of Mac OS X from you. For example, the standard command-line directories (folders) are hidden from you when you’re in the Finder or using an Open or Save dialog.

These directories have such revealing names as .bin (binary executables), .dev (devices), .etc (et cetera, miscellaneous items), .sbin (more binary executables, mostly run at startup time), and .usr (user directory hierarchy).

Now, you may ask, if the Finder hides these from us, how do we ever find out where they are? You can use a few easy ways to find out: use Unix commands in a Terminal window as described in Chapter 25 or use OS X’s Find command to search for items whose visibility is off, as shown in Figure 22-1. You can also make use of utilities such as TinkerTool and Cocktail (see Chapter 21 for more information) to turn off the invisibility of all of the files on your Hard Drive, and browse them like any other files.

click to expand
Figure 22-1: Mac OS X’s Find command is very powerful and allows you to set many constraints on your file search. You can use the Find command to search for invisible files by selecting the Visibility pull down menu.

Because these folders are invisible, Mac OS X’s Find command won’t let you double-click them to open them in the Finder. To see what they contain, you will have to make them visible, or be constrained by the use of the Terminal and then enter Unix commands — ls –F /bin, for example, gives you a listing of all the files in the /bin directory and indicates whether they are directories (appending a slash), executables (appending an asterisk), or a link (appending an at-sign).

start sidebar
I Forgot my Password and I Can’t Get Up

If a user can’t remember his or her password on your computer, you can log in as an administrator and reset the user’s password. If there are no other accounts, or no one can remember the password of an administrator account on your computer, you can reset passwords of ordinary user and administrator accounts by using the Mac OS X installation CD.

To reset a password when no administrator account passwords are at hand, follow these steps:

  1. Restart the computer with the Mac OS X installation CD. Insert the CD and choose Apple Restart.

  2. When you hear the computer’s startup chime, hold down the C key until the computer begins starting up from the CD. You can release the C key when you hear the sounds of activity coming from the CD. After a minute or two, the Installer application opens.

  3. In the Installer, choose Installer Reset Password. The Password Reset application opens.

  4. At the top of the Password Reset window, select the Mac OS X disk that has the user account whose password needs resetting.

  5. For each user account whose password needs resetting, do the following:

    1. Click the pop-up menu and choose the user account whose password you want to reset.

    2. Type a new password in both text boxes and click Save. If the two entries are not identical, you are asked to re-enter them.

    3. In the dialog that appears, click OK. The dialog informs you that the password you entered was saved.

    4. When you finish resetting passwords, choose Password Reset Quit Password Reset. You return to the Installer.

    5. In the Installer, choose Installer Quit Installer.

    6. In the dialog that appears, click Restart. The computer restarts.

end sidebar

Caution

Safeguard your Mac OS X installation CD to prevent someone from using it to gain unrestricted access to your computer. If your data is important to you, secure the computer physically and prevent access to unauthorized users.

Protecting against viruses

Although computer viruses are not nearly as prevalent on Macs as on Microsoft Windows PCs, Mac viruses do exist, and many of the so-called macro viruses developed on PCs (generally infecting Microsoft Office documents) can infect Macs. If you perform a search on one of the popular antivirus sites such as www.symantec.com you’ll find millions of viruses, but only a handful of viruses for the Macintosh, many of which don’t even apply to Mac OS X. Security through obscurity is not a very strong defense, however, and it is recommended that you take steps to protect yourself.

Viruses invade your computer through documents or applications that you have downloaded from the Internet, through electronic mail attachments, through any type of removable disk (including floppy disks), or network volumes you may use with your computer. Although some viruses may be relatively innocuous, doing little more than taking up space on disk and slowing down your computer a bit, others can be highly destructive, causing crashes and erasing files. The Unix system of file permissions underlying Mac OS X make infection from viruses even less likely to cause extensive damage — at least so long as you don’t log in with the System Administrator (root) account.

The only way to protect your Mac from computer viruses is to install an antivirus utility on your computer. Antivirus software warns you if a virus attempts to infect your system, scans your disks for viruses that may be lurking (or may already have caused some damage), and eradicates almost any virus that it finds. Symantec’s Norton Antivirus, MacAfee’s Virex X, and Sophos Anti-Virus, among others, are available for Mac OS X. If you are a .Mac member, one of the advantages is that Apple provides you with a licensed copy of Virex X with your membership.

Whichever antivirus software package you choose, make sure that you keep it up-to-date; each time a new virus appears, the antivirus packages must generally be updated to recognize it. Most of the time, you receive updates by downloading them from the software publisher’s Web site or accessing them in public download Web sites or FTP sites. Usually, you have a limited “subscription” to updates to the virus software itself. With Virex, you can pay an additional fee to have updates e-mailed directly to you. Norton AntiVirus includes a LiveUpdate feature that automatically downloads and applies the latest virus definitions for you. A full year of virus definition updates is normally included in the price of your software package, afterwards you must pay a subscription fee to continue to receive updates. If a newer version of the antivirus software has been released in the past year, it is sometimes a better deal to purchase the newer version rather than subscribe to the update plan. Virex and Norton AntiVirus are targeted at home and small business users, while Sophos Anti-Virus is aimed at the larger networked and cross-platform market. Sophos Anti-Virus generally runs on a server, and can be set to scan files on access, rather than at a set time. MacAfee , Symantec, and Sophos post new virus definitions to their Web sites monthly (normally in the first week of every month), possibly more frequently if a particularly destructive virus is discovered. If you are either a Virex or Norton AntiVirus customer, you should consider marking your calendar to check on the first of the month and to bookmark the company’s virus definitions page for easy access.

Mac OS X is mostly free of virus infection, however, viruses in the PC world can affect Mac users. The widespread worms that have been hopping around the Internet, being propagated by insecure Microsoft Windows machines have caused other problems on the Mac. While not an infection, these worms spread themselves by emailing hundreds, sometimes thousands of people in the address books of those computers that are infected. Mac users have been inundated with these virus-containing messages, and while they pose no direct threat of corruption or data loss because they can’t infect the Macintosh that receives them, it is quite the pain to get 30 or more spurious messages a day. Even worse, is the fact that some viruses spoof the originator, and Mac users can be incorrectly pegged as virus propagators. Take heart that you haven’t been infected, and keep on top of what viruses are rampant in the wild so that you can determine the actual threat to your data.

start sidebar
Computer Viruses, Worms, and Trojan Horses

A computer virus is a piece of software designed to spread itself by illicitly attaching copies of itself to legitimate software. Although not all viruses perform malicious actions (such as erasing your hard disk), any virus can interfere with the normal functioning of your computer.

A macro virus is a virus written in the macro language of an application (a programming language that enables you to automate multiple-step operations in an application). By far, most macro viruses infect Microsoft Word (Version 6.0 and later) and Excel (Version 5.0 and later) documents. Like other viruses, macro viruses can be very destructive.

Viruses, alas, are not the only potentially destructive software that you may encounter. Worms are similar to viruses in that they replicate, but they do not attach themselves to files. A worm replaces a legitimate program or file on your system and performs its mischief whenever that legitimate program is run.

A Trojan horse is an intentionally destructive program masquerading as something useful, such as a utility, software updater, or game. Although worms and Trojan horses are not viruses, most commercial antivirus programs can detect and remove them.

end sidebar

Keeping software up-to-date

Unfortunately, no software of any consequential size and complexity is completely free of bugs (bugs being improperly programmed instructions). Some bugs may be features that do not function as planned to more serious errors, causing crashes or data corruption. Many bugs are so obscure, requiring an unusual confluence of events that you are likely never to encounter them. But a few bugs may appear to take a nip at you. As one of the largest bodies of code on your Mac, Mac OS X also is not completely bug-free.

Customarily, after software publishers become aware of a problem with their product, they take action to correct the anomaly by either one of the following:

  • Document a work-around while they work on a new version that fixes the problem.

  • Provide an updater that updates the application to a new version with the problem fixed.

Registering your software (either by sending in the postcard that came with it or via the Internet, as you did when you performed your Mac OS X Setup) and checking the publisher’s Web site regularly are two good ways to keep informed of workarounds and updaters. Many software publishers, such as Aladdin Systems, include in their applications the ability to automatically check the publisher for updates just as Apple does with Mac OS X and QuickTime.

Mac OS X, like Mac OS 9 before it, provides a live Software Update capability. The Software Update pane of System Preferences is easily accessible from the System Preference application. Keeping your operating system software up-to-date with the latest enhancements and bug fixes from Apple should be part of your maintenance regimen.

To install software updates:

  1. Launch the System Preferences application. It can be accessed from the dock, or from the Apple Menu by choosing System Preferences.

  2. In the System section of the System Preferences application, click on the Software update icon.

  3. Click on the Check Now button (shown in Figure 22-2). Your computer must be connected to the Internet, and you will see a progress bar in the bottom of the window. If there are any updates to be installed, the Software Update application will launch.

    click to expand
    Figure 22-2: The Software Update Preference pane can be configured to automatically check for updates on a daily, weekly, or monthly basis.

  4. Click on an update in the list of available updates to see more information about the update in the lower pane of the window. Make sure that the updates you want to install are checked and click the install button in the lower-right corner of the window. Some updates require the computer to restart, and they will have an icon next to them that indicates this. Figure 22-3 shows the update list before installation begins.

    click to expand
    Figure 22-3: Check off the updates you wish to install and click the install button. The number of items selected is displayed within the install button’s text.

After you have chosen to install the selected updates, the Software Update application connects to Apple’s servers and automatically downloads and installs the updates you have chosen. Some updates can be rather large, if you are on a dial-up account, you should pay attention to the size of the update so you can plan accordingly. Figure 22-4 shows the Software Update application downloading and preparing to install updates.

click to expand
Figure 22-4: The Software Update application conveniently downloads and installs the updates you have selected all at once, saving you the time of downloading and installing each one separately.

Tip

If you chose not to install an update because it doesn’t pertain to your system configuration (such as an AirPort update, but your computer doesn’t have or support AirPort), you can hide updates so you don’t have to see them each time you run the update check. Select an item from the list (do not check the checkbox, merely click on the name of the update), and from the Update menu, select Make inactive. You can show the inactive updates at a later date by going to the Update menu and selecting Show Inactive.

You can also check your iDisk for new and updated applications and utilities from Apple, as discussed in Chapter 10. There, you find such goodies as iTunes, iMovie, and the AppleWorks updaters in addition to new and updated printer drivers for Mac OS X. Here are some excellent sources to check:

  • Apple’s Mac OS X Web site (www.apple.com/macosx/)

  • Apple’s Software Updates library (www.apple.com/swupdates)

  • VersionTracker (www.versiontracker.com/macosx)

Despite testing by Apple and various software publishers, some older software products are incompatible with the Classic environment. Assuming that you have already verified that they work with Mac OS 9, you should keep them separate and run them only when you start up with Mac OS 9 until a Mac OS X–compatible version becomes available.

Maintenance measures

As you’ve seen in other Chapters, Mac OS X brought with it the concept of permissions. To a certain extent, this security model has grown from the Unix multiuser environment, and is designed to keep users out of places they shouldn’t have access to, such as each other’s home folders. The system, and all of the documents, applications, and folders contained on your hard drive each have their own permissions which tell the operating system who and what is allowed access to each item. These permissions can get messed up over time, and can cause applications to cease functioning in the way they are supposed to. Fortunately, Apple has provided a means of repairing the permissions on your computer to their proper settings.

Repairing system permissions

The included Disk Utility application provides an automated feature to repair the permissions of the system and the installed applications. If for some reason the permissions of your Disk Utility application are incorrect, it may in some very obscure instances be unable to properly function. In this case, you can boot your computer from a Mac OS X installation CD and repair the permissions using the Disk Utility command under the File menu. Alternatively, boot from an external or separate drive that has Mac OS X installed, and repair permissions from the Disk Utility on that volume. Permissions can only be repaired on drives that have Mac OS X installed; drives that only contain data or are Mac OS 9 boot volumes are not supported.

Disk fragmentation

When the files on a disk become fragmented, disk performance suffers considerably. In addition, files themselves (including applications) can become fragmented on a disk. A single file may be split into several pieces spread around in different locations physically on a disk. Fragmentation degrades disk performance because the drive must take extra time to move from one piece of a file to the next.

A fragmented file is analogous to a single track on an audio CD being split into multiple segments, so that the beginning of the track may be at the beginning of the CD, the middle at the end, and the end of the track some place in the middle with other unrelated files interspersed between. If audio CDs were mastered in that fashion (which, fortunately, they are not), you would likely notice a delay as the CD player’s laser moves to play the next segment.

In a disk with no fragmentation, each file physically resides in a single contiguous block. As a disk begins to fill up and new files are created and deleted with increasing frequency, files and the free space start to become fragmented. A heavily fragmented disk is more likely to experience a variety of problems, including corrupted directory structures and damaged files.

Without any special software, you can eliminate fragmentation by copying the entire contents of a disk to another disk, erasing the disk, and copying everything back. An easier solution is to use a commercial disk defragmentation utility, such as the SpeedDisk component of the Norton Utilities from Symantec (www.symantec.com), Plus Optimizer from Alsoft (www.alsoft.com), or Drive 10 from Micromat (www.micromat.com). Note, however, that older disk optimization utilities are not compatible with the Unix File System (UFS) and you should check for compatibility before attempting to run a disk optimizer on a UFS volume.

Before optimizing any disk, take the time to make a full backup, because virtually every byte on the disk can be erased and moved to a different location. If an error occurs during this process you stand the chance of losing some or all of your data.




Mac OS X Bible, Panther Edition
Mac OS X Bible, Panther Edition
ISBN: 0764543997
EAN: 2147483647
Year: 2003
Pages: 290

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net