
                  +----------------------------------------+
                  |                                        |
                  |            Partition saving            |
                  |                                        |
                  |    http://www.partition-saving.com     |
                  |  Copyright (c) 1999-2006 D. Guibouret  |
                  +----------------------------------------+

                                    Manual

Table of contents 
-----------------

  1- Preface 
  2- Introduction 
  3- System Requirements 
  4- Interface features/functions 
     a) Textual windows interface 
     b) Command line interface 
  5- Using the program 
  6- Saving an element 
     a) Support choice: 
     b) Source element choice: 
     c) Part to save: 
     d) Swap files directory: 
     e) File choice: 
     f) File size choice: 
     g) Compression choice: 
     h) Saving window: 
     i) Options file creation: 
     j) Examples: 
  7- Restoring an element 
     a) Backup file choice: 
     b) Destination element choice: 
     c) Restoring window: 
     d) Examples: 
  8- Copying an element 
     a) Support choice: 
     b) Source element choice: 
     c) Part to save: 
     d) Destination element choice: 
     e) Copying window: 
     f) Examples: 
  9- Copying a backup file 
 10- Verifying a backup file 
 11- Updating Windows 2000/XP registry 
     a) Support choice where Windows is installed: 
     b) Element choice where Windows is installed: 
     c) Directory where Windows is installed: 
     d) Disk choice where partition to update is: 
     e) Partition to update choice: 
     f) Drive letter of partition to update: 
     g) Confirmation: 
     h) Example: 
 12- Updating BOOTSECT.DOS file 
     a) Support choice where BOOTSECT.DOS file is: 
     b) Element choice where BOOTSECT.DOS file is: 
     c) Confirmation: 
 13- Simulating an element 
     a) Use of driver: 
     b) Simulating an element: 
     c) Remarks: 
 14- Creation of files on NTFS drive 
 15- Reset bad sectors in filesystem 
     a) Support choice where bad sectors shall be removed: 
     b) Element choice where bad sectors shall be removed: 
     c) Confirmation: 
     d) Execution: 
 16- Options file contents 
 17- Mounting a partition 
 18- Notes on what elements can be saved 
     a) The complete disk: 
     b) The Master Boot Record (MBR): 
     c) First sectors of disk: 
     d) Partition table: 
     e) Partitions (all sectors): 
     f) Partitions (only occupied sectors): 
     g) FAT (12, 16 and 32) partitions (DOS/Windows): 
     h) Ext2fs/ext3fs partitions (Linux): 
     i) NTFS partitions: 
     j) Floppy disks: 
     k) DOS devices: 
 19- What is not supported 
 20- What could not be tested 
 21- Acknowledgments 


1- Preface 
----------

This program may be copied and freely redistributed. It may not be sold in any
way, either alone or included in another program. All that is in this package 
must be kept together in its original form. 

This program is offered as-is without any guarantee. No pursuit can be engaged
against its author in case of damages due to this program. 

All remarks are welcome. 


2- Introduction 
---------------

The goal of this program is to achieve saving, restoring and copying of disk 
elements (whole disks, Master Boot Records, partition tables, partitions). 
This permits saving hard disk contents to restore it later in case of a 
problem, without losing time reinstalling and reconfiguring software. 
This program allows running the following tasks: 

  - saving an element (hard disk, partition, floppy disk, device).
  - restoring an element that was saved before.
  - copying an element.
  - copying a backup file created by this program, modifying its size or 
    compression rate.
  - verifying created files.
  - updating partition definition in Windows 2000/XP registry.
  - updating BOOTSECT.DOS file.
  - simulating elements with created files.
  - creating files on a NTFS drive under Windows for use in saving.
  - cancelling bad sectors information of a filesystem.

For detailed information about partitioning and this program, please read 
additional information. 


3- System Requirements 
----------------------

Hardware: 

  - 386 or better.
  - 4 Mb of memory (could work with less, but data compression might not 
    work). Free DOS memory must be at least 300 Kb.

Software: 

  - DOS (version >= 3.3).

This program does not work under Windows (see additional information) and 
using it with an emulator is not recommended(especially if it runs in a 
multitasking environment). 
You will need also a FAT or NTFS partition (or any other filesystem for which 
you have a DOS driver that allows access to it) to create backup file (this is
not needed if you merely want to copy a partition, since no file is created). 


4- Interface features/functions 
-------------------------------

Two interface types are available: 

  - a textual windows interface that presents information in windows that can 
    be navigated with the keyboard or mouse.
  - a command-line interface that presents information in a basic way and can 
    be used only with the keyboard.

The default interface is the first one. The second one is here to resolve some
incompatibility issues on some computers. 
To decide which interface to choose, please read chapter 5. 

  a) Textual windows interface

Interface can be used with keyboard or mouse. Keys common to all windows are: 

  - Tab, bottom arrow or right arrow to go from one item to another inside a 
    window.
  - Shift+Tab, up arrow or left arrow to go from one item to another inside a 
    window (in reverse order compared to Tab).
  - Ctrl+Tab to go from one window to another.
  - Alt+Tab to go from one window to another (in reverse order compared to 
    Ctrl+Tab).
  - Key assignments are defined to associate moving keys to a combination of 
    keys using the Control key: 

                           +-------------+-------------+
                           | Moving keys | Combination |
                           +-------------+-------------+
                           | Home        | Ctrl+B      |
                           | End         | Ctrl+E      |
                           | Down        | Ctrl+D      |
                           | Up          | Ctrl+U      |
                           | Right       | Ctrl+R      |
                           | Left        | Ctrl+L      |
                           | Page Down   | Ctrl+N      |
                           | Page Up     | Ctrl+P      |
                           | BackSpace   | Ctrl+H      |
                           | Delete      | Ctrl+X      |
                           | Insert      | Ctrl+Y      |
                           | Return      | Ctrl+M      |
                           | Tab         | Ctrl+F      |
                           | Shift+Tab   | Ctrl+G      |
                           | Alt+Tab     | Ctrl+V      |
                           | Ctrl+Tab    | Ctrl+W      |
                           +-------------+-------------+

If no item seems to be selected, press one of these keys to select first or 
last one. 
In general, Enter key activates Ok button (if no other button is selected) and
Escape key activates Cancel button. 
Various features of windows are presented below: 

  - Command buttons: to activate them, you have to press Enter key when they 
    are selected, or press Alt+<red letter in button name> (even if button is 
    not selected). 
    You can also activate them by clicking on them. 
    A button is selected if it has a black background and is flanked by ">" 
    and "<", otherwise it has a green background. 
  - Entry lines: this is an item that permits entering data. Just press a key 
    to add the character where the cursor is. Delete and BackSpace keys are 
    used to erase characters (respectively, character that cursor is on, and 
    character before cursor). Right and left arrows are used to move cursor 
    and Home and End keys are used to go to begin or end of string. Holding 
    down the shift key while using moving keys will select text that will be 
    erased when you will press a key other than the moving one. By pressing 
    Ctrl+A you select all the text. 
    Finally, Insert key is used to switch from insert mode (default mode: 
    cursor is underlined cursor) to replacement mode (cursor is block-cursor) 
    and back again. 
    With the mouse, you can move the cursor by clicking where you want it to 
    be, scroll the text by clicking on arrow on left or on right, select the 
    text by keeping button pressed when moving mouse and select all the text 
    by double clicking on it. 
    An entry line is selected when it has the cursor that appears in it. 
  - Listboxes: they are used to choose an item from a list. Up and bottom 
    arrows are used to move from one item to another, Page-Up and Page-Down 
    keys are used to go to begin and end of list. 
    If right column is a different color and contains a # character, it is 
    because all elements cannot be seen and the # character is used to locate 
    the currently selected item in the list. 
    If last line is a different color and contains a # character it is because
    there were some columns that cannot be seen and the # character is used to
    locate columns that are displayed. 
    With the mouse, you can select an element. If scroll bar appears on right,
    you can change list position by clicking where you want to be, or by 
    clicking arrows on up or bottom. By double clicking on selected element 
    you will activate command associated to the list (generally Ok button). 
    A selected item has a grey background if its listbox is not selected, and 
    has a black background if its listbox is selected. 
  - Checkboxes: these items allows activating/deactivating an option. To 
    change the state of a checkbox, click on it or press Space key when it is 
    selected. A checkbox is activated when an 'X' appears between square 
    brackets, it is deactivated otherwise. 
    A checkbox is selected when its text is white, is not selected when its 
    text is grey. 
  - Directory trees: this item allows selecting a directory on a partition. It
    functions similarly to a listbox. The first line ("\") is the root 
    directory of the partition, subsequent lines are directories on this 
    partition displayed with a tree view in alphabetic order. Directories that
    have "+- " before their name have some sub-directories that could be 
    displayed by selecting this directory and pressing '+' key or by clicking 
    the "+" before name. Directories that have their sub-directories displayed
    and that have "-- " before their name could be collapsed by selecting this
    directory and pressing '-' key or by clicking the first "-". 
    Example: 
    \
    -- displayed sub-directories
    |  |- sub-directory 1
    |  `- sub-directory 2
    |- no sub-directory
    +- sub-directories not displayed
    `- terminal directory

  b) Command line interface
This interface is more basic and can only be used with the keyboard. Pressing 
the Escape key at any time stops execution of the program. 
Various features are: 

  - Lists: a list is displayed with numbers on the left. Enter the item number
    when you are asked to choose. If the list is bigger than screen size, you 
    will have to press a key to scroll. 
  - Entering information: you must enter the required information (for example
    a filename). Delete key allows removing last character (what you have 
    already entered is displayed on next line without the last character and 
    you can continue to enter characters). It is not possible to move the 
    cursor. 
  - Choices: they have the form of a question with possible responses given in
    parentheses (sample: (Y/N)). You must answer by selecting from these 
    choices. It is not case-sensitive. 


5- Using the program 
--------------------

Usage: savepart.exe [-l en|fr|fr_2] [-cm|-nm|-pm] [-f <options file>] [-ncd] 
[-nvd] [-nvf] [-cui|-tui|-bui] [-b|-c|-d|-i|-m|-n|-r|-s|-t|-u|-z] 

  -l: this option allows you to select which language to use. You only have to
use this option if the automatically recognised language is not correct. If an
error occurs before this option is analysed, the error message will be written
with the automatically detected language. Recognised languages are: 

    * en: English.
    * fr: French.
    * fr_2: French with others code pages.

Detection of language sets language to French when detecting France, French 
Canada, French Guyana, French Antilles or French Polynesia settings, otherwise
it is set to English. 
fr_2 is to be used in case accents are not well displayed. I don't know for 
which setting it was (and I am not sure there was a DOS setting for it), it is
accents as Windows and Linux code them (ANSI). I put it in in case it is 
needed (if somebody uses it, please tell me with which configuration) and is 
not automatically detected. 

  -cm: this option is the default way the mouse is utilised. 

  -pm: this option is another way to utilise the mouse that can be used in 
case the first one does not work (it is default method with Windows NT/XP). 
Using this method may prevent detecting some double clicks. 

  -nm: this option disables the mouse. You would have to use it only if mouse 
use seems to pose a problem with 2 previous methods. 

  -f <options file>: this option allows you to use batch mode. To understand 
the contents of this file, please read chapter 16. 

  -ncd: this option disables the check that created/read file is not on 
saved/restored element. It is generally recommended only if DOS drive letter 
attribution is wrong. 

  -nvd: this option disables the check that sectors are correctly written. 
This speeds up restoring, but may prevent detecting bad sectors on the disk. 

  -nvf: this option disables the check that files are correctly written and 
that sectors are correctly written when using DOS devices access. This speeds 
up saving (and/or restoring), but created files or restored devices may be 
incorrect because the disk where they are written is damaged. 

  -cui|-tui|-bui: this option allows you to select the user interface: 

    * -cui: command line interface.
    * -tui: textual window interface.
    * -bui: textual window interface using BIOS calls to write on the screen. 
      This ensures better compatibility but goes slower.

