PC Review


Reply
Thread Tools Rate Thread

4k sectors and Linux

 
 
Arno
Guest
Posts: n/a
 
      11th Jul 2011
Seems something is working right. With fdisk (util-linux-ng 2.17.2)
and kernel 2.6.38.8, I get the following detection for a 3TB WD
with 4k sectors. This is via USB though:

Disk /dev/sdf: 3000.6 GB, 3000558944256 bytes
255 heads, 63 sectors/track, 45599 cylinders
Units = cylinders of 16065 * 4096 = 65802240 bytes
Sector size (logical/physical): 4096 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes

This is also listed in

# cat /sys/dev/block/8:80/queue/hw_sector_size
4096

Nice!

Arno

--
Arno Wagner, Dr. sc. techn., Dipl. Inform., CISSP -- Email: http://www.pcreview.co.uk/forums/(E-Mail Removed)
GnuPG: ID: 1E25338F FP: 0C30 5782 9D93 F785 E79C 0296 797F 6B50 1E25 338F
----
Cuddly UI's are the manifestation of wishful thinking. -- Dylan Evans
 
Reply With Quote
 
 
 
 
Rod Speed
Guest
Posts: n/a
 
      11th Jul 2011
David Brown wrote
> Arno wrote


>> Seems something is working right. With fdisk (util-linux-ng 2.17.2)
>> and kernel 2.6.38.8, I get the following detection for a 3TB WD
>> with 4k sectors. This is via USB though:


>> Disk /dev/sdf: 3000.6 GB, 3000558944256 bytes
>> 255 heads, 63 sectors/track, 45599 cylinders
>> Units = cylinders of 16065 * 4096 = 65802240 bytes
>> Sector size (logical/physical): 4096 bytes / 4096 bytes
>> I/O size (minimum/optimal): 4096 bytes / 4096 bytes


>> This is also listed in


>> # cat /sys/dev/block/8:80/queue/hw_sector_size
>> 4096


>> Nice!


> Do you mean to say you've found a 4K block disk that actually tells
> the truth about itself?


It clearly doesnt on the heads, sectors per track or the cylinders either.


 
Reply With Quote
 
 
 
 
Arno
Guest
Posts: n/a
 
      11th Jul 2011
David Brown <(E-Mail Removed)> wrote:
> On 11/07/11 19:20, Arno wrote:
>> Seems something is working right. With fdisk (util-linux-ng 2.17.2)
>> and kernel 2.6.38.8, I get the following detection for a 3TB WD
>> with 4k sectors. This is via USB though:
>>
>> Disk /dev/sdf: 3000.6 GB, 3000558944256 bytes
>> 255 heads, 63 sectors/track, 45599 cylinders
>> Units = cylinders of 16065 * 4096 = 65802240 bytes
>> Sector size (logical/physical): 4096 bytes / 4096 bytes
>> I/O size (minimum/optimal): 4096 bytes / 4096 bytes
>>
>> This is also listed in
>>
>> # cat /sys/dev/block/8:80/queue/hw_sector_size
>> 4096
>>
>> Nice!
>>
>> Arno
>>


> Do you mean to say you've found a 4K block disk that actually tells the
> truth about itself?


Indeed. Or Linux is able to figure it out.

Arno

--
Arno Wagner, Dr. sc. techn., Dipl. Inform., CISSP -- Email: (E-Mail Removed)
GnuPG: ID: 1E25338F FP: 0C30 5782 9D93 F785 E79C 0296 797F 6B50 1E25 338F
----
Cuddly UI's are the manifestation of wishful thinking. -- Dylan Evans
 
Reply With Quote
 
Franc Zabkar
Guest
Posts: n/a
 
      12th Jul 2011
On 11 Jul 2011 17:20:58 GMT, Arno <(E-Mail Removed)> put finger to
keyboard and composed:

>Seems something is working right. With fdisk (util-linux-ng 2.17.2)
>and kernel 2.6.38.8, I get the following detection for a 3TB WD
>with 4k sectors. This is via USB though:
>
> Disk /dev/sdf: 3000.6 GB, 3000558944256 bytes
> 255 heads, 63 sectors/track, 45599 cylinders
> Units = cylinders of 16065 * 4096 = 65802240 bytes
> Sector size (logical/physical): 4096 bytes / 4096 bytes
> I/O size (minimum/optimal): 4096 bytes / 4096 bytes
>
>This is also listed in
>
> # cat /sys/dev/block/8:80/queue/hw_sector_size
> 4096


That's great info!

Could you please indulge me by obtaining the 512-byte ATA Identify
Device information block from the drive? This would help me greatly in
resolving, or at least understanding, several problems at WD's and
Seagate's forums.

I believe smartmontools should be able to do this, eg ...

smartctl -r ioctl,2 -a hda

