Using Linux:Managing the Filesystem
-->
Previous
Table of Contents
Next
Disaster Recovery
Easy disaster recovery, in computing as in life, requires forward planning. This means making regular backups of your computer, and checking that those backups work properly.
The actual backup process is covered in Chapter 31, System Maintenance, but here we discuss the other aspects of disaster recovery.
Whats Vital and What Isnt?
There was a time when PC floppy disks were 360KB and hard disks were 10MB. A complete system backup might fit onto 30 floppy disks. A few years later, floppies were 1.44MB and hard disks were 100MBthats over 60 floppies. Today, floppy disks are still the same size but disks are 4GB. Even if you could buy 3,000 floppy disks, system backups would be ridiculously impractical.
There are many solutions to this problem. Floppy disks are no longer viable for backups of a whole system. Tapes and recordable CDs are perfectly good in their place.
A useful backup strategy takes into account several things:
What is the maximum acceptable downtime?
How much data must be backed up?
How quickly does the data change?
What backup devices are available?
If all the data you need to back up will fit on your backup device, then the simplest solution works bestback everything up, every time.
If a complete backup every time is impractical, you have to find a balance between the risk to your data and the cost of making backups. As an example, my own system has almost 4GB of filesystems. Much of this is occupied by the operating system and could easily be restored from the installation CD-ROM. Of the rest, the majority consists of packages either from CDs or downloaded from the Internet (WINE, POV, Gnome, LCLint, and so on). These come to over half a gigabyte. All these things can either be reinstalled from the CDs or downloaded again.
SEE ALSO For more information about doing system backups for Linux, see page 542.
Altogether, the files on which I work actively come to under 100MB, including the intermediate compiler output files, which dont really need to be backed up. I keep these files separate from the things that I dont work on. So, for me it is practical to back up my vital data to a series of floppy disks. This is not ideal, but its reasonable. This strategy is only possible because the filesystem is organized so as to keep the various kinds of data separate; I dont mix my own files (which I have to keep safe) with downloaded packages or documents (which I can delete).
Nontraditional backup devices
If you dont have a traditional kind of backup device, this does not mean that you cannot back up your important data. See your backup devices documentation for more information, and remember that backing up is absolutely crucial.
When to Back Up
When you have a catastrophe, you will lose everything modified since it was last backed up. So, there are two factors that determine how often you back your data up: what the capacity of your backup device is and how much suffering you can bear.
What to Do with the Backups
After youve backed up your data, the three most important things to do are as follows:
Write-protect the mediaTheres nothing worse than trying to restore from backup in a panic and accidentally deleting the backup.
Label your backupIf you cant identify the most recent backup when you need it, its no use. Keep your backups in a safe place.
Test your backupMake sure you can restore from it.
This last point is particularly important. Many people have a backup routine that they follow day in and day out but find out only too late that their backups are useless. A cautionary tale that sticks in my memory is that of a vendor of backup software whose code had a bug; it would make multivolume backups, but the second and following volumes were useless and could not be read back. Unfortunately, they used their own software to back up their systems and amazingly had never done a trial restore with their tapes.
Reviewing Your Backup Strategy
Dont forget to periodically reconsider your backup strategy. Circumstances change; your data may grow, or it may suddenly be more important that you be able to recover from backup suddenly. For example, while writing this chapter I added up the size of my working data and realized it was larger than I thought. Part of my next paycheck will go on a large r backup device; probably a SCSI tape drive or (if I can afford it) a CD-ROM recorder.
Coping with Disaster
When the worst happens, its important to be extra careful about what you do. If youve just typed rm -rf /tmp * instead of rm -rf /tmp/*, then by all means immediately interrupt this. Once you realize that data has been lost, take a moment to calm down and review your options. Determine the answers to these questions:
1. What data has been lost?
2. Where is my most recent backup?
3. Where is my system installation media (boot disk and installation CD-ROM)?
Restoring System Files
If youve just lost a few system files, you might be able to fix everything by reinstalling a few packages from the CD-ROM. People with even quite badly destroyed systems have recovered simply by booting from the installation floppy and selecting Upgrade. The Red Hat upgrade process can replace only missing files. If the destruction is more extensive, you may need to consider reinstalling from scratch.
Strictly speaking, it is quite possible to recover from losing almost everything just by booting the installation floppy in rescue mode and knowing how to haul yourself up by your bootstraps. However, if youre not an expert, you may find a reinstallation easier. If you do this, however, the installation process will destroy any data on partitions that the operating system installs onto. That is, if you only have one file system, /, then a reinstall will delete the contents of your home directory, too. If you have your /home file system on a separate drive, then the reinstall will not delete it (unless you tell it to format that partition by accident).
If a reinstall would destroy your own data and you have no useful backup, youre in a tight spot. The best approach is to avoid the reinstall, perhaps by recruiting the help of an expert. Lastly, if you do reinstall your system, consider putting your own important data on a separate filesystem (/home, for example).
Restoring User Files
After the system files are taken care of, you can restore your own data from a backup. The actual details of this are explained in Chapter 31.
Previous
Table of Contents
Next
Wyszukiwarka
Podobne podstrony:
513,21,artykul511 513APAR 517510 513Leksykon podatków i opłat lokalnych 517 pytań i odpowiedzi517 521513 12517 (2)513 515SL2009 513więcej podobnych podstron