All times are UTC - 5 hours [ DST ]


Switch to mobile style


Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Partition Table Structure
PostPosted: June 1st, 2005, 8:43 
The Partition structure

In Dos like system, the partition table entry is stored in a data structure called Master Boot Record (MBR). MBR is the most important data structure in the disk. It lies on the first sector of the disk and is created by disk partitioning programs like fdisk. It is the most critical part of the disk. If it is damaged or erased accidentally, all the data will be lost.

The MBR structure contains of three parts: the master boot code, partition table and the signature. The master boot code is a small program which scans the partition table for the active partition, finds the starting sector of the active partition, loads the boot sector from the active partition to the memory and transfers the execution flow to the loaded code.

The last two bytes of the MBR is a magic number ‘0x55AA’ which is called the signature.

The information of the partitions lies in the Partition table entry. It starts at 446 bytes and is 64 bytes long. It contains 4 partition table entries each 16 bytes long. Thus, there can be only four primary partitions in a disk. The fields of the partition structure are given below in the form of C structure.

Struct partition {

BYTE bootIndicator;

BYTE startingHead;

unsigned startingSector :6;

unsigned startingCylinder:10;

BYTE systemId;

BYTE endingHead;

unsigned endingSector:6;

unsigned endingCylinder:10;

DWORD relativeSectors;

DWORD totalSectors;

};

bootIndicator (offset 0x01be):- The boot indicator tells if the partition is active or not. The value of 0x80 denotes active and 0x00 inactive (There must be only one active partition).
startingHead (offset 0x01bf), startingSector (offset 0x01c1), startingCylinder (offset 0x01c3):- The startingHead, startingSector and startingCylinder gives the starting position of the partition in chs mode.
systemId (offset 0x01c2):- This field gives the type of the partition. E.g. 0x83 for ext2 partition.
endingHead (offset 0x01c4), endingSector (offset 0x01c5), endingCylinder (offset 0x01c6):- These fields give the ending position of the partition.
RelativeSectors (offset 0x01c6):- Offset from the beginning of the disk in sectors.
totalSectors (offset 0x01ca):- The total sectors in the partition.


Among the four primary partitions one is the extended partition and contains the logical partitions. The Partition Table Entry in the Extended Partition points to the MBR like structure called the Extended Boot Record (EBR). There is a EBR for each logical partition. Among the four Partition table entry, first entry points to the boot sector of the logical partition. Second entry points to the EBR of the second logical partition. Thus, the logical partitions are the linked lists.

Maybe this can help , in some recovery situation.

Jose Pinto
HDDLAB


Top
  
 
 Post subject: More about MBR
PostPosted: June 1st, 2005, 22:04 
Offline

Joined: November 12th, 2004, 1:56
Posts: 53
:)

Its a good link MBR unassembly,and more

http://www.ata-atapi.com/hiwmbr.htm

enjoy it


Top
 Profile  
 
 Post subject:
PostPosted: June 2nd, 2005, 6:57 
Hello Alberto,
A good thing to write here can be this ( and has a lot more, of course ), what is INT13 and its function and what is INT19 and its function.
And we also can write more about Hard Disk System Structure in this post, and is open to anyone that would like to help everyone here in learn about disk system.

Jose Pinto


Top
  
 
 Post subject:
PostPosted: June 13th, 2005, 6:46 
Offline

Joined: October 28th, 2004, 3:58
Posts: 49
Hard Disk Drive Functionality
Some things about HDD stucture and other basic things.

Samuil Karakashev


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: Google Adsense [Bot], mayanksharmaggc and 53 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group