LDBkup

A disk backup program designed for LAN's and large drives (> 2GB)

by

Walter F. Metcalf

Background

I have been a strong advocate of regular system backups for years. Some of you may know I've written several articles on the subject. Over the recent years, OS/2 users have had only one good choice for backup software -- CDS's Back Again/2000 product family. However their latest version v.4 failed to provide for backing up hard drives larger than 2 gigabytes.

With modern hard disk drives becoming so large and relatively inexpensive, it is quite easy to get partitions that exceed the 2 GB limit--if only because the number of letters is limited to 24. For example, on my main system, I have 9 partitions that are larger than 2GB!

The failure of CDS to respond to the needs of users with large hard drives can be partly explained, I suppose, by the fact that their software line was developed for tape backup products, and their software has been expanded to include backing up to hard drives and other products only recently.

As I continued to backup to tape, I began to find that the cartridges for modern tape drives were expensive and were often not that reliable over a period of time. Even 3-M has withdrawn its lifetime warranty for its data cartridges. Not only that but it began to take more and more tapes to handle my full backups; and multiple tape backups are a major source of errors--both human and machine. As hard drive prices continued to drop, I did some math, and realized that large hard drives were cheaper to use than tapes. In addition they were much faster and more reliable.

But I couldn't back up to my large hard drives because no software would produce archives larger than 2 GB. So I was stuck! After letting my disk drives go for many months without being properly backed up--which made me increasingly nervous, I made the decision to write a software product for my own use.

However, I'm not a developer. Fortunately there is one OS/2 software product that will handle partitions and archive files of any size: RAR written by Eugene Roshal. Eugene is focusing his development work on Windows version of RAR, but he is still making the OS/2 version available from his web site. RAR does this by producing "multi-part" archives (i.e. archives which consist of several smaller files). This operation is performed on the fly, eliminating the need for special post-archive handling.

RAR for OS/2 is a solid, reliable disk backup program, but it has a number of serious limitations, which make it difficult to use for regular, unattended backup. To name just two, the OS/2 version does not handle (i.e. reset) the archive flags and there is no differential backup feature--something I cannot live without.

What is LDBkup?

