The magazine of the Melbourne PC User Group

Beginners' Bytes: Part 2
Ron Wilby

Disaster Recovery

Hello, to all beginners and to anyone else who is patient enough to read this stuff.

Last month you had made a basic "start-up" disk, which would boot your computer in case your normal start-up procedure doesn't work. Now we need to prepare for the day when you lose all the files on your hard disk. This can happen due to virus attack, unwise use of the FORMAT or DEL (Erase) commands or hard disk failure. Getting back in business involves four steps.
  1. Restart your computer using your emergency start-up disk.
  2. Re-format or replace your hard disk, as required.
  3. Reload your applications programs (wordprocessor, database etc.) on to your hard disk. For this you will use the disks copied from the disks you bought. Hopefully you made these copies when you purchased the original Application Programs.
  4. Use your Backup and Restore Program to restore your data to your hard disk.
This should put you (nearly) back to where you were. To do it you need something more than a basic "Startup" disk. Let's see how you can make a "Disaster Recovery Disk."

Formatting

Before we can make a Recovery Disk, we may have to do some Formatting. This means taking the piece of virgin plastic with magnetic coating, (e.g. a new floppy) and making it ready to be used by a DOS system. You can only write to, and store information on, disks that have been formatted. To Format a disk you type
FORMAT A: (or B: but never C:)
next to the DOS prompt and press Enter.

The formatting process must be appropriate to the drive and the disk you are using. Thus you cannot format 360 kB floppies in a 1.2 MB drive unless you tell the drive you want the disk formatted to 360 kB. You do this by attaching "switches" to your command. These switches are letters or numbers added to the command, like the FORMAT A:/S command we used last month to make your basic startup disk, called a "system disk." This is a disk that contains, in particular special positions, the "System Files." These files are the Command Interpreter, called COMMAND.COM, the "heart" of DOS and two "hidden" files associated with the startup procedure.

The actual formatting is done by a program supplied with DOS called FORMATCOM, which many people delete from their hard disk or rename as something like FORMATII.COM. Why?

Before DOS 5, FORMAT.COM deleted everything already on the disk and recovery of your programs and data was a job for experts who were not always successful. Note that DOS 5 and 6 provide a "safe" format and an "unformat" command, although there is still a destructive format available. PC Tools and some other utilities also provide "safe" formats. Users of earlier DOS versions beware of the deadly FORMAT.

Many times my phone has rung with anguished calls for help after its unwise use.

The default drive is the one that shows at the DOS prompt, so if your prompt is A:\>, the default drive is A:. DOS will use the default drive to carry out commands and look for programs unless you tell it otherwise. You can change the default drive by typing B: at the prompt and Enter. The prompt will change to B:\> and DOS will look on the B: drive for programs and commands. The most common default drive is C:, your hard disk, and here lies the danger of the FORMAT command. If you don't specify a drive after the command FORMAT, you will format the default drive, usually C:, so you lose the contents of your hard disk. Yes, everything!

All you have to do is type the word FORMAT, the phone rings and you forget to type a drive name, press Enter and bingo, it's all gone. There are several switches with FORMAT, and they vary somewhat with different DOS versions, so check your Manual. Some switches allow you to give the disk a label, or put system files on the disk that is then called a "System Disk." That's what the /S switch did last month. You can boot your computer by putting a System Disk in drive A: before you switch on the power, and that is exactly how our Disaster Recovery Disk will be used.

The Copy Commands We are now going to work from the DOS Command Line, which means the line where the DOS prompt appears. It looks something like C:\> followed by a short blinking line. The name of the directory you are in may also be in the prompt, as in C:\MAGFILES>. What's a directory? I'll have to leave that for now. The DOS prompt is DOS saying to you "Type your commands here, Master."

There are three copy commands in DOS. Let's look at them. They are DISKCOPY, COPY and XCOPY.

DISKCOPY

You should have used this command to make working copies of the disks that came with your original program(s). Write-protect copies and originals by sticking the silver or black tabs (5.25-inch size) over the notch in the side of the floppy disk; for 3.5-inch disks move the write-pro-tect tab over. Beware of DISKCOPY. It will copy everything on a floppy disk in A: drive to another disk; everything, including bad sectors of the disk, corrupted files, you name it. DISKCOPY makes an exact copy and it formats the target disk as it copies, so any data you had on that target disk will be lost.

The command you issue (type at the prompt) is

DISKCOPY A: B:

which means copy exactly the disk in drive A: to the disk in drive B:. Don't worry if you only have one floppy drive. DOS then regards your drive as A: when copying from the Source disk but as drive B: when copying to the Target disk. Thus you have ones physical drive but its name to your computer (called its logical name) depends on which disk is in it. As DISKCOPY works, DOS will instruct you to change disks when necessary. Clever, isn't it?

