Jump to content

Partition Boundary Alignment in 4096-byte physical sector drives


Recommended Posts

Jaclaz,

Just one more question about bootloaders on 4K sectors. Does that mean that any "ordinary" bootloader/manager, which was designed for 512byte sectors, can reside partially in the (first 512byte) MBR, and then continue from the 1025th byte onwards in the first 4K sector, all the way up to the last byte of the 256th 4K sector, just before the beginning of the first partition? Also, can any "ordinary" bootloader/manager, which was designed for 512byte sectors, function without any risk for problems on a 4K sector drive?

I noticed that with older drives there is alway the offset of 63 512byte sectors; it looks like it is an international standard. However, is there also an international standard for the offset in 4K drives?? Microsoft uses an offset of 256 times a 4K sector, but the HD manufacturers (WD, Seagate) seem to deviate from that. I think (but I could be wrong) this could be annoying for the developers of more sofisticated boatloaders. Anyhow, so far so good for the MBR related stuff. I have some other questions about partition in the next message.

johan

Link to comment
Share on other sites


Just one more question about bootloaders on 4K sectors. Does that mean that any "ordinary" bootloader/manager, which was designed for 512byte sectors, can reside partially in the (first 512byte) MBR, and then continue from the 1025th byte onwards in the first 4K sector, all the way up to the last byte of the 256th 4K sector, just before the beginning of the first partition? Also, can any "ordinary" bootloader/manager, which was designed for 512byte sectors, function without any risk for problems on a 4K sector drive?

No.

You got it wrong. :ph34r:

An "ordinary" MBR is 512 bytes long, NO MATTER sector size of the hard disk.

The BIOS will read first 512 bytes of the hard disk, NO MATTER sector size of the hard disk.

*ANY* bootmanager/bootloader may be longer than 512 bytes AND has to provide code to read beyond the 512th byte, NO MATTER sector size of the hard disk.

AS AN EXAMPLE of such kind of MBR bootloader/bootmanager I cited grub4dos and it's grldr.mbr.

That PARTICULAR, SPECIFIC EXAMPLE uses bytes 512÷1023 to store a backup of previous - if any - MBR.

In normal operation the grldr.mbr code (within the first 512 bytes) "jumps over" the second 512 bytes and continues to read up to where it is instructed to, in the specific case not beyond the end of it's code which is in total 9216 bytes.

Also, can any "ordinary" bootloader/manager, which was designed for 512byte sectors, function without any risk for problems on a 4K sector drive?

You are falling in the usual "generalization" error. :w00t:

*any* makes no sense, as well as "ordinary".

In theory yes, *any and all* MBR codes and bootmanager/bootloaders, including "ordinary" and "rather uncommon" and "exceptionally good" ones ;) will work allright, NO MATTER sector size of the hard disk.

BUT:

In theory there is no difference between theory and practice, but in practice there is.

YMMV.

I noticed that with older drives there is alway the offset of 63 512byte sectors; it looks like it is an international standard. However, is there also an international standard for the offset in 4K drives?? Microsoft uses an offset of 256 times a 4K sector, but the HD manufacturers (WD, Seagate) seem to deviate from that. I think (but I could be wrong) this could be annoying for the developers of more sofisticated boatloaders. Anyhow, so far so good for the MBR related stuff. I have some other questions about partition in the next message.

It is not an "international" standard, it was a "practical consequence" of the initial completely botched approach (in the sense of not enough "open" to future increasing in size of hard disks) which is (was) the CHS addressing scheme AND for historcal reasons (actual way hard disks were initially made).

If you think of a common floppy, it has a geometry of 80x2x18 AND it actually has 2 Heads (Sides) and actually each side has 80 cylinders, each containing 18 sectors.

Early hard disks were the same.

Very soon physical geometry lost each and any resemblance with logical geometry.

You will need to go all the way through this to understand this "evolution" and to understand WHY the nx255x63 geometry became a "standard".

http://www.pcguide.com/ref/hdd/bios/size.htm

Be warned that the mentioned site goes through ALL historical size barriers (no matter which was the cause) whilst you are interested in those that are BIOS/IDE/ATA related only, BUT you need to read them all to understand the path taken.

jaclaz

Link to comment
Share on other sites

Jaclaz,

Still a few questions.

Q1: What are the best tools for looking up bad sectors, or looking up those sectors that *might* become (or have a high potential of becoming) bad in the "near" future? Is Disk Management under Win7 good enough for that job?

