520 Byte Sector Harddisk problem

Hi Friends,

I am connecting a 520 byte Sector hard disk(SATA) to windows OS and OS is detecting the disk. But my problem is that I am not able to initialize the disk. So I am not able to use the disk. My OS is Win7 Ultimate 32 bit. I have to make windows intialize the disk so that I can issue commands to the disk.
Can some body suggest what exaclty I have to do to make this work?
Can I write some filter driver and acheive this?
Please help.

Regards,
Sony

I have never heard of a 520 byte sector HD for general consumer sales. I
don’t believe Windows supports anything other than 512 byte sectors and I
have heard there is support for 4KB sectors (2048 bytes), and some of the
“green” drives use sectors of some multiple of 512 bytes. That might be
restricted to powers of 2 sectors.

wrote in message news:xxxxx@ntdev…
> Hi Friends,
>
> I am connecting a 520 byte Sector hard disk(SATA) to windows OS and OS is
> detecting the disk. But my problem is that I am not able to initialize the
> disk. So I am not able to use the disk. My OS is Win7 Ultimate 32 bit. I
> have to make windows intialize the disk so that I can issue commands to
> the disk.
> Can some body suggest what exaclty I have to do to make this work?
> Can I write some filter driver and acheive this?
> Please help.
>
> Regards,
> Sony
>

You are right this is not for normal users but for enterprises and this is some thing new. Here I need to develop a tool to test this HDD but I cannot do anything if windows does not detect or intialize this disk. Your help on how to approach this problem will be highly appreciated.

I think maybe you have to find a SATA controller and proper driver to support that disk.
In SCSI Miniport driver, SCSIOP_READ_CAPACITY can specific bytes per block and disk capacity. Not sure Windows can recognize 520 bytes per block.

Thanks
Wayne

Date: Sun, 8 Aug 2010 20:45:15 -0400
From: xxxxx@rediffmail.com
To: xxxxx@lists.osr.com
Subject: [ntdev] 520 Byte Sector Harddisk problem

Hi Friends,

I am connecting a 520 byte Sector hard disk(SATA) to windows OS and OS is detecting the disk. But my problem is that I am not able to initialize the disk. So I am not able to use the disk. My OS is Win7 Ultimate 32 bit. I have to make windows intialize the disk so that I can issue commands to the disk.
Can some body suggest what exaclty I have to do to make this work?
Can I write some filter driver and acheive this?
Please help.

Regards,
Sony


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

> … this is not for normal users but for enterprises

Well, I am afraid your choice of the target OS is, probably, wrong then…

…and this is some thing new.

Well, this is certainly not “something new” - enterprise drives have long had the capability to be reformatted to 520 bytes to allow the array firmware to use these extra 8 bytes to store the integrity information. Furthermore, T10 Protection Information Model was introduced as a way to use those extra bytes in a standardized fashion.

However, this model specifies only the protocol between the host adapter and the storage device - the way the OS interacts with the I/O controller is outside of its scope. AFAIK, Windows just would not
recognize 520-bytes-per-sector disk. Therefore, I think you should try to use some OS that is more suitable for enterprise use…

Anton Bassov

> Therefore, I think you should try to use

some OS that is more suitable for enterprise use…

Very subtle Anton :slight_smile:

James

>Very subtle Anton :slight_smile:

Probably in this particular case the OP may find the following link to be of interest
http://lwn.net/Articles/285371/

Anton Bassov

> recognize 520-bytes-per-sector disk. Therefore, I think you should try to use some OS that is more

suitable for enterprise use…

What OS has the real-world replacement of MS Exchange Server in it?

Better to forget 520byte/sector drives in the computer itself (their place is in the dedicated RAID box), then to forget Exchange which is by far one of the best enterprise software titles ever created.


Maxim S. Shatskih
Windows DDK MVP
xxxxx@storagecraft.com
http://www.storagecraft.com

> have heard there is support for 4KB sectors (2048 bytes)

I think these drives still support IO aligned to 512byte boundary, it is just slower.


Maxim S. Shatskih
Windows DDK MVP
xxxxx@storagecraft.com
http://www.storagecraft.com

> I am connecting a 520 byte Sector hard disk(SATA) to windows OS

Such a drive is not intended for general computer use.

It is a highly special thing intended for the dedicated RAID/SAN boxes.

If you’re lucky, you can find a controller board+its driver capable of attaching these drives to usual PC and representing them as 512b/s.


