Re: ATA 4 KiB sector issues.

From: Karel Zak
Date: Tue Mar 09 2010 - 07:20:11 EST


On Tue, Mar 09, 2010 at 01:16:01PM +0300, Michael Tokarev wrote:
> Karel Zak wrote:
> > # mdadm --create /dev/md8 --level=5 --raid-devices=4 /dev/sdb{1,2,3,4}
>
> That's 3-disk stripe size with default 64Kb chunk size, which makes
> 3x64=320KiB - the number to which everything should be aligned.
>
> > # fdisk -lcu /dev/md8
> >
> > Disk /dev/md8: 1572 MB, 1572667392 bytes
> > 2 heads, 4 sectors/track, 383952 cylinders, total 3071616 sectors
> > Units = sectors of 1 * 512 = 512 bytes
> > Sector size (logical/physical): 512 bytes / 4096 bytes
> > I/O size (minimum/optimal): 65536 bytes / 65536 bytes
>
> And here we go: fdisk does not see the right number: nothing
> is dividable by 3.

Well, the same setup with 2.6.34-0.9.rc0.git13.fc14.x86_64:

# fdisk -luc /dev/sdb

Disk /dev/sdb: 2621 MB, 2621440000 bytes
255 heads, 63 sectors/track, 318 cylinders, total 5120000 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 32768 bytes
Disk identifier: 0x77fbab55

Device Boot Start End Blocks Id System
/dev/sdb1 2048 1026047 512000 83 Linux
/dev/sdb2 1026048 2050047 512000 83 Linux
/dev/sdb3 2050048 3074047 512000 83 Linux
/dev/sdb4 3074048 4098047 512000 83 Linux


# mdadm --create /dev/md8 --level=5 --raid-devices=4 /dev/sdb{1,2,3,4}


# fdisk -luc /dev/md8

Disk /dev/md8: 1572 MB, 1572667392 bytes
2 heads, 4 sectors/track, 383952 cylinders, total 3071616 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 65536 bytes / 65536 bytes


# cat /sys/block/md8/queue/{minimum,optimal}_io_size
65536
65536

> > # cat /sys/block/md8/md8p{1,2}/alignment_offset
> > 0
> > 0
>
> And that's where the issue is. md does not {sup,re}port all
> this stuff yet.

Hmm...

Karel

--
Karel Zak <kzak@xxxxxxxxxx>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/