home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 2008 May
/
PCWorld_2008-05_cd.bin
/
temacd
/
partion
/
savepart.exe
/
doc
/
en
/
addinfo.txt
next >
Wrap
Text File
|
2008-03-15
|
8KB
|
156 lines
+--------------------------------------+
| Partition Saving |
| |
| http://www.partition-saving.com |
| Copyright (c) 1999-2008 D. Guibouret |
+--------------------------------------+
Additional information
Table of contents
-----------------
0- Preamble
1- Types of access to a hard disk
2- Partitioning
a) Principle:
b) Partitions table:
3- Why save partitions ?
4- Why a DOS program ?
0- Preamble
------------
This file gives some more precise information on accessing a hard disk,
partitioning, and use of this program. Its aim is only to give this precise
information (not to give all the details on the subjects presented).
1- Types of access to a hard disk
----------------------------------
At the BIOS level, there are two types of access to a hard disk:
- By physical definition (CHS-Cylinder/Head/Sector). This access type was
the first defined, but it does not allow access to a disk with a capacity
exceeding 8 Gb, which has been far exceeded these last few years (and even
for a smaller disk, the physical definition used does not follow the true
physical definition).
- By linear access (LBA-Logical Block Addressing). A disk is seen as having
a unique leadin (like a CD). A disk with a capacity up to 2 Tb can be
accessed with this method.
If the second access type is possible, the program uses it even if the disk
capacity is less than 8 Gb.
2- Partitioning
----------------
a) Principle:
Partitioning allows installing several OSes on the same disk. Each OS has a
part of the disk and manages it as it wants.
It also allows creation of several logical drives for a given OS (for example,
the different units C: D: E: ... with DOS).
For this purpose, information on partitioning is saved on the disk so that
each OS can know to whom each part of the disk belongs: this information is
the partitions table. Once an OS knows which partition(s) it uses, it loads
functionalities with which it can access data written on this partition with
care taken as to how it must access it (FAT system on DOS, ext2fs on Linux,
...). At this level, an OS is unable to access the data of other OS's
partitions (unless it has some extensions which allows it: Linux is able to
read DOS partitions, for example).
b) Partitions table:
Only the most common format will be presented here. This format is the one
used notably by Microsoft, Linux, OS2, BeOS, ... (the only OS that I know that
does not support it is Solaris x86). My apologies to those people who have
other OSes, but I have neither the OS nor the information required to realize
tests.
The format of this partitions table is the following:
- On the first sector of a hard disk a table is saved giving 4 partitions
which can be empty. This table allows defining partition type, position on
disk and some other information.
- The restriction to 4 partitions was judged too low, so the notion of an
extended partition was added. For this purpose a special type of partition
can be defined as one of the first four partitions (now called principal
partitions). For a partition of such a type, the first sector of the
partition must be read to find a new table defining 1 or 2 partitions (it
seems that OS2 allows 4 partitions on this new table): the first one
contains data, the second one (if defined) is a new extended partition. So
if this second partition is defined, the sector at its beginning must also
be read to find a new table and so on. If the second partition is not
defined, partition search is ended. With this method a list of partitions
can be built (without limit a priori).
Information given by a partitions table entry is:
- Partition type: a number associated with each partition type. As there was
no standard defined for these types, each OS maker has chosen a number as
it wanted.
- A flag to know if this partition is bootable. This flag can generally be
defined only for principal partitions.
- The position of the partition by its physical definition on the disk (as
if we wanted to use the first access type for the hard disk). The
positions of the first and of the last sector of the partition are given.
- The position of the partition by its linear definition: the number of the
first sector (relative to the beginning of an extended partition if the
partition appertains to an extended one) and the number of sectors in the
partition.
As you can see, position information is duplicated between the physical
definition and the linear position. If the disk is accessed with linear
access, it is the linear position that is used, else it is the physical
definition.
3- Why save partitions ?
-------------------------
It appears that each OS manages its data as it wants and does not know what is
done elsewhere. So if we want to save data, we have to write a program for
each OS (and we must follow OS evolution). Another way is to bypass the OS
level by directly accessing the disk. Indeed, at the disk level data does not
seem to be organized, it is only written at a position on the disk and we do
not need to know its sense. The restraint is that it is necessary to save all
data that is related together: the minimum level is a partition.
So when saving a partition, we save all the information without knowing how it
is organized. We are free from the OS and it is even possible to save data for
which we still do not know the organization method.
Remark:
-------
The minimum set of related information that does not depend on data
representation is the partition. But when saving, care must be taken because
some OSes can relate several partitions together. For example, if you install
Windows on the C: drive and then some other programs that modify the register
base or add DLLs on the D: drive, you have to save both partitions one after
other (because the two become linked).
4- Why a DOS program ?
-----------------------
An OS must be chosen. Even if we do not need to know the data organization,
saved data must be written somewhere with a known organization for the user to
access it (for example, to write it on a CD). The choice has been made to use
DOS because it is a single-task OS. With a multi-tasking OS, imagine the
problems that can be caused by a process changing data on a partition while
saving (or restoring) of the partition is in progress. In general, there is a
way to avoid simultaneous access, but what can happen if access to the hard
disk must be forbidden for a long time, as is the case with this program (for
example, with the swap file under Windows)? And what can happen if the OS does
not fully hold in memory?
An advantage to using DOS is that it can be quickly installed (what is the
gain if you have to lose an hour to install an OS before restoring?) and can
be held on one floppy. So by running on one floppy, it is possible to
save/restore a partition even if there is no DOS partition on a computer, or
if this computer is connected to a network with a Samba server on it, or if it
has a high capacity saving system (like ZIP or LS120).
These are the reasons why this program cannot be run under Windows and why it
is not advisable to use it with an emulator running in a multi-tasking
environment (moreover, an emulator cannot define all the functionalities used
in this program).
------
All trademarks and registered trademarks are property of their respective
holders.