XXCOPY

DATMAN TECHNICAL BULLETIN #027



From:    Kan Yabumoto           tech@datman.com
To:      DATMAN user
Subject: Windows 95/98 System Backup/Restore using DATMAN
Date:    1999-01-08
====================================================================

The primary purpose of the DATMAN-99 software is to create a file
system for Windows 95/98 using the DAT (and similar) tape drive.
However, for better or worse, the great majority of DATMAN users
consider DATMAN as yet another backup and restore alternative.
Therefore, we are expected to solve the "secondary" purpose of the
software.  It's like a floppy drive manufacturer being demanded to
come up with a first-class bullet proof disaster-recovery software.

Well, here is a step-by-step description of how we would tackle
this problem.  This article outlines the method which is to be
implemented "by hand".  We feel this approach is superior to many
"disk mirroring" solutions which saves the entire hard disk as a
gigantic binary file.  As a matter of fact, a few such products
are successfully used in conjunction with the DATMAN-DOS software.
The drawback of such a brute-force approach is its consumption of
time for each backup session which cannot perform incremental
backup.  The restore operation is also an all-or-nothing proposition.

Incidentally, we are working on a more user-friendly DATMANCC
command which create an emergency boot diskette with which the
restore operation are performed with considerable ease.

The elegance of the DATMAN tape as the repository of the backup
files lies on its fine granularity of file access.  You can access
the backup data either on a single file basis or on a subdirectory
restore basis.  Such accesses are performed much more frequently
than full disaster recovery operations.

Albeit its infrequent usage, a full, worst-case system restore
capability must be present for any serious storage application. 

Here's the basic approach which you can run by hand as long as you
have a DATMAN backup tape of your Windows 95/98 system.  The
method you use in creation of the backup tape (a full backup
scheme vs. incremental backup scheme) is not very critical.  You
can use a full complete backup in one setting.  Or, you may use
an updated backup made by incremental (or so-called differential)
backup.  The only difference among the tapes made by these different
approaches is the positions and the order of the files saved on
the tape.  Only the newest copy of a given file matters and its
overwritten copies which are "logically" deleted (but physically
remains on tape in the case of DATMAN volume) are conveniently
absent when the tape volume is access as a file system.  Therefore,
DATMAN's restore operation described here works equally well with
a backup tape made in one full backup session, and with a backup
tape which has undergone many incremental backup sessions.

In either case, we strongly recommend the use of our DCOPY32.EXE
utility for both the backup phase and the restore phase.  (See
below on why DCOPY and DCOPY32 are definitely the choice for a
serious backup and restore operation.)



Boot diskette should have the following files.

     io.sys       (hidden)
     msdos.sys    (hidden)
     drvspace.bin (hidden)
     command.com
     fdisk.exe
     format.com
     aspi7dos.sys (for AHA-294X, else your real-mode ASPI manager) 
     datmanfe.exe

    Optional handy utilities (ordered by relative importance)

     datman.exe
     dcopy.exe
     smartdrv.exe
     ddir.exe
     sys.com
     deltree.exe
     scandisk.exe
     label.exe
     attrib.exe
     doskey.com
     loadaspi.exe


Make a DATMAN-99 backup tape with the latest set of files found
in the system disk (C:).  The tape may contain backup volume of
additional drive (e.g., D:, E:, etc.).  The entire backup volume
may be split into two or more tapes.

Here, let us assume the system (C:) volume was backed up in the
T:\mybackup directory.  Furthermore, say, the entire C: drive
was saved under the T:\mybackup directory although you may make
necessary adjustments if some portions of the C: drive were
saved in other directories.

===================================
 The three-step restore operations
===================================

1.  Reboot from a system diskette
     config.sys
               device=himem.sys
               device=aspi7dos.sys /d

     autoexec.bat
               smartdrv
               doskey /insert

     at the dos prompt, you may run
               fdisk
               format

     after that, you will run the first batch file (restore1.bat)

 2.  Restore1.bat (still on diskette)
      datmanfe -vt -x8192
      dir t:\            
      dcopy /c/h/r/bi/y/q   t:\mybackup                  c:\
      dcopy /c/h/r/bi/y/q/i t:\mybackup\windows          c:\windows
      dcopy /c/h/r/bi/y/q/i t:\mybackup\windows\system   c:\windows\system
      dcopy /c/h/r/bi/y/q/i t:\mybackup\windows\system\iosubsys c:\windows\system\iosubsys
      dcopy /c/h/r/bi/y/q/i t:\mybackup\windows\command  c:\windows\command
      dcopy /c/h/r/bi/y/q/i t:\mybackup\windows\fonts    c:\windows\fonts
      dcopy /c/h/r/bi/y/q/i t:\mybackup\windows\inf\apps.inf c:\windows\inf
      dcopy /i/bi/y/q       t:\datman\bin\datmanfe.vxd   c:\$temp$
      dcopy /i/bi/y/q       t:\datman\bin\datmancc.exe   c:\$temp$
      dcopy /i/bi/y/q       t:\datman\bin\dcopy32.exe    c:\$temp$
      dcopy /i/bi/y/q       a:\restore2.bat              c:\$temp$
    
      The idea here is to restore just the bare minimum to get
      Win95 going so that DATMAN-99 can run.  There is one more
      small step (omitted here) which inject a special entry into
      the system registry file so that the next win95 reboot will
      initiate the next step batch file (restore2.bat) automatically.
      But, you can manually do the same thing after this...

 3.  Reboot from the hard disk for a temporary Win32 environment
     Then, run c:\$temp$\restore2.bat which contains the following
     lines...

      c:\windows\start.exe c:\$temp$\datmancc.exe -t
      pause
      c:\$temp$\dcopy32 t:\mybackup c:\  /nl
      c:\$temp$\dcopy32 t:\mybackup c:\  /c/h/r/bi/y/q
      c:\$temp$\dcopy32 t:\mydrived d:\  /c/h/r/bi/y/q
      c:\$temp$\dcopy32 t:\mydrivee e:\  /c/h/r/bi/y/q
      deltree /y c:\$temp$

      Now, you are ready to reboot to the fully restored Win95.