If this option is not given, textual window interface is used. This option has
to be used only if this interface poses a problem (for example nothing appears
when the program begins). In this case, you can first try the -bui option, and
if it still does not work, use the -cui one. 

  -b|-c|-d|-i|-m|-n|-r|-s|-t|-u|-z: this option allows selecting which action 
to do: 

    * -b: update BOOTSECT.DOS file.
    * -c: copy an element.
    * -d: copy files created by this program to modify the compression rate or
      maximum size.
    * -i: get information from driver.
    * -m: simulate an element with backup files.
    * -n: create files on NTFS partition when you are running from Windows NT,
      2000 or XP.
    * -r: restore an element.
    * -s: save an element.
    * -t: verify a backup file.
    * -u: update Windows 2000/XP registry.
    * -z: cancelling bad sectors information of a filesystem.

If none of these options are given, the program asks what you want to do. For 
information about each action, please read subsequent chapters. 

Return code of program can be one of the following: 

  - 0 if no error has been detected.
  - 1 if en error has appeared.
  - 2 if user cancels execution.
  - 3 if no error has been detected, but there were some bad sectors.
  - 255 if some exception has been raised.

Remarks: 
--------

  - -f <option file> cannot be used when copying a partition or files.
  - copying or checking file can be executed under Windows (in this case it 
    will certainly run faster than with DOS).


6- Saving an element 
--------------------

This is the part executed when you use the -s option or select it when the 
program asks you. 

Execution follows the diagram below (if not in batch mode): 
            Support choice
                  |
                  V
        Source element choice
                  |
                  V
            [Part to save]
                  |
                  V
        [Swap files directory]
                  |<------------------------+---+
                  V                         |   |
             File choice                    |   |
                  |                         |   |
                  V                         |   |
           File size choice                 |   |
                  +-------------------------+   |
                  V                             |
          [Compression choice]                  |
                  |                             |
                  V                             |
            Saving window                       |
                  +-----------------------------+
                  V
        Options file creation
                  |
                  V
                 end


  a) Support choice: 
You have to choose the disk, floppy drive or DOS device where the element to 
be saved is located. 
Disk access modes are: 

  - standard access: with this access mode disk is accessed with its physical 
    definition (cylinder, sector, head). With this access mode sector size 
    cannot been known (it is assumed to be 512 bytes which is most common 
    value) and disk size is at most of 8 Gb.
  - extended access: this is a new access mode, which has become the standard 
    one. In this case the hard disk is seen as a unique track (it does not 
    care about physical definition). This mode allows use of more than 8 Gb 
    hard disk. Nevertheless size reported can be wrong (without any 
    consequence). Sector size can be different from 512 bytes (but this value 
    is still the most common).

For floppy drive, access is always standard access and for DOS devices it 
appears as extended for Partition Saving, but as it is the DOS driver that 
accesses the device, it is this last one that choose access mode. 

  b) Source element choice: 
This window allows you to select what part of the disk to save. 
Support tells you whether the element is directly related to the disk or to a 
partition. In the case of a partition, support is specifies whether it is a 
main partition or if it is a partition defined in the extended partition. 
Partition number is the number as given under Linux. 
Drive name is the DOS drive name that corresponds to the partition (if it is a
DOS partition). This can be wrong because some new partition type can be 
defined (for example with Windows95, several new partition types have been 
defined for VFAT16 and FAT32 partitions). 
In the case of an element related to the disk, element type identifies the 
element: it can be the whole disk, the master boot record (first sector of 
disk), sectors that are before first partition and partition table. In the 
case of an element related to partition, element type is partition type: this 
is used to identify the OS installed on it. As this type is not normalised, 
the list is not exhaustive. 
Size gives element size. By default, it is expressed in Mb, except in cases 
where it is followed by Kb. 
Partition name is the label (or volume name). It is given when it can be 
found. If, for a DOS drive, there seems to be incoherence between drive letter
and partition name, this last one is certainly correct and drive letter wrong.
For floppy drive, this window does not appear. 
For DOS devices, you can choose the device to save from the list given you 
which DOS understands as having a sector access and having a FAT filesystem. 

Remark: 
-------

  - If you save a main partition of extended type, you will save all 
    partitions defined inside this extended partition (all that have "Extended
    n <extended partition chosen>" as support).
  - If you have only one partition with type 42 (dynamic disk) or 8e (Linux 
    LVM), disk is used with new dynamic partition scheme that is not supported
    by Partition Saving, so you cannot save it.
  - If you have a partition with type 44 (GoBack), it is because you use 
    Norton GoBack that has its own partition mechanism. You have to deactivate
    it in order to be able to save a partition.

  c) Part to save:  
This window only appears if chosen partition is of a type which permits saving
only occupied sectors. In this case, it proposes the following choices: 

  - "All sectors": With this choice, all sectors of the partition are saved 
    without considering if they are occupied or not. This makes saving need 
    more space than in following choices, but allows saving a partition even 
    if it is heavily damaged (for example, to save it before trying some 
    radical way to repair it). Constraints are that this partition can only be
    restored onto a partition with the same format (hard disk must have the 
    same size and physical definition, and partition must have the same size 
    and be at the same place).
  - "Occupied sectors": with this choice, only occupied sectors are saved. 
    This has the advantage that saving need less space and allows restoring 
    this partition onto a different partition (it can be on another disk, at 
    another place and have another size), but there are still some size 
    constraints. Disadvantages are that it needs more memory and saving can 
    fail if your partition is damaged (for example, if important sectors are 
    damaged).
  - "Element on itself": this choice appears for FAT, NTFS and ext2 
    partitions. It is the same as preceding choice but allows creating a 
    backup file on the saved partition (which must NOT be done for the 2 
    previous choices). You can choose this option for NTFS and ext2 partition 
    only if you use the internal program feature to access NTFS and ext2 
    partitions (by using partition mounting), not if you have another way to 
    access NTFS and ext2 partitions. If you choose this option, partition is 
    automatically mounted to be able to access it if that is not already the 
    case. Constraints are that it needs more memory, and you will have to do a
    scandisk on the restored partition (after having restarted your computer) 
    to correct some potential errors on the size of created files (those you 
    have used for restoration are correct, those on the restored partition are
    not). For FAT16, FAT32, NTFS and ext2 partitions, this check is 
    automatically activated the next time you boot. For FAT12 partitions, you 
    have to do the check by yourself. 
    For FAT and ext2 partition it is better to not overwritte an existing file
    because it could lead to more errors than creating new files. For NTFS 
    partition there is no such constraint (moreover there is no choice).
  - "Element without swap files": this choice appears only for FAT and NTFS 
    partitions. With this choice only occupied sectors are saved and the swap 
    files contents are not saved (Windows will reset them at first boot after 
    doing restoration). Swap files could be "win386.swp", "pagefile.sys" and 
    "hiberfil.sys" on a FAT partition and "pagefile.sys" and "hiberfil.sys" on
    a NTFS partition. This option allows reducing backup file size, but need 
    more memory than saving occupied sectors only.
  - "Element on itself without swap files": this choice is a combination of 
    the two previous choices.

If partition to save is not a partition for which saving only occupied sectors
is available or if you have chosen an element that is related to disk, this 
window will not appear and all sectors will be saved. 
To have more information on saving only occupied sectors, please read chapter 
18. 

Remark: 
-------

  - a window informing you of searching for last occupied sector is displayed 
    between maximum filesize choice and saving window. If you chose one of the
    two options where only occupied sectors are saved, this window might be 
    displayed for a long time. If you save all sectors, you will certainly not
    see it because it is displayed too briefly.

  d) Swap files directory: 
This window appears only if you chose "Element without swap files" or "Element
on itself without swap files" option in the previous window. It allows telling
the program which directory contains the swap files. In addition to the 
directory you choose here, the program also searches for them in the root 
directory (you could obviously give the root directory here also). As a 
general rule, swap files are either in the root directory or in the Windows 
directory. To select the directory you have to go into the tree (with 
displaying subdirectories of a directory by pressing the '+' key when it is 
selected if necessary) until you reach it, then press Enter or click the Ok 
button. 

  e) File choice: 
In this window you can choose the name and location of the file in which to 
save partition data. For this purpose you can type into "File" line the name 
of the file (with possibly its path) or select one from the files list or 
select another directory with drives and directories lists. By default "*.*" 
is displayed which means that all files are shown. 
A second window gives you the option to use automatic naming or to mount a 
partition. With automatic naming, the program will generate a file names 
automatically for following files if several files are needed. To accomplish 
this purpose, the program uses the first filename and changes (or adds) the 
two last characters of file extension (last three if more than 100 files are 
needed) by file number (with using 0 for number of first file). For example if
your first file is called "disk_c.par", the second one will be "disk_c.p01", 
the third "disk_c.p02", ..., the hundred and first "disk_c.100". Mounting a 
partition allows you to access a partition that could not be used by DOS, such
as an NTFS partition you want to write a backup file on. For have more details
on mounting a partition, please read chapter 17. 
A third window gives you the list of DOS drives with free space and the full 
size of the partition (without taking into account the fact that only occupied
sectors might be saved and whether compression is used). 

Remarks: 
--------

  - If a drive does not appear in the drives list, it is because it can't be 
    detected. Nevertheless, you can enter its letter into the file name line 
    (in which case the drive list would not give the right name, but there is 
    no consequence).
  - if the selected file already exists, a window is opened to confirm 
    selection (if file is read-only, the window will inform you that it cannot
    be removed).
  - if you save a whole disk, a FAT or NTFS partition, you should NOT create 
    the file on the disk or partition you save unless you chose "Element on 
    itself" or "Element on itself without swap files" option in the saving 
    window. If you have not chosen this option and try to create a file on the
    partition to be saved, a warning window informs you of this potential 
    problem. It is not displayed if you used the "-ncd" option.
  - when using automatic naming, file existence is not checked except for the 
    first file, so files will be removed if they exist (for example, avoid 
    calling the first file <name>.<letter>01 because it will be erased when 
    creating second one).

  f) File size choice: 
This window permits you to choose the maximum size you want for the file. If 
more space is needed to save the element, a new file will be asked of you when
this one is full. If free space on the drive is less than 10 Mb, asked size is
in kb, else it is in Mb. This maximum size cannot be bigger than drive free 
space or 2047 Mb, whichever is smaller. 
If you enter 0, you go back to the file choice window. 

  g) Compression choice: 
If you have enough memory, a window asks which compression level you want to 
use to compress data. The level goes from 0 (no compression) to 9 (maximum 
compression). Level generally used by the compression routine is level 6. The 
higher the compression level, the longer the execution time will be (but only 
a small change when expanding). 
If you do not have enough memory, a window will inform you of this. In this 
case no compression is done (<=> 0 level). 
This window will be displayed only for the first file (for subsequent files 
the same compression rate is used). 
The compression algorithm used is the gzip algorithm. 

  h) Saving window: 
This window shows the backup progress. 
The upper progress bar shows progress for element being saved. The lower 
progress bar shows progress for file in relation to its maximum size. 
Consequently, it is not unusual for this progress to not reach 100% when 
saving ends. 
Remaining time is an estimate of remaining time. Its accuracy is strongly 
influenced by compression, or saving of only occupied sectors. 
Errors list is the list of errors detected when reading sectors on the disk. 
If you have the same errors when restoring and if, when you use a disk 
checking program (like surface checking with scandisk), bad sectors appear, 
these errors have no consequence (if there was no data on these sectors before
saving, but that is a rule of the OS). 
If the maximum file size you have given is not enough to save the entire 
element (progress bar for file reaches 100%), a new file name is asked of you 
with a new maximum size (if you use automatic naming, this happens 
automatically, with the same maximum size as the first file). 
While saving is running, you cannot activate the Ok button (only cancel button
can be activated to stop saving). When saving is finished, the Ok button 
becomes active, the cancel button inactive, and line marked "State" changes 
from "Running ..." to "Ended.". 

  i) Options file creation:  
If you do not use batch mode (or if some options have been added to those 
given in batch mode), a window will ask you if you want to create an options 
file that will allow you to use batch mode for future save/restore of this 
partition. If you answer "yes", a window will ask you to give its name. This 
file will contain all the options you have used. 

