# Using FBSD with SSD



## michaelrmgreen (Feb 4, 2009)

A bit of background:

I'll be setting up a new server for work. I don't need high performance and I'd like to try out a solid state disk (possibly this : http://www.mini-itx.com/store/?c=16#satassd). In fact I'm trying to go 'moving parts free'. 

The question is this: 

Can someone point me to a source of information on what changes to make from a completely standard FBSD 7.n installation to maximise the life of the SSD. I have already reviewed this : http://www.freebsd.org/doc/en_US.ISO8859-1/articles/solid-state/index.html
but I'm looking for further feedback from SSD users. 

Thanks.


----------



## User23 (Mar 24, 2009)

michaelrmgreen said:
			
		

> A bit of background:
> 
> I'll be setting up a new server for work. I don't need high performance and I'd like to try out a solid state disk (possibly this : http://www.mini-itx.com/store/?c=16#satassd). In fact I'm trying to go 'moving parts free'.



A Intel X25-E 32Gb with SLC chips http://www.intel.com/design/flash/nand/extreme/index.htm Intel X25-E should be shipped soon to me. Ill make some tests under FreeBSD and check out throuhput and I/O ops under different circumstances. The results will be posted.



> The question is this:
> 
> Can someone point me to a source of information on what changes to make from a completely standard FBSD 7.n installation to maximise the life of the SSD. I have already reviewed this : http://www.freebsd.org/doc/en_US.ISO8859-1/articles/solid-state/index.html
> but I'm looking for further feedback from SSD users.
> ...



The only thing you can do is to decrease the possible I/O operations to its minimum. How and what you can do depends on the job the server should do.

One  of the options a lot of FreeBSD people using is the mount option:


> noatime
> Do not update the file access time when reading from a
> file.  This option is useful on file systems where there
> are large numbers of files and performance is more criti-
> ...



If your applications dont need the time of the last access it will work fine.

The next easy step is to think about logfiles. Did you need them? Can another server used to store them. Or maybe you need them only temporaly, so maybe store them into a RAM disk. 

best regards


----------



## trev (Mar 25, 2009)

Adding to the above, I also:

1. Created a memory file system for /var (but don't forget to write a script to re-populate/de-populate the fs at each boot/shutdown).

2. Used a syslog server so as not to lose any valuable log file entries if the system reboots/panics.

3. Created a tmpfs for /tmp.


----------



## michaelrmgreen (Mar 27, 2009)

Thanks for the input. I think SSD will be very significant in the future. 

Lets here more from people with practical experience!


----------



## oliverh (Mar 27, 2009)

http://wiki.eeeuser.com/ssd_write_limit

SSD write limit


----------



## Carpetsmoker (Mar 30, 2009)

I have two SSD drives lying on my desk, a `consumer' and `enterprise' class, I'll do some real-world test with both Windows and FreeBSD during the week ...


----------



## User23 (Apr 14, 2009)

*First results on SSD*

SSDSA2SH032G1GN INTEL 045C8621 
Intel X25-E 32Gb with SLC chips

System: Standard FreeBSD Installation

```
...

FreeBSD 7.1-RELEASE #0: Thu Jan  1 14:37:25 UTC 2009
    root@logan.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC
Timecounter "i8254" frequency 1193182 Hz quality 0
CPU: Intel(R) Core(TM)2 Quad CPU    Q6600  @ 2.40GHz (2402.39-MHz 686-class CPU)
  Origin = "GenuineIntel"  Id = 0x6fb  Stepping = 11
  Features=0xbfebfbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CLFLUSH,DTS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE>
  Features2=0xe3bd<SSE3,DTES64,MON,DS_CPL,VMX,EST,TM2,SSSE3,CX16,xTPR,PDCM>
  AMD Features=0x20000000<LM>
  AMD Features2=0x1<LAHF>
  Cores per package: 4
real memory  = 3489333248 (3327 MB)
avail memory = 3410030592 (3252 MB)
ACPI APIC Table: <072307 APIC0949>
FreeBSD/SMP: Multiprocessor System Detected: 4 CPUs
 cpu0 (BSP): APIC ID:  0
 cpu1 (AP): APIC ID:  1
 cpu2 (AP): APIC ID:  2
 cpu3 (AP): APIC ID:  3

...

ad8: 78533MB <Hitachi HDS728080PLAT20 PF2OA21B> at ata4-master UDMA133
ad16: 30517MB <SSDSA2SH032G1GN INTEL 045C8621> at ata8-master SATA300
SMP: AP CPU #1 Launched!
SMP: AP CPU #3 Launched!
SMP: AP CPU #2 Launched!
Trying to mount root from ufs:/dev/ad8s1a
```

tunefs -p /dev/ad16s1d
tunefs: ACLs: (-a)                                         disabled
tunefs: MAC multilabel: (-l)                               disabled
tunefs: soft updates: (-n)                                 enabled
tunefs: gjournal: (-J)                                     disabled
tunefs: maximum blocks per file in a cylinder group: (-e)  512
tunefs: average file size: (-f)                            16384
tunefs: average number of files in a directory: (-s)       64
tunefs: minimum percentage of free space: (-m)             8%
tunefs: optimization preference: (-o)                      time
tunefs: volume label: (-L)


The ssd_iozone.tar.gz contain test results for

file size (per thread): 4GB
records sizes: 4KB,16KB,32KB,64KB,128KB,256KB,512KB,1M,2M,4M,8M
threads: up to 4 (8 threads results will be posted later)

--

Thanks a lot to Rob!


----------



## michaelrmgreen (May 15, 2009)

I found this article :
http://www.storagesearch.com/ssdmyths-endurance.html

Perhaps noattime etc is unnecessary?


----------



## kamikaze (May 15, 2009)

An SSD already has a much longer life expectancy than a regular hard disk. No optimizations required.


----------



## michaelrmgreen (May 21, 2009)

kamikaze said:
			
		

> An SSD already has a much longer life expectancy than a regular hard disk. No optimizations required.



That is what the link I posted above seem to suggest. BUT I'd be very interested to know the basis for your statement.


----------



## kamikaze (May 21, 2009)

Flash memory has always more memory than available to the user. This is used to replace broken sectors. Normally if a sector breaks, it's detected in time before a data loss and the data is transparently transferred to a hidden sector that henceforth replaces the old one.

Also the flash memory has an abstraction layer for the addressing. Two writes on the same address end up on physically different memory sectors. This ensures an even use of all available memory, no matter the writing pattern of the application using it.

There are no mechanical parts, so it's pretty shock resistant, too.


----------



## kagura-san (May 22, 2009)

I run a little home FreeBSD server with 2x4GB SSD (actually there are Compact Flash with ATA reduction) disks. Here are my experiences, which sometimes colide with the article you have posted, becouse I managed to discover them without any how-to:

At first, I changed rc.conf to create mfs for /var and /tmp at boot:

tmpmfs_enable="YES"
varmfs_enable="YES"
tmpsize="..."
varsize="..."

I think, that you can simply omit tmpmfs, if you do:
ln -s /var/tmp /tmp

The first problem I found was, that I need to save some directories under /var/db when restarting (e.g. /var/db/pkg or /var/db/ports), so I wrote a rc.d script, which do

tar -czf /root/mfs.tar.gz /var/db

at shutdown and 

tar -xzf /root/mfs.tar.gz -C /

at startup. Its not so elegant as ln -s /var/db/pkg /etc/pkg, but it works well  I can post this script, if you will  There is a bad thing about that: If you want to run rc.d scripts at shutdown, then you cannot use 'reboot' or 'halt' command, so as a prevention for my stupidity I finnaly wrote this to roots .cshrc:

alias reboot 'shutdown -r now'
alias halt 'shutdown -p now'

Have a nice day


----------



## kagura-san (May 22, 2009)

*One more thing..*

I forget to mention var populating 

if you enable polupatevar_enable="YES", then you can change population behavior by changing /etc/mtree/BSD-var... (I dont remember the exact file name), becouse the /var is populated by mtree utility.. read the man page 

That shoud be all


----------



## charles (Oct 15, 2009)

*Intel SSD only in UDMA33*

I'm running some tests with an Intel SSD... seems to work fine but is being run in UDMA33 mode, which has got to be slowing it down.  Here's how it shows up in the kernel log:


```
ad4: 76319MB <INTEL SSDSA2MH080G1GC 045C8820> at ata2-master UDMA33
```

Shouldn't it be running at at least UDMA133?

This is on a Quad-core Xeon system running 7.1-RELEASE-p5.

Thanks


----------



## jnr (Oct 16, 2009)

charles said:
			
		

> Shouldn't it be running at at least UDMA133?



Do you have native SATA mode (not PATA emulation) and AHCI enabled in your BIOS? Mine shows up like this:


```
ad12: 76319MB <INTEL SSDSA2M080G2GN 2CV102G9> at ata6-master SATA300
```


----------



## charles (Nov 5, 2009)

*Thanks!*



			
				jnr said:
			
		

> Do you have native SATA mode (not PATA emulation) and AHCI enabled in your BIOS? Mine shows up like this:
> 
> 
> ```
> ...



This was the answer... AHCI needed to be enabled in BIOS.  Thanks much!

Charles


----------



## dalys (Mar 13, 2010)

I'm playing around with a server here and installed FreeBSD 8.0-RELEASE-p2 on a Intel X-25V G2 40GB.


```
ad0: 38166MB <INTEL SSDSA2M040G2GC 2CV102HB> at ata0-master SATA300
```


```
[dalys@ari ~]$ sudo diskinfo -c -t /dev/ad0s1a
/dev/ad0s1a
        512             # sectorsize
        35826328064     # mediasize in bytes (33G)
        69973297        # mediasize in sectors
        69417           # Cylinders according to firmware.
        16              # Heads according to firmware.
        63              # Sectors according to firmware.
        CVGB950400J8040GGN      # Disk ident.

I/O command overhead:
        time to read 10MB block      0.063820 sec       =    0.003 msec/sector
        time to read 20480 sectors   1.878730 sec       =    0.092 msec/sector
        calculated command overhead                     =    0.089 msec/sector

Seek times:
        Full stroke:      250 iter in   0.018572 sec =    0.074 msec
        Half stroke:      250 iter in   0.017989 sec =    0.072 msec
        Quarter stroke:   500 iter in   0.034450 sec =    0.069 msec
        Short forward:    400 iter in   0.023765 sec =    0.059 msec
        Short backward:   400 iter in   0.032332 sec =    0.081 msec
        Seq outer:       2048 iter in   0.095603 sec =    0.047 msec
        Seq inner:       2048 iter in   0.099419 sec =    0.049 msec
Transfer rates:
        outside:       102400 kbytes in   0.654993 sec =   156338 kbytes/sec
        middle:        102400 kbytes in   0.508768 sec =   201271 kbytes/sec
        inside:        102400 kbytes in   0.438239 sec =   233662 kbytes/sec
```


----------

