How to Perform Better Recovery on Drives with Long Physical Sectors

5 Jan 2012

Your data recovery process needs to accommodate the peculiarities of the Long Physical Sector format if you want to achieve higher imaging speeds, spend significantly less time processing problematic areas, and minimize the risk of facing a drive failure during the imaging process.
Knowing this, we’ve given DeepSpar Disk Imager 4 the functionality to handle the Long Physical Sector format. Here’s why it matters.

What is the Long Physical Sector format?

Most high capacity drives nowadays have the Long Physical Sector format, meaning that there are multiple logical sectors (LBA: 512 bytes) per physical sector (PBA: 1KB or 4KB). You can find lots of information about this subject on the Internet. We’re most interested in the impact that the Long Physical Sector format has on data recovery processes.

Why did hard drive vendors decide to use this format?

The first reason is that most modern drives use a 32-bit CPU and/or 32-bit firmware architecture and these drives cannot support capacities higher than 2TB (2^32 sectors limit). The easiest way to overcome this limit was to increase the physical size of each sector from 512 bytes to 1KB or 4KB. By increasing the physical sector to 4KB, hard drive vendors are now able to support drive capacities up to 16TB while still using 32-bit architecture.

The second reason is the fact that hard drive vendors have always been trying to achieve a better price-per-GB ratio. Since increasing the densities of the disk platters has always been quite a challenging task, the easier solution was to try minimizing the disk capacity utilized for metadata.

The Long Physical Sector format optimizing the disk capacity in two ways:

  • It minimizes the space used for gaps between the sector’s Header and Data (fewer sectors means less space used by gaps)
  • It reduces the number of bytes used for ECC data. Increasing the length of physical sectors on the media increases the efficiency of ECC by enabling better error detection and correction while using a smaller proportion of media.

Have the Long Physical Sector drives made an impact on data recovery processes?

On one hand, since the interface sector size (that is, the logical sector size of an LBA) of all long physical sector drives is still 512 bytes, all data recovery hardware and software should continue using the same ATA commands to access the drive. Thus, no changes are needed as far as the ATA protocol is concerned. In fact, such drives do not even provide any standard ATA commands to access physical sectors (PBA) directly and so you still need to communicate to the drive using LBA (the 512-byte Logical Block method).

On the other hand, since reading sectors is mostly done in blocks, the imaging process should take into account the following considerations.

1. The first byte of data transfer should begin at the first byte of a physical sector and the last byte of data transfer should end at the last byte of a physical sector.

Obviously, this rule is required to increase performance and to achieve higher imaging speeds. This consideration is especially important for those drives that have any read cache limitations or those that need to be imaged while the read look-ahead feature is disabled.

However, the main reason for this block alignment rule is to avoid unnecessary access to physical sectors crossing the beginning or the end of the read block, that is, physical sectors that are not aligned to the start or the end of the block. The drawbacks of not following this rule are as follows:

  • Unaligned physical sectors are accessed twice during the imaging process, causing extra wear on the drive in situations when those sectors cause any read instability issues.
  • Adjacent read blocks that are crossing the same unaligned physical sector result in the same problem, that is, a read timeout or an ATA error. In other words, the imaging process is not able to localize that particular problematic physical sector and so both read blocks crossing that sector are affected.

2. If a physical sector causes any read instability issues, such as a bad sector, accessing any LBA located in that PBA will result in exactly the same outcome.

An imaging process should take this fact into account to avoid unnecessary read attempts leading to further wear on the drive and higher risk of drive failure. Also, such unnecessary read attempts may significantly increase imaging time, because processing problematic areas is usually the longest part of the imaging process and therefore the total imaging time may easily double or even triple if your imaging process doesn’t accommodate this instability issue.

For example, since most high capacity drives nowadays have 4KB physical sectors and imaging problematic areas is usually executed a single LBA at a time, as soon as any bad PBA is accessed once, the following seven attempts to read other LBAs of that same physical sector are unnecessary and will result in seven more identical bad sectors. So, the wear on the drive and the processing time for that problematic area will be increased by eight times!

What you need to know about Long Physical Sector parameters

The ATA Specification has been updated to provide extra capabilities for drives to report various parameters of their Long Physical Sector architecture. There are two critical parameters: 1) Number or LBAs per PBA and 2) Location of LBA 0 within PBA 0. As you can see, the situation is a bit complicated by the fact that the first physical sector of the drive may contain a smaller number of LBAs than other physical sectors. This feature was necessary to build drives with a specific PBA-LBA alignment required by a particular file system. In fact, many of the earlier long physical sector drives had the location of LBA0 within PBA0 equal to 1 (instead of 0) for the purposes of alignment of the first partition of the drive, usually located at LBA63, so that the entire partition would be PBA-aligned.

We should mention that some drives, especially earlier ones, do not report their Long Physical Sector parameters, which is unfortunate. As a result, an imaging tool cannot automatically request these parameters from the drive to adjust its imaging algorithm according to the particular architecture of the drive. This means that the tool should also provide the ability to enable the Long Physical Sector algorithm manually by providing the corresponding parameters of the drive. In most cases, it is quite easy to identify those parameters as soon as the first physical bad sector is accessed during the imaging process. You can then see the number of LBAs per PBA and calculate a location of LBA0 within PBA0 of the drive.

Now you know the importance of the Long Physical Sector format when it comes to data recovery. DeepSpar Disk Imager 4 makes it easy to apply what you know: all you have to do is enable the Long Physical Sector Imaging Algorithm option and adjust the Long Physical Sector parameters of a particular drive, if necessary.