View previous topic :: View next topic |
Author |
Message |
theosib Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
Joined: 09 Mar 2004 Posts: 207
|
Posted: Fri Feb 12, 2010 5:17 am Post subject: WD Green drive (4K sectors), LBA 63, sector alignment ?? |
|
|
I got one of those WD "Green" drives that has the 4KiB physical sectors. There are warnings about older versions of Windows having problems where they start the partition at LBA 63 and therefore have every 4K cluster one sector out of alignment from the physical disk.
When I use fdisk under Linux to create a "primary" partition, I find that it starts the partition at LBA 63. I've read that Linux is supposedly unaffected, but if the partition starts at LBA 63, doesn't that mean that it's out of alignment?
Is this a bug in fdisk, or does Linux magically do the right thing and align clusters to multiples of 8? |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
theosib Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
Joined: 09 Mar 2004 Posts: 207
|
Posted: Fri Feb 12, 2010 2:02 pm Post subject: Ran an experiment |
|
|
I ran an experiment. I created a write test that does random 4096-byte writes to the block device with O_SYNC. The block offset is varied in 512-byte increments, and I compare the time it takes to write (and sync) 1000 completely random writes. It's slow because O_SYNC means EVERY write must hit the disk, but it proves the point.
When writing blocks with LBA offsets in multiples of 8, it takes about 7 seconds. When writing blocks with LBA offsets not multiples of 8, it takes about 23 seconds.
Now, this tells me nothing about whether or not ext3 is smart enough to align things differently, although that would violate the partition abstraction, so I'm going to guess that it's doing it wrong. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
cyrillic Watchman
![Watchman Watchman](/images/ranks/rank-G-2-watchman.gif)
![](images/avatars/8174739453e52fd5e9aef6.jpg)
Joined: 19 Feb 2003 Posts: 7313 Location: Groton, Massachusetts USA
|
Posted: Sat Feb 13, 2010 1:23 am Post subject: |
|
|
You could use parted instead of fdisk to do what you want.
Check man parted for the --align option. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
cwr Veteran
![Veteran Veteran](/images/ranks/rank_rect_5_vet.gif)
Joined: 17 Dec 2005 Posts: 1969
|
Posted: Mon Feb 15, 2010 11:47 am Post subject: |
|
|
www.osnews.com has a recent article on this; it looks as if a lot of Linux
tools aren't fully aware of the problem, so you may have to do some
juggling to get partitions correctly aligned. You can get a slowdown
of a factor of 3 or so, so it's worth some tinkering.
Will |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
jonfr Veteran
![Veteran Veteran](/images/ranks/rank_rect_5_vet.gif)
Joined: 20 Jul 2003 Posts: 1008 Location: Denmark
|
Posted: Mon Feb 15, 2010 12:28 pm Post subject: |
|
|
How does cfdisk handle this type of hard drive ? |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Hupf Tux's lil' helper
![Tux's lil' helper Tux's lil' helper](/images/ranks/rank_rect_1.gif)
![](images/avatars/95602605547b8b6c614193.gif)
Joined: 11 Sep 2005 Posts: 112 Location: Germany
|
Posted: Mon Feb 15, 2010 1:46 pm Post subject: |
|
|
Taken from the /. and osnews forum discussions: the main problem seems to be that the drive is reporting a sector size of 512 bytes (for compatibility e.g. with Windows XP). You have to use a tool where this can be overridden manually (parted does this) or use this method. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
theosib Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
Joined: 09 Mar 2004 Posts: 207
|
Posted: Mon Feb 15, 2010 1:48 pm Post subject: cfdisk, etc. |
|
|
cfdisk is part of the same tool suite as fdisk. Besides having a curses interface, it only has a few other minor differences. So I'm sure it does not automatically handle this problem. It's developed by the same people.
BTW, I'm the one who wrote the OSnews article. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
cwr Veteran
![Veteran Veteran](/images/ranks/rank_rect_5_vet.gif)
Joined: 17 Dec 2005 Posts: 1969
|
Posted: Tue Feb 16, 2010 2:33 pm Post subject: Re: cfdisk, etc. |
|
|
theosib wrote: | BTW, I'm the one who wrote the OSnews article. |
Synchronicity!
Will |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
|