All of lore.kernel.org
 help / color / mirror / Atom feed
* 4k sector size and WD20EARS
@ 2010-04-08 14:20 Alexander Clausen
  2010-04-08 16:02 ` Martin K. Petersen
  0 siblings, 1 reply; 9+ messages in thread
From: Alexander Clausen @ 2010-04-08 14:20 UTC (permalink / raw)
  To: linux-ide

Hi,
i just bought some WD20EARS harddisk. They are supposed to have 4k physical sector size, right?
My system seems to think they are not:

alex@hal:/sys/block/sdb/queue$ cat logical_block_size physical_block_size
512
512
alex@hal:/sys/block/sdb/queue$


alex@hal:~$ uname -a
Linux hal 2.6.33.2 #1 SMP PREEMPT Sun Apr 4 20:52:14 CEST 2010 x86_64 GNU/Linux
alex@hal:~$

from dmesg:

scsi 1:0:0:0: Direct-Access     ATA      WDC WD20EARS-00S 80.0 PQ: 0 ANSI: 5
sd 1:0:0:0: [sdb] 3907029168 512-byte logical blocks: (2.00 TB/1.81 TiB)

so, who is right?

The current partition table looks like:

alex@hal:~$ sudo cfdisk -P s /dev/sdb
Partition Table for /dev/sdb

                First       Last
  # Type       Sector      Sector   Offset    Length   Filesystem Type (ID) Flag
-- ------- ----------- ----------- ------ ----------- -------------------- ----
  1 Primary           0  3907024064     63  3907024065 Linux (83)           None
alex@hal:~$

is that okay for 4k sector size?

Alexander

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: 4k sector size and WD20EARS
  2010-04-08 14:20 4k sector size and WD20EARS Alexander Clausen
@ 2010-04-08 16:02 ` Martin K. Petersen
  2010-04-08 16:12   ` Mikael Abrahamsson
  2010-04-08 17:04   ` Alexander Clausen
  0 siblings, 2 replies; 9+ messages in thread
From: Martin K. Petersen @ 2010-04-08 16:02 UTC (permalink / raw)
  To: Alexander Clausen; +Cc: linux-ide

>>>>> "Alexander" == Alexander Clausen <alex@gc-web.de> writes:

Alexander> Hi, i just bought some WD20EARS harddisk. They are supposed
Alexander> to have 4k physical sector size, right?  My system seems to
Alexander> think they are not:

Alexander> alex@hal:/sys/block/sdb/queue$ cat logical_block_size
Alexander> physical_block_size 512 512 

Alexander> so, who is right?

For unknown reasons these drive report themselves as 512-byte drives
despite using 4096-byte sectors internally.

There really isn't much we can do about devices that don't tell us the
truth.  However, recent fdisk/parted will align on a 1MB boundary by
default which happens do the trick in this particular case (because the
WDC drive is naturally aligned).


Alexander>  1 Primary 0 3907024064 63 3907024065 Linux (83) None
Alexander> alex@hal:~$

Alexander> is that okay for 4k sector size?

No, you should shift the start sector using the fdisk's advanced menu.

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: 4k sector size and WD20EARS
  2010-04-08 16:02 ` Martin K. Petersen
@ 2010-04-08 16:12   ` Mikael Abrahamsson
  2010-04-08 16:33     ` Martin K. Petersen
  2010-04-08 17:04   ` Alexander Clausen
  1 sibling, 1 reply; 9+ messages in thread
From: Mikael Abrahamsson @ 2010-04-08 16:12 UTC (permalink / raw)
  To: Martin K. Petersen; +Cc: Alexander Clausen, linux-ide

On Thu, 8 Apr 2010, Martin K. Petersen wrote:

> For unknown reasons these drive report themselves as 512-byte drives
> despite using 4096-byte sectors internally.

It's not unknown, it's for compatibility reasons.

The original poster is well off reading the earlier discussions on 
linux-raid regarding these drives.

