FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Gentoo > Gentoo User

 
 
LinkBack Thread Tools
 
Old 02-09-2010, 05:21 PM
Mark Knecht
 
Default 1-Terabyte drives - 4K sector sizes? -> bar performance so far

On Tue, Feb 9, 2010 at 9:09 AM, Frank Steinmetzger <Warp_7@gmx.de> wrote:
<SNIP>
> So sdb7 now ends at sector 976703935. Interestingly, I couldn’t use the
> immediate next sector for sdb8:
> start for sdb8 * response by fdisk
> 976703936 * * * *sector already allocated
> 976703944 * * * *Value out of range. First sector... (default 976703999):
>
> The first one fdisk offered me was exactly 64 sectors behind the end sector of
> sdb7 (976703999), which would leave a space of those mysterious 62 “empty”
> sectors in between. So I used 976704000, which is divisable by 64 again,
> though it’s not that relevant for a partition of 31 MB.
<SNIP>

Again, this is probably unrelated to anything going on in this thread
but I started wondering this morning if maybe fdisk could take a step
forward with these newer disk technologies and build in some smarts
about where to put partition boundaries. I.e. - if I'm using a 4K
block size disk why not have fdisk do things better?

My first thought was to look at the man page for fdisk and see who the
author was. I did not find any email addresses. However I did find
some very interesting comments about partitioning disks in the bugs
section, quoted below.

I don't think I need what the 'bugs' author perceives as the
advantages of fdisk so I think I'll try to focus a bit more on cfdisk.
Interestingly cfdisk was the tool Willie pointed out when he kindly
took the time to educate me on what was going on physically.

- Mark

Quote:

BUGS
There are several *fdisk programs around. Each has its
problems and strengths. Try
them in the order cfdisk, fdisk, sfdisk. (Indeed, cfdisk is a
beautiful program that
has strict requirements on the partition tables it accepts, and
produces high quality
partition tables. Use it if you can. fdisk is a buggy program
that does fuzzy things
- usually it happens to produce reasonable results. Its
single advantage is that it
has some support for BSD disk labels and other non-DOS
partition tables. Avoid it if
you can. sfdisk is for hackers only - the user interface is
terrible, but it is more
correct than fdisk and more powerful than both fdisk and
cfdisk. Moreover, it can be
used noninteractively.)
 
Old 02-09-2010, 05:25 PM
Mark Knecht
 
Default 1-Terabyte drives - 4K sector sizes? -> bar performance so far

On Tue, Feb 9, 2010 at 9:38 AM, Stroller <stroller@stellar.eclipse.co.uk> wrote:
<SNIP>
> IMO this is a fdisk "bug". A feature should be added so that it tries to
> align optimally in most circumstances. RAID controllers should not be trying
> to do anything clever to accommodate potential misalignment unless it is
> really cheap to do so.
>
> Stroller.

We think alike. I personally wouldn't call it a bug because drives
with 4K physical sectors are very new, but adding a feature to align
things better is dead on the right thing to do. It's silly to expect
every Linux user installing binary distros to have to learn this stuff
to get good performance.

- Mark
 
Old 02-09-2010, 09:54 PM
Mark Knecht
 
Default 1-Terabyte drives - 4K sector sizes? -> bar performance so far

On Tue, Feb 9, 2010 at 1:13 PM, Frank Steinmetzger <Warp_7@gmx.de> wrote:
> Am Dienstag, 9. Februar 2010 schrieb Frank Steinmetzger:
>
>> I have reset sdb7 to use boundaries divisible by 64.
>> Old range * * * * * *begin%64 *size%64 *New range * * * * * *begin%64
>> size%64 813113973-976703804 *0.8281 * *0.125 * *813113984-976703935 *0
>> * *0
>>
>> And guess what - the speed of truecrypt at creating a new container
>> doubled. With the old scheme, it started at 13.5 MB/s, now it started at
>> 26-odd. I’m blaming that cap on the USB connection to the drive, though
>> it’s gradually getting more: after 2/3 of the partition, it’s at 27.7.
>
> I fear I'll have to correct that a little. This 13.5 figure seems to be
> incorrect, in another try it was also shown at the beginning, but then
> quickly got up to >20. Also, a buddy just told me that this 4k stuff applies
> only to most recent drives, as old as 5 months or so.
>
> When I use parted on the drives, it says (both the old external and my 2
> months old internal):
> Sector size (logical/physical): 512B/512B
> So no speedup for me then. :-/

Frank,
As best I can tell so far none of the Linux tools will tell you
that the sectors are 4K. I had to go to the WD web site and find the
actual drive specs to discover that was true.

As far as I know so far there isn't a big improvement to be had
when the sector size is 512B.

- Mark
 
Old 02-10-2010, 12:27 AM
Mark Knecht
 
Default 1-Terabyte drives - 4K sector sizes? -> bar performance so far