You should see something like this:
http://www.users.on.net/~fzabkar/Sma...mart_debug.txt

AIUI, the Advanced Format features are reported in words 106, 117-118,
209.

These are described in section 7.16.4 of the following ATA standards
document.

Working Draft AT Attachment 8 - ATA/ATAPI Command Set (ATA8-ACS):
http://www.t13.org/documents/Uploade...a-ATA8-ACS.pdf

- Franc Zabkar
--
Please remove one 'i' from my address when replying by email.
 
Reply With Quote
 
Arno
Guest
Posts: n/a
 
      12th Jul 2011
David Brown <(E-Mail Removed)> wrote:
> On 11/07/11 22:46, Rod Speed wrote:
>> David Brown wrote
>>> Arno wrote

>>
>>>> Seems something is working right. With fdisk (util-linux-ng 2.17.2)
>>>> and kernel 2.6.38.8, I get the following detection for a 3TB WD
>>>> with 4k sectors. This is via USB though:

>>
>>>> Disk /dev/sdf: 3000.6 GB, 3000558944256 bytes
>>>> 255 heads, 63 sectors/track, 45599 cylinders
>>>> Units = cylinders of 16065 * 4096 = 65802240 bytes
>>>> Sector size (logical/physical): 4096 bytes / 4096 bytes
>>>> I/O size (minimum/optimal): 4096 bytes / 4096 bytes

>>
>>>> This is also listed in

>>
>>>> # cat /sys/dev/block/8:80/queue/hw_sector_size
>>>> 4096

>>
>>>> Nice!

>>
>>> Do you mean to say you've found a 4K block disk that actually tells
>>> the truth about itself?

>>
>> It clearly doesnt on the heads, sectors per track or the cylinders either.
>>


> Yes, but at least these lies have been common practice for many years.
> They also make much less difference in practice (though partitions have
> traditionally been aligned to cylinder boundaries).


The only remarkable thing is the correctly reported sector size,
which removes a lot of problems.

C/H/S do not cover it with ZBR anymore, as different cylinders
have different numbers of sectors. C/H/S has been a fiction
for quite some time and are just listed for user convenience and
this is not even information from the disk but calculated by fdisk.

The size info from the disk is 3000558944256 bytes.
Divide by sector size to get maximum LBA sector adddress.

Incidentally these facts about C/H/S have been known to everybody
that understands disk technology for a long, long time.

Arno
--
Arno Wagner, Dr. sc. techn., Dipl. Inform., CISSP -- Email: (E-Mail Removed)
GnuPG: ID: 1E25338F FP: 0C30 5782 9D93 F785 E79C 0296 797F 6B50 1E25 338F
----
Cuddly UI's are the manifestation of wishful thinking. -- Dylan Evans
 
Reply With Quote
 
Franc Zabkar
Guest
Posts: n/a
 
      12th Jul 2011
On 12 Jul 2011 19:42:41 GMT, Arno <(E-Mail Removed)> put finger to
keyboard and composed:

>The only remarkable thing is the correctly reported sector size,
>which removes a lot of problems.
>
>C/H/S do not cover it with ZBR anymore, as different cylinders
>have different numbers of sectors. C/H/S has been a fiction
>for quite some time and are just listed for user convenience and
>this is not even information from the disk but calculated by fdisk.
>
>The size info from the disk is 3000558944256 bytes.
>Divide by sector size to get maximum LBA sector adddress.


I've been trying to understand what is happening in regards to device
detection for quite some time ago. Unfortunately I'm frustrated by a
lack of appropriate feedback. ;-)

AISI, there is a difference in the way that CHS parameters and sector
sizes are calculated or reported for external drives as compared with
internals.

According to the document below, a USB mass storage device reports the
following information via the Flexible Disk Mode Page (Mode Page 5) of
the SCSI MODE SENSE(10) Command.

Number of Heads
Sectors per Track
Bytes per Sector
Number of Cylinders

The SCSI READ CAPACITY command returns ...

Last Logical Block Address
Block Length in Bytes

Here is a thread where a user of a Seagate FreeAgent GoFlex 3TB
external drive has provided some usueful information:
http://forums.seagate.com/t5/GoFlex-...3tb/m-p/109026

The 3TB drive continues to report, via the ATA Identify Device
command, that it has 5.86 billion LBAs with a sector size of 512
bytes. However, it appears that the USB-SATA bridge chip inside the
enclosure fakes the drive's _logical_ geometry by reporting to the USB
host (via the abovementioned SCSI commands) that it has 4KB sectors
and 732 million LBAs.

I was hoping that your Identify Device report would provide more
information on the subject. ;-)

Universal Serial Bus Mass Storage Specification For Bootability:
http://www.usb.org/developers/devcla...c_boot_1.0.pdf

