Backing up a hard disk is an operation we postpone as much as possible, but it is something we should learn to do and do it regularly. The main reason most of us do not back up our hard disk as often as we should is that the process of back up using the DOS command or any of the existing programs is too complex and too time consuming. We regret our negligence when we run into a problem.
There are two main reasons why we need to back up a hard disk:
One, as a protection against accidents of any kind;
two, to be able to re-format the disk regularly.
This article presents simple procedures to back up a hard disk that, although have some limitations, are good for both cases.
Some time ago, the idea of back up was to recover the data in the event of a "disk crash". Today, the technology has improved sufficiently that such crashes are not that common. Today, we need to back up our data (whether on a hard disk or in floppies) to prevent the consequences of human errors.
The case is as follows: imagine you are working in a file and you make a mistake that trashes it completely; or, imagine you try to delete two files and you delete others you did not intended to. The latest versions of DOS, have commands to un-delete a file or un- format a disk, but this can only be used if you realize your mistake immediately, not when you realize it several days later, because you cannot find your files.
The requirements for back up differ very much from one user to another, because they depend on the use you give your computer. If you use only programs written by others and you never produce any files, like when the computer is used solely to play games and the like, your needs for back up are minimal, as long as you store your original disks in a safe place (inside a metal cabinet).
On the other hand, if you write your own programs or if you use programs like word processors, spreadsheets, databases, and the like, you are continuously producing new files and loosing your hard disk could mean loosing many hours of work. In this case, your requirements for back up are greater and they are not satisfied by the normal back up programs.
This is a delicate point, so we need to analyze it further. Imagine that whether for work or play, you keep and maintain a number of databases. Let us consider a non-profit case, and say that you maintain databases for your music records, your CD's, your audio tapes, your movie video tapes, your music video tapes, your house inventory, etc. You make a back up with the BACKUP command regularly, say every week. One day, when you have been working in your databases for several hours and you made changes to many of them, you mess up one of the files beyond repair. Well, you say, this is why I made all those back ups. You get your back up disks and, surprise, surprise! Your whole hard disk was converted into a neatly packed file that uses several disk. You have two choices: recover all your hard disk, destroying the changes you made since last back up, or sit down and cry, cursing the programmers that think on how to write a program, not how it will be used.
It is clear that the problem comes from the use of the word back up. In the past, the definition of back up was a procedure to put you in the condition you were when you made your last back up. Years ago, quite a few, this was a good definition. Today, as you just saw, the conditions have changed but the back up programs have not changed. Today, practically everybody needs a procedure for back up that permits to recover a single file, if it is needed. This can be done, with some limitations, with a tape back up system, but with the cost of a tape drive you can buy tons of floppy diskettes!
Now, let us cover the second need for back up, the need for cleaning the hard disk. Whatever the use you give your computer, except in very simple cases, you create and modify files. At the beginning, the files were neatly organized on your hard disk, one after the other. As the dimensions of the files change, the space they need change and DOS breaks the files, using for the pieces whatever space is available. After a while, your files are formed by little pieces scattered all over the disk. You do not need expensive programs to know that this is happening, your hard disk makes more and more noise as the files get broken up in little pieces. The computer becomes sluggish, and the whole operation slows down. It is time to clean your hard disk. For this purpose you should remove all your files to diskettes, format the hard disk, and put the files back on the hard disk. If you do this properly, you will notice how happy your hard disk will sound. Properly means that the files are put back on the hard disk, each one as one piece.
The purpose of this article is to present procedures for back up of your hard disk, that permit you to recover one or any number of files, or all of them. The former is used to correct mistakes and accidents, the later is used to clean your hard disk.
Backing up your hard disk does not involve finding or writing a program, it involves organizing your hard disk and developing a procedure that you can use over and over with minimal changes, and that you are sure it works.
You need to perform the following steps:
1) Analyze and organize your hard disk;
2) Develop the procedure for copying the files;
3) Develop the procedure for restoring the files;
4) Develop a System Disk;
5) Make copies of the files on your hard disk;
6) Format your hard disk;
7) Put the programs back in place; and
8) Store your back up disks in a safe place.
Let us analyze these steps in detail. Analyze and organize the hard disk involves more than looking at the directory. One of the limitations of the procedure that will be explained is that each directory should fit inside one of the diskettes you use. This can be a problem if you use double density diskettes, and you might need to use one of the alternate procedures explained later. Another limitation is that you cannot have any file larger than the size of a diskette. Again, this might force you to use an alternate procedure. The analysis of the hard disk is made by printing the tree of the disk. This is done from the command line by typing the following line: tree
c:\ > prn.
This produces a graph with the organization of the hard disk. All the main directories are there with their sub-directories, etc. Once you have this tree, call the directory of each of the directories, to be sure that they do not have more bytes than what can be put in a diskette. Do not worry about less. Do not forget to look at the root of C and of all the directories that have sub-directories. If you find any one that is too large, see if you can divide it into smaller directories, by moving files around. If you cannot, it is time to look for the alternate methods.
There are some commercial programs that use huge amounts of space and require many files that all must be in the same directory. This is the case of popular programs like Word Perfect, Lotus, etc. In these cases, it is not possible to fraction the directory into pieces that can fit in a floppy and still work with the programs. One elegant solution is to copy all your files to another temporary directory and move back to the original directory only what fits a disk. Back up this directory, erase all the files and copy some more. Follow this procedure until you have copied all the files.
Note that the copies in the floppy are all into a directory with the same name as the directory you use for working. When you restore files onto your hard disk, the original directory will be properly restored. This sounds like a lot of work, but remember that you need to do it only once in your life. Later, you need only to back up the files you produce. Taking the case of Word Perfect, you copy the directory WP51 into the directory TEMP and leave only enough files to fit a diskette. You put this into A with the xcopy command and continue the process. When you restore these disks, all the files go to the WP51 directory. The files of letters and documents you produce should be put in a separate directory, as is always good practice. In the future, you need only to back up this directory of files, not the main directory.
Once you have your hard disk organized so all the directories are less than the size of the diskette, it is necessary to develop the batch files to simplify the procedure for storing the files. Write the following batch file, which you can call SAVING.BAT:
xcopy c:\%1\*.* a:\%1\*.* /v
To use this batch file you simply type SAVING and the path of the directory you wish to back up without beginning or ending slashes, but starting from the root. Say you have a directory called utility and several sub-directories. One is called archive and you want to back up this directory. You type
Note that the procedure will show you the list of files in the directory you want to back up and the directory of A. In this way, you can see if the directory you want to back up does not have sub-directories you forgot about, and if the disk in A has enough room. If everything is OK, press any key. You can change the disk in A if it does not have enough room, or you can press control-C to abort the operation.
Note that this batch file is good not only when you want to back up the whole hard disk but also when you want to back up only one directory where you have made changes. If you want to include the sub-directories, add the switch /s to the xcopy command. Do not remove the /v because you want to be sure the copy is good and the extra time is well invested. Do not forget to label the diskettes. So this is all it takes to back up your system.
Now, how can you recover the files. If you need one file, find the disk that contains it and copy it like normal. If you want to restore the whole directory, use wild cards. The only problem is when you want to format the hard disk and restore all the files. When you format the hard disk you need to have what is called a system disk; that is, a disk that has all DOS commands you will need, as well as the hidden files that permit you to boot the computer from it. To produce a system disk, format a disk in drive A: and add the switch /s. Once the operation ends, make a directory in this disk that we will call ROOT. Copy to the root of A: the AUTOEXEC.BAT, the CONFIG.SYS from your hard disk. Edit these two files to remove all the lines that are not imperative. Remove any ram disk, or accessories like the mouse, etc. Do the same with the AUTOEXEC.BAT, removing anything that can be removed. Copy these two files to the directory you called ROOT and edit the AUTOEXEC.BAT in the directory ROOT, to add the following line:
Develop a batch file in the root of A:, and call it FORMATER.BAT, that will permit you format the hard disk and restore it to proper operation. The file is as follows:
format c: /s /v:SYSTEM-DISK
xcopy a:\root\*.* c:\*.* /v
xcopy a:\*.* c:\dos\*.* /v
Notice that this file not only formats your hard disk, but it also puts on the hard disk your minimal CONFIG.SYS and AUTOEXEC.BAT files, you saved in the directory A:\ROOT. All the files you have in A will be transferred to a directory DOS in C.
You need to prepare another file and put it in the directory of A you called ROOT. This file PUTBACK.BAT is needed to replace the files in drive C, and is like this:
:begin echo Insert Next Disk to Restore,
echo Press Control-C if no more, or pause
xcopy a:\*.* c:\*.* /s /v
Note that this file is an infinite loop that is broken only with a control-c. This file will restore your hard disk to total health and happiness. Copy from drive C to the root of A, all the DOS programs that are needed. You need as a minimum FORMAT, COPY, XCOPY, and commands of this type. Copy programs until the disk is full, you do not know what you will need. This is your SYSTEM DISK. With it you can boot up your computer and do whatever you want to do.
Now you are ready to back up the hard disk and format it if it is necessary. Prepare enough formatted diskettes, one high density, two 720 K, or four 360 K for each megabyte of programs you have in your hard disk. This does not mean the total capacity of the disk but only the programs you have. If you have a 40 Mb hard disk and only 15 Mb in programs, you need 15 HD disks.
Get a new copy of the tree of the hard disk and, using the program SAVER, go in order, copying to diskettes one directory after another, being sure that you do not leave any files without copying them.
Do not tire of checking and re-checking that you are not leaving something out. Remember that once you format the hard disk, you will loose any file you did not copy.
Label each diskette as it is produced, and put them in a safe place. Once you are sure you have everything copied, put the system disk in drive A and reset the computer. Do not change from drive A: but simply type FORMATER. You will have to answer questions as it goes and, at the end, you will need to reset the computer to work from drive C. Do not forget to open the gate of drive A. Note that as long as your DOS is in drive A, you cannot use it to copy disks onto C. When the computer resets, simply type PUTBACK and follow the instructions, inserting diskettes until all of them have been copied. Press control-C and reset the computer again to get back to your normal way of working.
If you have two drives, you could make the copies with drive B. In this way you avoid the need to reset the computer three times. In this case, put the last two batch files together, changing the xcopy command to copy from B. Naturally, you will be working from a DOS in drive A. Since xcopy is an external command, it will be read from disk every time, slowing down the operation.
Let us consider a modification to this procedure that permits you to use larger directories and less diskettes for storage, without loosing the possibility of recovering a single or a group of files. This is obtained by much more work preparing the back up. Remember you do this only once in your life. The idea is that instead of organizing the hard disk with directories that have less bytes than what a disk can handle, you compress each directory in such a way that the compressed file can be stored in one diskette. This is not a trivial work and will require many trials. A simpler procedure is to copy the large directory into several small directories, in a similar way as explained above, but archiving the resulting directories, which now can be larger because you only need that the archived file fits in a diskette. Another possibility that simplifies matters somewhat, is to archive only those directories that are too large to fit in a single diskette, and copy all the other directories, as explained above. When you label the diskettes, indicate if the files are archived or not.
The recovering procedure must be done with the use of a de- archiving program, like NARC, that permits you recover a single file, a group of files, all of them, and direct the output to any directory in your system. If you use NARC, you should compress your files with PKZIP or ARC. To compress a directory using PKZIP, you issue the command
PKZIP -a "file name" "directory to compress"
If you want to compress all the files in a directory and all its sub-directories, you should type
PKZIP -a -r -p "file name" "directory to compress"
In this way, when you un-zip the files, they will go to their proper sub-directories. The program ARC permits to archive files with the ARC format. Its use is similar to PKZIP but it cannot handle sub-directories in a way that can be recovered properly.
Once you have a total back up of your system, you do not need to back up again the permanent files. Considering again the case of Word Perfect, the programs and files of Word Perfect remain constant. What you have to back up is the files of letters and documents you produce. If you put these files in a separate directory, you can back up this directory every time you work on these files. In this way, when you need to format the hard disk again, you do not need a full back up. In the recovery procedure you need to read all the disks from the full back up and all the disks you produced later, in order.
If you consider the content of your hard disk, you will find that a large part of it really does not need a back up; at least, not every time you do a full back up. The reason is that there are programs and files that do not change ever. Consider again the case of DOS, Word Perfect, or any commercial program. Once you have installed Word Perfect in your disk, it will never change. So, if you make a back up once, just after you installed it, you do not need to repeat the back up later.
More important is the case of programs you do not need to "install" in your system but that you simply copy to your hard disk. As long as you have the originals in a safe place, you do not need to back up such files ever, not even the first time.
There is another set of files that does not need to be back up either; these are files that are put temporarily in your hard disk. For example, I have a directory of programs that are asked for more often from the Library, some of them quite large, ready for when our members call me for programs. Since I have the Library, I do not need to back up these files. Finally, there are program that produce files that are not that important as to back them up every time. For example, error files and the like.
The perfect solution seems to be to have the files in the hard disk organized in three groups (permanent files, variable files, don't care files) and put each group in subdirectories of two or three directories for each group. The second part of the perfect solution is to write or use a program that will copy the files from your hard disk onto diskettes, directory by directory, and when the diskette is full, it prompts you to insert another diskette. Further more, the perfect program should permit you to specify which drive has the empty disks, which drive to back up and which directories of that drive should be backed up. Finally, it should be possible to copy any one of the files from the diskettes. The final part of the perfect solution is to have a program that will search only the specified directories in the specified drive and copy to disks all those files that have been modified since the last back up. In this way, you reduce the time it takes to perform a back up of you disk to less than half; in the future, backing up only the modified files takes only two or three minutes, and you can do it every day. The author of this article has these programs for the perfect solution to the back up problem and use them every day. The package, which also includes the necessary batch files and documentation, can be obtained from the author.
I hope I have removed the mystery from the back up procedure, and that
now you will not have any reason for not doing it to your hard disk. If
you have any questions, you know how to get hold of me.