From what I read, the latest drives check for (very) bad sectors in an automated way (on the fly). If sectors have to be re-read too often, the firmware in the drive could move the data off the suspicious sector to a spear sector, or something like that. However, I want to minimize the chance that any sectors in the next coming years start causing trouble; that way I could minimize the probability that I loose any data or have any other problems the next coming years. Hence that I'm looking for a tool that could look for potentially future bad sectors (some tool that can test the sectors to the very extreme).

Q2: What are according to you the best tools---meaning, delivering the most comprehensive, detailed hardware info of the drive---for analyzing 4K (and 512byte too) sector drives? (Probably, any such tool will rely on SMART info from the drive.)

Q3: What are the best Benchmark tools for testing the performance of 4K sector drives? I got DiskSpeed32 and Atto Disk Benchmark v.2.47, but I assume there must be more powerful stuff out there. NOTE, I got Win7HP, 64-bit.

Thanks in advance,

johan

Link to comment
Share on other sites

Still a few questions.

You won't like the answers. :(

A1. There is "NO" *best* tool that I know of. Whether a disk will develop bad sectors and whether bad sectors are going to spread and/or will be relocated automatically by the disk firmware is something that no program can forecast reliably and anyway you cannot do nothing about it. BTW, if you want to unneededly put additional stress on a disk :w00t: you may want to run from time to time Victioria, here:

http://majorgeeks.com/Victoria_for_Windows_d5688.html

though it won't probably run on 64 bit and, if you choose the "wrong" settings, you can easily botch a hard disk for good. :ph34r:

It is a tool that is more suited to check a disk when attempting reconditioning it than a "periodical check".

A2. There is "NO" *best* tool that I know of. There are dozens of similar tools that read S.M.A.R.T. data. It's the S.M.A.R.T. mechanism that is the issue, IMHO. See here:

A3. Benchmarking a disk makes very little sense (unless you are trying to publish a disk speed comparison). A benchmark is only useful as "comparison" metrics. Real life (and real data transfer) is very different from what any bechmark reports, for a quick idea of what is happening I normally use Atto, though since it is aging, probably it is not fully reliable on newish disks/OS.I guess that if you want such an app you shoud check published disk benchmarking tests and see what they use.

jaclaz

Edited by jaclaz
Link to comment
Share on other sites

Still a few questions.

You won't like the answers. :(

jaclaz

Yes, that's right I don't like the answers, but I guess I just have to learn to live with the non-perfect tech-world. Still got a question about bad sectors, though. Right-click any drive in WinExplorer root level, -> Properties, Tools, Check Now, then one can Scan for and attempt recovery of bad sectors. If I create just ONE primary partition onto my 2TB drive and I perform a full Scan for bad sectors, do I have to scan again for bad sectors in the newly created partitions after I've split the drive into smaller partitions. Note, I just hope Win7 can scan for bad 4K sectors just as good as it can scan for bad 512byte sectors (If that is not the case, then please notify).

Thanks,

johan

Link to comment
Share on other sites

Yes, that's right I don't like the answers, but I guess I just have to learn to live with the non-perfect tech-world. Still got a question about bad sectors, though. Right-click any drive in WinExplorer root level, -> Properties, Tools, Check Now, then one can Scan for and attempt recovery of bad sectors. If I create just ONE primary partition onto my 2TB drive and I perform a full Scan for bad sectors, do I have to scan again for bad sectors in the newly created partitions after I've split the drive into smaller partitions. Note, I just hope Win7 can scan for bad 4K sectors just as good as it can scan for bad 512byte sectors (If that is not the case, then please notify).

I don't think that you will find *any* bad sector. :unsure:

On modern hard disks, the disk firmware should re-locate the bad sector mapping (and increase one of the S.M.A.R.T.) registries.

But no, you don't have to re-scan the disk, not even with old controllers, unless of course, but it really is a VERY rare occasion, the bad sector "appears" in the short time between your check and the re-partitioning.

jaclaz

Link to comment
Share on other sites

  • 2 weeks later...

Hi,

The 2TB (4K-sector; 512e; Advanced Format) drive of mine is a Seagate drive. I used SeaTools for Windows to check the drive---took me a whole long day---and all seems ok. A comparison of SMART info from before and after the SeaTools testing revealed no problems with the drive. Most important SMART attribute 'Reallocated Sector Count' remained pinned down at zero. On the other hand, the attribute 'Hardware ECC recovered' went from 19 to 27 (Current); the value for Worst remained at 15. Hope the attribute 'Hardware ECC recovered' is ok.

