Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Debian support on newer 4K Advanced format drives (rather than 512 bytes)

136 views
Skip to first unread message

Mike Viau

unread,
Jul 2, 2010, 5:40:02 PM7/2/10
to
Hello List,

I was just wondering what some of the debian community users has been experiencing in regards to the new Western Digital 4K Advanced format drives? Has any one tried using one of these drives on the 2.6.26 (64/32 bit) kernel shipped with Lenny stable? How about with the 2.6.32 (64/32 bit) kernel shipped with squeeze testing?

Is the support more dependant on the kernel or does debian already support these drives?

Thanks in advance.



Specifications for the WD Caviar Green (Advanced Format) SATA internal hard drives


http://wdc.custhelp.com/cgi-bin/wdc.cfg/php/enduser/std_adp.php?p_faqid=5324&p_created=1263858658&p_sid=xbnV-uVj&p_accessibility=0&p_redirect=&p_srch=1&p_lva=&p_sp=cF9zcmNoPTEmcF9zb3J0X2J5PSZwX2dyaWRzb3J0PSZwX3Jvd19jbnQ9MTk2LDE5NiZwX3Byb2RzPTIyNywyOTQmcF9jYXRzPSZwX3B2PTIuMjk0JnBfY3Y9JnBfcGFnZT0x&p_li=&p_topview=1


-M




Your Photo on Bing.ca: You Could WIN on Canada Day! Submit a Photo Now!

Mike Viau

unread,
Jul 3, 2010, 12:40:01 PM7/3/10
to
Does this mkfs work around work to preserve the performance of the drive? By using the -b 4096 (to signify the 4k sectors) when creating partitions such as:

mkfs -t ext4 -b 4096 /dev/sda1

Is there any implication for mounting a partition formatted with the above command (e.g: mounting in other systems)?

Is there anything in fdisk that one should do to signify 4K sectors for partitions as well?

I understand that added layers to the partitions such as drive encryption and/or LVM volumes must also be setup to use 4K sectors too so that performance is not lost.

Thanks.


-M





From: vi...@sheridanc.on.ca
To: debia...@lists.debian.org
Subject: Debian support on newer 4K Advanced format drives (rather than 512 bytes)
Date: Fri, 2 Jul 2010 17:31:22 -0400

Ron Johnson

unread,
Jul 3, 2010, 1:10:01 PM7/3/10
to
I think that the partitioning tool (fdisk, cfdisk, parted, ...) is
what is really important. That is because filesystems already use
4KB block sizes.

Possibly also fsck.

There was a recent IBM DeveloperWorks article on this very topic.

On 07/03/2010 11:36 AM, Mike Viau wrote:
> Does this mkfs work around work to preserve the performance of the
> drive? By using the -b 4096 (to signify the 4k sectors) when creating
> partitions such as:
>
> mkfs -t ext4 -b 4096 /dev/sda1
>
> Is there any implication for mounting a partition formatted with the
> above command (e.g: mounting in other systems)?
>
> Is there anything in fdisk that one should do to signify 4K sectors for
> partitions as well?
>
> I understand that added layers to the partitions such as drive
> encryption and/or LVM volumes must also be setup to use 4K sectors too
> so that performance is not lost.
>
> Thanks.
>
>
> -M
>
>
>
>

> ------------------------------------------------------------------------


> From: vi...@sheridanc.on.ca
> To: debia...@lists.debian.org
> Subject: Debian support on newer 4K Advanced format drives (rather than
> 512 bytes)
> Date: Fri, 2 Jul 2010 17:31:22 -0400
>
> Hello List,
>
> I was just wondering what some of the debian community users has been
> experiencing in regards to the new Western Digital 4K Advanced format
> drives? Has any one tried using one of these drives on the 2.6.26 (64/32
> bit) kernel shipped with Lenny stable? How about with the 2.6.32 (64/32
> bit) kernel shipped with squeeze testing?
>
> Is the support more dependant on the kernel or does debian already
> support these drives?
>
> Thanks in advance.
>
>
>
> Specifications for the WD Caviar Green (Advanced Format) SATA internal
> hard drives
>
>
> http://wdc.custhelp.com/cgi-bin/wdc.cfg/php/enduser/std_adp.php?p_faqid=5324&p_created=1263858658&p_sid=xbnV-uVj&p_accessibility=0&p_redirect=&p_srch=1&p_lva=&p_sp=cF9zcmNoPTEmcF9zb3J0X2J5PSZwX2dyaWRzb3J0PSZwX3Jvd19jbnQ9MTk2LDE5NiZwX3Byb2RzPTIyNywyOTQmcF9jYXRzPSZwX3B2PTIuMjk0JnBfY3Y9JnBfcGFnZT0x&p_li=&p_topview=1