Remarks: 
--------

  - The contents of this file remain valid only as long as you do not change 
    the partitioning of your hard disk.
  - The names of files used to save data are absolute path names. 
    Consequently, if you move these backup files, you will have to modify this
    options file.
  - You can create this file manually.
  - The DOS naming convention (8.3: 8 characters maximum for file name and 3 
    characters maximum for extension) must be used for file names in the 
    options file.

  j) Examples: 
Suppose you have 2 hard drives partitioned as described below (next to 
partition type are <DOS>|<Linux> drive names): 

                   Disk 1                             Disk 2
     +-------------------------------+  +-------------------------------+
     | Main partition 1:             |  | Main partition 1:             |
     | DOS FAT 32          (C:|hda1) |  | DOS FAT 32          (D:|hdb1) |
     +-------------------------------+  |                               |
     | Main partition 2:             |  +-------------------------------+
     | DOS extended        (  |hda2) |  | Main partition 2:             |
     | +---------------------------+ |  | DOS extended        (  |hdb2) |
     | | Extended partition 1 of   | |  | +---------------------------+ |
     | | main partition 2:         | |  | | Extended partition 1 of   | |
     | | DOS FAT 32      (E:|hda5) | |  | | main partition 2:         | |
     | +---------------------------+ |  | | DOS FAT 32      (G:|hdb5) | |
     | | Extended partition 2 of   | |  | |                           | |
     | | main partition 2:         | |  | +---------------------------+ |
     | | DOS VFAT 16     (F:|hda6) | |  +-------------------------------+
     | +---------------------------+ |  | Main partition 3:             |
     +-------------------------------+  | Empty               (  |hdb3) |
     | Main partition 3:             |  |                               |
     | Linux ext2          (  |hda3) |  +-------------------------------+
     +-------------------------------+  | Main partition 4:             |
     | Main partition 4:             |  | Linux swap          (  |hdb4) |
     | Empty               (  |hda4) |  |                               |
     +-------------------------------+  +-------------------------------+

If you want to save the partition containing the D: drive, you execute 
savepart.exe -s, then: 

  - choose the second disk,
  - select the first partition,
  - choose to save all sectors or only occupied ones (this second option will 
    require less space),
  - choose to compress file or not,
  - choose path and file name to create (taking into account free space on the
    various drives, but preferably a drive on the first disk so the savings 
    will go faster, hence on C:, E: or F:), for example c:\disk_d.par.
  - if you want to burn the file on a CD you will have to choose a maximum 
    file size of 620 Mb.

From this point, saving proceeds. If 620 Mb is not enough to store all data, 
you will have to give a path and file name for a second file, then its maximum
size, etc. Once saving ends, you can decide to create the batch file or not. 
If you create a batch file and burn files onto CD, put the batch file with the
first backup file and don't forget to change the path of the backup file in 
the batch file. 

If you want to save the Linux partition, you must: 

  - select the first disk,
  - choose the third partition

and then continue as in previous example (since the Linux partition is on the 
first disk, it is better to create the backup file on the second disk). 


7- Restoring an element 
-----------------------

This is the part that is executed when you use the -r option or select it when
the program asks you. 

Execution follows the diagram below (if not in batch mode): 
             Backup file choice
                  |
                  V
      Destination element choice
                  |<------------------------------+
                  V                               |
           Restoring window                       |
                  +-----> Backup file choice -----+
                  V
                 end


  a) Backup file choice: 
This is the same window as the one used for file choice when saving. The 
selected file header is verified and an error is displayed if it is incorrect.
Automatic naming can be selected for subsequent filenames to be generated 
automatically (filenames must follow rule described in chapter 6.e). You could
also mount a partition if the backup file is on a partition that DOS is not 
able to access. 

  b) Destination element choice: 
This windows gives a list of elements that are compatible with what is saved 
in the file. You must choose one of the elements in this list to do a 
restoration. 
At the top of the window is a description of the saved element. Below is the 
list of compatible elements. 
"Dis" column gives disk number on which element is located. 
"Support" column gives support type on which element is located. 
"Num" column is the partition number as it is known with Linux, if the element
is a partition. 
"L." column gives DOS drive letter of the element, if it is a DOS partition. 
"Id." column indicates whether an element is identical to the one saved. If 
so, an "X" will appear in this column, otherwise it is empty. 
"Size" gives element size. By default, it is expressed in Mb, unless it is 
followed by Kb. 
Partition name is the label (or volume name). It is given when it can be 
found. If for DOS drive, there seems to be incoherence between drive letter 
and partition name, this last one is certainly correct and drive letter wrong.
For more details on element compatibility, please read chapter 18. 
If no compatible element is found, a message tells you this and the program 
ends. 

!!!!! Warning !!!!!:  
--------------------
Restoring erases all data currently present on the chosen element. 
Moreover, you must NOT choose the disk (when restoring a whole disk) or the 
partition on which the file used for this restoration is located (indeed it 
would be erased during restoration and thus would no longer be accessible, 
causing an error and stopping the restoration).
A warning window informs you if the selected file is located on the disk or 
partition to be restored. This window is only displayed for the first file 
(for subsequent files, you must NOT access the disk or partition you are 
restoring) and is not displayed if you used the "-ncd" option. 

  c) Restoring window: 
This window permits you to watch the restoration progress. 
The upper progress bar shows file progress. 
The lower progress bar progress for the chosen element. 
Remaining time is an estimate of remaining time. Its accuracy is strongly 
influenced compression, or saving of only occupied sectors. 
Errors list contains list of errors that were detected when writing sectors on
disk. If errors are the same as those on saving, there is no consequence (if 
they are not the same, or if they are fewer or more, you can have lost data: 
run a program like scandisk to try to resolve this problem). 
If the element has been saved into several files, you must give them when they
are asked of you. 
While restoring is running, you cannot activate Ok button (only cancel button 
can be activated to stop restoring). When restoring is finished, Ok button 
becomes active, cancel button inactive, and line marked "State" changes from 
"Running ..." to "Ended.". 

!!!!! Warning !!!!!: 
--------------------

  - When choosing subsequent files, you must not access the drive 
    corresponding to the disk or partition being restored (if it is a DOS 
    partition). Indeed this drive is being written and so the file allocation 
    table is wrong (as if you want to access a file when a drive is being 
    formatted).
  - Once the element is restored, restart your computer if you have restored a
    DOS partition (or a partition that can be accessed under DOS). This is 
    needed for DOS to update information about this partition.
  - If you cancel a running restoration, you must reformat the destination 
    element (or do a new restoration).
  - If when saving, you had created the backup file on the saved partition, 
    after having restarted your computer you have to run scandisk on the 
    restored partition to remove errors on the size of the backup file. This 
    check is now needed only for FAT12 partitions (for FAT16 and FAT32 
    partitions, this check is automatically enabled and it is not needed for 
    NTFS partitions).
  - If you restore a partition onto a partition other than the one that was 
    saved and you have Windows 2000 or XP, you have to update the registry for
    this partition. For this, please read chapter 11.
  - If the partition you restore is a system partition that is launched using 
    the Windows XP multiboot feature (but isn't the Windows XP partition) and 
    you restore this partition onto a partition other than the one that was 
    saved, you have to update the BOOTSECT.DOS file for this partition. For 
    this, please read chapter 12.
  - If the partition you restore is a system partition that is launched using 
    the Windows XP multiboot feature and you restore this partition onto a 
    partition other than the one that was saved, you have to update the 
    BOOT.INI file. For this, you have to boot with the Windows XP CDROM, use 
    console mode and use the bootcfg command.
  - If the partition you restore is a partition used with Linux and you 
    restore this partition onto a partition other than the one that was saved,
    you have to update the /etc/fstab file and the boot loader if it is a 
    system partition. For this you have to boot with the Linux CD, use the 
    rescue mode and update mount point and boot loader.

  d) Examples: 
Consider the same partitioning presented in the above examples for saving 
partitions, and now you want to restore the partitions previously saved. 
In the case of restoring the D: drive, you execute savepart -r and: 

  - choose the file name where D: was saved,
  - choose the partition that you want to restore. If you saved all sectors, 
    only partition that contains D: drive will be listed (if the 2 hard- 
    drives have the same format and C: and D: drives have the same size, C: 
    drive can be also listed). 
    If you have saved only occupied sectors, partitions containing C:, D:, E: 
    and G: drives might be listed depending on their size (partition 
    containing F: drive won't be listed because it doesn't have the same 
    filesystem type). In this case, the partition that contains D: drive will 
    have an "X" in the "Id." column but others won't (if the 2 hard drives 
    have the same format and C: and D: drives have the same size, C: drive can
    also have an "X").
  - once the partition is chosen, restoring begins. If saving was done into 
    several files, the second file will be asked for when the first one is 
    finished, etc.

Once restoring ends, reboot your computer for DOS to take into account 
modifications done onto the D: drive. 

If you want to restore the Linux partition, you do the same things as above. 
In this case only the third partition of the first disk will be listed as it 
is the only Linux partition (the Linux swap partition does not have the same 
filesystem). 


8- Copying an element 
---------------------

This is the part executed when you use the -c option or select it when the 
program asks you. 

Execution follows the diagram below: 
            Support choice
                  |
                  V
        Source element choice
                  |
                  V
            [Part to save]
                  |
                  V
      Destination element choice
                  |
                  V
            Copying window
                  |
                  V
                 end


  a) Support choice: 
Please refer to the same description in the "saving element" chapter (chapter 
6.a). 

  b) Source element choice: 
Please refer to the same description in the "saving element" chapter (chapter 
6.b). 

  c) Part to save: 
Please refer to the same description in the "saving element" chapter (chapter 
6.c). 

  d) Destination element choice: 
Please refer to the same description in the "restoring element" chapter 
(chapter 7.b) replacing all references to "file" by "element to copy". 

  e) Copying window: 
This window permits you to follow copying progress. 
Upper progress bar is progress for the element being copied. 
Lower progress bar is progress for the destination element. 
Remaining time is an estimate of remaining time. Its accuracy is strongly 
influenced by whether all sectors or only occupied sectors are copied. 
Errors list is the list of errors that were found when reading sectors on the 
element to be copied or when writing sectors on the destination element. If 
some errors appear, it is advisable to use scandisk or an equivalent program 
on the faulty element. 
As long as the copy is running, you cannot press Ok button (only cancel button
is active to stop copying). Once copying is finished, Ok button becomes 
active, cancel button inactive and line marked "State" changes from "Running 
..." to "Ended.". 

!!!!! Warning !!!!!: 
--------------------

  - Once the element is copied, restart your computer if you have restored a 
    DOS partition (or a partition that can be accessed under DOS). This is 
    needed for DOS to update information about this partition.
  - If you cancel a running copy, you must reformat the destination element 
    (or do a new copy or restoration on it).
  - Please read chapter 7.c remarks to know what shall be performed after copy
    in some cases.

  f) Examples: 
Take the same partitioning presented above in the examples of saving a 
partition, and now you want to copy the partition containing the D: drive onto
the partition containing the E: drive (assuming that size is compatible). 
For that purpose, you run savepart -c and: 

  - select the second hard drive,
  - select the first partition,
  - choose to copy only occupied sectors (for the copy to be possible on a 
    partition that has a different format from the original),
  - choose the destination partition. The partitions containing C:, E: and G: 
    drives will be listed if their size is compatible. Partition containing D:
    drive will not be listed, as it is the partition to be copied. Partition 
    containing F: drive will not be listed, since it does not have the same 
    filesystem type.

From this point, copying begins. Once this is ended, reboot your computer. 


9- Copying a backup file 
------------------------

This is the part executed when you use the -d option or select it when the 
program asks you. 

This part allows you copying files, modifying their compression rate or 
maximum size. 

Program begins with asking you the source filename (please read chapter 7.a), 
the name and maximum size of the destination file and its compression rate 
(please read chapters 6.e, 6.f and 6.g). The copying window displays progress 
for the source file with the upper progress bar and progress for the 
destination file with the lower progress bar. If several source or destination
files are necessary, they will be asked of you when they are needed. 