For downloading SeaTools for Windows, go to:

http://www.seagate.com/www/en-us/support/downloads/seatools

Note; SMART check in SeaTools returns "Test unavailable". I contacted Seagate support via email and they told me that it's probably because the drive is in a third party USB enclore. I find that hard to believe as CrystalDiskInfo and PC Wizard 2010 both give me huge amounts of very *SMART* info about the drive.

Seagate also has a Partition Offset Information (POI) Utilitie:

http://seagate.custkb.com/seagate/crm/selfservice/search.jsp?DocId=214391&NewLang=en

POI does work fine on my internal 512-byte sector drives of both laptops (XP and W7), but on the 2TB drive POI does not work at all. Also here, Seagate support purported POI does not work on drives in third party external enclosures, as mine. I have to say I also find that nonsense because PTEDIT32 (which is 12 years old) and PartitionInfo 8 both give the number of "Sectors Before" the beginning of all partitions, on the internal drives as well as on the external drive. Divide the "Sectors Before" by 8 and if the outcome is an integer than the partition in question is aligned. The same job for all other partitions (and maybe also on the total sectors inside each partition) return an integer in case of proper alignment. Strange that POI from Seagate cannot do that.

I've found another cute Alignment Checker called Disk Alignment Test (short: diskat):

http://diskat.net/download-en.html (if the site is not down)

I got it from

http://www.hddoctor.net/how-to-fix-disk-alignment-in-advanced-format-hard-drives/

Diskat did exactly the job on the Seagate 2TB drive that POI didn't, couldn't or wouldn't do.

All the alignment stuff raised a question with me. If Advanced Format drives emulate 512-byte sectors, how come that utilities like Diskat (and POI) somehow know that the 2TB drive is a 4K physical sector drive?? I couldn't find any attribute in SMART that passes on to Diskat or POI info about the number of bytes per physical sector.

nice links:

http://www.techsupportalert.com/freeware-forum/system/6404-discussion-about-advanced-partitioning.html

http://www.techsupportalert.com/content/best-free-partition-manager.htm

Regards,

Johan

PS: I'll be off for a week. Back on 28 Dec.

Link to comment
Share on other sites

Note; SMART check in SeaTools returns "Test unavailable". I contacted Seagate support via email and they told me that it's probably because the drive is in a third party USB enclore. I find that hard to believe as CrystalDiskInfo and PC Wizard 2010 both give me huge amounts of very *SMART* info about the drive.

Actually this is most probably correct.

The USB protocol prevents some "data structures" to "pass through".

As an example, try accessing an hard disk with Victoria for windows when it is directly connected to the MB (Pata or Sata) and when it is connected through a USB adapter/external case.

POI does work fine on my internal 512-byte sector drives of both laptops (XP and W7), but on the 2TB drive POI does not work at all. Also here, Seagate support purported POI does not work on drives in third party external enclosures, as mine. I have to say I also find that nonsense because PTEDIT32 (which is 12 years old) and PartitionInfo 8 both give the number of "Sectors Before" the beginning of all partitions, on the internal drives as well as on the external drive. Divide the "Sectors Before" by 8 and if the outcome is an integer than the partition in question is aligned. The same job for all other partitions (and maybe also on the total sectors inside each partition) return an integer in case of proper alignment. Strange that POI from Seagate cannot do that.

See above.

The "Sectors before" are data stored in the MBR, you can (obviously) access these no matter the interface/connection.

If you prefer this kind of data is "public".

Manufacturer proprietary tools, generally speaking use different ways to connect to the device, having access to other, proprietary, settings.

Even if there is no need whatsoever to use those to align or re-align a partition, it is very possible that they have a "base" program using this kind of "privileged" access instead of "standard" reading/writing, and they made the aligning tool out of this "base".

All the alignment stuff raised a question with me. If Advanced Format drives emulate 512-byte sectors, how come that utilities like Diskat (and POI) somehow know that the 2TB drive is a 4K physical sector drive?? I couldn't find any attribute in SMART that passes on to Diskat or POI info about the number of bytes per physical sector.

