Table of Contents

Using SSD on linux

Sorry people, only raw notes here

SSD Firmware

Check firmware version of your SSD:

hdparm -I <BEGIN GeSHi>/dev/sda<END GeSHi> | grep Firmware

I've got an OCZ Vertex2 60GB firmware version 1.25 'OCZ-VERTEX2'

SSD considerations

Partition choice

ext4 has trim support, xfs too.

TRIM(/discard?)-support TODO

Aligning

Aligning filesystems to an SSD’s erase block size http://thunk.org/tytso/blog/2009/02/20/aligning-filesystems-to-an-ssds-erase-block-size/

http://www.ocztechnologyforum.com/forum/showthread.php?54379-Linux-Tips-tweaks-and-alignment&p=373226#post373226

parted

Options: check-align alignment optimal minimal

vm-mgr:/mnt/vm# cat /sys/block/sda/alignment_offset

What writes to disk often

http://itezer.com/blog/ubuntu-linux/125-Four-Tweaks-for-Using-Linux-with-SSD.html

[stijn@hermes ~]$ grep writeback /etc/sysctl.conf # Increase the VM dirty writeback time from 5.00 to 15 seconds vm.dirty_writeback_centisecs = 1500

/dev/shm

Hoe groter de capaciteit van een ssd, hoe langer hij zal meegaan (bij een gelijkblijvend aantal schrijfacties). Een ssd met een capaciteit groter dan 1GB is dus wel degelijk nuttig voor jouw toepassing. http://gathering.tweakers.net/forum/list_messages/1347858///ssd%2Cbestandssysteem Over het eventuele nut van het gedeeltelijk partioneren van ssd's: reviews: Kingston SSDNow V 40GB en de volgende pagina. http://kevin.vanzonneveld.net/techblog/article/create_turbocharged_storage_using_tmpfs/

What if you're running a PXE server with an ISO stored on it,

http://gathering.tweakers.net/forum/list_messages/1347858///ssd%2Cbestandssysteem downloads, torrents, news nzb /var/run and /var/lock can be tmpfs filesystems, to alleviate having to clean them up at each reboot. 'VM writeback time' dus vergroot Voor de mensen die in het bezit zijn van een OCZ SSD 2de generatie (Vertex, Summit, …) is er een post van Tony op het OCZ-forum met welke S.M.A.R.T.-waarden relevant zijn voor de betreffende SSD, met o.a. "D1 Remaining drive life in % by Erase count". :9 http://www.ocztechnologyforum.com/forum/showthread.php?t=57898 echo 1 > /sys/block/sda/queue/iosched/fifo_batch

deadline of noop

noop voor virtuele machines

# Comment out to run the lxc init script
#RUN=yes
 
# Directory containing the container configurations
CONF_DIR=/etc/lxc
 
# Start /etc/lxc/example.conf, /etc/lxc/autostart.conf, etc.
CONTAINERS="vm-template"

you may separate the 'CONTAINERS' with spaces.

mkfs xfs ext4

http://linux.die.net/man/8/mkfs.xfs

mkfs.xfs -l lazy-count=1 /dev/vg0/log logbufs=8,noatime size=128m,

http://searchenterpriselinux.techtarget.com/tip/Settings-to-optimize-an-XFS-file-system

With lazy-count=1, the superblock is not modified or logged on every change of the persistent counters. Instead, enough information is kept in other parts of the filesystem to be able to maintain the persistent counter values without needed to keep them in the superblock. This gives significant improvements in performance on some configurations. The default value is 0 (off) so you must specify lazy-count=1 if you want to make use of this feature.

mount: /dev/sda4 on /home type xfs (rw,noatime,logbsize=256k,logbufs=2,nobarrier)

mkfs.xfs -l lazy-count=1 /dev/vg0/maildir

Swapping

To check the swappiness value use command: cat /proc/sys/vm/swappiness nano /etc/sysctl.conf add the following parameter to the end of the file: vm.swappiness=0

http://www.nuclex.org/blog/personal/80-aligning-an-ssd-on-linux mkfs.ext4 -b 4096 -E stride=128,stripe-width=128 /dev/mapper/vg0-vm

Om TRIM/discard te enablen voor ext4, kun je sinds kernel 2.6.32 de mount optie "discard" gebruiken, deze staat standaard uit.

vm-mgr:/mnt/vm# cat /etc/fstab

# /etc/fstab: static file system information. # # <file system> <mount point> <type> <options> <dump> <pass> proc /proc proc defaults 0 0 /dev/mapper/vg0-vm–mgr / ext3 noatime,errors=remount-ro 0 1 /dev/mapper/vg0-vm /mnt/vm/ ext4 noatime,discard 0 2 /dev/scd0 /media/cdrom0 udf,iso9660 user,noauto 0 0 /dev/sdb1 /media/usb0 auto rw,user,noauto 0 0 cgroup /cgroup cgroup defaults 0 0 /dev/mapper/vg0-log /mnt/log xfs noatime,logbufs=8 0 2 /dev/mapper/vg0-maildir /mnt/maildir xfs noatime,logbufs=8 0 2 none /tmp tmpfs defaults,noatime,mode=1777 0 0 none /var/run tmpfs defaults,noatime 0 0 none /var/lock tmpfs defaults,noatime 0 0 none /var/tmp tmpfs defaults,noatime 0 0 none /var/log tmpfs defaults,noatime 0 0 vm-mgr:/mnt/vm#

127  cat /sys/block/sda/queue/scheduler
128  echo noop > /sys/block/sda/queue/scheduler
129  nano /etc/rc.local
115  grep writeback /etc/sysctl.conf
116  nano /etc/sysctl.conf