NetBSD-Users archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: Partition alignment for optimal disk I/O
On Sat, Aug 25, 2018 at 7:40 PM Greg Troxel <gdt%lexort.com@localhost> wrote:
> If the underlying actual disk(s) has 512-byte sectors, so that operations
> are the same speed whether aligned or not then it doesn't amtter.
>
> If the underlying actual disk(s) has 4K sectors (typical on > 2T disks,
> and maybe newer disks even if smaller), then you need to set things up
> so that actual write operations (that are bigger than 512 bytes) are
> lined up so they don't span 4K sectors.
>
> Filesystems typically have 8K or some other block size, and generally do
> 8K (or 4K or 16K) writes, aligned naturally relative to the beginning of
> the filesystem.
>
> But, there's the within-filesystem alignment, and then the fs within the
> disklabel, and then the disklabel within the mbr partition.
>
> All that really matters in the end is that the writes hit the disk
> controller aligned.
>
> So yes, if you use MBR, make the NetBSD partition start at a mulitple of
> 64. Then, within disklabel, make every partition start at a multiple of
> 64.
Thank you for your reply! Sorry to reply to this so late, but I don't
understand why everything should start at a multiple of 64 sectors
instead of 8 sectors? Shouldn't it be a multiple of 8 sectors because
8 sectors * 512 bytes/sector = 4096 bytes which aligns with the
underlying actual disk's 4K-sized sectors?
Lewis
Home |
Main Index |
Thread Index |
Old Index