Because that data is NOT in the S.M.A.R.T. set of attributes, but in other data structures (no, don't ask me where exactly) and these latter data structures are anyway "publicly" accessible.

jaclaz

Link to comment
Share on other sites

All the alignment stuff raised a question with me. If Advanced Format drives emulate 512-byte sectors, how come that utilities like Diskat (and POI) somehow know that the 2TB drive is a 4K physical sector drive?? I couldn't find any attribute in SMART that passes on to Diskat or POI info about the number of bytes per physical sector.

Hi, the information about the physical sector comes with ATA IDENTIFY command reply for ATA devices and READ CAPACITY (16) for SCSI ones.

Link to comment
Share on other sites

Note; SMART check in SeaTools returns "Test unavailable". I contacted Seagate support via email and they told me that it's probably because the drive is in a third party USB enclore. I find that hard to believe as CrystalDiskInfo and PC Wizard 2010 both give me huge amounts of very *SMART* info about the drive.

Actually this is most probably correct.

The USB protocol prevents some "data structures" to "pass through".

As an example, try accessing an hard disk with Victoria for windows when it is directly connected to the MB (Pata or Sata) and when it is connected through a USB adapter/external case.

It depends on conrete model of USB/ATA bridge. Most modern bridges allow pass-through in standard way. In this case the SMART and IDENTIFY data are available for great number of software. But some models don't support pass-through at all. Others allow only vendor-specific commands.

Link to comment
Share on other sites

  • 2 weeks later...

SUBJECT: 512-byte-size clusters on Advanced Formate drives.

Just want to report a peculiarity about 4K-physical sector drives that emulate 512-byte sectors (Advanced Format [AF] drives). What follows might seem trivial to many readers, but anyhow, I figured I'll drop it on this blog.

I've formatted my 4K physical sector 2TB AF drive in clusters (Allocation Unit Size) of 512 bytes under WinXP: guess what, it works! Unbelievable!

I checked it with a notepad document of 130 bytes. On my old 512-byte physical sector drive, which is formatted with 4096-byte clusters, the Size On Disk is 4096 bytes. However, on the 4K sector 2TB drive, the Size On Disk is 512 bytes too!!! As far as I understood, one 4K physical sector could be home to 8 different files of each less than 512 bytes.

So, even if the beginning of any partition on a 4K-physical sector drive would be aligned (by whatever trick, or tool, or utility under WinXP), my temporary conclusion is that 2 files could still be starting and ending within the same 4K physical sector, resulting in a performance degradation. It seems obvious to me that partition alignment only makes sense if the cluster size is a multiple of 4096 bytes.

Nonetheless, I haven't found any information on the Internet about the issue that clustersize must be a multiple of 4096 bytes for making partition alignment effective. I wouldn't be surprised there are folks out there who try to combine a partition alignment with cluster sizes of 512 or 1024 bytes.

All this was on WinXP.

One would expect that on a modern OS like Win7 this kind of nonsense would not be possible, but forget it!; exactly that kind of nonsense is possible in Win7. I just formatted my 4K physical sector 2TB AF drive under Win7 in clusters of 512 bytes. I checked it with a 259-byte notepad text file and the Size On Disk is 512 bytes. During partitioning and formatting Win7 (Disk Management) puts the partition(s) at an offset of 1048576 bytes so that the partition(s) on an Advanced Format drive is always aligned. However, Win7 allows the user to erase the advantage of partition aligned. Any user, ignorant about the partition alignment issue, and more concerned about minimizing waist of disk space for large numbers of small files, can put the cluster size at a fraction of 4096 bytes.

Is there anybody who could confirm this flaw in Win7 formatting of AF drives?

Johan

Edited by DiracDeBroglie
Link to comment
Share on other sites

SUBJECT: 512-byte-size clusters on Advanced Formate drives.

You are right. The cluster size must be a multiple of the physical sector size.

I have tried to describe the role of file system for AF-disks at http://diskat.net/background-en.html

I think the possibility of formatting with small cluster on Win7 will be eliminated in some update.

BTW, have you SP1 or http://support.microsoft.com/kb/982018 on your Win7 ?

Edited by SergeyVolynkin
Link to comment
Share on other sites

Hi,

I got Win7 Home Premium SP1. I know the KB doc but it is not applicable to my case as my internal Win7 drive is a 512-byte physical sector 1TB drive.

In the mean time I ran into another partitioning problem under Win7:

where I could really use some help.

johan

Edited by DiracDeBroglie
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...