On Tue, Feb 9, 2010 at 4:31 PM, Iain Buchanan <iaindb@netspace.net.au> wrote:
> On Tue, 2010-02-09 at 14:54 -0800, Mark Knecht wrote:
>> On Tue, Feb 9, 2010 at 1:13 PM, Frank Steinmetzger <Warp_7@gmx.de> wrote:
>
>
>> > When I use parted on the drives, it says (both the old external and my 2
>> > months old internal):
>> > Sector size (logical/physical): 512B/512B
>> > So no speedup for me then. :-/
>
> so does mine
>
>> Frank,
>> * *As best I can tell so far none of the Linux tools will tell you
>> that the sectors are 4K. I had to go to the WD web site and find the
>> actual drive specs to discover that was true.
>
> however if you use dmesg:
> $ dmesg | grep ata
> ata1: SATA max UDMA/133 irq_stat 0x00400040, connection status changed
> irq 17
> ata2: DUMMY
> ata3: SATA max UDMA/133 abar m2048@0xf6ffb800 port 0xf6ffba00 irq 17
> ioatdma: Intel(R) QuickData Technology Driver 4.00
> ata3: SATA link down (SStatus 0 SControl 300)
> ata1: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
> ata1.00: ATA-7: ST9160823ASG, 3.ADD, max UDMA/133
> ata1.00: 312581808 sectors, multi 8: LBA48 NCQ (depth 31/32)
> ...
>
> you can look up your drive model number (in my case ST9160823ASG) and
> find out the details. *(That's a Seagate Momentus 160Gb with actual 512
> byte sectors).
>
> saves having to open up your laptop / pc if you didn't order the drive
> separately or you've forgotten.
> --
> Iain Buchanan <iaindb at netspace dot net dot au>
>
> polygon:
> * * * *Dead parrot.
>
>
>

Consider as an alternative "hdparm dash capital eye". Note that is the
1TB drive and it still suggests 512B Logical/Physical sector size so
I'd still have to go find out for sure but there's lots of easily
readable info there to make it reasonably easy.

- Mark


gandalf ~ # hdparm -I /dev/sda

/dev/sda:

ATA device, with non-removable media
Model Number: WDC WD10EARS-00Y5B1
Serial Number: WD-WCAV55464493
Firmware Revision: 80.00A80
Transport: Serial, SATA 1.0a, SATA II Extensions, SATA Rev
2.5, SATA Rev 2.6
Standards:
Supported: 8 7 6 5
Likely used: 8
Configuration:
Logical max current
cylinders 16383 16383
heads 16 16
sectors/track 63 63
--
CHS current addressable sectors: 16514064
LBA user addressable sectors: 268435455
LBA48 user addressable sectors: 1953525168
Logical/Physical Sector size: 512 bytes
device size with M = 1024*1024: 953869 MBytes
device size with M = 1000*1000: 1000204 MBytes (1000 GB)
cache/buffer size = unknown
Capabilities:
LBA, IORDY(can be disabled)
Queue depth: 32
Standby timer values: spec'd by Standard, with device specific minimum
R/W multiple sector transfer: Max = 16 Current = 16
Recommended acoustic management value: 128, current value: 128
DMA: mdma0 mdma1 mdma2 udma0 udma1 udma2 udma3 udma4 udma5 *udma6
Cycle time: min=120ns recommended=120ns
PIO: pio0 pio1 pio2 pio3 pio4
Cycle time: no flow control=120ns IORDY flow control=120ns
Commands/features:
Enabled Supported:
* SMART feature set
Security Mode feature set
* Power Management feature set
* Write cache
* Look-ahead
* Host Protected Area feature set
* WRITE_BUFFER command
* READ_BUFFER command
* NOP cmd
* DOWNLOAD_MICROCODE
Power-Up In Standby feature set
* SET_FEATURES required to spinup after power up
SET_MAX security extension
* Automatic Acoustic Management feature set
* 48-bit Address feature set
* Device Configuration Overlay feature set
* Mandatory FLUSH_CACHE
* FLUSH_CACHE_EXT
* SMART error logging
* SMART self-test
* General Purpose Logging feature set
* 64-bit World wide name
* {READ,WRITE}_DMA_EXT_GPL commands
* Segmented DOWNLOAD_MICROCODE
* Gen1 signaling speed (1.5Gb/s)
* Gen2 signaling speed (3.0Gb/s)
* Native Command Queueing (NCQ)
* Host-initiated interface power management
* Phy event counters
* NCQ priority information
* DMA Setup Auto-Activate optimization
* Software settings preservation
* SMART Command Transport (SCT) feature set
* SCT Features Control (AC4)
* SCT Data Tables (AC5)
unknown 206[12] (vendor specific)
unknown 206[13] (vendor specific)
Security:
Master password revision code = 65534
supported
not enabled
not locked
frozen
not expired: security count
supported: enhanced erase
200min for SECURITY ERASE UNIT. 200min for ENHANCED SECURITY ERASE UNIT.
Logical Unit WWN Device Identifier: 50014ee2ae6b5ffe
NAA : 5
IEEE OUI : 0014ee
Unique ID : 2ae6b5ffe
Checksum: correct
gandalf ~ #
 
