Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 13 Jun 2012 15:24:28 +0100
From:      "Steven Hartland" <killing@multiplay.co.uk>
To:        "Olivier Smedts" <olivier@gid0.org>, "Irjohn Junus" <i.junus@gmail.com>
Cc:        freebsd-fs@freebsd.org
Subject:   Re: gpart add -a 4096 vs 4k
Message-ID:  <F219F77DCEBA49309C8A7A44A806737C@multiplay.co.uk>
References:  <CALXkR%2B879QJPNisOKA71yej9m1%2BUiz4cNopkoM42irmRoaBL-g@mail.gmail.com> <CABzXLYNZPO90fA41HGcJ-D-thE7KT586S5k7eo41GxLXBrWuCQ@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
----- Original Message ----- 
2012/6/13 Irjohn Junus <i.junus@gmail.com>:
> Hello,
>
> Relatively new to FreeBSD and learning, I'm trying to partition my HDD and
> align it to 4k sector.
>
> I do apologize if this has been answered before, I have Googled and read
> gpart(8) man page to no joy. Can anyone please advice why gpart add '-a
> 4096' doesn't yield the same result with '-a 4k'? Many thanks and captures
> are below.


Question: Do you actually want to partition? Or are you just trying
to get it 4k aligned?

Its my understanding, someone correct me if I'm wrong, that if you
just want to create a zfs volume on a disk you can just use the raw
disk instead of a partition slice and alignment just works.

Its only if you want multiple slices and hence need to partition that
you need to worry about alignment.

Also worth noting that if your 4k disk is actually reporting as 512b
sectors e.g.
cat /var/run/dmesg.boot |grep sectors
da0: 57241MB (117231408 512 byte sectors: 16H 63S/T 16383C)

Then you can use gnop hack to fix this:-
gnop create -S 4096 da0
zpool create mytank da0.nop
zpool export mytank
gnop destroy da0.nop
zpool import mytank

This will ensure the value of the zpool ashift is 12 for a 4k disk.
You can check this with:-
zdb | grep ashift

In my testing this made 100MB/s performance increase for sequential
writes of none random data on a Corsair Force 2 60GB ssd.

    Regards
    Steve

================================================
This e.mail is private and confidential between Multiplay (UK) Ltd. and the person or entity to whom it is addressed. In the event of misdirection, the recipient is prohibited from using, copying, printing or otherwise disseminating it or any information contained in it. 

In the event of misdirection, illegible or incomplete transmission please telephone +44 845 868 1337
or return the E.mail to postmaster@multiplay.co.uk.




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?F219F77DCEBA49309C8A7A44A806737C>