Gentoo Archives: gentoo-user

From: Mark Knecht <markknecht@×××××.com>
To: gentoo-user@l.g.o
Subject: [gentoo-user] 1-Terabyte drives - 4K sector sizes? -> bar performance so far
Date: Sun, 07 Feb 2010 17:03:38
Message-Id: 5bdc1c8b1002070827i14f59047k39a695900ebe9889@mail.gmail.com
1 Hi,
2 I got a WD 1T drive to use in a new machine for my dad. I didn't
3 pay a huge amount of attention to the technical details when I
4 purchased it other than it was SATA2, big, and the price was good.
5 Here's the NewEgg link:
6
7 http://www.newegg.com/Product/Product.aspx?Item=N82E16822136490
8
9 I installed the drive, created some partitions and set off to put
10 ext3 on it using just mke2fs -j /dev/sda3. The partitions gets written
11 and everything works but when I started installing Gentoo on it I was
12 getting some HUGE delays at times, such as when unpacking
13 portage.latest.tar.bz. Basically the tar step would be rolling along
14 and then the drive would literally appear to stop for 1 minute before
15 proceeding. No CPU usage, the machine is alive in other terminals, but
16 anything directed at the disk just seems dead. Sticking my ear on the
17 drive it doesn't sound like the drive is doing anything.
18
19 I was trying to determine what to do - I.e is this a bad drive, how
20 to return it, etc. - and started reading the reviews at NewEgg. One
21 guy using it with Linux had this to say:
22
23 <QUOTE>
24 4KB physical sectors: KNOW WHAT YOU'RE DOING!
25
26 Pros: Quiet, cool-running, big cache
27
28 Cons: The 4KB physical sectors are a problem waiting to happen. If you
29 misalign your partitions, disk performance can suffer. I ran
30 benchmarks in Linux using a number of filesystems, and I found that
31 with most filesystems, read performance and write performance with
32 large files didn't suffer with misaligned partitions, but writes of
33 many small files (unpacking a Linux kernel archive) could take several
34 times as long with misaligned partitions as with aligned partitions.
35 WD's advice about who needs to be concerned is overly simplistic,
36 IMHO, and it's flat-out wrong for Linux, although it's probably
37 accurate for 90% of buyers (those who run Windows or Mac OS and use
38 their standard partitioning tools). If you're not part of that 90%,
39 though, and if you don't fully understand this new technology and how
40 to handle it, buy a drive with conventional 512-byte sectors!
41 </QUOTE>
42
43 Now, I don't mind getting a bit dirty learning to use this
44 correctly but I'm wondering what that means in a practical sense.
45 Reading the mke2fs man page the word 'sector' doesn't come up. It's my
46 understanding the Linux 'blocks' are groups of sectors. True? If the
47 disk must use 4K sectors then what - the smallest block has to be 4K
48 and I'm using 1 sector per block? It seems that ext3 doesn't support
49 anything larger than 4K?
50
51 As a test I blew away all the partitions and made one huge 1
52 terabyte partition using ext3. I think tried untarring the portage
53 snapshot and then deleting the directory where I put it a bunch of
54 times. I get very different times each time I do this. untarring
55 varies from 6 minutes 24 seconds to 10 minutes 25 seconds. Removing
56 the directory varies from 3 seconds to 1 minute 22 seconds.
57
58 Every time there is an apparent delay I just see the hard drive
59 light turned on solid. That said as far as I know if I wait for things
60 to complete the data is there but I haven't tested it extensively.
61
62 Is this a bad drive or am I somehow using it incorrectly?
63
64 Thanks,
65 Mark
66
67
68 gandalf TestMount # time tar xjf /mnt/TestMount/portage-latest.tar.bz2
69 -C /mnt/TestMount/usr
70
71 real 6m24.736s
72 user 0m9.969s
73 sys 0m3.537s
74 gandalf TestMount # time rm -rf /mnt/TestMount/usr/
75
76 real 0m3.229s
77 user 0m0.110s
78 sys 0m1.809s
79 gandalf TestMount # mkdir usr
80 gandalf TestMount # time tar xjf /mnt/TestMount/portage-latest.tar.bz2
81 -C /mnt/TestMount/usr
82
83 real 7m50.193s
84 user 0m8.647s
85 sys 0m2.811s
86 gandalf TestMount # time rm -rf /mnt/TestMount/usr/
87
88 real 0m3.234s
89 user 0m0.119s
90 sys 0m1.792s
91 gandalf TestMount # mkdir usr
92 gandalf TestMount # time tar xjf /mnt/TestMount/portage-latest.tar.bz2
93 -C /mnt/TestMount/usr
94
95 real 10m25.926s
96 user 0m8.645s
97 sys 0m2.765s
98 gandalf TestMount # time rm -rf /mnt/TestMount/usr/
99
100 real 1m22.330s
101 user 0m0.124s
102 sys 0m1.810s
103 gandalf TestMount # mkdir usr
104 gandalf TestMount # time tar xjf /mnt/TestMount/portage-latest.tar.bz2
105 -C /mnt/TestMount/usr
106
107 real 8m12.307s
108 user 0m8.463s
109 sys 0m2.708s
110 gandalf TestMount # time rm -rf /mnt/TestMount/usr/
111
112 real 0m29.517s
113 user 0m0.114s
114 sys 0m1.810s
115 gandalf TestMount #
116
117
118
119
120 gandalf ~ # hdparm -tT /dev/sdb
121
122 /dev/sdb:
123 Timing cached reads: 11362 MB in 2.00 seconds = 5684.46 MB/sec
124 Timing buffered disk reads: 314 MB in 3.00 seconds = 104.64 MB/sec
125 gandalf ~ #

Replies