Maxim S. Shatskih
Windows DDK MVP
xxxxx@storagecraft.com
http://www.storagecraft.com

> Probably in this particular case the OP may find the following link to be of interest

http://lwn.net/Articles/285371/

So, Linux still uses 512b/s on these drives, while supporting the additional 8b/s as out-of-band “special info” which can be attached to IRPs (or how they are called in Linux? block device stack there surely uses the same kind of structures).

This “special info” is useless unless there is some layer above the disk stack to make use of it, and I’m not sure there are such software RAID implementations in Linux now.

Windows Dynamic Disk is surely happy without these additional 8b/s, so, it would be useless for Windows to support them the way Linux does - no users of the feature (until Dynamic Disk is rewritten to support them).


Maxim S. Shatskih
Windows DDK MVP
xxxxx@storagecraft.com
http://www.storagecraft.com

>

> recognize 520-bytes-per-sector disk. Therefore, I think you should
try to
use some OS that is more
>suitable for enterprise use…

What OS has the real-world replacement of MS Exchange Server in it?

Windows 2008 R2 running on Xen :slight_smile:

James

Thank you all for your valuable suggestons.
I have analysed the problem using SATA analyser. I found during the intialize disk from the disk manager, the disk is sending 520 byte DMA Set up FIS. But The host sending a COMreset command to the device in response to a 520 byte DMA FIS setup . This COMreset command mostly I believe send by the Miniort driver or an Uper windows component like ATAport driver. If it is from miniport driver I can do some thing but if it is from windows default drivers may be I have to find new OS to test this.

You don’t need a new OS, you just need a new miniport driver. There is nothing inherently wrong with the Windows OS in terms of
supporting 520-byte sectors, provided that the low-level driver that manages the physical transport itself (i.e. SATA / SCSI / FC /
SAS, etc.) is capable of abstracting away the fact that the physical sectors on the disk are 520 bytes. If the miniport presents a
model of the disk in which the sectors are 512 bytes to the layers above it, there should be no problem. The miniport gets requests
from above in which the blocks are assumed to be 512 bytes, but when those commands go out to the disk drive, the data that goes
back and forth on the storage transport will be in multiples of 520. The miniport strips off the extra bytes and looks for errors.
But in terms of the layers above it, the driver uses blocks that are assumed to be 512.

In summary, you need to find a host controller and corresponding driver software that supports your 520-byte sector disk.

wrote in message news:xxxxx@ntdev…
> Thank you all for your valuable suggestons.
> I have analysed the problem using SATA analyser. I found during the intialize disk from the disk manager, the disk is sending 520
> byte DMA Set up FIS. But The host sending a COMreset command to the device in response to a 520 byte DMA FIS setup . This COMreset
> command mostly I believe send by the Miniort driver or an Uper windows component like ATAport driver. If it is from miniport
> driver I can do some thing but if it is from windows default drivers may be I have to find new OS to test this.
>

Do you know this from personal experience dealing with odd-sector-sized disks, or are you making a supposition? (To be entirely clear, that’s a serious question, not a sarcastic one).

MY experience (from trying to deal with disks of varying sector-sizes) is contrary to this. When I looked into this, here were a TON of things that make assumptions about sector size. Win7 is MUCH better than other versions in this regard, but I recall tons of hardcoded "512"s among disk-related stuff. In fact, even disks with 4K sectors have “problems.”

Consider, for example, the cache manager and memory manager. They’re not going to magically start writing data in multiples of 520-byte sectors no matter WHAT the storage controller is capable of.

I’m curious to hear Don’s experiences in this regard,

Peter
OSR

Hi Peter,

You’re right, I was making a supposition. I would not expect the cache manager or the memory manager, or the disk class driver, or
*any* other layer above the storage miniport, for that matter, to do anything different at all. In fact, all layers above the
miniport could continue to operate as they have been, thinking the sectors are 512 bytes in length. Is it not possible for the
miniport driver to completely encapsulate the knowledge that the sectors are actually 520? Or, for that matter, that they are 4 KB?
If it does its job right, no other layer above it needs to know. That’s my theory, at least.

Thanks,
Don

wrote in message news:xxxxx@ntdev…
>


