Hard Disk Bad Sector Mapping
When a hard disk is manufactured, there are areas on the platter that have bad sectors. Considering that on a 200 GB hard disk there are 400 million sectors, then a few bad sectors is only a miniscule proportion of the total sectors. During the final test phases of a hard disk, the platters are scanned at the factory and the bad sectors are mapped out - these are generally called 'Primary Defects'. The primary defects are stored in tables in the firmware zone, or in some cases the ROM of a hard disk.
When you buy a brand new hard disk, you will most likely be completely unaware of these bad sectors and the numbers because they are 'mapped out' using 'translator' algorithms.
Modern hard disk use Logical Block Addressing, this describes the sector numbering system on the hard disk, and goes in sequence
0,1,2,3,4,5,.....n-1,n (where n is the last sector on the drive.
Spare sector pools
All modern drive have a spare sector pool. This is mainly used as bad sectors develop during the life of the hard disk and any new bad sectors are replaced with good ones from the spare sector pool, again this process is invisible to the user and most users will never know that anything has changed.
How the Bad Sector Mapping Works
- P-List Remapping
lets say we have a hard disk with 100 sectors and a 10 sector spares pool. When bad sectors are found at the factory, shift-points are entered into the p-list, if we take the following LBA sequence: 0,1,2,3,4,5,6,7,8,9,10 ...100
Lets say that Sectors 3, 6 and 9 are found to be bad. The first part of the mapping will look like this: 0,1,2,B,4,5,6,7,8,9,10 .. What happens here is the bad sector at position 3 is recorded in the p-List. The new map now looks like this; 0,1,2,P,3,4,5 .. You can see now that 3 is where 4 was, so the original sequence is maintained.
The next bad sector is now found 0,1,2,P,3,4,5,B,7 and is again mapped out giving 0,1,2,P,3,4,5,P,6,7 When the whole sequence is complete, our final map looks like this. 0,1,2,P,3,4,5,P,6,7,8,P,9 Because these sectors are mapped out, the user will never be aware that they exist. If you want to look at sector 6, the drive will translate that to physical sector 8. It takes the 6 and adds the shift points to it, +1 for the bad sector at LBA3 and +1 for the bad sector at LBA5.
When the testing gets to the end of the drive, in order that it is of the correct LBA value, it allocates the sectors from the spare sector pool. Again, completely concealing the fact that there are bad sectors on the media. To all intents and purposes the drive looks just like the original as 1,2,3,4,5,6,7,8,9,10. However, our spare pool has reduced in size and there are now 7 sectors left in the spare pool. - G-List Remapping
Grown defect list or g-List are tables containing the location of bad sector defects found during normal operation of the hard disk drive. When a bad sector occurs during normal use of the drive, something similar happens to that during p-List generation - the bad sectors are mapped out, however the process is slightly different. Lets say our hard disk develops a bad sector at the current LBA 6. What happens in this case is first the bad sector is mapped out. Giving; 0,1,2,3,4,5,G,7,8,9,10 .. A sector from the spare pool is allocated in the bad sectors place. We used 3 of these sectors in factory testing, so the next available bad sector is 104 this now becomes mapped to LBA 6 so our sequence would look like this; 0,1,2,3,4,5,104,7,8,9,10 Again, this process is completely invisible to the user and will still look like the original sequence of 0,1,2,3,4,5,6,7,8,9,10
Translation Algorithms
When a hard disk is powered up, the p-list and g-list are usually loaded into RAM on the controller card. As requests for data come through, the location where the data is required from is passed to the translator, which makes calculations as to which sectors to actually read in order to get to the actual data.
So, in our example above, if we wanted the data from LBA 6 the translator would first run through the p-list and adds 2 for the two bad sectors found at the factory, it then checks this value in the G-list and finds it has been reallocated to sector 104. It then reads sector 104 and presents you with the data.
Free diagnosis, no data recovery, no fee
All data recovery work undertaken by MjM is under a Free diagnosis and a no recovery no-fee policy. If we can't recover your data, then there is no fee for you to pay.
If you have lost data or your drive has stopped working contact us now.