[PREFACE] Excerpt from Common Questions & Answers About Arcada Backup for Windows 95 found at the Arcada Web Site in early 1996 Q. If my Windows 95 crashes will the [Arcada Windows 95] backup program work with DOS? A. No, you must reinstall Windows 95 and then the backup program. Unfortunately, the disaster recovery feature that we worked so hard on has turned out to be significantly more difficult than we first believed and did not make it into the first release of the product. The problem is in storing enough of the Windows 95 operating system on the bootable disk so that we can access the VFAT file system and gain access to the long filenames and the Registry. Many people mistakenly believe that you can boot to DOS and restore from there, but unfortunately this does not allow recovery of the long filenames and the registry. Arcada is working with Microsoft on the design of this feature and hopes to have it in the next release before the end of the year. As it currently stands, to recover from a complete disaster you need to do the following: 1) Boot from a DOS disk, 2) Install a minimal version Windows 95 from CD-ROM or floppies (hopefully the former, this means you do not have to recreate the Registry or any preferences, etc.), 3) Install Arcada Backup for Windows 95, 4) Restore your latest backup. Fact is, most Windows 95 users don't understand the problems the failure of drive C can cause. Many also don't even understand their old pre- Windows 95 (legacy) software won't restore Windows 95 properly and that the backups have truncated long filenames (LFN) and long-filename- format directory names. ======================================================================= DOSLFNBK v 1.0 - Backs up/restores Win95 long filenames in DOS Copyright (c) 1995 D.J. Murdoch. [Textual modifications or annotations to this file occurred 2/11/96 and appear as bracketed insets like this one.] [DOSLFNBK.TXT v1.1] 0. Contents of this file 1. Syntax 2. Description 3. Details 4. Memory Limitations 5. Safety 6. Recovery from Total Disk Failure 7. License 8. Release History 9. Acknowledgments 1. Syntax: DOSLFNBK [drive]directory [options] will back up all the long filename records in the named directory and subdirectories of it to a file called BACKUP.LFN. Options: /f [filename] Back up to this file instead (with a default .LFN extension) /force Force DOSLFNBK to go ahead without asking questions, even when it may be unsafe [consider avoiding this option] /nr No recursive: don't do subdirectories /nt Don't restore times from LFN backup /p Prompt before each filename restore (ignored during saves) /r Restore from existing backup /v Give running status report /d filename Write a detailed debugging log to filename [Note that while DOSLFNBK.EXE can be run from earlier versions of DOS, in order to use "lock" or "unlock" as shown in examples below, you must have either booted under Windows 95, pressed F8 to get the Boot Menu and selected menu item 5, or, you must have booted from a Windows 95 startup disk and avoided loading the Windows GUI. Where you have booted from DOS 3.1-6.22 the "lock" or "unlock" commands are not needed and will produce a BAD COMMAND OR FILENAME message. It isn't necessary under pre-Windows 95 DOS anyway.] Examples: For recovery from a total disk failure, see [Section 6] below. To back up every long filename on the disk into C:\BACKUP.LFN: doslfnbk c:\ To restore just the Windows directory and subdirectories: lock c: doslfnbk c:\windows /r unlock c: To restore just the root directory, but no subdirectories: lock c: doslfnbk c:\ /r /nr unlock c: The following [syntax] is not allowed; you need a full path: doslfnbk . <---- Error! To restore the "Program Files" directory name and its subdirectories, you need two runs: lock c: doslfnbk c:\PROGRA~1 /r doslfnbk c:\ /r /p /nr unlock c: On the second run, you'll be prompted for each name to restore; just say yes when you see "Program Files". 2. Description: Microsoft's Windows 95 introduced long filenames (LFNs), and they are [often] compatible with old software [in their truncated form]. However, there are some problems. Old backup programs [truncate] LFNs, so they don't get properly backed up. Worse, the Win95 backup program doesn't support a lot of common backup hardware (e.g. Colorado Memory Systems tape drives using accelerator cards) and won't run in DOS mode. [Even backup software released as Windows 95 compatible has the problem of not being usable under DOS.] So recovery from a catastrophic disk failure can be really difficult. To address this problem, Microsoft put a program called LFNBK on the Win95 CD ROM to [help] back up your LFNs. However, it's very inconvenient [and somewhat dangerous] to use. It requires changes to your Control Panel settings before and after use [by novices -- Control Panel changes can be avoided by using its /force parameter], and it works by [truncating] all the LFNs on your disk(s) --- so you need to restore them again after you've done your backup to tape. It will only run after Win95 has booted, so, again, you've got big problems after a catastrophic disk failure. If you're using a [legacy backup] program that is completely incompatible with LFNs then you might want to use LFNBK, but for routine system backups it's [complicated and] too much of a pain. [The thing to remember about Microsoft's LFNBK.EXE is that it is destructive to long filenames and unless you clearly understand how to use it, it can greatly complicate your life.] I wrote DOSLFNBK to address these problems. It runs in any version of DOS [above 3.1] that can see your disk, and can both backup and restore your files there. During backup, it makes no changes to the names, [i.e., it is not destructive to LFNs] so you can routinely run it just before a tape backup and not have to undo the damage afterwards. It also allows partial backups and partial restores; I'm pretty sure LFNBK is an all- or-nothing affair. The downside of DOSLFNBK is that it has to work on the disk below the file system level. This means that if other programs are running simultaneously, it can get confused, and may cause errors in the backup or even errors on the disk itself. I recommend running it only in a single-tasking DOS session, unless you're quite sure no other program is writing to the disk. [Extreme caution should be exercised on using DOSLFNBK in a multi-tasking mode. It can trash your part of your VFAT and make files unrecoverable unless they've already been backed up. DOSLFNBK will warn you to be careful. Consider the warning CARVED IN STONE.] 3. Details: [Prior to commencing] a backup, DOSLFNBK reads the directories on the disk and writes copies of all of the LFN records to the [binary index] BACKUP.LFN file (or whatever filename you specify with /f). If you use the /nr option, it will work only on the specified directory; otherwise, it saves those entries as well as everything in any subdirectory below it. [Under most conditions, DOSLFNBK is best executed from the root directory unless you have a specific reason to be focusing on LFNs in a specific part of your directory structure.] You'll get a warning if you run it in Windows mode, since other programs might change the directories while DOSLFNBK is running and cause it to store and/or restore garbage [in addition to trashing filenames]. The /force option tells DOSLFNBK to go ahead without stopping for this warning, or several others (e.g. overwriting the backup file). Use it in a batch file only when you're sure you always want it to go ahead. [And consider using /force or even DOSLFNBK as in a multi-tasking mode as playing with matches in a room full of dynamite.] You *must* give the drive letter and a full path to the directory; relative directory specifications are not supported. Note that the directory name itself won't be backed up or restored [unless it is a long-filename-format named directory]; only the files and subdirectories within it. There is no way to specify a subset of the files; you have to use the /p prompting option if you want this. The original drive letter is not stored in BACKUP.LFN, so you can use DOSLFNBK to save the long filenames on one drive, use a DOS utility to move them to another drive, and then restore the filenames there. [If you have booted in native DOS mode under Windows 95,] during a restore, you should use the DOS command LOCK to give DOSLFNBK access to the disk at a low level. I can't find documentation for LOCK anywhere, [but it does not necessarily provide extra protection if you are so foolish as to run DOSLFNBK in a multi-tasking mode (e.g., from a DOS window from within Windows 95]. DOSLFNBK will normally not overwrite an existing LFN with a different one; you should rename the file to its 8.3 alias before running if you want to restore an old name, or run with the /p option for individual prompting. Normally, DOSLFNBK will restore the backed up date information, since older DOS versions and DOS utilities don't [always] save this properly. You can override this behavior by using the /nt switch. If during a restore, DOSLFNBK detects that the file size has changed, you'll be prompted as to whether you want to restore the LFN or not. If you choose to restore it, the date information will *not* be restored, as it is probably incorrect. During a restore, the file attributes of the file on the disk will be kept. To show you the progress [while running], DOSLFNBK prints a dot for about every 10 directories examined or (in /v mode) prints the directory and file names. [Faster computers may complete the execution of DOSLFNBK before the dots even appear.] If it stops printing [dots] for more than a few seconds, something is probably wrong. Try running again with the /d debug log option, and if it stops again, please email me (dmurdoch@mast.queensu.ca) a copy of your log, along with a description of your system. I'm very interested in making DOSLFNBK as bug-free as possible. When a run is successful, DOSLFNBK exits with [but does not display] ERRORLEVEL 0. When something goes wrong, it prints an error message and exits with a higher errorlevel. The currently defined [v1.0] error levels are: 99 = Syntax error 98 = Error initializing disk 97 = Error reading disk 96 = Error writing disk 95 = Error in directory on disk 94 = Error setting up directory 93 = Error opening backup 92 = Error reading backup 91 = Error writing backup 90 = Error closing backup 89 = Memory error 88 = Multitasker running 87 = Backup file exists 86 = Debug log problem 4. Memory Limitations: When running, DOSLFNBK keeps copies of several directories in memory at once. It is written as a real mode DOS program and keeps all of this data in the low 640K of memory. This means that in a typical DOS session with 500K of memory available, DOSLFNBK will run out of memory [if] about 15,000 directory entries are in memory. On a restore, up to 3 copies of each directory entry may be in memory at once, limiting DOSLFNBK to disks with fewer than 5000 directory entries in any branch of the directory tree. (The total number of files on the disk doesn't matter; what matters is the number of entries in a directory, its parent, grandparent etc., back to the root.) I think disks approaching this limit are very unusual. However, it *is* possible to have such a disk, and here's how to find out if you do: Run your [DOSLFNBK] backup with the /V verbose option. At the end, it will print a message something like Used 255K; restore will require about 264K in DOS session. If the amount of memory estimated for the restore is more than you have available (as reported by the DOS MEM command), you might have problems. You might not; the number reported is usually an overestimate. If it ever turns out that you do run out of memory during a restore, you can still restore the LFNs by breaking up the restore operation into several steps, restoring different parts of your subdirectory tree separately. In the worst case (more than 5000 entries in a single subdirectory), you may have to temporarily move files out of the directory and restore the LFNs a few thousand (!!) at a time. 5. Safety: DOSLFNBK works with your disk at a level below the file system, so if things go wrong during an LFN restore, it's conceivable that you could lose whole files or directories. I've tried to make it as safe as I can, but you should follow some simple precautions: - If you aren't sure of the integrity of your file system, run Scandisk before DOSLFNBK and get it to fix any errors. In particular, if you've run other low level software (e.g. a defragger or a directory sorter) that may have messed up the LFNs, run Scandisk first. - If you choose to run in Windows despite the warning about the multitasker, then definitely don't make changes to files in the directories where DOSLFNBK is currently restoring LFNs. You're *very* likely to lose your new work. - Don't turn off or reboot your PC in the middle of a DOSLFNBK run. If there's a power failure or (horrors!) a bug in DOSLFNBK forces you to reboot, then Scandisk should be able to repair much of the damage. You may lose some filenames, but Scandisk should be able to recover the files themselves. - If you hit Ctrl-Break or Ctrl-C during a DOSLFNBK restore, it shouldn't do any damage other than giving you only a partial restore of your LFNs --- but this is *not* a well-tested feature, and there may be conditions under which you'll suffer worse damage. Again, Scandisk should be able to repair most of it. - DOSLFNBK was written for version 4.00.950 of Windows 95 (the August 1995 release). It hasn't been tested on the earlier beta test versions or on any later releases. If the VFAT file structure isn't what DOSLFNBK is written for, it could do some real damage. - This is the first release of DOSLFNBK to the public. There may still be special conditions on your system that it doesn't handle. If you can, try it out when you've got a good second backup to make sure it works. If it doesn't, *please* send me details, and I'll attempt to fix it. 6. Recovery from total disk failure: If your boot disk fails, or you decide to repartition it, then you may need to do a full restore from a backup tape. Unfortunately, the Win95 backup program [and other now-available Windows 95 compatible backup programs] provide *no way* to do this without re-installing Win95 from the original disks or CD ROM. [Actually, if you bought the $89 upgrade version of Windows 95, you'll first have to re-install Windows 3.1x.] From reports I've heard, the same is true of the just-released Win95 version of Colorado Memory System's backup program and some other commercial backup programs. [As of early 1996 it was also true of Arcada Backup for Windows 95 and IOMEGA's Windows 95 upgrade software.] However, if you have a reliable DOS-based backup program, DOSLFNBK will let you do a complete restore from a backup. [A very good choice for tape backup systems is Arcada's pre- Windows 95 software distributed free with blank tapes. It comes in both the DOS and Windows (3.1x) versions. Use the DOS version only, though.] I've only had to do this once, so these instructions aren't guaranteed to cover everything for every system, but they worked on mine. ADVANCE PREPARATIONS: Before your disk fails (i.e., right now! :-), you need to prepare the following: 1. A Win95 startup disk. If you didn't create one when you installed Win95, start the Add/Remove Programs option in Control Panel, and click the Startup Disk tab. Then click the Create Disk button, and follow the instructions on-screen. [A DOS 3.1-6.22 startup disk will also work and may even make matters a bit simpler.] 2. A copy of your DOS-based backup/restore program on a floppy disk [or the original distribution disks so you can reinstall it after a drive C failure -- your DOS legacy backup software may be too large to fit on a startup disk, especially one created with Windows 95]. It may require EMS memory; if so, you should put HIMEM.SYS and EMM386.EXE on your startup disk, and load them via CONFIG.SYS. 3. If you use Drivespace disk compression, then you should also make sure that the MINI.CAB file from the installation disks or the CD ROM is in your Windows directory. [An alternative for this possible snag is to create your Windows 95 startup disk and then put your DOS legacy backup software on a second disk.] 4. [Perform] a full backup of your disk(s). Just before creating this, run DOSLFNBK to save all of your long filenames. You'll need to create one DOSLFNBK backup file for each disk. It's fine to leave this on the hard disk so that it ends up on the backup; you don't need to have it on floppy disk. [Example .BAT file @echo off cls c: cd\ if exist backup.lfn del backup.lfn if exist backup.lst del backup.lst doslfnbk c:\ /v > backup.lst type backup.lst | more This .BAT file first checks for the presence of earlier files from previous use of DOSLFNBK. Then it saves an ASCII version of the binary index using redirection and the TYPE command. Having a list of the LFNs affected can prove very useful if your restore misses renaming a LFN or two. If you are using DOSLFNBK on other hard physical or logical hard drives, you'll need a similar .BAT file for each drive.] WHEN YOUR DISK FAILS: Depending on the reason for your disk failure, you may be able to skip some of the early steps here. Read them over, and figure out where to start. If you have to, you can start again, so the only thing you lose by starting too far down is time. 1. Make any necessary repairs to your hardware. 2. Boot from your Startup disk, and use FDISK to partition your disk. Use "FORMAT c: /s" to reformat the disk and transfer the system files to it. 3. (Optional) Transfer your tape backup software to your hard disk. [The software will run much faster from the hard drive.] [3.a. To be prepared for a catastrophic failure of drive C, consider putting a copy of your backup software on another drive, perhaps in a .ZIP file to save space.] 4. If you're not planning to use Drivespace, you can skip down to step 8. 5. If you want to compress your drive, you need to restore enough of Win95 to run Drivespace. Don't restore the whole disk; you might not have room for it. For most people, restoring the files in the root directory and the files in the Windows directory should be enough. If you have any essential drivers in other directories, you'll need to restore them too. Finally, you should restore DOSLFNBK and the data file(s) containing the backed up long filenames. IMPORTANT: You should not overwrite IO.SYS, but you *should* overwrite MSDOS.SYS. It is a hidden read-only file in your root directory. A good way is to erase MSDOS.SYS before starting the restore (use ATTRIB from the Startup disk to remove the System, Hidden, Read-only attributes), and then telling your restore program not to overwrite existing files. Restore all those files now. 6. Restore the long filenames by running LOCK C: DOSLFNBK c:\ /R /V /F backupfilename [Remember, using "lock" or "unlock" is not necessary if your emergency startup disk is DOS 6.22 or lower.] 7. Remove the Startup disk, and reboot your system. You may get some errors about missing drivers (e.g. no sound card drivers), but things should basically work. Run DriveSpace to compress your drives the way you want. 8. Reboot your system in DOS mode or from the Startup disk. 9. Restore all rest of the files on all of your disks from the backup now. See the "IMPORTANT" note in step 5 about MSDOS.SYS and IO.SYS. 10. Restore all the rest of your long filenames by running LOCK C: DOSLFNBK c:\ /R /V /F backupfilename [unless you executed DOSLFNBK specifying a backupfilename other than BACKUP.LFN, type in BACKUP.LFN as the backupfilename] and if you've also got a D: partition, LOCK D: DOSLFNBK d:\ /R /V /F backupfilename You may get messages about some long filenames already existing from your first restore; don't worry about those. [10.a. An alternative restore command syntax is lock DOSLFNBK c:\ /r /v /p /f BACKUP.LFN which will prompt you for an okay before restoring each LFN or long-filename-format directory name.] 11. Some restore programs set the archive bit on all restored files; you might want to turn it off (since you've still got those files backed up) at this point. Reboot your system, and things should be back as they were when you did your backup! [In the event something is missing from your StartUp menu or program folders, odds are high it is a .LNK file which was missed in the restoration process. This is where that BACKUP.LST file in the above example .BAT file can become very handy.] [In the even you need to rename a truncated 8.3 format filename as a LFN which has spaces, put the new name in quotes. For example: REN PROGRA~1 "Program Files" or REN MICROS~1.WAV "Microsoft Sound File.Wav" Again, your most likely missing or unrenamed LFNs will be .LNK files and usually on the far end of a directory branch.] 7. License: DOSLFNBK is *not* public domain software, but you may use it at no charge. You may distribute unmodified copies of the complete DOSLFNBK package, provided your total charge is no more than $1. The total cost of a compilation (e.g. a CD ROM) including DOSLFNBK must be no more than $1 per package in the compilation. DOSLFNBK was written in Borland Pascal 7.01, using the excellent Object Professional library from TurboPower Software. You can obtain the source code (including an object-oriented low-level disk access unit and a huge memory support unit, but not Opro) by sending a cheque or money order for $50 (in Canadian or US dollars, or the UKP equivalent of $50US) to: Duncan Murdoch 337 Willingdon Ave. Kingston, Ontario, Canada. K7L 4J3 You can also order source code from the Public (software) Library (PsL) using MC, Visa, AmEx, or Discover card: - by calling 800-242-4775 (US only) - by calling 713-524-6394 - by faxing your order to 713-524-6398 - by sending your order by Compuserve to 71355,470. - by sending your order by Internet to 71355.470@compuserve.com PsL only accepts payment in US dollars. Please give PsL your name exactly as it appears on the card, and tell them your card's expiry date. DOSLFNBK is PsL product #14247. The PsL numbers are for ordering only. I *cannot* be reached at the PsL numbers. To contact me for information about dealer pricing, volume discounts, site licensing, the status of shipment of the product, the latest version number or for technical information write to me at the address above or at one of the email addresses below. I'd especially like to hear bug reports and suggestions for improvements. Fidonet: DJ Murdoch at 1:249/99.5 Internet: dmurdoch@mast.queensu.ca Compuserve: 71631,122 8. Release history: 0.0 - first beta test version 0.1 - kept file attributes of existing file during restore. 0.2 - made messages more informative; fixed bug in handling erased file entries; added check of overwrite of backup file; changed default name of backup file to BACKUP.LFN and made LFN the default backup extension; added /P option. 0.3 - fixed memory leak that caused run-time error 203 on large restore 0.4 - added check for successful write of backup file, added /force option. 0.5 - added report of memory use, /d option, many debugging messages 0.6 - cleaned up messages and debug log, removed disk size restriction, added progress dots for non-verbose runs. 1.0 - first public release --- same as 0.6 9. Acknowledgments DOSLFNBK was written based on the information in Robert Hummel's article on Win95 long filenames in the June/July 1995 issue of PC Techniques Magazine. Thanks are due to the beta testers, who suggested many improvements, and several of whom were put to considerable inconvenience by early versions that messed up their disks. END DOSLFNBK.TXT v1.01 text modifications/additions by the Intrepid Infonaut mguffey@aol.com online since 1983 [post script] EXAMPLE .BAT FILE FOR TWO HARD DISKS @echo off cls c: echo. echo Preparing to create BACKUP.LFN and BACKUP.LST on drive C: echo. cd\ if exist backup.lfn del backup.lfn if exist backup.lst del backup.lst doslfnbk c:\ /v > backup.lst REM The redirection saves DOSLFNBK's verbose output to a handy disk file. REM If you wish to view BACKUP.LST before proceeding into the backup, REM add the following line here: TYPE C:\BACKUP.LST | MORE d: echo. echo Preparing to create BACKUP.LFN and BACKUP.LST on drive D: echo. cd\ if exist backup.lfn del backup.lfn if exist backup.lst del backup.lst doslfnbk d:\ /v > backup.lst c: \windows\smartdrv REM Above makes everything faster if your startup disk did not load SMARTDRV. \ex\mouse REM Above is an example of loading mouse software for the tape backup program. echo. echo Preparing to load IOMEGA's QBACKUP for Ditto Drives. echo. cd\ditto qbackup [post, post script] Subj: Your message re DOSLFNBK Date: 96-02-21 20:03:56 EST From: dmurdoch@mast.QueensU.CA (Duncan Murdoch) To: MGuffey@aol.com I got your mail regarding DOSLFNBK today. Thanks for all the suggestions; they do improve the text, and with your permission I'll make use of a lot of them if I release a new version. (I have no immediate plans to do so, though.) I only saw one error in what you wrote, and I thought it might help you to know about it. In the 4th paragraph of the Details section, I wrote "Note that the directory name itself won't be backed up or restored" and you added "unless it is a long-filename-format named directory". This isn't correct. DOSLFNBK will never modify the name of the directory that is specified on its command line. To change it, you need to specify the parent directory on the command line. That's what the PROGRA~1 example was about. Duncan Murdoch