Linked by theosib on Sun 14th Feb 2010 10:45 UTC

Recently, I bought a pair of those new Western Digital Caviar Green drives. These new drives represent a transitional point from 512-byte sectors to 4096-byte sectors. A number of articles have been published recently about this, explaining the benefits and some of the challenges that we'll be facing during this transition. Reportedly, Linux should unaffected by some of the pitfalls of this transition, but my own experimentation has shown that Linux is just as vulnerable to the potential performance impact as Windows XP. Despite this issue being known about for a long time, basic Linux tools for partitioning and formatting drives have not caught up.

Permalink for comment 409506
To read all comments associated with this story, please click here.
by pavlinux on Mon 15th Feb 2010 21:53 UTC
Member since:


#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>

#define LIMIT 1000

char buffer[4096];

int main(int argc, char *argv[]) {

int fd, i, off;
long bk[LIMIT], byte;

if (argc<2) {
off = 0;
} else {
off = atoi(argv[1]);

/* fill array of randoms */
for (i = 0; i < LIMIT; i++) {
*(bk+i) = random() % 2000000000;

*bk = 0; /* goto begin */
off *= 512; // mul
off += 4096 // add

fd = open("/dev/sds", O_RDWR | O_SYNC);
printf("fd = %d", fd);

for (i = 0 ; i < LIMIT; i++) {
byte = bk * off;
lseek64(fd, byte, SEEK_SET);
write(fd, buffer, 4096);


return 0;


[i]Edited 2010-02-15 22:07 UTC

Reply Score: 1