Remarks: 
--------

  - Only files created by this program can be used with this feature.
  - The program checks that the destination file does not have the same name 
    as the source file to avoid the source file being erased before being 
    copied. Nevertheless, it cannot check that the destination file erases 
    another source file other than the one in use, so be careful not to 
    confuse source and destination file.
  - You can use any other compression program to do this, but you will have to
    decompress the files before being able to use them with this program, that
    is not the case for this option.


10- Verifying a backup file 
---------------------------

This is the part that is executed when you use the -t option or select it when
the program asks you. 

This permits verifying that backup files are valid. This verification consists
of checking file headers, size and checksum of data (once they are expanded if
they were deflated). If a saving was done in several files, you are obliged to
check all files. No data is written on disk or is modified inside the files. 

Execution begins with asking source filename (please read chapter 7.a). The 
checking window shows in the upper progress bar the state of the check for the
current file. If saving was done in several files, subsequent files will be 
asked of you. 


11- Updating Windows 2000/XP registry 
-------------------------------------

This is the part that is executed when you use the -u option or select it when
the program asks you. 

Windows 2000 and XP store partition position in the registry in order to 
preserve association between a partition and its corresponding driver letter. 
Partition position is composed of two parts: disk number that is stored into 
MBR (4 bytes) and offset of first byte of partition on disk (8 bytes). 

So if you copy a partition onto another disk (without copying MBR) or if you 
move the beginning of a partition, you have to update the information in the 
registry for each partition that you moved for Windows to be able to still use
the same drive letter. In the case of restoring a partition which has not been
moved, this is not necessary. 

Execution is composed of 2 parts: first, to designate where Windows is 
installed so that the program can find the registry file; second, to give the 
partition to be updated in this registry. If you copy the Windows 2000/XP 
partition, the Windows installation that should be updated is the one that was
the destination of the copy. 

Execution follows the diagram below: 
Support choice where Windows is installed
                    |
                    V
Element choice where Windows is installed
                    |
                    V
  Directory where Windows is installed
                    |
                    V
Disk choice where partition to update is
                    |
                    V
      Partition to update choice
                    |
                    V
  Drive letter of partition to update
                    |
                    V
              Confirmation
                    |
                    V
                   end


  a) Support choice where Windows is installed: 
You select the disk or DOS devices list where the Windows installation whose 
registry should be updated is located. 

  b) Element choice where Windows is installed: 
You select the partition (if a disk has been chosen in the first window) or 
the DOS device (if DOS devices have been chosen in the first window) where the
Windows installation whose registry should be updated is located. 

  c) Directory where Windows is installed: 
You select the Windows installation directory. As a general rule, this 
directory is called "WINDOWS", unless you specified another name when 
installing it. If you give a wrong directory name, or if the installed Windows
version is not correct, you will get an error message telling you that the 
registry file has not been found. 

  d) Disk choice where partition to update is: 
You choose the disk which has the partition whose registry definition you want
to update. 

  e) Partition to update choice: 
You choose the partition for which you want to update the definition in the 
registry. 

  f) Drive letter of partition to update: 
This window shows a list of driver letters that could be modified with their 
current definition. The first column is the drive letter, the second is the 
disk identifier where the corresponding partition is located, and the third 
column is the first byte of the partition on the disk. The last column 
displays the two previous columns as given by regedit. 
You must choose from this list the drive letter you want to be associated with
the partition selected with two previous windows. The program will modify the 
corresponding definition for this letter with the values defined at the top of
the window. 

  g) Confirmation: 
The program asks you to confirmation the registry modification. It gives you 
the key name that will be modified, its previous and new values. The value is 
composed of 12 hexadecimal digits, the first four being the disk number, last 
eight the offset of the partition on the disk (it is the same format as the 
last column of previous window). 

  h) Example:

                     Disk 1                        Disk 2
          +--------------------------+  +--------------------------+
          | Main partition 1:        |  | Main partition 1:        |
          | Windows XP (C:)          |  | Windows XP (D:)          |
          +--------------------------+  |                          |
          | Main partition 2:        |  +--------------------------+
          | Extended partition       |  | Main partition 2:        |
          | +----------------------+ |  | Extended partition       |
          | | Extended partition 1 | |  |                          |
          | | of main partition 2  | |  | +----------------------+ |
          | | Data (E:)            | |  | | Extended partition 1 | |
          | +----------------------+ |  | | of main partition 2  | |
          | | Extended partition 2 | |  | | Data (G:)            | |
          | | of main partition 2  | |  | |                      | |
          | | Swap file (F:)       | |  | +----------------------+ |
          | +----------------------+ |  |                          |
          +--------------------------+  +--------------------------+
You have copied the Windows XP partition from disk 1 to disk 2. In this case, 
drive letter of Windows XP on disk 2 shall be C: for this Windows to be able 
to boot. So, you have to modify registry of Windows XP on disk 2 to swap drive
letters. 
For this, you have to launch Partition Saving, choose the update registry 
option, choose disk 2 and first partition as partition where Windows is 
installed. Then you select first partition of first disk and give it the D: 
letter. Then you launch Partition Saving again, again select first partition 
of second disk as Windows partition, then select first partition of second 
disk to give it the C: drive letter. If you copied also the data partition, 
you have to perform the same thing for second partitions with drive letters E:
and G:. 
Once you have performed this, if you boot with the first disk Windows XP, you 
still have the same configuration as above (this one has not been modified). 
But if you boot with the Windows XP on second disk, you get (considering you 
also swap data partitions drive letters): 

                     Disk 1                        Disk 2
          +--------------------------+  +--------------------------+
          | Main partition 1:        |  | Main partition 1:        |
          | Windows XP (D:)          |  | Windows XP (C:)          |
          +--------------------------+  |                          |
          | Main partition 2:        |  +--------------------------+
          | Extended partition       |  | Main partition 2:        |
          | +----------------------+ |  | Extended partition       |
          | | Extended partition 1 | |  |                          |
          | | of main partition 2  | |  | +----------------------+ |
          | | Data (G:)            | |  | | Extended partition 1 | |
          | +----------------------+ |  | | of main partition 2  | |
          | | Extended partition 2 | |  | | Data (E:)            | |
          | | of main partition 2  | |  | |                      | |
          | | Swap file (F:)       | |  | +----------------------+ |
          | +----------------------+ |  |                          |
          +--------------------------+  +--------------------------+
Note: once you done this, it could be a good idea to give partitions a 
different name to not mix them. 


12- Updating BOOTSECT.DOS file 
------------------------------

This is the part that is executed when you use -b option or select it when the
program asks you. 
In order to manage multi-boot with another DOS or Windows version, Windows XP 
saves the boot sector of other Windows versions into BOOTSECT.DOS file on the 
same partition and modifies this boot sector to set a new one (this one asks 
for the Windows version to run depending on BOOT.INI file contents). 
Consequently, if you copy to another disk or move the begin of the partition 
where the other Windows version is, this file needs to be modified to reflect 
that. This option is for that purpose. 

Warning: This option only modifies some parameters in BOOTSECT.DOS to take 
into account changes that may have been made in the boot sector; it does not 
allow creating or completing a BOOTSECT.DOS file. 

Execution allows choosing the partition on which BOOTSECT.DOS file is located 
to update it according to the current boot sector of this element. Execution 
follows the diagram below: 
Support choice where BOOTSECT.DOS file is
                     |
                     V
Element choice where BOOTSECT.DOS file is
                     |
                     V
                Confirmation
                     |
                     V
                    end


  a) Support choice where BOOTSECT.DOS file is:
You have to choose disk, floppy disk or DOS devices list on which is the 
BOOTSECT.DOS file to be modified. 

  b) Element choice where BOOTSECT.DOS file is:
You have to choose the partition (if a disk has been chosen in first window) 
or DOS device (if DOS devices has been chosen in first window) on which is the
BOOTSECT.DOS file to be modified. You will get an error message if the chosen 
element does not contain a BOOTSECT.DOS file or if it has an incorrect size or
does not contain a boot sector signature. 

  c) Confirmation:
The program asks you to confirm the BOOTSECT.DOS file modification. If you 
confirm, it will be modified to update some parameters according to those in 
the current element boot sector. 


13- Simulating an element 
-------------------------

This section covers the use of the driver (DRVPART.SYS) and the options "-m" 
and "-i" for savepart. The purpose of this driver is primarily to allow access
to a partition contained in a backup file in order to recover some files. 

  a) Use of driver:
DRVPART.SYS is a DOS driver that allows simulating that a new drive letter is 
present. This drive is simulated with a backup file created previously. 
As with all DOS drivers, DRVPART.SYS must be loaded into memory with the help 
of CONFIG.SYS. This text file is on the boot disk (either C: or A: depending 
on whether you boot from hard disk or floppy disk). For the driver to be 
loaded you have to add at the end of this file the line: 
DEVICE=<path>\DRVPART.SYS <options> 
where <path> is the directory where DRVPART.SYS is located. Once this line has
been added, the next time you boot your computer, you will have a new drive 
(the drive letter is defined by DOS and is the next letter following those of 
your last drive). 
DRVPART.SYS can have 2 parameters: 

  - the first gives sector size in bytes. It must be between 512 and 32768 and
    must be a multiple of 512. If this option is not given, a default size of 
    512 bytes is used (that is the most common size).
  - the second gives the memory size in Kb that is allocated for running this 
    program. This must greater or equal to 1024. If this option is not given, 
    a size of 1024 Kb is used. If you want to use this option, you must give 
    the sectors size.

Examples: 
---------
DEVICE=C:\DRVPART.SYS 
Driver is loaded with default values of 512 bytes for sectors size and 1024 Kb
for memory. 
DEVICE=C:\DRVPART.SYS 512 4096 
Driver is loaded with values of 512 bytes for sectors size and 4096 Kb for 
memory. 

Memory allocated by the driver is a memory block which allows temporarily 
storing sectors requested by others programs. As needed, this size can 
dynamically be increased/decreased (but never goes bellow the size defined 
when loading). The worst case of memory use is certainly when a program wants 
to know free space on the drive (as when you do a "dir"). 
Memory used by the driver is XMS or EMS memory (depending on what is present).
These are standard memory types (you do not need specific hardware) called XMS
or EMS depending on the way it is managed. XMS memory is managed by HIMEM.SYS 
driver (a DEVICE=<location>\HIMEM.SYS line has to be present at the beginning 
of the CONFIG.SYS file) and EMS memory is managed by EMM386.EXE driver (or 
some other that does the same thing) (a DEVICE=<location>\EMM386.EXE line has 
to appear in CONFIG.SYS file just after the one containing HIMEM.SYS). If 
neither of these two types of memory is present, driver will not be loaded. 
Note that using EMS memory can limit useful memory size to 32 Mb. 
Driver can generate following messages when loading: 

  - "Driver has been initialised. It simulates drive <letter>:.": The driver 
    has been correctly loaded and it simulates a drive having letter <letter> 
    .
  - "Parameter for size of sectors is not correct: it must be between 512 and 
    32768 and be a multiple of 512.": You must modify the first parameter in 
    the line from CONFIG.SYS file to give a correct value.
  - "Parameter for allocated memory size is not correct: it must be bigger 
    than 1024.": you have to modify the second parameter in the loading line 
    from CONFIG.SYS file to give a correct value.
  - "Memory could not be allocated: you need XMS or EMS memory.": The driver 
    did not find EMS or XMS memory. You have to add into your CONFIG.SYS file 
    at least the line that allows loading XMS memory.

If one of the last three messages is displayed, the driver is not loaded. 

  b) Simulating an element:
Once the driver is loaded into memory, "-m" and "-i" options of savepart can 
be used (or associated actions appear in lists of actions if you do not 
specify an action option). 
The first option ("savepart -m") or the choice "Simulate an element" in 
actions allows you to give the list of files to use in order to simulate the 
element they contain. Execution is done in the same way as when testing a 
backup file (chapter 10). Once execution has correctly ended, you will be able
to use the added drive through the driver as if it is the partition that is in
the backup file (If no element is simulated, accessing this drive returns an 
error). 
The second option ("savepart -i") or the choice "Get information from driver" 
in actions allows getting information from driver (drive simulated, sector 
size and files used if an element is simulated) and stopping simulating an 
element if there is one simulated. 
When simulating an element, more EMS/XMS memory can be needed by the driver. 
Unfortunately running savepart when only XMS memory is available means that 
savepart uses the whole memory and it is not possible to allocate more memory 
for the driver. In this case you will certainly get a "You do not have enough 
EMS or XMS memory: <n> Kb free memory are needed." error. In this case you 
have to use the ALLOCXMS.COM program giving it <n> as a parameter in order for
memory to be allocated before running savepart, then you can run savepart 
again (example: ALLOCXMS.COM 1024 will allocate 1024 Kb memory). As this size 
depends on the partition simulated, it cannot be be known (and so allocated) 
sooner. ALLOCXMS can display following messages: 

  - "Memory allocated": memory has been allocated and you can run savepart 
    again.
  - "DrvPart driver could not be found": you have forgotten to load the driver
    into your CONFIG.SYS file (note: in this case, options to manage drive 
    simulation are not available into savepart).
  - "DrvPart driver into memory has not the same version as AllocXMS": 
    versions of DRVPART.SYS and ALLOCXMS.COM are not the same. You must use 
    programs having the same version (it is true also for savepart).
  - "An element is currently simulated": you have to stop simulating the 
    element by using "Stop simulating element" button into the window giving 
    information on driver into savepart.
  - "XMS memory driver could not be found": you do not have loaded a XMS 
    driver into your CONFIG.SYS file, so you cannot use XMS memory.
  - "Parameter is not correct": given parameter is not correct: it must be a 
    positive integer.
  - "Such an amount of memory could not be allocated": XMS driver does not 
    allow allocating such an amount of memory. If this size is not over memory
    available into your computer, using a more recent driver or not using EMS 
    memory can solve this problem.

  c) Remarks:

  - This driver allows simulating only FAT elements or elements where all 
    sectors were saved. In this last case, the fact that it is a FAT element 
    is not checked, but DOS will certainly refuse to access it if that is not 
    the case.
  - Files used for simulation must not be compressed.
  - All files used have to be always accessible to avoid an error (example: if
    files are on several CDs, you must have either several CDs readers or copy
    the files on your hard disk for them to be read simultaneously). First 
    files will be used more often than last file, so put them on the faster 
    support.
  - simulated element is set as read-only. So all attempts to write on them 
    will generate an error. If you get an error like "Unable to write on drive
    <letter>" with letter equal to the simulated drive, you have to answer 
    "Fail".
  - This driver can be run only in DOS mode. If Windows is started, it frees 
    used memory and deactivate itself. Under Windows you will get a new drive,
    but you cannot use it.
  - Using the driver will slow your computer and use memory. So it is better 
    to use it only when you need it (so modify your CONFIG.SYS file each time 
    or better yet use a special floppy disk).
  - Accessing a simulated drive is a lot slower than accessing other drives.
  - The driver will run correctly only for programs that use peripherals in a 
    standard way. Naturally, some specific programs generate errors.
  - If a program terminates in an abnormal way, it can leave the driver in an 
    incorrect state (trying to access simulated drive generates an error). In 
    this case, you just have to run and quit any program for the simulated 
    drive to be accessible again.
  - The driver can increase memory use depending on its need. If a program 
    uses all available memory (savepart is one when only XMS memory is 
    present), you can get errors when accessing the simulated drive. In this 
    case try increasing the permanently used memory size with the second 
    parameter on the loading line of DRVPART.SYS in the CONFIG.SYS file. 
    Obviously this will take effect only at the next boot of the computer.
  - When using savepart, access to simulated drive is deactivated.
  - If you want to simulate an element other than the one being simulated, you
    don't need to run savepart a first time to stop simulating the element, 
    then a second time to simulate a new one. You can directly choose to 
    simulate the new one (it will stop simulating the first one). This implies
    that it is not possible to simulate several elements simultaneously (even 
    with loading driver several times).
  - You cannot run a program that is on the simulated drive. You have to copy 
    it onto another drive first.
  - Driver, savepart and allocxms versions must be the same. This is why they 
    all have the same version number. This version number is checked when 
    these programs work together and they do not communicate if versions are 
    not the same.
  - Because a new drive is created, the letter assigned to your CD reader 
    could be changed.
  - DRVPART.SYS is not needed to run savepart. You only need to use it if you 
    want to use options to simulate an element.


14- Creation of files on NTFS drive 
-----------------------------------

This option appears only when you are running the program under Windows NT, 
2000 or XP. It allows you to create a file on a NTFS partition which can be 
used as a backup file by using partition mounting once you are running from 
DOS. This is due to fact that the program is not able to create files on a 
NTFS partition (only to read/write and resize) when it runs from DOS, so files
you create here serve as a base. This option asks you names of files to be 
created until you hit the 'Cancel' button. If you use automatic naming, 
instead of asking you several files, it asks number of files you want to 
create. 

Remarks: 
--------

  - You need to create enough files to be able to store saving result. To have
    an idea of how many files are needed, take the partition size (only 
    occupied part in case you want to save occupied sectors only), divide it 
    by 2 in case you use compression, divide it by maximum size you want files
    to do then round result up and add 2 to it (3 in case you think you will 
    create the option file).
  - Created files are only between 4 Kb and 64 Kb, so do not be afraid to 
    create too much files.
  - You could use files that were created elsewhere (as long as they do not 
    use internal NTFS encrypting and compression feature) without using this 
    option. Their content will obviously be erased when performing saving.
  - Remaining free size on drive is given as information. It is wrong in case 
    more than 970 Mb is available on drive.

Example: 
--------
You want to save a partition with 4 Gb data into 680 Mb files (to be able to 
burn them) with using partition. In this case you will have to create: 4*1024 
/ 2 / 680 = 3.011 => 6 files. 


15- Reset bad sectors in filesystem 
-----------------------------------

This is the part that is executed when you use -z option or select it when the
program asks you. 

This option allows removing that sectors are marked as wrong on a filesystem. 
It does not allow correcting bad sectors, it shall only be used in case you 
restore/copy a partition with bad sectors on another hard drive. This is 
automatically done by program when restoring but in case where source and 
destination disks and partitions are identical: in this case program thinks it
performs restoration on the saved partition and so does not reset bad sectors 
information. 

So this option shall only be used in one case: the one where you got an "X" 
into the "Idem" column on restoring/copying even when disk is not the same as 
the source one. 

Notes: 
------

  - This option is obviously useful only in case you have some bad sectors on 
    a partition.
  - In case you restore partition on a disk that still has some bad sectors 
    (as when restoring after resizing a partition), you have to perform a 
    surface test to update bad sectors list of partition.

Execution follows the diagram below: 
 Support choice where bad sectors shall be removed
                         |
                         V
 Element choice where bad sectors shall be removed
                         |
                         V
                    Confirmation
                         |
                         V
                     Execution
                         |
                         V
                        end


  a) Support choice where bad sectors shall be removed: 
You have to choose disk, floppy disk or DOS devices list where filesystem to 
modify is. 

  b) Element choice where bad sectors shall be removed: 
You have to choose partition (if a disk was selected into first window) or DOS
device (if DOS devices list was selected into first window) on which bad 
sectors information shall be removed. 

  c) Confirmation: 
Program asks for you confirmation of filesystem modifications. If you confirm,
all bad sectors will be marked as valid back. 

  d) Execution: 
Filesystem modification is running. Depending on filesystem type and partition
size this could need more or less time (faster being for ext2 partition and 
slower for FAT partitions). 


16- Options file contents 
-------------------------

The options file allows you to restore (or save again) element you have saved.
When using savepart with the -f <options file name> option, the various 
parameters are read from the file instead of being asked of you. Contents of 
this file can be partial (not covering all the options, in which case missing 
parameters will be asked), but in this case some rules described below must be
followed. 
The options file is a text file that allows options to be specified. Each 
option must be alone on a line. 
If the line begins with ";", its a comment line (it is not analysed). 
Option content can be defined with an environment variable. In that case, the 
environment variable must be given between % (example: file=%CONF%.PAR, %CONF%
will be replaced by the content of the CONF environment variable). If the 
environment variable does not exist, an error will be generated. To be able to
give the % character inside option contents, you have to double it (example: 
file=WITH%%.PAR, the file name would be WITH%.PAR). 