- Franc Zabkar
--
Please remove one 'i' from my address when replying by email.
 
Reply With Quote
 
Rod Speed
Guest
Posts: n/a
 
      12th Jul 2011
David Brown wrote
> Rod Speed wrote
>> David Brown wrote
>>> Arno wrote


>>>> Seems something is working right. With fdisk (util-linux-ng 2.17.2)
>>>> and kernel 2.6.38.8, I get the following detection for a 3TB WD
>>>> with 4k sectors. This is via USB though:


>>>> Disk /dev/sdf: 3000.6 GB, 3000558944256 bytes
>>>> 255 heads, 63 sectors/track, 45599 cylinders
>>>> Units = cylinders of 16065 * 4096 = 65802240 bytes
>>>> Sector size (logical/physical): 4096 bytes / 4096 bytes
>>>> I/O size (minimum/optimal): 4096 bytes / 4096 bytes


>>>> This is also listed in


>>>> # cat /sys/dev/block/8:80/queue/hw_sector_size
>>>> 4096


>>>> Nice!


>>> Do you mean to say you've found a 4K block disk that actually tells the truth about itself?


>> It clearly doesnt on the heads, sectors per track or the cylinders either.


> Yes, but at least these lies have been common practice for many years.


Irrelevant.

> They also make much less difference in practice


Wrong, again.

> (though partitions have traditionally been aligned to cylinder boundaries).


And the larger than reported sectors dont matter a damn.


 
Reply With Quote
 
Rod Speed
Guest
Posts: n/a
 
      13th Jul 2011
David Brown wrote
> Rod Speed wrote
>> David Brown wrote
>>> Rod Speed wrote
>>>> David Brown wrote
>>>>> Arno wrote


>>>>>> Seems something is working right. With fdisk (util-linux-ng
>>>>>> 2.17.2) and kernel 2.6.38.8, I get the following detection
>>>>>> for a 3TB WD with 4k sectors. This is via USB though:


>>>>>> Disk /dev/sdf: 3000.6 GB, 3000558944256 bytes 255 heads, 63 sectors/track, 45599 cylinders Units = cylinders of
>>>>>> 16065 *
>>>>>> 4096 = 65802240 bytes Sector size (logical/physical): 4096 bytes / 4096 bytes I/O size (minimum/optimal): 4096
>>>>>> bytes / 4096 bytes


>>>>>> This is also listed in


>>>>>> # cat /sys/dev/block/8:80/queue/hw_sector_size 4096


>>>>>> Nice!


>>>>> Do you mean to say you've found a 4K block disk that actually tells the truth about itself?


>>>> It clearly doesnt on the heads, sectors per track or the cylinders either.


>>> Yes, but at least these lies have been common practice for many years.


>> Irrelevant.


>>> They also make much less difference in practice


>> Wrong, again.


> Tell me, then, what difference it would make if the drive reported
> accurate information about heads, sectors and cylinders?


It isnt even possible with modern hard drives.

> Theoretically you could make use of it to improve seek times, but
> that would be an enormous complexity for very little gain, especially
> as the number of sectors per track varies across the surface.


Irrelevant to what is being discussed.

>>> (though partitions have traditionally been aligned to cylinder boundaries).


>> And the larger than reported sectors dont matter a damn.


> Larger than reported sectors /do/ matter


Wrong. again.

> - because writing a block that is smaller than a physical sector, or that overlaps physical sector boundaries, means
> that the disk firmware must do read-modify-write cycles instead of straight writes.


Wrong. again.

> The most obvious example is when the drive has 4K sectors but claims to have 512 byte sectors, and writes are
> misaligned.


Trivially avoidable by not having them misaligned.

> More generally, if drives start using 16K sectors and reporting 4K sizes, for example, then we will have similar
> problems.


Wrong. again.

> Partitions will be aligned, since the modern standard is 1 MB alignment.


Wrong. again.

> But most disk accesses are done in 4K blocks because that matches the memory page size (on x86, amd64 at least).


Wrong. again.

> As far as I know, Linux would be fine writing 16K blocks if the drive is honest about it, but lying here would cause
> big performance issues.


Wrong. again.


 
Reply With Quote
 
Arno
Guest
Posts: n/a
 
      13th Jul 2011
Franc Zabkar <(E-Mail Removed)> wrote:
> On 12 Jul 2011 19:42:41 GMT, Arno <(E-Mail Removed)> put finger to
> keyboard and composed:


>>The only remarkable thing is the correctly reported sector size,
>>which removes a lot of problems.
>>
>>C/H/S do not cover it with ZBR anymore, as different cylinders
>>have different numbers of sectors. C/H/S has been a fiction
>>for quite some time and are just listed for user convenience and
>>this is not even information from the disk but calculated by fdisk.
>>
>>The size info from the disk is 3000558944256 bytes.
>>Divide by sector size to get maximum LBA sector adddress.