>
> Do you know this from personal experience dealing with odd-sector-sized disks, or are you making a supposition? (To be entirely
> clear, that’s a serious question, not a sarcastic one).
>
> MY experience (from trying to deal with disks of varying sector-sizes) is contrary to this. When I looked into this, here were a
> TON of things that make assumptions about sector size. Win7 is MUCH better than other versions in this regard, but I recall tons
> of hardcoded "512"s among disk-related stuff. In fact, even disks with 4K sectors have “problems.”
>
> Consider, for example, the cache manager and memory manager. They’re not going to magically start writing data in multiples of
> 520-byte sectors no matter WHAT the storage controller is capable of.
>
> I’m curious to hear Don’s experiences in this regard,
>
> Peter
> OSR
>

That might be possible, but it almost certainly wouldn’t work for
booting where you’re running BIOS or EFI.

The 4k sector disks get away with that by having 512 byte emulation
written in to their firmware.

Mark.

At 16:35 09/08/2010, Don Matthews wrote:

Hi Peter,

You’re right, I was making a supposition. I would not expect the
cache manager or the memory manager, or the disk class driver, or
*any* other layer above the storage miniport, for that matter, to do
anything different at all. In fact, all layers above the
miniport could continue to operate as they have been, thinking the
sectors are 512 bytes in length. Is it not possible for the
miniport driver to completely encapsulate the knowledge that the
sectors are actually 520? Or, for that matter, that they are 4 KB?
If it does its job right, no other layer above it needs to
know. That’s my theory, at least.

Thanks,
Don

wrote in message news:xxxxx@ntdev…
> >


> >
> > Do you know this from personal experience dealing with
> odd-sector-sized disks, or are you making a supposition? (To be entirely
> > clear, that’s a serious question, not a sarcastic one).
> >
> > MY experience (from trying to deal with disks of varying
> sector-sizes) is contrary to this. When I looked into this, here were a
> > TON of things that make assumptions about sector size. Win7 is
> MUCH better than other versions in this regard, but I recall tons
> > of hardcoded "512"s among disk-related stuff. In fact, even
> disks with 4K sectors have “problems.”
> >
> > Consider, for example, the cache manager and memory
> manager. They’re not going to magically start writing data in multiples of
> > 520-byte sectors no matter WHAT the storage controller is capable of.
> >
> > I’m curious to hear Don’s experiences in this regard,
> >
> > Peter
> > OSR
> >
>
>
>
>—
>NTDEV is sponsored by OSR
>
>For our schedule of WDF, WDM, debugging and other seminars visit:
>http://www.osr.com/seminars
>
>To unsubscribe, visit the List Server section of OSR Online at
>http://www.osronline.com/page.cfm?name=ListServer

> Consider, for example, the cache manager and memory manager. They’re not going to magically

start writing data in multiples of 520-byte sectors no matter WHAT the storage controller is capable of.

I think that the following is a major architectural thing in Windows, deeply hard-coded to the OS:
a) sector size <= page size
b) page size is an integral multiple of sector size

More so, I expect Linux to be the same, and, from the article provided by Anton, it is obvious that the data sectors are still 512, and the remaining 8 bytes/sector are provided via some additional kinda “out-of-band” interface (for software RAID implementations above the disk stack I think).

Now about 4KB sectors. Their only negative footprint would result from the alignment issues, but IIRC all of them support 512byte-aligned transfers anyway (but slower).

As about the rest of 4KB/s issue - even if the app uses sector sizes and sector numbers (and not byte offsets), it must be very stupid to hardcode sector size == 512. And, if there is no such hard-code, then the app is fine.

Anyway Windows IO API is formulated in terms of byte offsets and not sector numbers.


Maxim S. Shatskih
Windows DDK MVP
xxxxx@storagecraft.com
http://www.storagecraft.com

>it not possible for the

miniport driver to completely encapsulate the knowledge that the sectors are actually 520?

More so, Linux works exactly this way, and also providing a way for the upper layers to access these extra 8bytes of “out-of-band” data per sector.


Maxim S. Shatskih
Windows DDK MVP
xxxxx@storagecraft.com
http://www.storagecraft.com

At 16:52 09/08/2010, Maxim S. Shatskih wrote:

Anyway Windows IO API is formulated in terms of byte offsets and not
sector numbers.

Except for raw volume and disk access where, although in bytes the
offset must be in multiples of sector size.

There’s always a corner case, and since sector sizes have been
assumed to be 512 bytes for 30 years, a lot of hard coded apps are out thre.

Mark.