Data Recovery eBook by Chendu Yiwo - HTML preview

PLEASE NOTE: This is an HTML preview only and some elements such as links or page numbers may be incorrect.
Download the book in PDF, ePub, Kindle for a complete version.

d.Hard disk data organization

1.Primary formatting of hard disk

Before restoring data, hard disk usually needs low-level format, partition, high-level format to be used. The function is establishing certain data logical structure on physical hard disk. Usually hard disk is divided into 5 regions: MBR, DBR, DIR, FAT and DATA (Here we do not introduce FAT and NTFS file system), which altogether store and manage data.

Low level format
After setting parameter of hard disk in CMOS Setting, why the hard disk is still unusable? That’s about Cylinder, Header and Sector. When hard disk is firstly made in the factory, it usually is “blank”. Only after partitioning tracks and sectors, we can save data on hard disk (Now, before leaving the factory, many disks have been low-level formatted. So you may need not do the operation, but it is not unnecessary.)

Main functions of low level format
Low level format can also be called physical format, whose functions are to detect the magnetic media, to partition tracks, to partition sectors for each track, and to arrange the order of partitions in track according to the interleave the customer choose. Its main functions are as following:

1. Test the hard disk media
2. Partition tracks for hard disk
3. Arrange sectors for each track according to the specified interleave
4. Set the sector ID to each track and finish setting sectors
5. Test the hard disk surface, mark “bad” to the damaged track and sector
6. Write a certain ASCato each sector of hard disk

Hard disk is an important storage resource in computer system. Do not low-level format the hard disk unless it is the only thing possible. For hard disk being used, you need back up important data before low level format; even if back up is unnecessary, it may take much time to partition, high-level format, and install system and application programs. Usually, low level format can be used in the following cases:

When you have bought a new hard disk or hard disk adapter, you’d better low level format it again, which is for the better matching of hard disk and hard disk adapter.

“Bad” sectors, which result from long-time operation, often cause “sector not found” error in DOS. This is because of the loss of sector ID. Sector ID is used to distinguish the sectors. It is marked onto disk as the magnetization map, which however, may dribble away for long-time storage or use. Low level format is the only way for computer users to refresh sector ID in disk. This assignment cannot be done by high level format.

Appropriate set of interleave can fasten data transfer. In most conditions, low level format is the only way to change the interleave.

 

When there are always inexplicable problems, you can take low level format into consideration.

Ways to low-level format
There are many ways to low-level format. In early time, it can be completed in CMOS or by some special disk tools, or by writing some short programs in Debug. Nowadays, people usually use special tools provided free by hard disk manufacturers.

2.Advanced formatting of hard disk

High-level format
After partitioning the hard disk, some “independent” logical drivers are founded. If now we start system from the floppy drive, enter DOS, then you can see the drive letters of DOS partition, which is on behalf of logical driver, for instance “C:”, “D:” and so on. The system commonly arranges letters according to alphabet. Now let’s try to enter “C:” or “D:” after that we can see the system prompt that “DISK MEDIA ERROR”. Why? These logical disks are empty; to use them, we need create file system. The whole process is high-level format of logic disk. The high-level format certainly aims at the logic disk, neither physical disk nor certain directory. For file system is corresponding to logic disk, we can say that high-level format aims at file system. In this article, logical disk means logical drive.

Format partition
High-level format of DOS logic disk can be completed by “format” command. Main functions of high-level format are as following:

Assign logical serial numbers for sectors (serial numbers in partition) from cylinder that assigned by each logical drive


Establish DBR in basic partition, and load 3 system files of DOS if there is “/S” parameter in the command.

Establish file allocation table (FAT) in each logical disk.

 

Establish File Directory Table (FDT) that is corresponding to root directory and data area.

 

If you carry out high-level format by “Format” command, please pay attention to following 4 items.

 

1. To already activated basic DOS partition (generally it is disk C), you need the following command:

 

FormatC:/s

By this command, you may install DOS system files after high-level format, to make this logical disk to become the boot disk. Certainly, you may also use “SYS” command to send system files after high-level format, that is complete the boot disk and file transmission by the following two commands:

Format C SYS C

 

Continuously using these two commands equals to “Format C:/S” command.

 

2. For other logical disk, we only need to carry out the following commands:

 

Format ; d:=

 

“d” is the logical disk drive.

 

3. Before format, on the screen it may appear the following prompt information:

WARNING: ALL DATA ON THE DISK DRIVE C: WILL BE LOST !
Proceed with Format (Y/N) ? _

