divac

Distinguished
Aug 25, 2010
56
0
18,630
Hello,
I have been reading about the new 4k sector format. It is said that Windows 7 supports 4k sectors. But then, it is also said that ALL 4k drives on the market today still interface with 512 bytes.

These two statements do not add up? If the HDD talks 512 bytes, then there is no difference between Win7 and WinXP except for the alignment problem?
 
Solution
No, there will be no performance difference.

Even if there were such as thing as a "true" 4KByte sector drive made today, there wouldn't be a performance difference. There's no difference between sending a commands that says:

- "write eight 512-byte sectors starting at LBN 123456" followed by 4Kbytes of data

or

- "write one 4096-byte sector starting at LBN 123456" followed by 4Kbytes of data

Both actions take one command, the command itself is the same size, and the amount of data transferred over the SATA connection is...
They are using 512k emulation for now until all the vendor can update their software to work with 4K sectors, especially the backup/cloning software vendors. Then they will switch to native 4K sectors.

Will 4k sectors use capacity faster?
If you write 500 bytes and the minimum sector is 4k, will that write take up the full 4k, wasting 3.5 KB? No.

The initial WD drives - and I assume other vendors as well - will operate in a 512 byte emulation mode. Eventually new disks will operate in native 4k mode, and then you might have a concern. But many operating systems already do 4k IO, and at a couple of cents per future GB, who cares?

The emulation mode puts 8 512 byte writes into a single 4k sector. There is no loss at all. Here’s a picture:

Read this article.
http://www.zdnet.com/blog/storage/are-you-ready-for-4k-sector-drives/731
 
The newer versions of Windows work with disks that have 4K sector sizes, but older versions don't. The industry is loath to deal with support calls that will come from people who buy disks that won't work with older systems - that's why we've been stuck with disks no larger than 2TB for such a long time.
 

divac

Distinguished
Aug 25, 2010
56
0
18,630


Wait, I'm assuming newer Windows means Vista and Seven. I know these drives can be used in XP too as long as it's aligned correctly. Even if not aligned, it still works though performance suffers. So I don't get your point here.
 
When I talk about OS support for drives with 4K sector sizes, I'm not taking about the current crop of "advanced format" drives that have 4K sectors internally but which emulate 512-byte sector drives. From the OS point of view, there's no difference - they both look like drives that store 512 bytes per sector.

Windows 7 & Vista support drives which actually accept I/O commands in which 4K bytes are read or written to a single sector. Nobody's making these drives yet because they're not backward compatible with older operating systems.

So in terms of the your original question - yes, Windows 7 does support drives with 4K-byte sectors - drives that not only store that much per sector internally but also expect the OS to read or write 4K bytes for every "logical block" on the drive.

But the current crop of 4K-sector drives all emulate a 512-byte-per-sector device. That's why they work with XP. The reason for using the larger sectors internally is that the drives can cram around 10% more bytes into a track by using fewer, larger sectors and eliminating the per-sector overhead of gaps, preambles (and to a lesser extent, ECC).

The issue with XP is that it doesn't align it's partitions on a 4K-byte sector boundary, so the emulation is very inefficient. That's why you need to either use the drive's "XP alignment" jumper or partition them using a newer OS or other tool that aligns the sectors properly.
 

MarkG

Distinguished
Oct 13, 2004
841
0
19,010


In addition, if I remember correctly Windows uses a default 4k block size on NTFS for disks over a couple of gigabytes, so it should always be writing complete 4k sectors even if the disk pretends it's really 512 bytes.

The big issue is the partition alignment, which Windows 7 gets right and XP always gets wrong unless you force it to do it right.
 

divac

Distinguished
Aug 25, 2010
56
0
18,630


Yes, NTFS sets cluster size to 4kb. However, if the HDD interface is 512b, is it not going to be 'throttled'? If not, then in theory there is no performance difference between 4knative and 512emu in Win7?

I'm already on Win7, but am pondering if I will regret buying a HDD now considering everything is 512emu.
 
No, there will be no performance difference.

Even if there were such as thing as a "true" 4KByte sector drive made today, there wouldn't be a performance difference. There's no difference between sending a commands that says:

- "write eight 512-byte sectors starting at LBN 123456" followed by 4Kbytes of data

or

- "write one 4096-byte sector starting at LBN 123456" followed by 4Kbytes of data

Both actions take one command, the command itself is the same size, and the amount of data transferred over the SATA connection is the same. So no performance difference is attributable to the difference between "native" 4K commands to a 4K drive versus 512-byte commands to a 4K drive emulating a 512-byte drive.

The reason for the 4K-byte sectors is to get more capacity per track, not because it's faster.

Mind you, because 4K sectors cram a little more data in each track, the data IS transferred a little faster than with 512-byte sectors (more data per track = more data transferred with each rotation of the platter). But that's true of ANY 4KByte/sector drive whether it emulates a 512-byte sector drive or not. The performance difference isn't about the commands used to transfer the data or the sector size that the OS thinks is being used, it's about the physical layout of data on the track.
 
Solution

lafontma

Distinguished
Jan 4, 2006
218
0
18,710



This is not quite correct. Writing 8 sectors of 512 bytes will most likely require more head movements then 1 write of 4k. All depends on disk fragmentation, but more likely then not the 8 writes will not be contiguous all the time nor even most of the time unless you are continously defraging your disk.
 
The default cluster size for NTFS is 4K bytes - that means the file system always reads and writes information in contiguous 4K chunks. This is the big reason that 4Kbyte-sector drives that emulate 512-byte sector drives are practical - the drive never has to update just one 512-byte piece of information in one of it's 4K sectors because the file system never makes such a request. The only time that rule breaks is if the partitions aren't aligned on 4K boundaries, and that's why XP-partitioned disks have an issue.

Reading or writing a 4K chunk will never require head movement on a drive that has 4K-byte sectors. It could only potentially require a 1-track seek on disks with 512-byte sectors if the 8 consecutive sectors happen to span from the end of one cylinder to the start of the next.
 

stabilo

Honorable
Jun 15, 2012
9
0
10,510
I'm trying to follow you guys about this 4k thingie but my head is already spinning. I do however understand why the need is for the 4k sectors on modern hard-drives (I did some reading). I also understand hard drives now do 512 sector emulation when communicating to the host-system. But physically translate the incoming 512 logical sector data to physical 4k sectors or something. But then it gets blurry.

Would you all be so kind to help me keep it practical?

I got this brand new Samsung HD204UI harddrive which uses 4k sectors. Now what do I do now to get this new hard drive up- and running at it's best?

My system runs Windows 7 64-bit, MSI E65 AMD AM3 motherboard, with Athlon II 440 3* core processor.


Will I need to setup special BIOS options?
Do I need special BIOS functions?
What sector size to choose to format the drive corrrectly?
Do I neeed to set jumpers on the drive beforehand?
Do I need special software to format this drive properly or just 'disk management' in windows?
What software do I use to test this drive for bad sectors and performance (I do have HD-Tune Pro 4.60)

TIA for all the useful help!