Options are: 

  - mouse=[yes|no|poll]: choice of the method of using the mouse (same as 
    -cm|-nm|-pm option on command line).
  - check_drive=no: verification that created/read file is not on 
    saved/restored element is disabled (same as -ncd option on command line).
  - verify_disk_write=no: verification that sectors are correctly written is 
    disabled (same as -nvd option on command line).
  - verify_file_write=no: verification that files are correctly written is 
    disabled (same as -nvf option on command line).
  - lang=[en|fr|fr_2]: language choice (same as -l option on command line).
  - user_interface=[console|text|text_bios]: user interface choice (same as 
    -cui|-tui|-bui option on command line).
  - disk=<number>: gives the disk number to use. This number must be between 
    zero and the number of disks minus one. When saving, this option replaces 
    the first window. When restoring, this option restricts the search of 
    elements to be restored, to elements of the given disk (otherwise, the 
    element is searched for on all the disks). This option cannot be given if 
    floppy= or device= option is given.
  - floppy=<number>: gives the floppy drive number to use. This number must be
    between zero and number of floppy drives minus one. When saving, this 
    option replaces the first window. When restoring, this option restricts 
    the search of elements to be restored, to elements of the given floppy 
    drive (otherwise, the element is searched for on all floppy drives). This 
    option cannot be given if disk= or device= option is given.
  - device=[A-Z]: gives the DOS device letter to use. When saving, this option
    replaces the first two windows. When restoring, this option restricts the 
    search of elements to be restored, to elements of the given DOS device 
    (otherwise, element is searched for on all DOS devices). This option 
    cannot be given if disk= or floppy= option is given.
  - main_part=<number>: gives the number of the main partition to use. This 
    number must be between 1 and 4. If the element to save/restore is directly
    related to a disk, this option must not be given. For this option to be 
    used, "disk=" option must be given.
  - ext_part=<number>: gives the number of the extended partition to use. This
    number must be between 1 and the number of extended partition 
    corresponding to main partition. For this option to be used, "main_part=" 
    option must be given. You do not have to give this option if you want to 
    save a main partition. 
    The pair of options "main_part=" and "ext_part=" replace the second window
    when saving, and the pair "disk=", "main_part=" and "ext_part=" replace 
    the second window when restoring.
  - def_level=<number>: gives the compression level to use. This number must 
    be between 0 and 9. When saving, this option replaces the third window. 
    When restoring, this option is not used (hence can be omitted). If this 
    option is not given and a file name is given (see "file=" option below), 
    compression level used is level 0 (no compression).
  - file=<file name>: gives the file to use to save/restore element. This 
    option can be given several times in case saving/restoring need several 
    files. In this case, options must be given in order you want files to be 
    used.
  - max_size=<number> [kb|Mb] or max_size=max: gives the maximum size that a 
    file can be. If kb|Mb is not given, size is in Mb. If size is in kb, it 
    must be between 1 and 9999 kb, if it is in Mb it must be between 1 and 
    2047 Mb. If "max" is used as value, the program will use minimum between 
    drive free space and 2047 Mb. This option can be given several times if 
    saving/restoring needs several files. In this case this option must be 
    given in the same order as file names are given. If this option is given 
    less time than number of file names, the last option will be used for all 
    remaining files. If this option is given more times than number of file 
    names, remaining options will not be used. If this option is not given and
    some file names are given, maximum size of 2047 Mb is used. When restoring
    this option is not used (hence can be omitted).
  - filesystem=[no|fat12|fat16|fat32|ext2|ntfs|MBR|firstsect|parttable|
    fat12mem|fat16mem|fat32mem|ntfsmem|ext2mem|fat12swap|fat16swap|fat32swap|
    ntfsswap|fat12memswap|fat16memswap|fat32memswap|ntfsmemswap]: gives the 
    filesystem type to use when saving. If this parameter is equal to "no", 
    all sectors are saved without considering filesystem that is on the 
    partition. If this parameter is equal to one of the others possibilities, 
    the program checks that partition to save corresponds to the filesystem of
    the asked type. If this is the case, only occupied sectors will be saved. 
    Otherwise, an error is displayed. 
    The options fat12mem, fat16mem, fat32mem, ntfsmem and ext2mem allow saving
    only occupied sectors, while authorizing that the backup file created can 
    be on the saved partition. 
    The options fat12swap, fat16swap, fat32swap and ntfsswap allow saving only
    occupied sectors without saving the swap files contents. 
    The options fat12memswap, fat16memswap, fat32memswap and ntfsmemswap put 
    together the features of both <xxx>mem and <xxx>swap options. 
    When restoring, this option is not used (the value defined inside the 
    backup file is used).
  - swap_dir=<path name>: This option allows giving the directory where swap 
    files are located. It is used only when saving and when requesting to not 
    save swap files. <path name> must be the path name from the partition root
    directory without a drive letter (example: "\" for root directory, 
    "\WINDOWS" for WINDOWS directory). As with the window which requests this 
    information, the program searches for swap files in the root directory 
    also.
  - quit=[yes|no|nobadsector]: This options permits to exit program 
    automatically. If it is equal to "yes", program exits at end of 
    saving/restoring/copying (be aware that in the case of saving, if one of 
    the options used from option file has been modified, the window asking if 
    you want to create options file will still appear). It this option is 
    equal to "nobadsector", program will exit only if no bad sectors have been
    found (otherwise, user can read errors list on screen, then click "Ok" 
    button). If this option is equal to "no" or is not given, user has to 
    click "Ok" button to exit.
  - reboot=[yes|no]: This option allows rebooting computer automatically at 
    end of program execution. It is active only when saving or restoring a 
    partition (copying does not take an option file and it is not useful to 
    reboot computer in others cases). If the "quit" option is equal to "no", 
    or "nobadsector" with some errors, or is not given, program will reboot 
    only after the user has clicked on the "Ok" button. If the "quit" option 
    is equal to "yes", or "nobadsector" without any errors, reboot will be 
    done immediately.
  - automatic_naming=[yes|no]: This options allows using automatic naming. If 
    no file= option is given, this will only cause the automatic naming 
    checkbox to be checked when asking for the first file name. If one or more
    file= options are given, all these options will be first used and if more 
    files are needed, the program will use the last file name, changing its 
    extension with the file number following rules described in chapter 6.e 
    (it does not verify whether the file already exists or not).
  - nb_files=<number>: this option allows giving number of files to create 
    when creating files on an NTFS drive with using automatic naming. Number 
    must be between 1 and 256.
  - windows_disk=<number>: gives the disk number where Windows is installed. 
    This option is equivalent to the "disk=" one but is used in the case of 
    update of Windows 2000/XP registry to give disk number where Windows is 
    installed (see chapter 11.a).
  - window_main_part=<number>: gives the main partition number where Windows 
    is installed. This option is equivalent to the "main_part=" one but is 
    used in the case of update of Windows 2000/XP registry to give main 
    partition number where Windows is installed (see chapter 11.b).
  - window_ext_part=<number>: gives the extended partition number where 
    Windows is installed. This option is equivalent to the "ext_part=" one but
    is used in the case of update of Windows 2000/XP registry to give extended
    partition number where Windows is installed (see chapter 11.b).
  - window_device=[A-Z]: gives the DOS device letter where Windows is 
    installed. This option is equivalent to the "device=" one but is used in 
    the case of update of Windows 2000/XP registry to give DOS device where 
    Windows is installed (see chapter 11.b).
  - window_dir=<string>: gives the directory where Windows is installed (see 
    chapter 11.c).
  - part_letter=[A-Z]: gives drive letter that should be modified in the 
    registry for the chosen partition (see chapter 11.f).
  - mount=<drive number>:<disk number>/<main partition number>,<extended 
    partition number>: allows defining mounting options of a partition. The 
    first number is the drive number used to identify this partition, it must 
    be between 0 and 2147483647. The second number is the disk number on which
    partition to mount is, it must be between 0 and number of disks - 1. The 
    third number is the main partition number of partition to mount, it is 
    between 1 and 4. The last number must not be given for a main partition 
    (if it is omitted, the colon before must be also) and is the extended 
    partition number where the main partition is a logical partition, it must 
    be between 1 and 255. The drive number must be unique and a partition can 
    only be mounted with one number. When a mount is defined, the "file=" 
    option could use this number to define a file name. 
    Example: 
    mount=0:0/1 mounts as 0: the first main partition of the first disk, 
    mount=10:3/2,2 mounts as 10: the second extended partition in the second 
    main partition of the forth disk, 
    file=0:\DISK_C.PAR defines a file that is on the partition mounted by the 
    first mount.

Remarks: 
--------

  - When using batch mode, no confirmation is asked when a file must be 
    erased, when element is restored, when registry or BOOTSECT.DOS file is 
    modified.
  - If you do not give enough file names (for example, you give only one file 
    name when restoring, and two files were created when saving), or a file is
    wrong (for example, the files are given in the wrong order or a file name 
    is bad), missing or incorrect file names will be asked, as in normal mode.
  - If an option is not valid, the program ends. To verify your option file 
    you can use savepart with "-t" option.
  - When restoring, if several files are needed and are stored on removable 
    media (and the program is able to detect this), the program asks to change
    media instead of displaying an error and asking for next filename.

Examples: 
---------

If we again take the partitioning presented in the example of saving a 
partition, and look at the batch file created when saving drive D:, we will 
have (assuming that all sectors were saved and two files are needed): 
;------------------------------- 
; Parameters for D: drive 

; On the first disk 
disk=0 

; Main partition 1 
main_part=1 

; No compression 
; (remark: in this case this option can be omitted) 
def_level=0 

; Files: 
file=c:\driv_d_1.par 
file=c:\driv_d_2.par 

; Same size for all files 
; (remark: in this case the second line can be omitted) 
max_size=620 
max_size=620 

; All sectors are saved 
filesystem=no 

; End of file 
;------------------------------- 
If you name this file drive_d.cfg, you will have to enter "savepart -s -f 
drive_d.cfg" to save the partition or "savepart -r -f drive_d.cfg" to restore 
it. Your are not obliged to give the -s/-r flag in which case you will be 
asked what you want to do, and then the option file will be taken into 
account. 

The file below will permit you to save/restore the Linux partition (all 
sectors of this partition): 
;----------------------------------- 
; Parameters for Linux partition 

; On the first disk 
disk=0 

; Main partition number 3: 
main_part=3 

; Standard compression: 
def_level=6 

; File: 
file=c:\linux.par 
max_size=2047 

; All sectors are saved 
filesystem=no 

; End of file 
;------------------------------- 
If you change filesystem parameter from "no" to "ext2" in above file, only 
occupied sectors of partition will be saved. 

If you have two disks where the first one has a partition format that is not 
recognised by savepart, you can use the following file to force the program to
only use the second hard drive: 
;------------------------------- 
; Partition format of the first disk not recognised 
; => we force using only the second one 

disk=1 

; End of file 
;------------------------------- 

To modify the registry automatically, you have to give all the options which 
define the element to be modified and the element where Windows is installed. 
As an example: 
;----------------------------------- 
; Modification of registry for logical partition on second disk while 
; Windows is installed on the first partition of first disk. 

; Parameters for Windows installation 
windows_disk=0 
windows_main_part=1 
windows_dir=windows 

; Parameters for partition definition to be modified in the registry 
disk=1 
main_part=2 
ext_part=1 
part_letter=G 

; End of file 
;----------------------------------- 


17- Mounting a partition 
------------------------

Mounting a partition allows accessing partitions that could not be used from 
DOS. Instead of using a drive letter as for DOS, mounted partitions get a 
drive number that could be used in the same way as drive letter. As an 
example, to access DISK_C.PAR file that is on first mounted partition (that 
has the 0: number), you have to use "0:\DISK_C.PAR". 
Mounting process is similar to saving partition choice process: you have to 
first choose the disk where partition to mount is, then partition itself. Once
this is done, and if filesystem on this partition is recognised, this 
partition gets a drive number that is unique. If you try to mount a partition 
several times, you always will get the number it was mounted under at first 
time. 
Recognised filesystem are NTFS, FAT and ext2/3 filesystems. Mounting a NTFS 
partition allows modifying its files, but does not allow creating or erasing 
files. Mounting a FAT or ext2/3 partition allows creating files on them (not 
for ext2/3 partitions using binary tree sorted directories). Mounting a 
damaged partition allows accessing it in read-only mode. On ext2/3 partitions,
symbolic links are displayed as files, but cannot be read or followed. 
When you mount a partition to modify its files, you must let the program end 
by itself for it to be able to synchronise the filesystem with modifications 
you perform. For example, do not reboot immediately when saving has ended, but
click on 'Ok' button, create (or not) the configuration file and wait for the 
program to end. 

Notes: 
------

  - Mounting a partition that is available to DOS by another way is not 
    advised unless you reboot computer after program exiting, especially if 
    you wrote something on it (this could lead to some errors or data lost 
    because DOS is no more coherent with disk content).
  - The more partitions you mount the more memory you need. So if you have 
    barely enough available memory, try to avoid mounting partitions 
    unnecessarily.
  - When restoring with an options file, this file must be on a drive that was
    accessible by DOS because when it is read, no mounting has been done.
  - For files used on mounted partition, the option to disable write checking 
    is not "-nvf" but "-nvd" because writing is performed via the program 
    internal mechanism and not by using DOS.
  - On ext2/ext3 partitions, created files take ownership and rights of 
    directory where they are created. On ext3 partitions, journal is not 
    updated.


18- Notes on what elements can be saved 
---------------------------------------

This chapter describes some points specific to each type of element that can 
be saved. It describes in particular restrictions that are checked by program 
when restoring an element. 

  a) The complete disk: 
This is about saving/restoring the whole disk without taking into account its 
organisation. 

When saving you should not create the backup file on one of the partition of 
the disk, else you are likely to have incoherencies when restoring. 

When restoring you should not use files that are on this disk as it is 
entirely rewritten and so files would be erased before they were completely 
read (so restoring will end with an error and files will be lost). Restoring 
is possible only on a disk with a compatible physical definition. For that, it
must have the same access type, the same number of heads, of sector per track 
and have sectors that have the same size. It must equally have the same number
or more cylinders (so the disk will have the same size or be bigger). If it 
has more cylinders, the last cylinders will be not allocated (consequently 
left empty) and you will have to create a new partition or increase the last 
one to use them. 

If disk size seems to be incorrect (for example it is displayed as 8 Gb when 
the disk is 20 Gb), you should not save this disk because the backup will not 
be complete (in this example, the last 12 Gb will not be saved). This comes 
from a bad detection of the disk (for example in the way it is accessed). The 
use of a disk manager program may solve this problem. 

  b) The Master Boot Record (MBR): 
This sector is the first one on the disk. It contains: 

  - boot code used when computer is started.
  - main partitions declaration.

When saving it, this sector is fully saved, but when restoring only the part 
corresponding to the boot code is restored. The part corresponding to the 
partition table is not modified else you would loose all partitions of disk. 
It should be noted that the disk identification used by Windows NT/2000 and XP
to distinguish the disks is restored also. 

When restoring, the only constraint on destination disk is that it must have 
the same sector size. 

It can be useful to save the Master Boot Record to restore it on another disk 
or in case of a boot virus. This is the same as doing "fdisk /mbr" if you have
a boot sector written by Windows 9x/Me. This also allows you to restore a boot
loader in case you install an operating system that modifies the boot sector 
without notice. 

Boot code is restored as-is, so if it contains some code specific to the disk 
format, this format is not updated even if this sector is restored on another 
disk. 

You cannot save the MBR if it is not considered valid (in which case this 
choice will not be displayed). 

  c) First sectors of disk: 
These are the sectors that are before the first partition. This includes 
Master Boot Record, which is restored as described above (only boot code is 
restored). 

