Chapter 3. Safe Computing

Table of Contents

Protecting Your Files From Data Loss
Handling files safely
Backups
Using Your Computer Responsibly
Scheduling Your Computer Time
Controlling Your Computer Expenses
Safe Computing On the Internet
E-mail Safety
Web Safety
Avoiding Online Breakins
Ergonomic Considerations

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?]

Protecting Your Files From Data Loss

Computers are excellent at archiving data and keeping records. Some of the important files I keep on my computer include:

  • Information about my monthly earnings and expenses.
  • My resume and employment history, my medical information, and information about where I have lived over the past five years.
  • Lists of books to read, movies to watch, music to listen to, and corresponding lists of books I have read, movies I have watched, and music I have listened to.
  • All the writing, notes, and projects I have worked on ever since I bought my first computer.
  • All of the e-mail I have received since I started using e-mail.

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.

Handling files safely

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.

Accidentally deleting files

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.

  1. 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.

  2. 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.

  3. 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.

  4. 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]

  5. 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?]

  6. 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?]

Save Early, Save Often

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, ???]

Recovering From Crashes

[LIST CRASH FILES HERE] [MAYBE PUT THIS IN TROUBLESHOOTING]

Backups

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:

  • Convenience. If it is inconvenient to use a backup method, the backup will not get done. If a backup method can be fully automated, you can set it up and then forget about it.
  • Cost. What additional charges are associated with this method? You may have to buy extra hardware, or consumable resources (such as blank CD-ROMs or floppy disks), or services (such as Internet connectivity).
  • Backup capacity. How much data can you backup with this method? You have to match this to the amount of data you want to backup.
  • The nature of your data. How much data do you need to back up? What data can you not afford to lose? If you only have a few files that are irreplacable, you may be able to back up just those few files. Most people focus on backing up personal files; program files can always be reinstalled.
  • Configuration difficulty. How long does it take to set up this backup system? Will you be able to do this yourself? Will you need to recruit a local computer genius to set up the backup method for you?
  • Privacy. What data of yours contains sensitive information? How easy is it for others to see or steal your backed-up data?
  • Disaster protection. Say that your computer catches on fire, or is stolen. Will you still be able to access your backups?

Floppy disks

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:

  • You probably have a floppy drive already, and you know how to copy files. [REF] It is easy to get started with this option immediately.
  • Floppies can be transported and stored in a safe place. You can keep floppies with very important information in a safety deposit box.
  • Many computers have floppy drives, so you can usually find another computer on which to restore your files.

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.

  • Floppy disks typically store 1.44MB (megabytes) of information. By todays standards, this is not much information. The amount of data you can back up is very limited. In fact, some data files are bigger than 1.44MB in size. Getting these files onto floppies is tricky. (Two commands named split and join exist to do this, but they both require the use of the commandline.)
  • Floppies are notoriously unreliable. They break down from time to time. I get around this problem by backing up files to two floppy disks at a time. That way, if one floppy breaks down, I have my file on the other floppy.
  • You need to obtain and store stacks of floppies. Compared to other storage media, floppies are quite expensive. Sometimes you can find used floppies for free or cheap, but otherwise you will have to spend some money to get some floppy disks.

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.

Internet Storage

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:

  • The process can often be completely automated. If you can get the backup system set up (which often will require the services of a computer guru) then your computer can back up its data while you are asleep.
  • Since your Internet server is far away, your data will be safe even if your computer catches on fire.

Because of their convenience, Internet backups are an excellent option for many people. This method does have some disadvantages, however:

  • You need to purchase Internet access at home. You may also need to purchase some Internet storage, if your Internet service provider does not provide it.
  • This method works best if you have a reasonably fast, reasonably stable internet connection.
  • Currently, we know of no easy-to-use software to configure Internet backups. That means you will likely have to recruit a computer guru to help you out.
  • 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.)

  • The amount of storage you will have on the Internet is probably small. You will probably have to pick and choose which files to back up.

[MORE INFO -- ssh, gpg, ftp, tar, gz, rsync]