> I've been trying to understand what is happening in regards to device
> detection for quite some time ago. Unfortunately I'm frustrated by a
> lack of appropriate feedback. ;-)


> AISI, there is a difference in the way that CHS parameters and sector
> sizes are calculated or reported for external drives as compared with
> internals.


> According to the document below, a USB mass storage device reports the
> following information via the Flexible Disk Mode Page (Mode Page 5) of
> the SCSI MODE SENSE(10) Command.


Aeh, yes. USB uses SCSI as storage command set, whule SATA
uses ATA. As the SCSI command set is far more well designed,
quite a few things work with it that do not work in ATA.

But this does have nothing to do with the drive being external
or internal. An internal SAS drive, e.g. will also use
the SCSI command set.

Arno
--
Arno Wagner, Dr. sc. techn., Dipl. Inform., CISSP -- Email: (E-Mail Removed)
GnuPG: ID: 1E25338F FP: 0C30 5782 9D93 F785 E79C 0296 797F 6B50 1E25 338F
----
Cuddly UI's are the manifestation of wishful thinking. -- Dylan Evans
 
Reply With Quote
 
Arno
Guest
Posts: n/a
 
      13th Jul 2011
David Brown <(E-Mail Removed)> wrote:
> On 12/07/2011 23:35, Rod Speed wrote:
>> David Brown wrote
>>> Rod Speed wrote
>>>> David Brown wrote
>>>>> Arno wrote

>>
>>>>>> Seems something is working right. With fdisk (util-linux-ng
>>>>>> 2.17.2) and kernel 2.6.38.8, I get the following detection
>>>>>> for a 3TB WD with 4k sectors. This is via USB though:

>>
>>>>>> Disk /dev/sdf: 3000.6 GB, 3000558944256 bytes 255 heads, 63
>>>>>> sectors/track, 45599 cylinders Units = cylinders of 16065 *
>>>>>> 4096 = 65802240 bytes Sector size (logical/physical): 4096
>>>>>> bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes /
>>>>>> 4096 bytes

>>
>>>>>> This is also listed in

>>
>>>>>> # cat /sys/dev/block/8:80/queue/hw_sector_size 4096

>>
>>>>>> Nice!

>>
>>>>> Do you mean to say you've found a 4K block disk that actually
>>>>> tells the truth about itself?

>>
>>>> It clearly doesnt on the heads, sectors per track or the
>>>> cylinders either.

>>
>>> Yes, but at least these lies have been common practice for many
>>> years.

>>
>> Irrelevant.
>>
>>> They also make much less difference in practice

>>
>> Wrong, again.


> Tell me, then, what difference it would make if the drive reported
> accurate information about heads, sectors and cylinders? Theoretically
> you could make use of it to improve seek times, but that would be an
> enormous complexity for very little gain, especially as the number of
> sectors per track varies across the surface.


Indeed. It would have to report a whole table. Complexity
is the enemy of reliability and the designers wisely decided
to not go down that road. A system that really needs this can
still benchmark the drive.

>>
>>> (though partitions have traditionally been aligned to cylinder
>>> boundaries).

>>
>> And the larger than reported sectors dont matter a damn.
>>


Seems somebody has not been following the discussions in
various places or has not understood anything. Not even
worth an answer.

Arno
--
Arno Wagner, Dr. sc. techn., Dipl. Inform., CISSP -- Email: (E-Mail Removed)
GnuPG: ID: 1E25338F FP: 0C30 5782 9D93 F785 E79C 0296 797F 6B50 1E25 338F
----
Cuddly UI's are the manifestation of wishful thinking. -- Dylan Evans
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Is Netscape Leaving Firefox Behind on GNU/Linux? THE LINUX PROPAGANDA MACHINE CONTINUES. FIREFOX IGNORING LINUX............. traci.manicotti@gmail.com Windows XP General 1 19th Oct 2007 09:12 AM
Re: Is Netscape Leaving Firefox Behind on GNU/Linux? THE LINUX PROPAGANDA MACHINE CONTINUES. FIREFOX IGNORING LINUX............. traci.manicotti@gmail.com Windows Vista General Discussion 1 19th Oct 2007 09:12 AM
Bad sectors: how to single out the file(s) in the bad sectors? scientia2002@gmail.com Windows XP General 14 22nd Feb 2007 06:40 PM
2 sectors per cluster vs. 4 sectors per cluster =?Utf-8?B?YjExXw==?= Windows XP General 0 21st May 2006 07:21 PM
OT: Any LINUX Guru - linux red hat 9 start up error (please ignore non-linux guys) abdul mahmoodi Freeware 10 17th Aug 2004 11:57 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:14 AM.