Here is where you must learn to talk with your computer. You talk to it by typing commands, the computer talks back to you by on-screen messages. You must read these messages else disaster will strike. When you issue the computer (DOS) will say

"Insert SOURCE diskette in drive A:" 
"Insert TARGET diskette in drive B:" 
Press any key to continue . . .


DISKCOPY will start working.

Please note that any key should perhaps read "any character key" The space bar works here, but the three shift keys, Shift, Ctrl (control) and Alt (alternate) do not qualify as "any key."

You can type
DISKCOMP A: B:

which compares the source and target disks, to verify that you have an exact copy. If it isn't, you will get messages like "compare error track 47" and you need to try again.

COPY

COPY is just that. The Syntax (up-market jargon for how to make DOS understand what you want) is

COPY {Source filespec) {Destination filespec}

So what's a Filespec? It's the address where a file can be found, and every file on all your disks has a unique Filespec, just as every house in your city has a unique address. An example is the file from which this article was created. The file's full address is CAMAGFILES\BEGBYTE2, which says that the file is located on drive C: in the directory called MAGFILES ~a,nd its name is BEGBYTE2. An example of using ROPY would be the command
COPY MYFILE A: 

which copies MYFILE from the default drive to the disk in your A: drive. Another example could be
COPY MYFILE A:YOURFILE

which copies MYFILE to a file called YOURFILE on drive A:. But what if DOS can't find MYFILE? The computer will say to you
"File not found. 0 files) copied"

This happens because you have not used the full Filespec. You may have to use the full address, like
C:\WORK\MYFILE

Use the command
COPY MYFILE PRN

to send that file to the printer, which DOS calls PRN or sometimes LPTI. COPY is rather slow, and if you have only one floppy drive and big files, there is a lot of diskswapping involved. This means you must be careful to put the right disk in, or some files could be lost.

XCOPY

In my early days I didn't know about XCOPY, but I have since discovered it offers many advantages over COPY. For a start it works much faster than COPY, it can copy whole directory trees (we'll talk about these later) and it can be made to copy only those files that have been updated since the last XCOPY. There is much less diskswapping since XCOPY reads as many files as possible into memory before it starts dumping them onto the target disk. If, for example, you want to take home all the files in a particular directory (section) of your hard disk, use XCOPY. You will need to add some "switches" to XCOPY, so you might type XCOPY/V where the /V part is known as a "switch." This particular switch verifies the copy being made, so if you type COPY/V or XCOPY/v DOS will check the copy for accuracy and correct any errors. Trade-off, of course, adding /V slows the copy process. An alternative is to use the COMP command. COMP will compare your copy with the original, to ensure an accurate copy. Refer to your DOS Manual for the available switches and how to use them, or look at PC Update Nov. 1989, which has an excellent piece by Fritz Lang on this subject.

Well, that's all for this month, and we still haven't made that Disaster Recovery Disk. But, we're getting there. So, next month ........

The Dangers of Well-Intentioned Friends
Dave Mitchell

I'm sure all of you have experienced this or are experiencing this - the danger of the well-intentioned friend.

As Ron has shown, the pitfalls of being new to the mysteries of computers are deep and many, even if some of them are so simple it's amazing you didn't spot them before you did the evil deed. This wisdom is fine after the event but, prior to creating a major disaster, we just carry on blithely secure in our knowledge, or lack thereof.

All this is caused by the bane of the new user "The Well-Intentioned Friend". You all know them. They're the "kind" folks who help us set up our systems in the first place, put all the right commands in the AUTOEXEC.BAT and CONfIG.SYS files, install all their favourite applications and happily leave us in the lurch with a cheery "Just edit the AUTOEXEC.BAT" when you run into the first problem with memory or something.

Unfortunately for us tyros the kindness of our "Well-Intentioned Friends" generally lasts no longer than the second stupid (their definition not ours) question about such things as "Yes, but what does the ANSI driver actually do?". At this point you generally get a growled "Why don't you read the damned manual?". Good advice but when our brand new machine has gone sulky on us and we're panicking our socks off, not much help.

The moral of the story?

Let your "Well-Intentioned Friends" help you set up your system but don't expect them to be the fount of all knowledge that you're going to need for the rest of your computing life. Thank them, send them on their way and spend the next week reading the manuals. At least after that you'll know where to find the AUTOEXEC.BAT when you're told to edit it.

Reprinted from the October 1993 issue of PC Update, the magazine of Melbourne PC User Group, Australia

[About Melbourne PC User Group]