When restoring, the destination disk must have the same sector size and have a
valid partition table. If the number of sectors before the first partition is 
not the same between the saved and restored disks, only the common part (the 
minimum number of sectors) will be restored. 

You may need to save all sectors before first partition rather than just the 
MBR in the situation where you have a boot loader that uses these sectors to 
store its program. If this is restored onto a disk other than the original one
or on a disk with different partitions, restored sectors will not be modified 
to take into account this new definition. 

You will not see this option if MBR or partition table is not valid. 

  d) Partition table: 
These sectors describe the partitions table. They include MBR and all sectors 
that describe extended partition. 

When saving, the sectors are fully saved but, when restoring, only the part 
corresponding to the partition table is restored (so boot code is not 
modified). Constraints on the destination disk are the same as when 
saving/restoring whole disk. 

When restoring partition table, you will lose the whole contents of the disk, 
not because it is overwritten (only sectors of the partition table are 
written), but because the way it is organised is modified. It is recommended 
that the backup file is not on the destination disk because there is a risk 
that it could be erased (it is a low risk because the file should be too big 
to be stored in memory and one of the sectors of the partition table would be 
where the file is stored). 

  e) Partitions (all sectors): 
In this case all sectors of a partition are saved without taking into account 
if they are occupied or not. 

When saving be aware to not create backup file on saved partition (for same 
reasons as when saving whole disk). This is equally true when saving only 
occupied sectors except when choosing to save a partition on itself. 

When restoring you should not use backup files that are on the restored 
partition (for same reasons as when restoring whole disk). This is equally 
true when restoring only occupied sectors. Restoring will be available only on
a partition that is on a disk that has the same constraints as when restoring 
whole disk. Moreover partition must be on the same place on disk (it must 
begin and end at the same place as the saved one). Finally, partition type has
to be compatible with type of saved partition. For this, here is the array 
giving compatibility between partition types: 

                  +---------+--------+----------------------+
                  |  Type   | Number | Designation          |
                  +---------+--------+----------------------+
                  |         |   0x01 | DOS FAT-12           |
                  | FAT 12  |   0x11 | DOS FAT-12 hidden    |
                  |         |   0xc1 | DR-DOS FAT-12        |
                  +---------+--------+----------------------+
                  |         |   0x04 | DOS FAT-16 < 32Mo    |
                  |         |   0x06 | DOS FAT-16 >= 32Mo   |
                  | FAT 16  |   0x14 | FAT-16 < 32Mo hidden |
                  |         |   0x16 | DOS FAT-16 hidden    |
                  |         |   0xc4 | DR-DOS FAT-16        |
                  |         |   0xc6 | DR-DOS,NT            |
                  +---------+--------+----------------------+
                  | VFAT 16 |   0x0e | Win95 VFAT-16        |
                  |         |   0x1e | Win95 VFAT-16 hidden |
                  +---------+--------+----------------------+
                  |         |   0x0b | Win95 FAT-32 (b)     |
                  | FAT 32  |   0x0c | Win95 FAT-32 (c)     |
                  |         |   0x1b | W95 FAT32 hidden(b)  |
                  |         |   0x1c | W95 FAT32 hidden(c)  |
                  +---------+--------+----------------------+
                  | NTFS    |   0x07 | QNX,OS/2,NT,Unix     |
                  |         |   0x17 | OS/2,NT              |
                  +---------+--------+----------------------+
                  | ext2    |   0x83 | Linux ext2fs/xiafs   |
                  +---------+--------+----------------------+
So if you save a partition of type Win95 FAT32 (b), you can restore it on a 
Win95 FAT32 (c) partition (theoretically, difference between the 2 is hard 
disk access (CHS or extended), but Windows seems not to check partition type 
and check access type when booting). Please note that partition type is not 
modified in the partitions table (so if you restore a Win95 FAT32 (b) 
partition on a Win95 FAT32 (c) partition, this last one will still be a Win95 
FAT32 (c) partition in the partitions table). 

Saving all sectors of a partition can be useful in the case of a partition for
which saving only occupied sectors is not available or in the case where the 
filesystem is too much damaged for saving only occupied sectors to work or if 
you do not have enough memory. 

  f) Partitions (only occupied sectors): 
This part describes how saving only occupied sectors works for partitions that
are known by this program. The following will describe some specific things 
for each partition type (FAT, ext2fs, NTFS). 

When saving/restoring occupied sectors of a partition, it is necessary to know
how data are stored on it to know if a sector is occupied or not. For this 
reason, this option is not available for all filesystem, but only for those 
where I found documentation and that I have, to perform tests. For those 
filesystems, some checks are done to verify that it will be correctly 
recognised (if it is not, the window asking you if you want to save only 
occupied sectors will not be displayed). 

Saving/restoring of occupied sectors allows saving space (backup file is 
smaller), to save time (less data are read) and to do restore on a partition 
with a different size or that is on a hard disk different from those where was
source partition or at a different place. Further constraints are that disk 
must have the same sector size as the original one and partition types must be
compatible. The partition also needs to respect some minimal and maximal sizes
(they are described below for each filesystem type). Remarks on where 
created/read file are located are the same as for a partition where all 
sectors are saved. 

Saving/restoring of occupied sectors keeps data sectors structure as it was 
defined when saving. If the partition is restored on a partition with a size 
different from original one, filesystem sectors can be modified to take into 
account this size change. 

Example: 
--------
With a FAT partition, suppose there was the following structure (each letter 
is a sector with its content, number of sectors given is not representative of
a true FAT structure): 

  RRRRRRFFFF    R: reserved sectors (boot sector and others) 
  FFFFDDDD..    F: FAT sectors (sectors that allow to know if clusters, 
  DDDDDDDD..       that are groups of sectors, are occupied) 
  ........DD    D: data sectors 
  DDDDDDDDDD    .: empty sectors 
  DD....DDDD 

This partition is 60 sectors long. If you want to restore it on a partition 
that has 120 sectors, you will get following result: 

  RRRRRRFFFF 
  FFFFFFFFFF 
  FFDDDD..DD 
  DDDDDD.... 
  ......DDDD 
  DDDDDDDDDD 
  ....DDDD.. 
  .......... 
  .......... 
  .......... 
  .......... 
  .......... 

The number of reserved sectors has not been modified, the number of FAT 
sectors has grown because there was more accessible data sectors. The number 
of data sectors has grown, but their organisation has not been modified (only 
empty sectors have been added at end). 
In this example, it is not possible to restore this partition on a smaller 
partition because the last sector of partition is occupied. To avoid this 
problem you have to use a defragmenter before saving in order to get following
structure: 

  RRRRRRFFFF 
  FFFFDDDDDD 
  DDDDDDDDDD 
  DDDDDDDDDD 
  DDDD...... 
  .......... 

In this case, the partition can be restored on a partition with 44 sectors 
(certainly less, as number of data sectors is reduced and so number of FAT 
sector will be reduced, and a partition with 42 sectors can certainly be 
used). 

To know minimum and maximum partition size you can use when restoring a 
partition where only occupied sectors were saved, you can: 

  - either create the batch file, in which case these sizes are written at 
    beginning of the file into description.
  - or run savepart -r with choosing the backup file. When the window where 
    you have to choose the partition to restore is displayed, it will contain 
    a line with minimum and maximum sizes allowed for partition. Then you can 
    cancel restoring to avoid doing it uselessly.

  g) FAT (12, 16 and 32) partitions (DOS/Windows): 
All FAT12 and FAT16 partitions are recognised. FAT32 partitions are recognised
only for version 0 of this filesystem (I did not know other version). FAT 
partitions group data sectors into groups called clusters. When restoring this
type of partition, cluster size is not modified and FAT type is not modified. 
Because of FAT structure, partitions of this type have to respect some size 
constraints that are summarised into following table: 
+----------------+-----------------+-----------------+-----------------+
| Clusters size  |    512 bytes    |    1 Kbytes      |   2 Kbytes     |
| Partition size | Min.   | Max.   | Min.   | Max.   | Min.   | Max.   |
+----------------+--------+--------+--------+--------+--------+--------+
| FAT12          |   2 Kb |   2 Mb |   4 Kb |   4 Mb |   8 Kb |   8 Mb |
| FAT16          |   2 Mb |  32 Mb |   4 Mb |  64 Mb |   8 Mb | 128 Mb |
| FAT32          |  32 Mb | 128 Gb |  64 Mb | 256 Gb | 128 Mb | 512 Gb |
+----------------+--------+--------+--------+--------+--------+--------+

+----------------+-----------------+-----------------+-----------------+
| Clusters size  |    4 Kbytes     |    8 Kbytes     |    16 Kbytes    |
| Partition size | Min.   | Max.   | Min.   | Max.   | Min.   | Max.   |
+----------------+--------+--------+--------+--------+--------+--------+
| FAT12          |  16 Kb |  16 Mb |  32 Kb |  32 Mb |  64 Kb |  64 Mb |
| FAT16          |  16 Mb | 256 Mb |  32 Mb | 512 Mb |  64 Mb |   1 Gb |
| FAT32          | 256 Mb |   1 Tb | 512 Mb |   2 Tb |   1 Tb |   4 Tb |
+----------------+--------+--------+--------+--------+--------+--------+

+----------------+-----------------+
| Clusters size  |    32 Kbytes    |
| Partition size | Min.   | Max.   |
+----------------+--------+--------+
| FAT12          | 128 Kb | 128 Mb |
| FAT16          | 128 Mb |   2 Gb |
| FAT32          |   2 Tb |   8 Tb |
+----------------+--------+--------+
So with this table, you see it is not possible to define a FAT16 partition 
with less than 16 Mb and more than 256 Mb if its cluster size is 4 Kb. When 
restoring, only partitions that respect these constraints are listed as 
compatible partitions. 

Remarks: 
--------

  - As has been said before, to restore a partition on a smaller partition, 
    the last sectors of partition must not be occupied. For this purpose you 
    have to use a defragmenter in full defragmentation mode. You have to check
    that the defragmenter put all files at the beginning of the partition 
    (some files are sometimes left at the end, for example the image.idx file 
    created by Norton Image. It can be erased before doing save (be sure to 
    remove its system and hidden attributes), then created again once the 
    saving is done).
  - If you restore the partition containing C: drive on a different partition,
    it may be necessary to make the partition active if it is not already to 
    set it bootable (with FDISK, choose "Activate partition" option). You may 
    also have to update the MBR (either with copying original MBR or with 
    using "fdisk /mbr"). If this partition is a partition used in Windows 
    2000/XP multiboot (without being the XP partition), you have also to 
    update the BOOTSECT.DOS file. It may also be necessary to use a bootable 
    floppy disk with SYS.COM on it, to install system files on the partition 
    (by running "sys c:" from floppy disk).
  - If you restore a partition on a different partition, references in the 
    Windows registry that point to the saved partition will be wrong. In case 
    of Windows 2000/XP, you can update registry with keeping the same drive 
    letter. For others Windows version, this cannot be done.
  - If bad sectors are found under FAT (or boot sector copy for FAT32) when 
    saving, their content is replaced by the content of their copy in the 
    backup file to avoid problems when restoring this partition if it is done 
    on one that doesn't have these bad sectors.

  h) Ext2fs/ext3fs partitions (Linux): 
Ext2fs/ext3fs partitions that are recognised are 0 and 1 version. 
Similar to FAT filesystem, ext2 filesystem groups data sectors into groups 
called blocks. As for FAT, block size cannot be modified when restoring a 
partition. To switch this blocks size, you will have some size constraints. 
These size constraints are for a different reason than for FAT partition. They
define only a maximum partition size switch that size of the saved partition 
(there was no minimum size). 

           +----------------------+----------+----------+----------+
           | Block size           | 1 Kbytes | 2 Kbytes | 4 Kbytes |
           +----------------------+----------+----------+----------+
           |                      |   256 Mb |     2 Gb |    16 Gb |
           |                      |   512 Mb |     4 Gb |    32 Gb |
           |  Maximum partition   |     1 Gb |     8 Gb |    64 Gb |
           |                      |     2 Gb |    16 Gb |   128 Gb |
           |                      |     4 Gb |    32 Gb |   256 Gb |
           |        size          |     8 Gb |    64 Gb |   512 Gb |
           |                      |    16 Gb |   128 Gb |     1 Tb |
           |                      |    32 Gb |   256 Gb |     2 Tb |
           |                      |    64 Gb |   512 Gb |     4 Tb |
           +----------------------+----------+----------+----------+
