9.0 on SSD

Warren Block wblock at wonkity.com
Fri Jun 1 01:24:23 UTC 2012

On Fri, 1 Jun 2012, Victor Sudakov wrote:

> Warren Block wrote:
>>> I have installed 9.0-RELEASE on a SSD drive with the following
>>> tweaking so far:
>>> 1. tmpmfs="YES" (WRKDIRPREFIX etc will go there too).
>>> 2. mount -o noatime
>>> 3. tunefs -t enable
>>> I have not done any tricky partition alignment, do I really need to? Is
>>> anything else advisable?
>> If it's not aligned, there can be a pretty significant performance
>> drop.  Please show the output of 'gpart show' on that drive if it's GPT
>> (gpart show ada0) or drive and slice if it's MBR/bsdlabel (gpart show
>> ada0 && gpart show ada0s1).
> It was created by the "Auto" option of the new FreeBSD installer:
> [sudakov at vas ~] gpart show ada0
> =>       34  117231341  ada0  GPT  (55G)
>         34        128     1  freebsd-boot  (64k)
>        162  111148928     2  freebsd-ufs  (53G)
>  111149090    5861376     3  freebsd-swap  (2.8G)
>  117010466     220909        - free -  (107M)

That is not aligned, either with 4K or 1M:
   (162*512)/4096 = 20.25

If the performance is good enough, leave it alone.  Use
# diskinfo -tv /dev/ada0p2
to get an optimistic version, or do some in-depth benchmarking with 

To get it aligned, back up and repartition:

(Back up first!)
# gpart destroy -F ada0
# gpart create -s gpt ada0
# gpart add -t freebsd-boot -s 512k ada0
# gpart bootcode -b /boot/pmbr -p /boot/gptboot -i1 ada0
# gpart add -t freebsd-ufs -b 1m -s 53G ada0
# gpart add -t freebsd-swap ada0

That creates a 512k boot partition which allows for growth of the boot 
code.  Then the UFS partition starts at 1M, an even multiple of both 4k 
and 1M for alignment, and a common semi-standard.  Then swap fills out 
the drive; that could be reduced by giving a -s size if you want to 
leave that 107M at the end for something else.

(gpart's -a option is not used.  It isn't needed here, and overrides the 
-b option in earlier versions of gpart.)

More information about the freebsd-questions mailing list