LDBkup (Large Disk Backup) is my attempt to get around the limitations in RAR. Essentially where I have seen bothersome limitations, I have written code to perform functions to eliminate them. For example, since RAR for OS/2 has no differential backup (at least not that I could find), I have written supplementary REXX code to perform this function while still using RAR. (Don't even ask!) Sometimes the code isn't the prettiest in the world, but it does work.

Another major limitation in RAR is the awkwardness in the OS/2 version of handling several logical disk drives in a single session. If you're dealing with very many hard drives, it gets very difficult to set it up. So I wrote some code in LDBkup to make it a snap to backup all your drives (even 24!) in one session.

LDBkup should be considered a first-release beta. I have tested as many combinations as I can, but there are hardware configurations that I don't have, and I probably missed some things even with the hardware I do have. So useful feedback would be appreciated. (Simply telling me it doesn't work is not considered "useful". If you want to report an error, tell me as much as possible about your hardware and software configuration, exactly what you were doing when you got the error, and what the message is. Copies of the log files log.txt, err.txt, and fileslist.lst, would help as well. These files can be found in the directory containing LDBkup.cmd.

Another cool feature about LDBkup is that it supports networks. You can choose to backup to a local drive or to remote drive. For example, I have one workstation containing three super-fast 120 GB hard drives linked together as one huge LVM drive. LDBkup backs up to that monster drive without a problem.

Features

  1. Backs logical hard drives > 2 Gigabytes;
  2. There is no artificial limit to the size of logical hard drives it will handle.
  3. Backs up multiple hard drives in a single session.
  4. Easy-to-use command line interface.
  5. Easily customizable using environment variables.
  6. Backs up to remote any workstation on a LAN.
  7. Uses RAR's proprietary "solid" mode to produce very compact archives.
  8. LDBkup uses a RAR feature to produce multi-part archives; that is, archives for large logical drives will consist of several files, each of which is less than 2GB. This results in archive files that do not require any special handling.

Installation

Installation is very simple. Just unzip the archive into the same directory containing RAR.This directory can be any directory you choose. You also need to rename the file named RAR32.exe to RAR.exe. LDBkup is delivered as four files: LDBkup.cmd, LDBkup1.cmd, GettingStarted.txt (for the impatient among us), and LDBkup.html (the file you're reading now and sometimes referred to as "the manual".

LDBkup.cmd defines two values that the main program--LDBkup--needs to know about. They are:

  1. The program (or, home) directory, and
  2. The output directory to which the archives will be written.

You will probably want to change these to something more suitable to your system configuration. Simply change the values to match your program directory and the directory where you want the archives to go. Be sure not to change any lines other than the one listed above.

Important Note: If you wish to put the archives on a drive on the same system from which you are running the backup, simply set LD_Output to "\\" followed by the server name (this is usually the same as the host name) of your system, followed by "\" and the share name of the drive where you want the archives to go. You can learn the values of both resource name and the share name by using the "Peer Workstation" utility, and clicking on the "Connections" tab, and then on the "Create Connection" button. This utility is located in the "Network Utilities" folder, which in turn is located in the "Local Network" folder on your Desktop. (On some versions of OS/2 or eCS, this utility may be called "Sharing and Connecting", "Shared Resources and Network Connections" or something similar.)

Example: \\BackupComputer\CDrive

Networking Note

I have a fair size LAN at home where I work. It consists of 6 workstations, a cable modem, a router, a switch, a hub, a print server, and a laser printer. My main desktop is connected directly to the router; however many of the other workstations are connected to a switch or a hub which is an uplink from the router.

When I first started developing LDBkup, I discovered that often when attempting a back up to the remote workstation I was using, RAR would crash (i.e. trap) with a network error. (I believe the error message reported the crash as occurring in NetBios). After trying all manner of things, I eventually tried replacing the NetBios protocol with NetBios over TCP/IP in both machines. Voila! everything now worked. I have since replaced the NetBios protocol with NetBios over TCP/IP in all my machines, and no longer experience this problem.

I recently discussed this problem with Ken Kirchner, VOICE's System Administrator, author of eBayWatch/2, VOICE's system administrator, network guru, and all-around nice guy. He asked me what network cards I was using. When I told him that I had 10/100 Belkin cards which use the Realtek 8139/8130/810x chip sets with the latest driver (Jan 2003), he told me that this chip set works great with TCP/IP, but when used with NetBios under heavy load, it can cause traps. (Ken suspects it's actually the driver that's at fault, but this hasn't been confirmed.). My solution works because NetBios over TCP/IP is an emulated NetBios that uses the TCP/IP transport protocols.

So, if you run into that problem, you have two possible solutions: change your NIC's or replace the NetBios protocols.

Unfortunately, changing the protocols is sometimes not easy, because the MPTS tool only does part of the job. Here are some pointers based on my experience with my machines:

Once you've configured your system that way, things should work properly. However, as always, your mileage may vary. You are welcome to email me if you have problems, and I'll see what I can do to help.


    Instructions
    1. I have expended considerable effort making LDBkup easy to use. Here's how to use it:
      1. LDBkup is called from an OS/2 command line. The syntax is:
        1. LDBkup Type L1: L2: L3: .....
        2. where
          1. Type is the type of backup. The only valid types at this time are FULL and DIFF.
          2. L1, L2, ... are logical disk drive letters.
          3. Each drive letter must be followed by a colon.
          4. Examples:
            1) LDBkup DIFF C: L: G: D:
            a) For each drive shown, LDBkup backs up every file that has the Archive flag set on.
            b) The archive flags are reset for each drive when the backup for a drive is completed successfully.
            2) LDBkup full e:
            a) LDBkup performs a simple full backup on drive e:
            b) The archive flags are reset for each drive when the backup for that drive is completed successfully.
      2. Notes:
        1. Parameters are case insensitive.
        2. Legitimate Types are FULL and DIFF.
        3. The type and at least one drive letter (followed by a colon) are required. You can specify drive letters according to your needs. They can be in any order, and you can specify as many as you like. (Of course there are only 24 letters available for logical hard drives.)