> <http://wdc.custhelp.com/cgi-bin/wdc.cfg/php/enduser/std_adp.php?p_faqid=5324&p_created=1263858658&p_sid=xbnV-uVj&p_accessibility=0&p_redirect=&p_srch=1&p_lva=&p_sp=cF9zcmNoPTEmcF9zb3J0X2J5PSZwX2dyaWRzb3J0PSZwX3Jvd19jbnQ9MTk2LDE5NiZwX3Byb2RzPTIyNywyOTQmcF9jYXRzPSZwX3B2PTIuMjk0JnBfY3Y9JnBfcGFnZT0x&p_li=&p_topview=1>
>
>
> -M
>
>
> <http://go.microsoft.com/?linkid=9734380>
> ------------------------------------------------------------------------


> Your Photo on Bing.ca: You Could WIN on Canada Day! Submit a Photo Now!

> <http://go.microsoft.com/?linkid=9734380>


--
Seek truth from facts.


--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org
Archive: http://lists.debian.org/4C2F6CF4...@cox.net

Kelly Clowers

unread,
Jul 3, 2010, 2:50:02 PM7/3/10
to
On Fri, Jul 2, 2010 at 14:31, Mike Viau <vi...@sheridanc.on.ca> wrote:
> Hello List,
>
> I was just wondering what some of the debian community users has been
> experiencing in regards to the new Western Digital 4K Advanced format
> drives? Has any one tried using one of these drives on the 2.6.26 (64/32
> bit) kernel shipped with Lenny stable? How about with the 2.6.32 (64/32 bit)
> kernel shipped with squeeze testing?
>
> Is the support more dependant on the kernel or does debian already support
> these drives?
>
> Thanks in advance.

Some relevant discussion, also check some of the links in the comments:
http://lwn.net/Articles/377895/


Cheers,
Kelly Clowers


--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org

Archive: http://lists.debian.org/AANLkTimjeHnhKFqyFfmjo...@mail.gmail.com

Mike Viau

unread,
Jul 3, 2010, 2:50:01 PM7/3/10
to
> On Sat, 3 Jul 2010 12:01:40 -0500 <ron.l....@cox.net> wrote:
>
> I think that the partitioning tool (fdisk, cfdisk, parted, ...) is
> what is really important. That is because filesystems already use
> 4KB block sizes.
>
> Possibly also fsck.
>
> There was a recent IBM DeveloperWorks article on this very topic.
>

This I take it?

http://www.ibm.com/developerworks/linux/library/l-4kb-sector-disks/index.html


Enter for a chance to get your town photo on Bing.ca! Submit a Photo Now!

Stan Hoeppner

unread,
Jul 3, 2010, 3:30:02 PM7/3/10
to
Ron Johnson put forth on 7/3/2010 12:01 PM:

> I think that the partitioning tool (fdisk, cfdisk, parted, ...) is what
> is really important.

It is. The first partition must be created on an even 4k sector aligned
boundary to avoid the performance hit of unaligned access. However, from all
I've read up to around March 2010, Linux, its partitioning tools, and the
documentation on how to use the with 4k drives aren't ready ready for prime
time yet. I'd avoid 4k sector drives until all the dust settles.

> That is because filesystems already use 4KB block
> sizes.

This is unrelated. FS block size != sector size. This discussion is about
disk hardware sector size.

> Possibly also fsck.

fsck is ignorant of hw sector size.

--
Stan


--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org

Archive: http://lists.debian.org/4C2F8D90...@hardwarefreak.com

Ron Johnson

unread,
Jul 3, 2010, 3:40:02 PM7/3/10
to
On 07/03/2010 01:40 PM, Mike Viau wrote:
> > On Sat, 3 Jul 2010 12:01:40 -0500 <ron.l....@cox.net> wrote:
> >
> > I think that the partitioning tool (fdisk, cfdisk, parted, ...) is
> > what is really important. That is because filesystems already use
> > 4KB block sizes.
> >
> > Possibly also fsck.
> >
> > There was a recent IBM DeveloperWorks article on this very topic.
> >
>
> This I take it?
>
> http://www.ibm.com/developerworks/linux/library/l-4kb-sector-disks/index.html
>