-- 
Mikael Abrahamsson    email: swmike@swm.pp.se

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: 4k sector size and WD20EARS
  2010-04-08 16:12   ` Mikael Abrahamsson
@ 2010-04-08 16:33     ` Martin K. Petersen
  2010-04-08 17:00       ` Mikael Abrahamsson
  0 siblings, 1 reply; 9+ messages in thread
From: Martin K. Petersen @ 2010-04-08 16:33 UTC (permalink / raw)
  To: Mikael Abrahamsson; +Cc: Martin K. Petersen, Alexander Clausen, linux-ide

>>>>> "Mikael" == Mikael Abrahamsson <swmike@swm.pp.se> writes:

>> For unknown reasons these drive report themselves as 512-byte drives
>> despite using 4096-byte sectors internally.

Mikael> It's not unknown, it's for compatibility reasons.

We still haven't been given a comprehensive explanation.  "It breaks
something for someone" doesn't really give us much to work with...

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: 4k sector size and WD20EARS
  2010-04-08 16:33     ` Martin K. Petersen
@ 2010-04-08 17:00       ` Mikael Abrahamsson
  2010-04-08 18:56         ` Martin K. Petersen
  0 siblings, 1 reply; 9+ messages in thread
From: Mikael Abrahamsson @ 2010-04-08 17:00 UTC (permalink / raw)
  To: Martin K. Petersen; +Cc: Alexander Clausen, linux-ide

On Thu, 8 Apr 2010, Martin K. Petersen wrote:

> We still haven't been given a comprehensive explanation.  "It breaks 
> something for someone" doesn't really give us much to work with...

I'd imagine the market for a 4k sector drive which only does 4k sectors on 
the wire, would be very limited considering the amount of driver and OS 
support for this. Otoh a lot of OSes write 8 blocks at the same time 
because they use 4k page sizes so doing 512b sectors on the SATA layer and 
4k when writing to the drive makes a lot of sense.

I don't really see what it is you're looking for when it comes to "more 
information"?

-- 
Mikael Abrahamsson    email: swmike@swm.pp.se

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: 4k sector size and WD20EARS
  2010-04-08 16:02 ` Martin K. Petersen
  2010-04-08 16:12   ` Mikael Abrahamsson
@ 2010-04-08 17:04   ` Alexander Clausen
  2010-04-09  2:14     ` Martin K. Petersen
  1 sibling, 1 reply; 9+ messages in thread
From: Alexander Clausen @ 2010-04-08 17:04 UTC (permalink / raw)
  To: Martin K. Petersen; +Cc: linux-ide

On 04/08/2010 06:02 PM, Martin K. Petersen wrote:
> For unknown reasons these drive report themselves as 512-byte drives
> despite using 4096-byte sectors internally.

ouch.

> However, recent fdisk/parted will align on a 1MB boundary by
> default which happens do the trick in this particular case

> Alexander>   1 Primary 0 3907024064 63 3907024065 Linux (83) None
> Alexander>  alex@hal:~$

> No, you should shift the start sector using the fdisk's advanced menu.

I created this partition table using cfdisk (util-linux 2.17 from debian/experimental). I guess even 
that is too old?

I now re-created the partition table using fdisk from util-linux-ng git and got this:

Command (m for help): p

Disk /dev/sdb: 2000.4 GB, 2000398934016 bytes
81 heads, 63 sectors/track, 765633 cylinders, total 3907029168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x2afff6d1

    Device Boot      Start         End      Blocks   Id  System
/dev/sdb1            2048  3907029167  1953513560   83  Linux

but:

$ sudo cfdisk -P s /dev/sdb
FATAL ERROR: Bad primary partition 0: Partition ends in the final partial cylinder

bug?

thanks for the help,
Alexander

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: 4k sector size and WD20EARS
  2010-04-08 17:00       ` Mikael Abrahamsson
@ 2010-04-08 18:56         ` Martin K. Petersen
  0 siblings, 0 replies; 9+ messages in thread
From: Martin K. Petersen @ 2010-04-08 18:56 UTC (permalink / raw)
  To: Mikael Abrahamsson; +Cc: Martin K. Petersen, Alexander Clausen, linux-ide

>>>>> "Mikael" == Mikael Abrahamsson <swmike@swm.pp.se> writes:

>> We still haven't been given a comprehensive explanation.  "It breaks
>> something for someone" doesn't really give us much to work with...

Mikael> I don't really see what it is you're looking for when it comes
Mikael> to "more information"?

The physical block size is reported in IDENTIFY DEVICE word 106 which
hasn't been and isn't used for anything else.  So nothing should be
looking there unless it is 4KB sector-aware.

I've been testing a variety of drives with 4KB sectors for well over a
year.  All of them correctly reporting the physical block size.  The
only real problems I have found during testing have been missing
SCSI-ATA translation or incorrect alignment reporting (SCSI and ATA
express things differently).

It's bad enough that our I/O stack has to deal with hordes of USB ATA
bridge devices that are unintentionally broken.  But now we are talking
production disk drives that were intentionally neutered.  And we're not
being told why.

Obviously some of this might fall into NDA territory.  And that's fair
enough.  My gripe is that nothing has been done to substantiate the
issue.  A problem that apparently warranted blowing away years of
industry-wide standardization, implementation, and testing efforts.
That's no small thing in my book.

I also want to be assured that the real root cause gets fixed.  We
obviously want future drives to be both standards-compliant and accurate
in their reporting.

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: 4k sector size and WD20EARS
  2010-04-08 17:04   ` Alexander Clausen
@ 2010-04-09  2:14     ` Martin K. Petersen
  2010-04-12 12:34       ` Karel Zak
  0 siblings, 1 reply; 9+ messages in thread
From: Martin K. Petersen @ 2010-04-09  2:14 UTC (permalink / raw)
  To: Alexander Clausen; +Cc: Martin K. Petersen, linux-ide, Karel Zak

>>>>> "Alexander" == Alexander Clausen <alex@gc-web.de> writes:

>> For unknown reasons these drive report themselves as 512-byte drives
>> despite using 4096-byte sectors internally.

Alexander> ouch.

Yeah, I know...


Alexander> $ sudo cfdisk -P s /dev/sdb FATAL ERROR: Bad primary
Alexander> partition 0: Partition ends in the final partial cylinder

Alexander> bug?

I'm not sure cfdisk has been kept in sync with the alignment and block
size changes.  Karel?

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: 4k sector size and WD20EARS
  2010-04-09  2:14     ` Martin K. Petersen
@ 2010-04-12 12:34       ` Karel Zak
  0 siblings, 0 replies; 9+ messages in thread
From: Karel Zak @ 2010-04-12 12:34 UTC (permalink / raw)
  To: Martin K. Petersen; +Cc: Alexander Clausen, linux-ide

On Thu, Apr 08, 2010 at 10:14:29PM -0400, Martin K. Petersen wrote:
> >>>>> "Alexander" == Alexander Clausen <alex@gc-web.de> writes:
> 
> >> For unknown reasons these drive report themselves as 512-byte drives
> >> despite using 4096-byte sectors internally.
> 
> Alexander> ouch.
> 
> Yeah, I know...
> 
> 
> Alexander> $ sudo cfdisk -P s /dev/sdb FATAL ERROR: Bad primary
> Alexander> partition 0: Partition ends in the final partial cylinder
> 
> Alexander> bug?
> 
> I'm not sure cfdisk has been kept in sync with the alignment and block
> size changes.  Karel?

 Unfortunately, sfdisk and cfdisk have no clue about alignment and 
 disks topology.

 Now only the fdisk and parted commands are ready for new disks.

    Karel

-- 
 Karel Zak  <kzak@redhat.com>
 http://karelzak.blogspot.com

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2010-04-12 12:34 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-04-08 14:20 4k sector size and WD20EARS Alexander Clausen
2010-04-08 16:02 ` Martin K. Petersen
2010-04-08 16:12   ` Mikael Abrahamsson
2010-04-08 16:33     ` Martin K. Petersen
2010-04-08 17:00       ` Mikael Abrahamsson
2010-04-08 18:56         ` Martin K. Petersen
2010-04-08 17:04   ` Alexander Clausen
2010-04-09  2:14     ` Martin K. Petersen
2010-04-12 12:34       ` Karel Zak

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.