Old 02-12-2010, 11:14 AM
Mark Knecht
 
Default 1-Terabyte drives - 4K sector sizes? -> bar performance so far

On Fri, Feb 12, 2010 at 1:06 AM, Mick <michaelkintzios@gmail.com> wrote:
> On Tuesday 09 February 2010 16:31:15 Mark Knecht wrote:
>> On Mon, Feb 8, 2010 at 4:37 PM, Mark Knecht <markknecht@gmail.com> wrote:
>> <SNIP>
>>
>> > There's a few small downsides I've run into with all of this so far:
>> >
>> > 1) Since we don't use sector 63 it seems that fdisk will still tell
>> > you that you can use 63 until you use up all your primary partitions.
>> > It used to be easier to put additional partitions on when it gave you
>> > the next sector you could use after the one you just added.. Now I'm
>> > finding that I need to write things down and figure it out more
>> > carefully outside of fdisk.
>>
>> Replying mostly to myself, WRT the value 63 continuing to show up
>> after making the first partition start at 64, in *my case since for
>> desktop machines the first partition is general /boot, and as it's
>> written and read so seldom, in the future when faced with this problem
>> I will likely start /boot at 63 and just ensure that all the other
>> partitions - /, /var, /home, etc., start on boundaries divisible by 8.
>>
>> It will make using fdisk slightly more pleasant.
>
> I noticed while working on two new laptops with gparted that resizing Windows
> 7 and creating new partitions showed up small blank partitions (marked as
> hidden) in between the resized, and/or the new partitions. *If I recall
> correctly these were only a few KB each so rather small as such. *I am not
> sure why gparted created these - could it be related to the drive
> automatically aligning partitions to this 4K sector size that is discussed
> here?
> --
> Regards,
> Mick
>

http://lkml.indiana.edu/hypermail/linux/kernel/0902.3/01024.html

Cheers,
Mark
 
Old 02-15-2010, 02:17 AM
Mark Knecht
 
Default 1-Terabyte drives - 4K sector sizes? -> bar performance so far

2010/2/14 Willie Wong <wwong@math.princeton.edu>:
> On Mon, Feb 15, 2010 at 01:48:01AM +0100, Frank Steinmetzger wrote:
<SNIP>
>>
>> action * * * * SS (1st) * SS (2nd) * SS+2 * * * SS+4 * * * SS+6 * * * SS+8
>> -------------+----------+----------+----------+----------+----------+----------
>> untar portage *3m12.517 * 2m55.916 * 1m46.663 * 1m35.341 * 1m47.829 * 1m43.677
>> rm portage * * 4m11.109 * 3m54.950 * 3m18.820 * 3m11.378 * 3m21.804 * 3m12.433
>> cp 1GB file 0m21.383 0m13.558 0m14.920 0m12.813 0m13.407 0m13.681




>
> Instead of guessing using this rather imprecise metric, why not just
> look up the serial number of your drive and see what the physical
> sector size is? If you don't want to open your box, you can usually
> get the information from dmesg.


hdparm capital eye works very nicely:

gandalf ~ # hdparm -I /dev/sda

/dev/sda:

ATA device, with non-removable media
Model Number: WDC WD10EARS-00Y5B1
Serial Number: WD-WCAV55464493
Firmware Revision: 80.00A80
Transport: Serial, SATA 1.0a, SATA II Extensions,
SATA Rev 2.5, SATA Rev 2.6
Standards:
Supported: 8 7 6 5
Likely used: 8
<SNIP>

>
> Only caveat: don't trust the harddrive to report accurate geometry.
> This whole issue is due to the harddrives lying about their physical
> geometry to be compatible with older versions of Windows. So the
> physical sector size listed in dmesg may not be the real one. Which is
> why you are advised to look up the model number on the vendor's
> website yourself to determine the physical sector size.
>
> W
> --
> Willie W. Wong * * * * * * * * * * * * * * * * * * wwong@math.princeton.edu

Very true...

Since this thread started and you help (me at least1) understand what
I was dealing with I got in contact with Mark Lord - the developer and
maintainer of the hdparm program. I was interested in seeing if we
could get hdparm to recognize this aspect of the drive. He was very
interested and asked me to send along additional info which he then
analyzed and decided that, at least at this time, even drives that we
__know__ are 4K sector sizes are not implementing any way of reading
it from the drive's firmware which is supported, at least in the newer
SATA specs. With that he decided that even for his own new 4K drives
he cannot do anything except either assume they are 4K and partition
appropriately or look up specs specifically as you suggest.

Currently I'm partial to the idea that all my sector starting
addresses will end in '000'. It's easy to remember and at most that
wastes (I think) 512K bytes between sectors so it's not much in terms
of the overall disk space. Just a couple of megabyte on a drive with 4
partitions.

= Mark
 

Thread Tools




All times are GMT. The time now is 09:12 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org