=====================
 Theory of Operation
=====================

There are a few files with similar files which may confuse some
novice DATMAN users.

  datmanfe.exe    ;DATMAN-DOS File Engine (16-bit TSR)
  datmanfe.vxd    ;DATMAN-99  FILE Engine (32-bit Virtual Driver)

  datman.exe      ;DATMAN-DOS user interface (for troubleshooting)
  datmancc.exe    ;DATMAN-99  Command Center

  loadaspi.exe    ;a utility bundled with DATMAN which allows you
                  ;to transform an ASPI Manager to a TSR so that
                  ;you can install the ASPI Manager without using
                  ;the "device=" statement inside CONFIG.SYS.
                  ;If you install your ASPI manager successfully
                  ;via CONFIG.SYS, you do not need this.

  aspi7dos.sys    ;the ASPI Manager for the popular AHA-294x host.
                  ;if you have a different host adapter, you need
                  ;its specific ASPI manager.

        Example:   Host Adapter         ASPI Manager required
                  ---------------------------------------------
                      AVA-1505             ASPI2DOS.SYS
                      AHA-151x             ASPI2DOS.SYS
                      AHA-152x             ASPI2DOS.SYS
                      AHA-154x             ASPI4DOS.SYS
                      AHA-294x             ASPI7DOS.SYS

        An ASPI Manager is a real mode device driver program
        supplied by the SCSI Host adapter manufacturer.  Since
        they are usually copyrighted by its owner, DATMAN packages
        do not include one (except for DATMAN-tape subsystems).


The important thing here is that the key Windows 95 component
files will be restored in the real-mode DATMAN restore operations
(the first seven dcopy commands above)

  destination of dcopy            components
 --------------------------------------------------------------
  c:\                             all root files
  c:\windows                      all files in windows directory   
  c:\windows\systems              DLLs and other key files
  c:\windows\systems\iosubsys     virtual driver (VxD) files
  c:\windows\command              DOS7 utility files
  c:\windows\fonts                necessary even for minimal GUI
  c:\windows\inf\apps.inf         to suppress some warning message
  c:\$temp$\datmanfe.vxd          just in case if it's missing in iosubsys
  c:\$temp$\datmancc.exe          the workhorse of DATMAN-99
  c:\$temp$\dcopy32.exe           the key restore utility
  c:\$temp$\restore2.bat          to be executed after the next reboot

Here, this example uses the temporary directory (\$temp$) as the
temporary home for the DATMAN-99 related files.  Alternatively,
you could use the real DATMAN home directory such as c:\datman\bin,
instead.  But, the temporary directory avoids a minor complication
where the actual home directory contains longname in its path
(e.g., c:\Program Files\datman\bin).  In this example, the initial
real-mode restore does not create any longname directory.  By
avoiding the use of any long-named directories, this method
guarantees to restore the names of directories and files to have
identical short names.  Note that although this step avoids
creation of long-named directories, it may copy long-named files
using their 8.3 alias names.  That is, being the common dumping
ground for many applications, both the \Windows and \Windows\system
directories typically contain a number of files with long name.
Such files with the 8.3 alias-only name will be renamed with
the corresponding long name in the first dcopy32 operation
(with the /nl switch) Step 3 immediately after the first entry
to the Win32 environment.  The second dcopy32 will overwrite the
entire C: drive including the files that were already restored
in earlier steps.  Although these file overwrite operations are
redundant, to avoid the redundancy would be messy and has little
advantage.


=======================================
 Why DCOPY and DCOPY32 are the choice?
=======================================

The reason for the usage of DCOPY32 over other copy utilities is
DCOPY32's unique ability to maintain the longname/shortname pair
when files are copied from a directory to another.  Most file copy
utilities including Microsoft's own copy, xcopy, xcopy32 as well
as drag-and-drop method of Explorer let the operating system to
synthesize the 8.3 alias name when a long-named files are copied.
Therefore, when similarly-named longnames are copied from a
directory to another, the order of copying will determine the
short-name alias which may differ from that of the source file.
Disregarding this subtle discrepancies using the ordinary file
copy utilities will result in many mysterious behavior after
restoration.

The greatest advantage of DCOPY and DCOPY32 over its corresponding
replacement utilities such as XCOPY and XCOPY32 is the one-pass
copy operation from the DATMAN volume.  The DCOPY/DCOPY32 utilities
first determine the physical positions of all the files to be copied
in the action and rearrange the copy order so that the tape will
move only in one direction.  This feature is especially valuable
when the backup tape was made by many incremental backup sessions
where even the files from one directory may be scattered all over
the tape. 



[ More Technical Bulletins ] [ DATMAN Table of Contents ]