YASSDQ

Wojciech Puchar wojtek at wojtek.tensor.gdynia.pl
Mon Jul 9 10:31:14 UTC 2012


>
> Notes:
>
> 1. SSDs don't necessarily use 4k blocks, some use larger ones. Starting the

All use 4K as it is NTFS default block size and most are sold to be used 
with windoze.

> first filesystem partition at 1M works for most of the common values.

Alignment of filesystem cannot be better than it's block size.

> 3. Swap is tricky with small drives, even trickier if you want to use TRIM. 
> Swap files can be used, and then you get TRIM, but see 
> http://www.freebsd.org/cgi/query-pr.cgi?pr=bin/168544 for a way to dismount 
> that swap file before shutdown and an annoying panic.

my solution:

# cat /etc/rc.local
#!/bin/sh
echo creating swapfile
/bin/rm -f /swapfile.tmp
dd if=/dev/zero of=/swapfile.tmp bs=8m seek=1k count=0
/sbin/mdconfig -a -t vnode -u 0 -f /swapfile.tmp || /bin/sh
/bin/chflags nodump /swapfile.tmp
/bin/rm -f /swapfile.tmp
/sbin/swapctl -a /dev/md0


# cat /etc/rc.shutdown.local
#!/bin/sh
echo removing swapfile
/sbin/swapctl -d /dev/md0
/sbin/mdconfig -d -u 0


my partitioning:

# disklabel ada0
# /dev/ada0:
8 partitions:
#          size     offset    fstype   [fsize bsize bps/cpg]
   a:  117231408          0    4.2BSD        0     0     0
   c:  117231408          0    unused        0     0     # "raw" part, don't edit




99% of the time swap is not needed so doesn't take space.


More information about the freebsd-questions mailing list