Table of Contents
Computers are powerful tools, and like many other tools they can be misused. When you buy a table saw or a sewing machine, you want to be aware of how to use your tool safely; not doing so could cost you limbs you would rather keep. Although your computer will not cut off your hand or sew your fingers together, computers can be used to cause you harm in other ways. In this chapter, we will discuss some of the dangers, and share some tips you can follow to protect yourself.
In the interests of education, we'll be describing some scary scenarios in this chapter. Please don't let these scenarios frighten you away from using your computer. Although there are always risks to using computers (just as there are always risks when using table saws) computers also have a lot to offer. Being aware of these dangers can help you minimize the risks, and help you maximize the enjoyment and productivity you get from your machine.
The term "computer safety" can refer to many different things. In this chapter we will touch upon the following areas:
We won't be able to cover any of these topics very deeply; no doubt entire books have been written on each of these topics. However, the introduction in this chapter will go a long way towards making your computer experiences safer and more pleasant. [REF TO FURTHER INFORMATION?]
Computers are excellent at archiving data and keeping records. Some of the important files I keep on my computer include:
Whenever I am fortunate enough to buy a new computer, I transfer all of the data from my old computer to the new one. I plan to keep doing this indefinitely. Keeping my information in electronic format makes it easy to search, easy to retrieve and easy to transport when I have to move. Although I do keep paper copies of some of my most important information, I have far too much data to keep it all in paper format.
The convenience of electronic recordkeeping has its costs, however. If my house caught on fire and my computer burned up, I would be in some trouble. Losing my data would not kill me, but it would make certain aspects of my life (such as future employment and finding employment references) difficult. For this reason, I want to keep my data safe.
There are two aspects of data safety to worry about. The first is safe file handling: how to work with your files so that you do not accidentally damage, lose, or delete them. The second concerns long-term storage and disaster recovery, which usually involves some kind of backup system. In the following sections we will discuss both of these in some detail.
Most people don't intend to do stupid things with their data. Nobody says to themselves, "I think I will delete my work report today, thus making my life miserable for the next few weeks." Rather, bad things happen to good files because people aren't aware of what they are doing. In this section I will talk about some of the stupid things I have done so that you can learn from my mistakes.
Here's the scenario: I look through my directories and find some directory that is full of junk. It's taking up hard drive space on my account for no good reason. So I open up the file manager, select that directory and delete it.
Then 10 minutes later I realize that the directory contained some important configuration file I now need. At this point I am stuck.
One thing you should know about Linux is that typically files cannot be undeleted. (This is because of the filesystems we use on your computer.) Once you delete a file, it is gone forever, and for the most part cannot be retrieved.
I know that deleted files are irretrievable in Linux, but I still make this dumb mistake? Why? My error is not to check inside the directory I am about to delete before I delete it. I sometimes make this dumb error even when I check my directories, because I will not realize that some file (or group of files) is important until it is gone.
How do you avoid this? Here are some tips.
Whenever you are about to delete a file, pause for a couple of seconds. Ask yourself whether you really want to delete the file in question. Ask yourself whether you can recreate the file (by typing it in again, or whatever) if you need it in the future. If you have some doubt about the file, you may want to keep it around.
Instead of deleting files, make a directory called garbage in your home directory. Every time you want to get rid of that file, move it to the garbage directory. Every week (or month), delete the contents of the garbage directory.
How does this help? It moves your files to a place you don't expect. If you find that you need the file, you will notice that it is not in its usual location, and realize that it can be retrieved.
Use a temporary directory to store temporary files. I avoid cluttering up my home directory with files I know I will only need for a few minutes. Instead of saving those files in my home directory, I save them to a special directory named /tmp . This directory is special because it is automatically emptied every time the computer boots up. This means that my temporary files get wiped out, the files I want to keep are stored in my home directory, and I am less tempted to clean out the clutter, possibly deleting important files in the process.
Organize your directories well. Directories are an excellent tool to keep the files in your home directory tidy. If you have a tidy home directory, then you will have to clean out files less often, which means that you are less likely to delete important files.
For example, I keep my writing in a folder called writing, my personal record-keeping files in a directory called personal, and things I download from the Internet in a directory called downloads. Some of these directories contain other directories. Although this structure seems complicated at first, it helps me keep track of where my files belong. It also gives me a sense of where my important data lies: I could probably lose my downloads directory without too much damage, since I could just download those items from the Internet again. However, I really want to preserve my personal and writing directories, because those directories are hard to recreate.
[THIS DOES NOT BELONG HERE]
Archive files instead of deleting them. The truth is that hard drive space is cheap and it gets cheaper all the time. If you have enough space to store your files now, you will have even more space if you ever upgrade your hard drive or computer. Thus, it usually does not cost a lot to keep extra files around. (On the other hand, I am a packrat, and I understand that this approach has its disadvantages.)
One technique I use is to archive files I know I will not need in the near future. For example, I use a command called tar to archive ("zip up") the directories that contain my old e-mail. Since I have the space to store them, these files do no harm. But when I need them, I can simply unarchive them and use them again. [HOW CAN USERS CREATE ARCHIVES?]
Be careful about wildcards. Some programs allow you to select groups of files using wildcards. A common example is the command-line utility rm. The following invocation of rm will delete all files that end in .bak (which is a common ending for backup files):
rm *.bak
The "*" is a wildcard. It means "match any pattern." If an unfortunate user types the following instead:
rm * .bak
then the rm will delete all files in the current directory. The difference is one space.
Since you can delete files using the file manager, you never need to use rm directly, but you may run into other programs that support wildcards. This is fine: wildcards are a powerful tool, and you should feel free to use them. However, be especially careful that your wildcards match the patterns you are thinking of.
[MAYBE DON'T MENTION WILDCARDS?]
Sometimes bad things happen to good computers, and you lose the files you are working on as a result. The reality of computers is that sometimes they break or turn off unexpectedly. Your house may lose power. Your computer might suddenly lock up. A malevolent child may disconnect your keyboard plug. You might stretch out and flip the switch on your power bar.
Is there anything you can do to prevent data loss? Your best defence is to save your work frequently. If you save your work every five minutes, you will lose at most five minutes of work if the power goes out. Losing five minutes of work is still not fun, but it is a lot better than losing five hours of work. I save my work every time I take a pause to think of what to write or program next. That way, I incrementally save every thought I enter into the computer.
Some programs have "auto-save" features. They will automatically back up your work every few minutes. Such features are good, but it is still wiser to save your work explicitly. Not every program you use will automatically save your work, and retrieving autosave files is not always easy.
One tool that can make it easier for you to get into the habit of saving frequently is the keyboard shortcut. A keyboard shortcut is a sequence of keystrokes that will perform some command in your program. For example, in Abiword the keyboard shortcut to save your document is [WHAT?]. Pressing this shortcut will save your document without you having to use your mouse to navigate through the menus. Alternatively, many programs have a single toolbar button that you can click to save your work. [SCREENSHOTS -- ABIWORD, ???]
A backup is a copy of your files, preferably stored in a safe place. If anything should happen to your original files (for example, if your hard drive dies), you can restore the lost files from backup. Backups are also used to archive your data, so that you can access it at a later date.
People are funny when it comes to making backups. Everybody knows that they should back up their data regularly -- but many people (maybe most people) do not make regular backups. Then when something bad happens, those people lose their data and feel sad. You do not want to be one of those people.
Why don't people do what they know is good for them? One big reason is convenience: if it takes a nontrivial amount of time, energy or money to do backups, then the backups don't get done. Ideally, the backup process should be completely automated: the less humans are involved with their backups, the more likely backups are to get done.
How often should you make backups? It depends on how often your data changes, how much you care about your data, and how much hassle it is to carry out the backup process. The more frequently you make backups, the less data you will lose in the event of a crash.
There are many sophisticated backup schemes available. Some require complicated software; others require expensive hardware devices that likely did not come with your computer. We will focus on the simplest, cheapest alternatives, and then mention some other possibilities at the end of this section.
Each backup alternative has advantages and disadvantages. Some factors to consider when deciding on a backup solution include:
Unless you buy additional hardware for your computer, your most readily available backup device is likely to be your floppy drive. To back up files to floppy disks, you copy the files you want to keep to the floppy from time to time.
Here are some advantages of this method:
And here are some disadvantages:
This is a very inconvenient method. You have to remember to do the backups, and you have to remember to have backup floppies on hand.
You can get around this disadvantage a bit by backing up files as you create them. Immediately after finishing with an important file for the day, you can back it up to a floppy.
Backing data to floppy disks is not a great method, but they are a good way to get into the habit of backing up your data.
If you get Internet access at home, you may be able to backup your files to servers on the Internet. Some Internet Service Providers provide you with storage space for your web pages or other data. It may be possible for you to store copies of important files to this space. You might be able to e-mail yourself some files you wish to back up, and store them in your Web-based e-mail account. You might be able to purchase storage space from some other Internet provider as well.
Here are some advantages of internet backups:
Because of their convenience, Internet backups are an excellent option for many people. This method does have some disadvantages, however:
Security is a big issue. As soon as you transmit your data on the Internet, you run the risk of naughty and/or curious people looking at it. If the data you want to keep is confidential (that is, you don't want to share it with the entire world) then you probably need to encrypt it, which means scrambling it so that you can recover your data and (hopefully) nobody else can. This process takes some care and knowledge, and it is not foolproof. (You may want to investigate gpg if you are interested in this.)
[MORE INFO -- ssh, gpg, ftp, tar, gz, rsync]
If you have (or get) a CD-RW or DVD-RW drive installed on your computer, you may want to back up your important files to CDs or DVDs. To back up your files, you would insert a blank CD or DVD, use a program (such as xcdrost) to select the files you want to back up, and "burn" the data to the blank CD. This is a very popular backup method.
Some advantages of CD or DVD backups include:
This backup method does have some notable disadvantages, however:
Although CDs are cheap, they are consumable. Regular writable CD-ROMs can generally be written to once, and only once. That means you might waste a lot CD-Rs if you make a lot of backups.
It is worth noting that rewriteable blank CDs and DVDs exist. They can be blanked and rewritten to hundreds of times. Rewritable CDs are getting hard to find, but rewritable DVDs are readily available.
[NEED: Better CD-burning software] [PICTURES OF CD/DVD DRIVES. HOW DO YOU IDENTIFY THEM?]
USB keychain drives are small storage devices that plug into the USB port of your computer. They are called "keychain drives" because they are small enough to attach to a keychain. The capacities of these devices is growing rapidly. At some point we may see very cheap, low capacity keychain drives for sale, but currently drives with smaller capacities fall off the market and are not sold at significantly cheaper prices than the expensive ones.
Once a keychain drive is plugged in Linux treats it as a hard drive. It is first mounted, and then it appears as a directory in the directory tree [REF]. You can then copy files to it just as you would copy files onto a floppy.
Keychain drives have replaced floppy disks as a standard way to transport files from computer to computer. However, they have advantages as a backup solution as well:
As always, there are some disadvantages to consider:
An interesting solution to the backup problem is to install (or get somebody to install) a second hard drive on your machine. This drive will be a backup drive -- every so often Linux will back up your data to the backup drive. Although this has some drawbacks, the convenience is a big win, and I use this backup solution myself. Here are some of the advantages:
As with other solutions, however, this backup system has drawbacks:
Many, many backup solutions exist. In the following section we'll list some of the alternatives that are available, and briefly cover some advantages and disadvantages. Most of these alternatives are probably out of reach for the home user, however.
ZIP drives used to be fairly popular, but their niche has been taken over by USB keychain drives. ZIP drives take cartridges that act as portable hard drives. They come in internal versions that are installed into your computer like a floppy drive, and external versions that plug into a parallel port [REF] or USB port. You might find other makes and models of cartridge drives, such as Jaz drives, or Shark drives.
The cartridges do not hold a lot of information by today's standards (100MB and 250MB are the most popular sizes) and they are fairly expensive to purchase new. However, if you can purchase cartridges and a drive used, this can be a worthwhile solution.
The backup procedures are similar to USB keychain drives, and many of the same advantages and disadvantages hold.
You can purchase an external hard drive which plugs into a USB or Firewire port of your computer. (Be careful: most computers we sell do not have Firewire support.)
These drives are portable and have lots of storage capacity. Unfortunately they are quite expensive -- more expensive than internal hard drives of the same capacity. Other than this, they have many of the same advantages and disadvantages as installing a second internal hard drive, except that external hard drives are portable.
Some people own multiple computers, and designate one of those computers to be a backup machine. They configure their other computers to back up data to this computer via a local network.
This solution is similar to having Internet backups, except that the backed up data can be more secure (since you never send your data out to the Internet for storage). On the other hand, setting up these solutions means running multiple computers, setting up a home network, and configuring each computer to send its data to the backup server. For these reasons, network backups are probably too much work for the average home user.
A RAID array is not really a backup mechanism, but it is similar, and very popular with system administrators. The "R" in RAID stands for "redundant", because these solutions write data multiple times to one or many hard drives. If any one copy of the data becomes corrupt, then the corrupted data can be detected and recovered from the other copies. Some setups use nine hard drives set up in parallel -- if any one hard drive fails, it can be replaced with another drive without losing data and without turning off the computer.
Professional-level RAID can get very expensive, and takes some work to configure. Even simple RAID setups require a lot of storage space. You probably do not want to consider this solution unless you are genuinely interested in the topic, or (for some reason) your computer is a server that contains very important data that must be accessible all the time.
Tape drives take cartridges that use a similar technology (and look much like) audio cassettes. Tape-based backups used to be very popular with system administrators. They are still in wide use.
Tape drives offer great deals of storage per tape. There is a lot of software written which supports tape drives as a backup storage medium. They are often used to archive data for a few months, so that the administrators can restore data that was deleted a few months ago.
On the other hand, tape drives (and tapes) are not that cheap and are increasingly hard to find. It also takes a fair amount of work to configure the backup system, and -- unless you are given a robotic jukebox which switches tapes for you -- you have to remember to insert tapes into the drives when it is time to backup the system. If you are given a tape drive and a set of tapes for free, you might want to consider this option. Otherwise it is likely too much work for too little benefit -- you can get many of these same advantages by using CDs or DVDs instead.
If you have very important documents you cannot afford to lose, it is worth considering printing those documents out and storing them in a safe place, far away from your computer.
Some people go overboard with printouts. I have seen people who print out every e-mail they receive. Although reading paper printouts is easier than looking at text on a screen, printing out all of your data is not a smart idea. In addition to wasting paper and ink, paper is very heavy, and filing away paper copies of your documents becomes very cumbersome very quickly. Having said that, in certain situations archiving printouts is worth the cost.
As we have seen, there are a large number of backup systems to choose from. Deciding which backup system to invest in can be difficult. Here are some pointers that might help you in your decision:
If you have a hard time remembering to do your backups, then using the Internet or installing a second hard drive in your computer may be the most reliable. Another possibility is to use a USB key that is always plugged into your computer.
Another alternative is to use a calendar or other reminder device to prompt you to get your backups done. One application that can pop up regular reminders is called rclock. [HOW CAN PEOPLE LEARN MORE? RCLOCK IS A BAD APP..]
[NEED: BACKUP APPLICATIONS]