Limitations

  1. At this time, there is no restore feature in LDBkup. Restoring has to be done using RAR with its standard restore function. I have been negotiating with the author of ZipCntrl to get the next release of ZipCntrl to support RAR. When/if that happens, then restores can be done using ZipCntrl. If there are enough requests (and if I can find the time!), I will try to add a simple restore feature to LDBkup.
  2. At this time, LDBkup only backs up to a remote system. It is fairly easy to add support for backing up to a local hard drive, so I will probably do that shortly.
  3. Currently, LDBkup only produces the proprietary RAR "solid" archives. Although these files are very compact, it takes longer to back up using the solid method, and solid archives are, of course, not compatible with other archives. If there is enough demand, I will add support for a variety of formats.
  4. RAR, and therefore LDBkup, does not back up the extended attributes of files that are in use (i.e. locked). Therefore it is best to boot to a maintenance partition when backing up the system drive. I will try to look into this problem and see if there is a way around it without modifying RAR, which of course I can't do.

Future Plans


    In addition to the ones discussed under "Limitations", here are some other ideas I have for LDBkup:
  1. Add support for running of LDBkup in a different directory from the one containing RAR.
  2. Add support for additional features in RAR such as selectable compression ratios and multiple archive formats.
  3. Add support for a LDBkup configuration file to make it easier to specify customization and other information.
  4. I would like to add some GUI support in the future, but that depends on how popular this program becomes. however I won't be able to do this anytime soon.

Requirements

  1. Any version of OS/2 or eCS equal to Warp 4 or eCS 1.0 or higher, although it has only been tested with eCS 1.1. As it comes "out of the box", Warp 3 has relatively limited networking capabilities. LDBkup might work with Warp 3 with some tweaking, but this has not been tested.
  2. Workstation with a large hard drive that supports long file names to hold the archives.
  3. Fast processor, say 1 GHz or more, to handle the high compression ratio in a reasonable amount of time.
  4. It's advisable that the latest patches and fixpaks be applied to the LVM, JFS (if used), and the networking (esp. Peer) components of your system.

Support

  1. As stated below, this program is presented to the eCS-OS/2 community on an as is basis with no guarantee it will work on your system.

  2. I freely admit there may be bugs in this program. Please report them to me with as much information as possible about your hardware and software configuration. Sending the logs (log.txt and err.txt in the home directory) would also be a help. Also please be nice when you report them. :-) Reports containing sarcasm, swearing, etc. will probably be trashed.

  3. Suggestions for enhancements or new features are also welcome. If I think they are worth doing, I will include them in future releases as my limited time permits. :-)

Acknowledgements

  1. I have already mentioned my indebtedness to Eugene Roshal and his RAR program, without which this program wouldn't exist at all and to Ken Kirchner for his help in overcoming a major networking problem.

  2. However, I should also mention my indebtness to Alex Taylor for giving me the initial idea that lies at the heart of this project. Alex is on the eComStation development team, and an all around great guy. You can see some of his other contributions to the eCS/OS2 community on his web site.

  3. Finally I should also thank my very good friend John Edwards for his almost endless patience with me whenever I attempt anything like this. Thanks John!

Licence

LDBkup is released as "copyright freeware". You are granted a
license to use this program freely, but the copyrights to the program
and program code remain with the author. Distribution is allowed, as
long as there is no more than a token copying or distribution fee
charged. This program may not be released as part of any commercial
software program, suite or compilation.

THERE ARE NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.

IF THERE ARE ANY RESTRICTIONS OF EXCLUSIONS OF IMPLIED LIABILITY IN YOUR JURISDICTION, YOUR LICENSE TO USE THIS PROGRAM IS HEREBY REVOKED.

Walter F. Metcalf
walter.os2@rogers.com
2 November 2004