This information is warning user: The format will cause all data lose! Then, if user choose “Y”, then the high-level format officially carries on, if user choose “N”, then nothing will happened and exit.

4. For the using disk without adjusting the partition, also may carry on the fast format, the command is:

 

FormatC:/Q

 

The full command of “Format” in Windows 2000 is as following shows:

 

00003.jpg

Format hard disk partition in Windows
In explore of Windows, everything is displayed by graphics, and different forms (partition) are expressed by different colors. Click the right key in the corresponding partition, and choose “format”, you may also choose fast format, complete format and so on.

Format hard disk partition by Partition Magic

In Partition Magic, everything is displayed by graphics, and different forms (partition) are expressed by different colors. Click the right key in the corresponding partition, and choose “format”. In the dialogue box, there will be a prompt indicating this operation may destroy your own data, and in the box you may also choose different format.

Format hard disk by various hard disks special-purpose tool in hard disk factory
Low level format tool provided by various hard disks factory can help hard disk breakthrough hard disk capacity limit, as well as complete low level format, the high-level format and make partitions. After partitions are done, you can choose corresponding options step by step.

Attention: To partitions with data, backup the data before format.

 

High-level format establish the file system, after format, it may carry on write in and read out operations with file as unit.

 

3.Data storage region of hard disk

In command to know hard disk better, we must have a simple understanding of hard disk construction. (NTFS uses different file management technology with FAT16 and the FAT32 file system, here we only introduce FAT16 and FAT32) The hard disk data may divide into 5 parts approximately according to its different characteristics and functions: MBR area, DBR area, FAT area, DIR area and DATA area. Among them, MBR is founded by the partition software, while DBR area, FAT area, DIR area and DATA area are founded by high-level format procedure. When file system writes in data, it just rewrites corresponding FAT area, DIR area and DATA area. Also it is the result which these 5 regions affect together. Only by this way, hard disk can be managed methodically. Here are some introductions to the 5 regions.

MBR:
The first physical sector (cylinder 0, head 0, sector 1) of the first hard drive in the system (the first hard drive with the BIOS device number 0x80); each hard drive contains an MBR, but not every BIOS can start the corresponding operation system from every hard drive. When booting from the hard drive, the BIOS or a special Firmware loads the contents of the MBR to a fixed address in the memory and allows it to take control. This code then loads either the operation system from a bootable hard drive partition, or from a complex boot loader, such as LILO.

Short for DOS Boot Record , it is the sector at cylinder 0, column 1, and sector 1 of a hard disk. DBR is the first sector that the operation system visits. It contains a boot program and a BPB (BIOS Parameter Block). The main task of the boot program is to determine whether the first two files in root directory of this partition are the boot files of operation system, when MBR hands over the system mastery to it. Take an example of DOS, i.e. IO.SYS and MSDOS.SYS. DOS of low edition requests that these two files are the first two files, and located at the section start of the root directory, covering the first two directory items (the high edition does not have this requirement.). Moreover, Windows and DOS are families; therefore, Windows follows the same management manner, except for the filenames. If it does exist, then reads IO.SYS in the memory, and hands over mastery to IO.SYS. BPB parameter block records the start sector, ending sector, file storage form, descriptor of hard disk media, size of root directory, number of FAT and size of allocated cell.

File Allocation Table (FAT) is a file system that was developed for MS-DOS and is the primary file system for consumer versions of Microsoft Windows up to and including Windows ME. The FAT file system is considered relatively uncomplicated, and because of that, it is a popular format for floppy disks; moreover, it is supported by virtually all existing operation systems for personal computers, and because of that, it is often used to share data between several operation systems booting on the same computer (a multi-boot environment). It is also used on solid-state memory cards and other similar devices. It has a serious drawback in that when files are deleted and new files written to the media, the files can become scattered over the entire media making reading and writing a slow process. De-fragmentation is one solution to this, but is often a lengthy process in itself and has to be repeated regularly to keep the FAT file system clean.

FAT is also called 12-bit FAT, the file allocation table (FAT) for a floppy disk. The location of files on a floppy disk are listed in a one-column table in the FAT. Because the width of each entry in a floppy disk column is 12 bits, the FAT is called FAT12. As a file system for floppy disks, it had a number of limitations: no support for hierarchical directories, cluster addresses were “only” 12-bits long (which made the code manipulating the FAT a bit tricky) and the disk size was stored as a 16-bit count of sectors, which limited the size to 32MB.