CD/DVD backups

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:

  • Blank CDs are cheap. They are probably the cheapest backup media you can buy these days. Blank DVDs are more expensive, but they store even more than a blank CD.
  • CDs offer a lot of storage space at a reasonable cost. You may not be able to back up your entire hard drive to CD, but you will be able to back up more files than with almost any other cheap backup system. This is a big advantage.
  • CDs and DVDs can be stored far away from your computer. You can likely store them in a safety-deposit box.
  • Once you have learned how to burn a CD, the process is fairly easy. Furthermore, the process can be mostly automated through the use of scripts (but you may require a computer expert to set this up for you).
  • CD/DVD drives are useful for many things besides backing up data.

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.

  • The CD-based backup system is inconvenient: you need to remember to put blank CDs into your computer. It is possible to set up reminders so that you remember to do your backups, but the process cannot be completely automated.
  • Usually, you have to buy (and install) extra hardware to make use of this option. CD-RW drives are not that expensive, but as of this writing (late 2004) we do not include them with the computer systems we sell. DVD-RW drives are expensive. In either case you have to install this hardware in order to use it.

[NEED: Better CD-burning software] [PICTURES OF CD/DVD DRIVES. HOW DO YOU IDENTIFY THEM?]

USB Keychain Drives

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:

  • Keychain drives offer a fair amount of storage capacity. You will not be able to back up your entire hard drive, but you will be able to back up many files.
  • Keychain drives are easier to set up than most other hardware. You can plug them in while your computer is running, and Linux will autodetect the drives. It is fairly straightforward to set up Linux so that it mounts the drives as well.
  • Since keychain drives are so small, they can easily be transported and stored in a safe place.
  • Most keychain drives are durable. I have heard of a keychain drive going through a washing machine undamaged.
  • Much of the backup process can be automated once the drive is plugged into the computer.
  • Occasionally it is possible to get older models (with smaller capacities) on sale.

As always, there are some disadvantages to consider:

  • Keychain drives are usually not that cheap. In Canada, they will cost you $50-100 each.
  • In theory, any USB keychain drive will work with any USB port. In practice this is not always the case: some drives have problems with the ports on older computers, and some drives do not work under Linux as well as they should.
  • Either you have to remember to plug in the drive and start the backup process manually, or you have to leave the drive plugged in all the time. Leaving the drive plugged in all the time is more convenient, but less safe if your computer is stolen or damaged.
  • Because keychain drives are so light and small they are easy to lose or have stolen. You have to be careful to keep your drive in a safe place, especially if you back up important data to it. (On the other hand, some drives are sold with security features so that strangers cannot look at your data.)
  • If your computer only has USB ports at the back of the machine, it can be awkward to plug in the drives. Some drives come with extension cables to assist you with this, however, and some computers have USB ports at the front of the computer for easy access.

Second hard drives

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:

  • The convenience is advantage number one. Every aspect of the backup process can be automated. My computer backs up my data once a day.
  • You can use any kind of hard drive you have available. It is sometimes possible to get cheap used drives on sale. Doing so will limit the data that you can backup, but can be very cost effective.
  • Your backed-up data is readily available on your computer. All you have to do is go to the directory containing the backup data. This is convenient if you accidentally delete a file and want to retrieve the previous day's version.
  • You can lose your data only by having both of your hard drives fail. You can restore all of your data if either your backup drive or your main hard drive break. (This has already saved my data once.)

As with other solutions, however, this backup system has drawbacks:

  • Your computer is not protected in the event of a disaster. If a power surge wipes out one drive, it will likely wipe out the other as well.
  • If you install a used hard drive as the backup drive, the backup drive has a greater chance of failure.
  • You will probably want somebody's help in setting up the backup system so that it runs automatically.
  • From time to time you have to verify that your backup system is still working. Linux does some of this for you -- if a drive fails, usually Linux will report errors when you start your computer.
  • You need to obtain a hard drive, and you have to get it installed. Depending on your computer you may not have the physical capacity to store the drive.

Other Backup Possibilities

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

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.

External Hard Drives

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.

Network backups

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.

RAID

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

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.

Printouts

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.

How To Choose a Backup System

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 honestly don't care about your data, and you would not miss your data at all if it were to disappear, then maybe you don't need a backup system at all. In my opinion few people are in this category, however.
  • If you have no other backup system, start by backing up your most important files to pairs of floppy disks. If you only have a few files you desperately want to keep, and you can remember to do your backups regularly, this may be sufficient for your needs.
  • 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..]

  • If cost is a big concern, then it may be worth saving your money to buy a USB key or second hard drive. The inital costs for these options is high, but there are no follow-up costs to pay on a regular basis.
  • If you do not have easy access to computer experts who are willing to help you set up your backup system, then CD/DVD or USB key backups may be the easiest.

[NEED: BACKUP APPLICATIONS]