Yuppers.

--
Seek truth from facts.

--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org

Archive: http://lists.debian.org/4C2F8FE7...@cox.net

Ron Johnson

unread,
Jul 3, 2010, 3:40:02 PM7/3/10
to
On 07/03/2010 02:20 PM, Stan Hoeppner wrote:
> Ron Johnson put forth on 7/3/2010 12:01 PM:
>> I think that the partitioning tool (fdisk, cfdisk, parted, ...) is what
>> is really important.
>
> It is. The first partition must be created on an even 4k sector aligned
> boundary to avoid the performance hit of unaligned access. However, from all
> I've read up to around March 2010, Linux, its partitioning tools, and the
> documentation on how to use the with 4k drives aren't ready ready for prime
> time yet. I'd avoid 4k sector drives until all the dust settles.
>

Even with older tools, there are ways to properly align partitions.
You've just got to do a bit of study beforehand.

>> That is because filesystems already use 4KB block
>> sizes.
>
> This is unrelated. FS block size != sector size.

It is when you use a 4KB drive!!!!

> This discussion is about
> disk hardware sector size.
>

Right. But not every geek knows everything about every topic.
Thus, OP's question was valid.

>> Possibly also fsck.
>
> fsck is ignorant of hw sector size.
>

I thought so.

--
Seek truth from facts.

--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org

Archive: http://lists.debian.org/4C2F912E...@cox.net

Stan Hoeppner

unread,
Jul 3, 2010, 4:20:01 PM7/3/10
to
Ron Johnson put forth on 7/3/2010 2:36 PM:

>> This is unrelated. FS block size != sector size.
>
> It is when you use a 4KB drive!!!!

Not according to man on Stable:

mkfs.xfs [ -b block_size ] ... [ -s sector_size ] [ -L label ] [ -N ] device

-b block_size_options

This option specifies the fundamental block size of the filesystem. The
valid block_size_options are: log=value or size=value and only one can be
supplied. The block size is specified either as a base two logarithm value
with log=, or in bytes with size=. The default value is 4096 bytes (4 KiB),
the minimum is 512, and the maximum is 65536 (64 KiB). XFS on Linux currently
only supports pagesize or smaller blocks.

-s sector_size
This option specifies the fundamental sector size of the filesystem. The
sector_size is specified either as a value in bytes with size=value or as a
base two logarithm value with log=value. The default sector_size is 512 bytes.
The minimum value for sector size is 512; the maximum is 32768 (32 KiB). The
sector_size must be a power of 2 size and cannot be made larger than the
filesystem block size.

--
Stan

--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org

Archive: http://lists.debian.org/4C2F9915...@hardwarefreak.com

Mike Viau

unread,
Jul 4, 2010, 12:20:02 AM7/4/10
to
On the link http://www.ibm.com/developerworks/linux/library/l-4kb-sector-disks/index.html

[snip]

Tip:
If you want to dual-boot between Linux and an older operating system that requires cylinder alignment, try aligning the starts of all your partitions on multiples of eight cylinders. This translates to 8-sector alignment for optimum disk performance as well as cylinder alignment for the older operating system.

[/snip]



It sounds like the term cylinders is used synonymously with sectors. Will this always be the case??





> On Sat, 3 Jul 2010 15:09:57 -0500 <st...@hardwarefreak.com> wrote:
>
> Ron Johnson put forth on 7/3/2010 2:36 PM:
>
> >> This is unrelated. FS block size != sector size.
> >
> > It is when you use a 4KB drive!!!!
>
> Not according to man on Stable:
>
> mkfs.xfs [ -b block_size ] ... [ -s sector_size ] [ -L label ] [ -N ] device
>
> -b block_size_options
>
> This option specifies the fundamental block size of the filesystem. The
> valid block_size_options are: log=value or size=value and only one can be
> supplied. The block size is specified either as a base two logarithm value
> with log=, or in bytes with size=. The default value is 4096 bytes (4 KiB),
> the minimum is 512, and the maximum is 65536 (64 KiB). XFS on Linux currently
> only supports pagesize or smaller blocks.
>
> -s sector_size
> This option specifies the fundamental sector size of the filesystem. The
> sector_size is specified either as a value in bytes with size=value or as a
> base two logarithm value with log=value. The default sector_size is 512 bytes.
> The minimum value for sector size is 512; the maximum is 32768 (32 KiB). The
> sector_size must be a power of 2 size and cannot be made larger than the
> filesystem block size.
>
> --
> Stan
>
>

