Backing up data is not fun. It takes time and resources, and 99.999 percent of the time it's not productive. For one person, it can be hard to justify taking the time to back up data, buy new storage media, and make sure your existing backups still work. But the day your hard drive decides to join the scrap heap is the day that all that time pays off. That's when you're reminded that backups are like insurance; you hope you never need it, but when you need it, you're really happy it's there. The trick is knowing how much to back up, what to back up, and how often to back up. This section will help you sort out these issues before you start. How to Lose DataWhen you think about it, data stored on a computer is a fragile thing. Nothing but ones and zeros stored electromagnetically on a cheap metal platter. The storage industry does a fine job of protecting those digits, but it's almost a wonder that users don't lose more data than they do. Aside from the times when you consciously press the Delete key or type rm <filename> at a shell prompt, when you talk about data loss, this is usually an unintended consequence stemming from various causes. Mother Nature is often at the root of the problem: thunderstorms leading to electrical power surges, tornadoes, floods, hurricanes, and fire can all make data disappear or become useless in an instant. Floppy disks are fragile things. They can get bounced around enough to damage the disk and corrupt files. Consider the unstable, buggy program you're using to create new data. When it hangs or crashes, you get a message warning you that All unsaved data will be lost. Hard drives do die, no longer capable of storing your ones and zeros on their platters. Manufacturers even use a rating system of Mean Time Between Failures (MTBF) to quantify the number of hours a hard drive should function. And using wildcards to remove batches of unwanted files can result in wanted files disappearing, too. Too often, however, data loss results from what technical support people call (privately) "keyboard-to-chair problems" good old human error. As long as there are humans, no matter how intelligent they happen to be, they will do not-so-intelligent things that can result in some level of data loss. Backups minimize the risk from all these causes of data loss. Assessing Your Needs and ResourcesIn many ways, deciding on a backup strategy is predicated on the answers to two simple questions: What files do I need to back up, and how often do those files change? The answers get down to a more critical question that lies beneath: What data is important to me? When you have those issues settled, the question then becomes: What can I afford, in both time and money, to protect that important data? The answers to these questions diminish in importance if you have access to massive amounts of bandwidth or empty warehouses that can store terabytes of data in every square foot of the property. That probably does not describe you, however. Some backup methods take longer than others, and the same is true for restore methods. Consider the situation where you have to restore everything. Can you afford to be down as long as it takes to restore using your method? If it's just your machine, will you have to sit there swapping disks in and out every few minutes, or can you automate the process? These are the questions that will help you formulate your backup strategy. After you have that strategy, it's important to practice it religiously and test it periodically. Whatever strategy you select, make sure to carry out these practices with similar fervor:
Choosing a Backup StrategyEveryone's situation is different, but we can make some generalizations about different types of users and their backup strategies.
Many backup strategies are used today, but in this section we'll review some of the more popular ones. Tweak any one of them for your own purposes. Caution If you are running Windows and Linux on the same computer, don't back up both file systems in one fell swoop. Back up your Linux files with a Linux tool and Windows files in Windows. YaST System Backup will also back up your partition table. See "Using YaST System Backup," later in this chapter. Simple StrategyIf all you need is to back up a few small documents and some configuration files, you only need a floppy disk or two. Copy the files directly. If you have a Zip drive or other high-capacity floppy, you can choose to back up the entire Documents directory for each user, plus the /etc directory for all your configuration files. Zip disks come in 100, 250, and 750MB varieties. With a CD-RW or DVD-RW on hand, you should be able to use K3b to burn the entire home directory for all your users to a single 700MB CD. The beauty of this strategy is that you can back up files on the spot, simply by copying every changed or new file to your chosen medium, although this is harder to do with a CD. It becomes problematic when your backups grow beyond a single disk. At that point, you'll want to adopt a more formal strategy, as in one of the following. Full Backup PeriodicallyThis is the standard backup process where you archive everything to your chosen medium on a weekly, biweekly, or monthly basis. The frequency depends on the importance of the data and how often it changes. Ideally, you can perform this backup to a designated network server, but depending on how much room your files take up, multiple CDs or DVDs may work. The best way to do this is with archiving software, which is discussed later in the chapter. Full Backups with IncrementsThis is the standard corporate backup routine used in medium-to-large networks. There's no technical reason smaller businesses can't do this, but it may be less necessary. With this strategy, you make a full backup to a tape weekly and back up new and changed files every day. There are two ways of defining what is "new and changed" that is, what to include in an incremental backup. The easiest way to do this is to have a single tape (Level 1) reference the last full backup (Level 0) each day. This way, you have to keep track of only two tapes. The danger is that if a lot of things change during a given week, you may run out of tape. The alternative is to have separate incremental tapes for each day. If you perform your full backup on Friday night, your first increment is Saturday, and it references the full backup. You then remove Friday's tape and insert Sunday's tape, which will include changes since Saturday, and onward to Thursday. So if someone comes to you and asks for the file they accidentally deleted on Wednesday, you can easily find Tuesday's backup tape and restore from there. It's best to use a professional backup solution, such as Amanda or BRU, for these complicated backups. As a system administrator, then, all you have to worry about is changing tapes. The software handles the actual backup. |