Gentoo Archives: gentoo-user

From: Mark Knecht <markknecht@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] 1-Terabyte drives - 4K sector sizes? -> bar performance so far
Date: Mon, 08 Feb 2010 18:03:35
Message-Id: 5bdc1c8b1002080910p37f78fdch99827fab37be32cb@mail.gmail.com
In Reply to: Re: [gentoo-user] 1-Terabyte drives - 4K sector sizes? -> bar performance so far by Willie Wong
1 On Sun, Feb 7, 2010 at 6:08 PM, Willie Wong <wwong@××××××××××××××.edu> wrote:
2 > On Sun, Feb 07, 2010 at 01:42:18PM -0800, Mark Knecht wrote:
3 >>    OK - it turns out if I start fdisk using the -u option it show me
4 >> sector numbers. Looking at the original partition put on just using
5 >> default values it had the starting sector was 63 - probably about the
6 >> worst value it could be. As a test I blew away that partition and
7 >> created a new one starting at 64 instead and the untar results are
8 >> vastly improved - down to roughly 20 seconds from 8-10 minutes. That's
9 >> roughly twice as fast as the old 120GB SATA2 drive I was using to test
10 >> the system out while I debugged this issue.
11 >
12 > That's good to hear.
13 >
14 >>    I'm still a little fuzzy about what happens to the extra sectors at
15 >> the end of a track. Are they used and I pay for a little bit of
16 >> overhead reading data off of them or are they ignored and I lose
17 >> capacity? I think it must be the former as my partition isn't all that
18 >> much less than 1TB.
19 >
20 > As far as I know, you shouldn't worry about it. The
21 > head/track/cylinder addressing is a relic of an older day. Almost all
22 > modern drives should be accessed via LBA. If interested, take a look
23 > at the wikipedia entry on Cylinder-Head-Sector and Logical Block
24 > Addressing.
25 >
26 > Basically, you are not losing anything.
27 >
28 > Cheers,
29 >
30 > W
31 > --
32 > Willie W. Wong                                     wwong@××××××××××××××.edu
33 > Data aequatione quotcunque fluentes quantitae involvente fluxiones invenire
34 >         et vice versa   ~~~  I. Newton
35 >
36 >
37
38 Hi,
39 Yeah, a little more study and thinking confirms this. The sectors
40 are 4K. WD put them on there. The sectors are 4K.
41
42 Just because there might be extra physical space at the end of a
43 track doesn't mean I can ever use it.
44
45 The sectors are 4K and WD put them on there and they've taken ALL
46 that into account already. They are 4K physically with ECC but
47 accessible by CHS and by LBA in 512B chunks. The trick for speed at
48 the OS/driver level is to make sure we are always grabbing 4K logical
49 blocks from a single 4K physical sector off the drive. If we do it's
50 fast. If we don't and start asking for a 4K block that isn't in a
51 single 4K physical block then it becomes very slow as the drive
52 hardware/firmware/processor has to do multiple reads and piece it
53 together for us which is slow. (VERY slow...) By using partitions
54 mapped to sector number values divisible by 8 we do this. (8 * 512B =
55 4K)
56
57 The extra space at the end of a track/cylinder is 'lost' but it was
58 lost before we bought the drive because the sectors are 4K so there is
59 nothing 'lost' by the choices we make in fdisk. I must remember to use
60 fdisk -u to see the sector numbers when making the partitions and
61 remember to do some test writes to the partition to ensure it's right
62 and the speed is good before doing any real work.
63
64 This has been helpful for me. I'm glad Valmor is getting better
65 results also.
66
67 I wish I had checked the title before I sent the original email it
68 was supposed to be
69
70 1-Terabyte drives - 4K sector sizes? -> bad performance so far
71
72 Maybe sticking that here will help others when they Google for this later.
73
74 Cheers,
75 Mark

Replies

Subject Author
Re: [gentoo-user] 1-Terabyte drives - 4K sector sizes? -> bar performance so far Valmor de Almeida <val.gentoo@×××××.com>