For example, if you have a 3 Gb partition with 2 Kb blocks, you would not be 
permitted to restore it on a partition that has more than 4 Gb (but you could 
restore it on a partition having a size between 0 and 4 Gb, lower limit will 
be determined by the number of the last used block). 

Remarks: 
--------

  - I did never try a Linux defragmenter and I am not sure it will do a full 
    defragmentation. Because of the way files are managed, it is highly 
    probable that only files will be defragmented (they are moved so that all 
    their data is stored on adjacent sectors, but are not put at the beginning
    of the partition). Hence it is very difficult to get a Linux partition 
    with their last sectors unoccupied (so it will be difficult to restore a 
    Linux partition on a smaller partition).
  - If you restore the root partition ("/") on a different partition (or if 
    you have compiled a new kernel between saving and restoring), you will 
    need a rescue disk to install your boot loader. Once the rescue disk has 
    booted, create /mnt/disk directory if it does not exist, mount the 
    partition with "mount -t ext2 /dev/<partition> /mnt/disk", then change 
    your boot loader file (e.g. /mnt/disk/etc/lilo.conf) and install it back 
    with "chroot /mnt/disk <boot loader command>" (<boot load command> = lilo 
    for example).
  - If you restore a partition onto a different one, don't forget to modify 
    your /etc/fstab file (the file that gives partitions with their mount 
    directory) to take into account this change.
  - Ext3fs partitions are recognised as ext2fs partitions if journal is on the
    same partition. If journal is on a self contained partition, base 
    partition can be saved as an ext2fs one, partition containing journal must
    be saved with all sectors (it is not important as journal partition is not
    very big and is swiftly full). Moreover in this last case, you must 
    maintain coherency between the two partitions.

  i) NTFS partitions:
NTFS partitions are recognised for versions 1.1, 1.2, 2, 3.0 and 3.1 (this 
number is not NT version but filesystem version (1.1, 1.2, 2 <=> NT, 3.0 <=> 
Windows 2000, 3.1 <=> Windows XP)). As Microsoft did never release a NTFS 
specification, this filesystem is not fully known and there still were some 
unknown parts. Nevertheless, parts concerning sector use is known and so can 
be used. But there was some feature of NTFS that I did not cover (it is the 
case of partitions that have heavily fragmented filesystem). 
Unlike FAT and ext2 partitions, there was no size constraint: only size limit 
is linked to last allocated sector for lower limit and for upper limit to 
limit of filesystem or too much fragmentation. So it is not possible to give a
size constraint as in others cases. 

Remarks: 
--------

  - As for Linux, NTFS defragmenter certainly does not group occupied sectors 
    at the beginning of the partition. So it can be difficult to restore/copy 
    a partition on a smaller one.
  - In some cases, the program may report that it cannot restore the partition
    onto another one because of a size problem. In this case, you have to try 
    to restore it on a smaller partition (if it can be done) or bigger. This 
    case will be unusual, involving some full or heavily fragmented 
    partitions.
  - Saving/restoring a NTFS partition needs more memory than for others cases.
    If you have the "not enough memory" error and if you have more than 32 Mb 
    memory and use EMM386, you can get more memory by disabling EMM386 (it 
    limits memory size to 32 Mb). To perform this, you have to add a "rem " at
    the beginning of the line concerning EMM386 in C:\CONFIG.SYS file (or 
    A:\CONFIG.SYS file if you use a floppy disk to boot), then restart your 
    computer. Once saving/restoring is done, you can remove the "rem " so that
    EMM386 will be activated again at next boot.
  - If you restore a partition on a different partition, references in the 
    registry that point to the saved partition will be wrong. In the case of 
    Windows 2000/XP, you can update the registry while keeping the same drive 
    letter. For others Windows version, this cannot be done.
  - If you save your system partition, then restore it onto another partition,
    you have to update the registry. You may also need to update your boot for
    this new location to be taken into account (the BOOT.INI file). For 
    Windows XP, you have to boot with Windows XP CDROM or the 6 floppy disks 
    which are downloadable on the Microsoft website and choose the repair 
    option. Once you have the prompt, tools to be used are fixmbr, fixboot and
    bootcfg. The first one is to update the first sector of the disk (in case 
    this one was never used as a system disk), the second one is to update the
    boot sector of the partition (this is theoretically not needed), the last 
    one is to configure your boot options (BOOT.INI file). You can type "help 
    <command>" to get more information on these commands. But despite all 
    this, because of protection mechanism that are set and due to a lack of 
    knowledge about this system, it may not work (but only in the case of a 
    restoring onto another disk, in the case of restoring on a previous 
    version, there should be no problem). A last option that could be tried in
    this case is to download the "sysprep" utility on Microsoft website and 
    use it before doing the save.

  j) Floppy disks:
360 Kb, 720 Kb, 1.2 Mb, 1.44 Mb and 2.88 Mb floppy disks can be saved. But 
only floppy disks that are correctly formatted and have 512 bytes sectors can 
be saved. 
Floppy disk size cannot be known (knowing its type 5"1/4 or 3"1/2 is possible,
but for a given type, size cannot be known). So the program searches the last 
sector of the disk to get its size. If this last sector is damaged, the 
program will be wrong and the whole floppy disk will not be saved/ restored. 
In this case it is better to save using DOS devices. To find out which size 
the program has found, you can use the window asking you if you want to save 
all sectors or occupied ones only (if it is displayed) or remaining size when 
window asking you backup filename is displayed. 
If you save all sectors, the same remarks as for saving a whole partition 
would apply, if you save only occupied sectors, refer to previous chapters 
referring to the filesystem. 
If you restore a floppy disk for which you have saved only occupied sectors, 
onto a floppy disk with a different size, it will work. But this floppy disk 
will no longer have a standard format so it can cause mistakes with some 
programs. 
After you have restored a floppy disk, you have to eject it then reinsert it 
so DOS can take changes into account. Otherwise, you could get incoherence on 
the disk. 

  k) DOS devices:
This method allows you to save all devices that DOS accesses using sector 
notation and that have a FAT filesystem. For example, it is not the case for 
CD or network mapped drive, but it is the case for large removable disks like 
Zip. 
This obviously allows accessing to FAT partitions of hard disks or floppy 
disks, but for both cases it is better to use direct access as described in 
previous chapters. The only case where this is not true is in the case where 
the floppy disk size is incorrectly recognized. 
Device to save/restore must be correctly formatted for it to be correctly 
recognized. 
Same remarks as for saving floppy disks would apply in this case. 


19- What is not supported 
-------------------------

The following situations are not supported for this program: 

  - partitions for OSes that do not follow partition format as it is described
    (notably Solaris x86).
  - disk manager programs (not to be confused with boot manager programs that 
    are supported). These programs allow access to disks of more than 8 Gb 
    with standard mode (if you use one, you will probably know it). If only 
    one partition is detected when you know that there were several, there is 
    a good chance that such a program is present. 
    Francisco Miranda has reported to me that he has successfully run 
    Partition Saving with Samsung disk manager. Thanks to him for having tried
    it and for returning this information back to me. Nevertheless this is 
    only valid for this disk manager, consequently I prefer to let stand this 
    warning for others disk manager.
  - extended partition with OS2 cannot be all detected: into extended 
    partition chain, generally only two partitions per node are defined (the 
    two others contain invalid information), but OS2 seems to use all four 
    partitions.
  - partitions managed with LVM (Logical Volume Management, also known as 
    dynamic disk).


20- What could not be tested 
----------------------------

The following situations could not be tested: 

  - disk with a sector size other than 512 bytes.
  - partitions for OSes other than DOS, Windows (9x, XP) and Linux.
  - creating backup file on partition which is saved, unless using dedicated 
    option.

If someone uses this program with one of above situations, I will be pleased 
to know the results and any problems encountered. For people wishing to make 
these tests, I want to say: 

  - savepart.exe -s only reads the disk physically (writing is done in a file 
    with standard DOS features) unless mounting some partition.
  - savepart.exe when used with "-t" option does not write anything on the 
    disk.


21- Acknowledgments 
-------------------

  - my father for having asked me for this program (without whom it would 
    never have been written), for having read this document (the French 
    version, any mistakes in this one is due to my poor English) and being the
    first to test this program.

  - DJ Delorie for the DJGPP environment (http://www.delorie.com/djgpp). This 
    includes equally everyone who has helped him create that environment.

  - Jean-Loup Gailly and Mark Adler for the zlib compression library 
    (http://www.zlib.net).

  - Ralf Brown for all the documentation that he has gathered on interruptions
    (http://www.pobox.com/~ralf).

  - Simon P. Bullen for fortify (a library to permit checking memory 
    allocation).

  - Chris Lattner for his Website "The Operating System Resource Center" where
    you can find a lot of information on hardware and software 
    (http://www.nondot.org/sabre/os/articles).

  - Rgis Duchesne and Richard Russon (and everyone that helped them) for all 
    the documents they gathered regarding NTFS 
    (http://linux-ntfs.sourceforge.net).

  - Markus Oberhumer and Laszlo Molnar for the executable packer UPX 
    (http://upx.sourceforge.net), and Serge Delbono for having pointed out it 
    to me. 

  - Brett Stevenson and Richard Ross-Langley for the correction of the English
    version of the FAQ and the web site homepage. 

  - Ralph Ball for the correction of the English version of the manual. I have
    got several offers for this (thanks to those having done this offer), but 
    Ralph is the one that had courage to end it ! 

  - B.D. for having searched and given the format of registry files (I cannot 
    find the whole name of the author). 

  - Will Rickards for pointing to me that when restoring a partition on a new 
    disk, bad sectors information could be resetted. 

  - bug finders for reporting them to me and helping me to resolve them: 

    * Charles M. Tilden (problem on bad detection of hard drive).
    * Daniel Lagunes (bug on reading partitions table for standard access disk
      with at least two logical partitions).
    * Thibaud Fontanet (failure of detection for some hard disks in V2.21 and 
      hang up of computer when rebooting, the first problem had been reported 
      by Juergen and Ray Schmitz)(for V2.22 bad attribution of DOS drive 
      letter when there was several main DOS partition on the same disk).
    * Ray Schmitz (problem about accessing the wrong disk in the case of a 
      drive before it is not detected as a hard disk).
    * Volker Beck (the forgetting of code to allow saving NTFS partition with 
      batch mode).
    * Frode Ingebretsen (screen problems with some computers (incompatible 
      BIOS ?)).
    * Brian Bell (the inability to restore FAT partitions that have bad 
      sectors when saving).
    * Menno Schoone (the unnecessary asking for option file creation when 
      saving with an option file using the automatic_naming option).
    * Patrick Barny (the first who has helped me with very fragmented NTFS 
      partition, followed by Peter Newman and Kamil Wicher).
    * Sbastien Willemijns, Gershwin Luhur and popfulmail (the unnecessary 
      asking for option files creation when saving with an option file in 
      which given file names were not full pathname).
    * Ian Stuart Turnbull (some NTFS files could not be found in case 
      partition goes in a lot of stress and files get allocated into a part 
      that I considered as reserved for filesystem files). He has also 
      confirmed me that the Windows 2000 registry update works, as I could not
      test it.
    * Jorge Cesario (a regression in V3.00 and V3.01 versions that does that 
      removable media were no more detected and so files name were asked 
      instead of requesting for media change).
    * Wu Chaowei (bad setting to occupied of clusters that are after MFT0 when
      restoring a NTFS partition to a different one but with a similar size).

  - All the people who have sent me emails of encouragement, comments, and 
    suggestions for improvements.


Hoping this program will be useful, 

D. Guibouret <damien.guibouret@partition-saving.com> 

------
All trademarks and registered trademarks are property of their respective 
holders. 