That seems like a very clean way to prepare a XFS file system that is aware of the 4096 byte sector size with the -s option. Its like away to override the 4096 byte sector size even if it gets read incorrectly as 512 by the /sys/block/sdX/queue/physical_block_size.

[snip]

In theory, the Linux kernel should return information on the physical sector size in the /sys/block/sdX/queue/physical_block_size pseudo-file and on the logical sector size in the /sys/block/sdX/queue/logical_block_size pseudo-file, where sdX is your device's node name (normally sda, sdb, and so on). In practice, however, the physical block size information is spurious, at least for the first generation of Western Digital Advanced Format drives. Unfortunately, this means that disk utilities cannot properly detect the presence of such disks.

[/snip]


-M


Look 'em in the eye: FREE Messenger video chat Chat Now!

Mike Viau

unread,
Jul 4, 2010, 12:30:02 AM7/4/10
to
On the link http://www.ibm.com/developerworks/linux/library/l-4kb-sector-disks/index.html

[snip]
Tip:
If you want to dual-boot between Linux and an older operating system that requires cylinder alignment, try aligning the starts of all your partitions on multiples of eight cylinders. This translates to 8-sector alignment for optimum disk performance as well as cylinder alignment for the older operating system.
[/snip]

It sounds like the term cylinders is used synonymously with sectors. Will this always be the case??


> On Sat, 3 Jul 2010 15:09:57 -0500 <st...@hardwarefreak.com> wrote:
>
> Ron Johnson put forth on 7/3/2010 2:36 PM:
>
> >> This is unrelated. FS block size != sector size.
> >
> > It is when you use a 4KB drive!!!!
>
> Not according to man on Stable:
>
> mkfs.xfs [ -b block_size ] ... [ -s sector_size ] [ -L label ] [ -N ] device
>
> -b block_size_options
>
> This option specifies the fundamental block size of the filesystem. The
> valid block_size_options are: log=value or size=value and only one can be
> supplied. The block size is specified either as a base two logarithm value
> with log=, or in bytes with size=. The default value is 4096 bytes (4 KiB),
> the minimum is 512, and the maximum is 65536 (64 KiB). XFS on Linux currently
> only supports pagesize or smaller blocks.
>
> -s sector_size
> This option specifies the fundamental sector size of the filesystem. The
> sector_size is specified either as a value in bytes with size=value or as a
> base two logarithm value with log=value. The default sector_size is 512 bytes.
> The minimum value for sector size is 512; the maximum is 32768 (32 KiB). The
> sector_size must be a power of 2 size and cannot be made larger than the
> filesystem block size.
>
> --
> Stan
>
>

CaT

unread,
Jul 4, 2010, 1:00:02 AM7/4/10
to
On Fri, Jul 02, 2010 at 05:31:22PM -0400, Mike Viau wrote:
> Hello List,
>
> I was just wondering what some of the debian community users has been
> experiencing in regards to the new Western Digital 4K Advanced format
> drives? Has any one tried using one of these drives on the 2.6.26
> (64/32 bit) kernel shipped with Lenny stable? How about with the 2.6.32
> (64/32 bit) kernel shipped with squeeze testing?
>
> Is the support more dependant on the kernel or does debian already support these drives?

These drives lie about the real size of their sectors so the kernel sees
them as 512byte sectors drives, as do all the utilities I used on them.

This presents a problem because unaligned access to these drives is a
right bastard of a performance killer. It hurts like blazes. I wound
up having to backup my desktop and repartition the hd appropriately.

This is where the fun comes in. You'll need to ignore all the defaults
of partitioning and do it all yourself.

A calculator is handy. :) You'll want to align at 8 sectors and leave
enough room at the beginning for the mbr and other fun stuff. I left
a meg, which is overkill but I just did not care at that point. From
there figure out the right sizes of your partitions. To be honest here
I found parteds UI to be a right total pain in the bottom but at least
it was somewhat easier to use (in other respects) than fdisk.