The FAT file system, as is the case with most file systems, does not utilize individual sectors, and there are several performance reasons for this. By using individual sectors, the process of managing disks becomes overly cumbersome since files are being broken into 512-byte pieces. If you were to take a 20 GB disk volume set up with 512 byte sectors and manage them individually, the disk would have over 40 million individual sectors. Just keeping track of this many pieces of information is both time, as well as resource, consuming. While some operation systems do allocate specific sector storage, they also require some advanced intelligence to do so. Bear in mind how old the FAT file system is, as it was designed many years ago as merely a simple file system, without the capability to managed individual sectors.

In order for FAT to manage files with some form of efficiency is to group sectors into larger blocks referred to as clusters, or allocation units. Cluster size, however, is not a predetermined size, but rather is determined by the size of the disk volume itself, with small volumes (disk sizes) resulting in smaller clusters, and larger volumes (disk sizes) using larger cluster sizes. For the most part, a cluster ranges in size from 4 sectors or 2,048 bytes to 64 sectors or 32,768 bytes. You should be aware that you may, on some occasions, find 128-sector clusters in use at 65,536 bytes per cluster, as well as some floppy disks with smaller clusters that is usual at just 1 sector per cluster. In all cases, the sectors in a cluster are continuous, therefore each cluster is a continuous block of space on the disk.

Cluster sizing, and therefore partition or volume size, as they are directly related, have an important impact on performance and disk utilization. In all cases, cluster size is determined at the time a disk volume is partitioned. Certain third-party partitioning utilities such as Partition Magic by PowerQuest can alter the cluster size of an existing partition within specific parameters. However, this aside, once the partition size is selected, so are the cluster sizes fixed.

FAT 16 means that file allocation table that uses 16 bits for addressing clusters. It is commonly used with DOS and Windows 95 systems. A 16-bit DOS and Windows file system (see FAT) that varies cluster sizes based on hard drive size. Cluster sizes range from 4K (for drives up to 127MB), to 4K (255MB drives), 8K (511MB drives), 16K (1GB drives). and 32K (for drives up to 2GB). The ultimate capacity of a FAT16 partition is 2GB.

FAT 32 is a disk file allocation system from Microsoft that uses 32-bit values for FAT entries instead of 16-bit values used by the original FAT system, enabling partition sizes up to 2TB (terabytes). FAT32 first appeared in Windows 95B and is also found in Windows 98 and Windows NT 5.0.

In order to overcome the volume size limit of FAT16 while still allowing memory-constrained DOS real-mode code to handle the format, Microsoft decided to implement a newer generation of FAT, known as FAT32, with 32-bit cluster numbers, of which 28 bits are currently used.

In theory, this should support a total of approximately 268,435,438 (< 228) clusters, allowing for drive sizes in the range of 2 terabytes. However, due to limitations in Microsoft's scandisk utility, the FAT is not allowed to grow beyond 4,177,920 (< 224) clusters, placing the volume limit at 124.55 gigabytes, unless “scandisk” is not needed. Windows 2000 and XP placed a limit on the size of FAT32 partitions they can create at 32 GB, Microsoft says this is by design but does not explain why, and those versions of Windows are quite capable of reading and writing larger FAT32 partitions created by other means. FAT32 was introduced with Windows 95 OSR2. The many changes it incorporated made it a major improvement.

The maximum possible file size for a FAT32 volume is 4 GB minus 1 byte (232-1 bytes). For most users, this has become the most nagging limit of FAT32 as of 2005, since video capture and editing applications can easily exceed this limit, as can the system swap file.

32-bit File Allocation Table File System Not the same as VFAT or FAT, which are both 16-bit file systems.

DIR
Means Directory, also called FDTFile Directory Table. DIR is the root sector, following after the second FAT (backup FAT). It records each start cell, files. Operation system can locate files according to the outset of FAT and FAT.

DATA
DATA area is the real place where data is stored. It is after DIR, covering the most space of hard disk.

The location of the 5 areas is as following:

 

00004.jpg

Usually, MBR covers 63 sectors (actually it covers only one); DBR covers 32 sectors (actually it covers the first and the sixth sectors. The first sector works while the sixth is backup of the first); FAT1=FAT2. The length of FAT will change according to the size of partition and the number of sectors. DIR changes the most. In early time system, DIR has fixed length of 32 sectors while each file directory covers 32 bytes. As a result, there are at most 512 items under root directory. Floppy disk can only contain 112 items, or there would be no file or directory created under root directory. Afterward, the limitation is broken. From then on, there will be no single root directory, which becomes part of DATA. Even, root directory files are not right after FAT. They can be in any position in DATA.