When Good Data Goes Bad

Thursday Jun 4th 2009 by Kenneth Hess

Cover Your Assets: Backup and Restore are major pain points for any business; ease yours inexpensively.

Oh sure, you purchased some expensive backup and restore package that's serving you quite well and you don't need a replacement. What's that? It isn't serving you well? That's odd. The expensive stuff is supposed to be awesome and failure free-after all, that's why you paid so much for it, right?

The truth is there's no perfect software backup solution. However, there is a method that comes close to perfect: Disk-to-disk file copy.

Do you think that it's too simple to be effective? Think again. Even in the largest enterprises, many system administrators, frustrated by backup and restore failure, resort to such primitive measures. It's cheap, reliable, fast and — hey, wait — what happened to the old adage, "Cheap, reliable, fast; choose any two?" That old saw went out with the introduction of fast and inexpensive Serial ATA (SATA) hard drives, which retail for about $50 for one with a 500GB 32MB cache.

Redundancy is the key to safety in the computer world. For maximum safety, always have at least two of whatever it is you need for mission-critical operations. Data integrity is mission-critical regardless of the type of business you own. Think about it: Your financial and human resource records define and protect your business. Your customer lists, contracts, documentation, spreadsheets, letters and other documents are also irreplaceable — thus making good backups, and the ability to restore backed-up files, imperative.

Getting Started

For each server system that must be backed up, buy two large disk drives — the larger, the better — even if a single drive's capacity exceeds your needs tenfold. A large drive allows you to make daily backups without overwriting the previous day's copy. Install the disk drives into the server system, format and mirror the drives for maximum redundancy. Internal drives are faster than external ones regardless of speed or architecture. Backing up over a network connection is slow and might cause connectivity problems unless your backup network is isolated. Similarly, backing up to USB drives is painfully slow and therefore not recommended on server systems.

Backup Scheduling

Once you've installed your drives and your system is back online, you'll need to setup your backup schedule. Windows and Linux have very different options for copying files, scripting and scheduling repetitive tasks so I'll address these tasks generically.

First, setup backup folders on your new drive. (You'll see only one drive since the other is a mirror copy.) If you have enough space for a complete daily backup on the new drive, create a folder for each day of the week, including Saturday and Sunday if there's a possibility of new files or data on those days.

Next, select the files you want to backup. Unless you're an experienced shell scripter, you'll probably want to back everything up in certain folders to the new drive. Script your backup to recursively copy files to the new disk.

Here is a very simple example for Windows systems:

XCOPY D:Files E:Monday /Q /E /O
This command tells the system to copy all files from the source, D:Files, to the destination, E:Monday, without listing the files being copied (/Q), copying all directories and subdirectories-empty ones too (/E) and preserve the ownership information (/O).

On Linux, the equivalent command looks like this:

# cp -Rp /Files /Backup/Monday
As root, this command copies all files from /Files to /Backup/Monday recursively (-R) and preserve permissions (-p).

Finally, setup your backup schedule to run nightly or at your server's lowest usage time. Run a test backup or two to see how long it takes for the backup. The amount of time it takes to perform the backup will give you a clue as to when it should take place. For example, you don't want the server to be sluggish due to a backup when employees or customers login to the server in the morning. Schedule your backups to start and complete during the hours of least use.

Restoring Files

Unless you have a complete disaster and must recover all files from a backup, you'll likely need to restore only a few files at a time. Since you're using disk-to-disk backup, you should copy only the files to restore them — never move the files. Moving a file removes it from the backed up location permanently.

Permanent Backups

If you have files that must be kept permanently or one that you wish to preserve, backup to optical media (CD or DVD). Always use the highest quality media, which might cost you two or three times more than cheap media, but your data will be safe. Permanent backups, whether on disk, optical media or tape should be taken to another site for maximum safety and data loss prevention due to weather, fire, theft or earthquake. Some backup strategies require remote site storage on a nightly basis.

No backup strategy is perfect regardless of price but disk-to-disk copy has advantages over almost every other type: speed, low price, ease of use, and reliability and safety. Almost everyone believes that their backup strategy is solid and their backups are working until disaster strikes. Don't assume your backups are working. It's a very costly assumption. Remember, when designing and implementing any backup strategy that no one has ever been fired for having a good backup.

Ken Hess is a freelance writer who writes on a variety of open source topics including Linux, databases, and virtualization. You may reach him through his web site at http://www.kenhess.com.

Follow ServerWatch on Twitter

Mobile Site | Full Site
Copyright 2017 © QuinStreet Inc. All Rights Reserved