Article View: comp.sys.ibm.pc.hardware.storage
Article #140TAR (W95) + DOSLFNBK = complete backup AND RESTORE solution !
From: Eric Cassette
Date: Thu, 14 Dec 1995 10:02
Date: Thu, 14 Dec 1995 10:02
262 lines
10155 bytes
10155 bytes
In a thread generated by problems with Colorado Backup for Windows 95,
I spoke as follows :
>As I use SCSI TAR for DOS + DOSLFNBK, I am able to recover from
>a disk crash without CBW95
And A J Bryant (ajb92@ecs.soton.ac.uk) replied me :
>What SCSI TAR software are you referring to - and does it support
>the long filenames used by Win 95. Hang on - that's doslfnbk isn't it.
>Have you tested this route sucessfully ?
I think my answer may be useful for some other peoples, so, here it is.
Thanks to Tim V.Shaporev (dmurdoch@mast.queensu.ca) and
Dan Murdoch (dmurdoch@mast.queensu.ca) for their softwares.
Eric.
---
Eric CASSETTE - Centre de Ressources Informatiques
Universite des Sciences et Technologies de Lille
Batiment M4 - 59655 Villeneuve d'Ascq Cedex - France
Tel: +33 20 43 40 31, Fax: +33 20 43 66 25
Email: Eric.Cassette@univ-lille1.fr
******************************************************************************
See at the end of this message to have informations about the tar I use,
it comes from Tim V.Shaporev.
Yes, I have tested TAR + DOSLFNBK to make a complete dump and to
restore after something like "FORMAT C: /U"...
BUT : the original TAR I use has 2 problems with W95 :
It refuses to restore files whose names contains non-ascii
characters (in some exotic languages like french, there are accented
characters)
The attributes of the files or directories are very important for W95
to work correctly (ex : C:\WINDOWS\FONTS must be SYSTEM), and TAR
restores only the READ-ONLY attribute...
So, I modified the sources (included in distribution, need Turbo C and
Turbo Asm) to create an executable whose name is "TAR95.EXE".
You'll find the modified version with the new .EXE at
ftp://ftp.univ-lille1.fr/pub/pc/dos/dumpers/tar320cp.zip
(in the same directory you may also retrieve doslfn10.zip) :
------------------------------------------------------------------------------
RESTORE.C, to accept "invalid" characters in file names :
121c121
< register char *p = fname;
---
> register unsigned char *p = fname;
149c149
< } else if (p[i]<=' ' || p[i]>'~' || strchr(invalid, p[i])) {
---
> } else if (p[i]<=' ' || p[i]>255 || strchr(invalid, p[i])) {
------------------------------------------------------------------------------
------------------------------------------------------------------------------
STORE.C, to display the commands that are needed to restore the attributes
of the files beeing tared (original(l?)y I wanted to store the DOS attributes
on the tape, using the modes bits, but if it works when writing, it does not
works well when restoring, or to be exact, I took no time to make it work) :
51a52
> # include <dos.h>
152a154,156
> int dosmodes;
> int readonly, hidden, system;
> int position;
254a259,286
> dosmodes = _chmod(fname, 0);
> if (dosmodes >= 0)
> {
> readonly = (dosmodes & FA_RDONLY);
> hidden = (dosmodes & FA_HIDDEN);
> system = (dosmodes & FA_SYSTEM);
> if (readonly || hidden || system)
> {
> position = 1;
> while(position <= strlen(fname))
> {
> if (fname[position-1] == '/') fname[position-1] = '\\';
> position++;
> }
> fprintf(myout, "a:attrib -r -h -s %s\n", fname);
> fprintf(myout, "a:attrib ");
> if (readonly) fprintf(myout, "+r ");
> if (hidden) fprintf(myout, "+h ");
> if (system) fprintf(myout, "+s ");
> fprintf(myout, "%s\n", fname);
> position = 1;
> while(position <= strlen(fname))
> {
> if (fname[position-1] == '\\') fname[position-1] = '/';
> position++;
> }
> }
> }
267a300,329
> #ifdef MSDOS
> dosmodes = _chmod(fname, 0);
> if (dosmodes >= 0)
> {
> readonly = (dosmodes & FA_RDONLY);
> hidden = (dosmodes & FA_HIDDEN);
> system = (dosmodes & FA_SYSTEM);
> if (readonly || hidden || system)
> {
> position = 1;
> while(position <= strlen(fname))
> {
> if (fname[position-1] == '/') fname[position-1] = '\\';
> position++;
> }
> fprintf(myout, "a:attrib -r -h -s %s\n", fname);
> fprintf(myout, "a:attrib ");
> if (readonly) fprintf(myout, "+r ");
> if (hidden) fprintf(myout, "+h ");
> if (system) fprintf(myout, "+s ");
> fprintf(myout, "%s\n", fname);
> position = 1;
> while(position <= strlen(fname))
> {
> if (fname[position-1] == '\\') fname[position-1] = '/';
> position++;
> }
> }
> }
> #endif
------------------------------------------------------------------------------
------------------------------------------------------------------------------
I have also updated TAPE.C to correct a little bug that made TAR unable
to save a file whose size is more than 16 Megabytes :
636c636
< int writearch(h, length, name)
---
> long writearch(h, length, name)
641c641
< register b;
---
> register long b;
------------------------------------------------------------------------------
To make a complete dump, boot with a W95 repair floppy containing
DOSLFNBK and TAR, and use the following .BAT :
c:
cd \
rem First tar to create a file containing the attrib commands
del c:\att_c.bat
a:\tar -c -f NUL *.* > c:\att_c.bat
rem Save long file names in a file with doslfnbk
del c:\lfn_c.lfn
a:\doslfnbk c:\ /f c:\lfn_c.lfn
rem Second tar to write on tape
a:\tar -c -f ASPI:adapter:0,target:4,lun:0,density:0x13 *.*
To do a complete restore on a new formatted hard disk, boot with a W95
repair floppy containing DOSLFNBK and TAR, then type :
sys c:
rem We need the msdos.sys that is on the tape
attrib -r -h -s msdos.sys
del msdos.sys
rem Restore
c:
cd \
a:\tar -x -f ASPI:adapter:0,target:4,lun:0,density:0x13
rem Restore long file names
lock c:
a:\doslfnbk c:\ /r /f c:\lfn_c.lfn
unlock c:
Reboot, et voila...
READ.ME of TAR320C?.ZIP :
------------------------------------------------------------------------------
This program is distributed on shareware basis.
See 'license.txt' file for more details.
Tar is a tool to save files to archive media and restore them back
again. Despite of its name, the program handles many media types,
be it a floppy disk or regular file.
The program was initially written for UNIX operating system, but
since many other OS support its format, tar became a useful tool
for information exchange between different platforms.
There was number of tar implementations. What are the reasons to
field another one?
Distinguishable features of the given program are:
- it process in a uniform way under both MS-DOS and UNIX clones;
- it does read/write UNIX-compatible floppies and quarter-inch
streamer cartriges under DOS;
- it supports unusual floppy formats: 80-tracks-by-9-sectors and
DEC Rainbow (under DOS);
- it supplies data compression option under both DOS and UNIX;
- it allows to read System V and/or GNU multivolume archives
under DOS and all UNIX clones;
- it includes option to restore damaged archives and plenty of
other useful options.
You can read detailed description in 'tar.txt' file.
Possible improvements in future versions are briefly
mentioned in 'to.do' file.
Copyright issues
I) Source codes performing 'deflate' compression are derived
from Info-Zip 'zip' 2.01 distribution copyrighted by Mark
Adler, Richard B. Wales, Jean-loup Gailly, Kai Uwe Rommel,
Igor Mandrichenko and John Bush.
Info-ZIP's software (Zip, UnZip and related utilities) is free and
can be obtained as source code or executables from various
anonymous-ftp sites, including ftp.uu.net:/pub/archiving/zip/*.
Accordingly to Info-Zip copyright license terms you can also get
original Zip sources directly from myself for the cost of
overhead expenses only.
II) since LZW algorithm used by compress program is protected by
US patent, there are two versions of the program with certain
restrictions associated with them.
Call the program without parameters to obtain info screen.
First line contains version information - something like
'Tape ARchive utility v3.20a' with subsequent plus or minus sign.
If this sign is
minus (-), then
this version has unlimited distribution but provides less
functionality: it supports LZW extraction only, not
compression. Namely, both 'z' and ',' (comma) options will
work for extraction only (they will work with 't' or 'x'
options).
plus (+), then
this version includes full LZW support, i.e. it allows to
create compressed archives, but it may not be sold in US.
As a rule that means that you are not allowed to use it in
US - see license agreement for details.
Full version is available via anonymous ftp from home site
ftp.kiae.su (144.206.136.10) as msdos/arcers/tar320ap.zip
------------------------------------------------------------------------------
******************************************************************************
---
Eric CASSETTE - Centre de Ressources Informatiques
Universite des Sciences et Technologies de Lille
Batiment M4 - 59655 Villeneuve d'Ascq Cedex - France
Tel: +33 20 43 40 31, Fax: +33 20 43 66 25
Email: Eric.Cassette@univ-lille1.fr
Technical Details
Message-ID:
<4aoss9$c4j@netserver.univ-lille1.fr>Path:
arc1-ca.pugleaf.net!univ-lille1.fr!pcntShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!univ-lille1.fr!pcnt From: Eric.Cassette@univ-lille1.fr (Eric Cassette) Newsgroups: comp.sys.ibm.pc.hardware.storage,comp.sys.ibm.pc.hardware.misc,comp.periphs.scsi,comp.os.ms-windows.win95.misc Subject: TAR (W95) + DOSLFNBK = complete backup AND RESTORE solution ! Date: Thu, 14 Dec 95 10:02:38 GMT Organization: CRI Univ Lille 1 France Message-ID: <4aoss9$c4j@netserver.univ-lille1.fr> NNTP-Posting-Host: pcnt.univ-lille1.fr X-Newsreader: News Xpress Version 1.0 Beta #4