I wont be buying more of these if I can avoid it. I'd rather a 4k drive
that says it's a 4k drive and get on with life.

Tis all fun. ;)


--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org

Archive: http://lists.debian.org/2010070404...@zip.com.au

Ron Johnson

unread,
Jul 4, 2010, 9:00:02 AM7/4/10
to
On 07/03/2010 03:09 PM, Stan Hoeppner wrote:
> Ron Johnson put forth on 7/3/2010 2:36 PM:
>
>>> This is unrelated. FS block size != sector size.
>>
>> It is when you use a 4KB drive!!!!
>
> Not according to man on Stable:
>
> mkfs.xfs [ -b block_size ] ... [ -s sector_size ] [ -L label ] [ -N ] device
>
> -b block_size_options
>
> This option specifies the fundamental block size of the filesystem. The
> valid block_size_options are: log=value or size=value and only one can be
> supplied. The block size is specified either as a base two logarithm value
> with log=, or in bytes with size=. The default value is 4096 bytes (4 KiB),

Ok, shame on me for forgetting to use the word "default".

> the minimum is 512, and the maximum is 65536 (64 KiB). XFS on Linux currently
> only supports pagesize or smaller blocks.
>

--
Seek truth from facts.

--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org

Archive: http://lists.debian.org/4C30852A...@cox.net

lee

unread,
Jul 4, 2010, 11:40:02 AM7/4/10
to
On Sun, Jul 04, 2010 at 02:31:15PM +1000, CaT wrote:
>
> I wont be buying more of these if I can avoid it. I'd rather a 4k drive
> that says it's a 4k drive and get on with life.

Well, I wonder what the manufacturers thinking behind lieing about the
sector size is. It only leads to problems --- everyone who bought a
disk like that and partitions it as usual should just exchange it if
permance testing shows poor performance until they get one that just
works.

And how do RAID controllers handle such disks? They present the disks
transparently to the OS, and if they can't figure out that a 4k
alignment is required, you can only return the disks when the
performance is poor ...

This problem has greatly contributed to my decision to buy one or two
more 500GB disks (same model as the others I have) and to convert the
RAID-1 to a RAID-5, rather than buying two 2TB disks to set up another
RAID-1. It's also a lot cheaper: Two more disks will triple the
capacity for less than half the price of one 2TB disk, and they are
somewhat likely to be faster.


--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org

Archive: http://lists.debian.org/20100704153...@yun.yagibdah.de

thib

unread,
Jul 4, 2010, 9:30:02 PM7/4/10
to
lee wrote:
> Well, I wonder what the manufacturers thinking behind lieing about the
> sector size is. [...]

XP, AFAIK.

-t


--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org

Archive: http://lists.debian.org/4C31347...@stammed.net

Mark Allums

unread,
Jul 5, 2010, 12:20:02 AM7/5/10
to
On 7/4/2010 10:30 AM, lee wrote:
> On Sun, Jul 04, 2010 at 02:31:15PM +1000, CaT wrote:
>>
>> I wont be buying more of these if I can avoid it. I'd rather a 4k drive
>> that says it's a 4k drive and get on with life.
>
> Well, I wonder what the manufacturers thinking behind lieing about the
> sector size is. It only leads to problems --- everyone who bought a
> disk like that and partitions it as usual should just exchange it if
> permance testing shows poor performance until they get one that just
> works.


These drives are transition drives. The industry is moving permanently
to the new sector size, and some situations can't cope, hence, the
lying. This will pass, as the world adjusts to it.

Patience.

--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org

Archive: http://lists.debian.org/4C315CD9...@allums.com

Jean-François

unread,
Jul 8, 2010, 7:00:02 PM7/8/10
to
I have a WD20EARS here. As these drives still report their sector size
to be 512B instead of 4KB (for compatibility purposes, apparently), you
have to manually align the partition when creating it. (otherwise you'll
get very slow performance, ~3.5 MB/s instead of the ~90MB/s this drive
can do)

You might want to look at this :
http://community.wdc.com/t5/Desktop/Problem-with-WD-Advanced-Format-drive-in-LINUX-WD15EARS/m-p/7573;jsessionid=238D80F83AF36209A94D65FBBB31B499#M369


--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org

Archive: http://lists.debian.org/4C35B892...@gmail.com

0 new messages