The main purpose behind this thread is to collect all the suggestions, the discussion and the benchmarks in one convenient Linux thread. 
This guide assumes your SSD is located at /dev/sda
Parts of this guide could be used even though you're not planning to use Linux. See this post made by khelvan for more details.
Short extract from the post made by khelvan

Originally Posted by
khelvan
The information below will allow any user to take advantage of the information above without having to install Linux. In addition, it will enable you to work with a computer that has no working hard disk (be it SSD or older HDD).
...
Wiper and manual TRIM
Take a look at this thread for further information.
(Link)
In-kernel automatic TRIM- You need at least kernel version 2.6.33 or later.
- You need at least firmware version 1.5. Firmware version 1.4 works, but it is too slow.
This thread covers most of the findings on the subject. (Link)(First relevant post)
For Ubuntu users, you need to manually update your kernel if you want automatic trim. The first Ubuntu version to support this feature will probably be Ubuntu 10.10 which will be released at the end of October 2010. Manual trim will of course still be supported through wiper.sh as with the previous firmware (1.4).
Check firmware revision
To check the firmware revision on Linux, you could use sudo hdparm -I /dev/sda. The final character denotes which disk to examine.
S.M.A.R.T (wiki)

Originally Posted by
Shadow_Dragon
Smartmontools with native S.M.A.R.T-support for Vertex and Agility ssd's.
It seems that there is a
new release of smartmontools and now one of the
released commits give us full native S.M.A.R.T-support for OCZ Vertex and Agility drives.
...
Ubuntu Picture Guide

Originally Posted by
b2bde4
Ubuntu Picture Guide
Trying out Linux is easy. This guide will show you the ease of using Ubuntu. The only thing you need, to try it out, is a Live CD (
wiki). The default Ubuntu desktop CD is a Live CD. An Ubuntu Live CD contain all the tools you need to align your partitions. Those tools could even be used to prepare for your Windows installation.
...
Alignment

Originally Posted by
TortureTest
Partition alignment for OCZ Vertex in Linux
This guide will show you how to set up general alignment for use with Linux.
Tweaking some of the values used will yield different results.
...

Originally Posted by
b2bde4
Creating aligned partitions using a GUID partition table
This is a guide for anyone going to use
GPT.
GPT is a partition table which replaces the legacy MBR. Since fdisk doesn't support GPT we will have to use a tool called parted. To use this tool we need to understand some of the basic maths behind aligning partitions. This guide shows how to manually create aligned partitions based on sectors. GPT is supported by GRUB 2 used by default in a clean installation of Ubuntu 9.10.
- This guide will create a new GUID partition table.
- Create a 100MiB partition.
- Create a second partition covering the rest of the disk.
...

Originally Posted by
b2bde4
Windows Alignment with Linux
This guide will show you how to set up "Windows alignment" using Linux. The alignment achieved should be identical to an alignment made using Windows tools. This is not the recommended procedure if your going to use Linux, though it should work just fine.
...
The best tool available to create your partitions is fdisk unless your going to use a GUID partition table in which case you should follow the guide about GPT above.
These are the some of the starting options available for fdisk. The option -S is used to define a custom number of sectors per track. -H is for heads. Changing these values will effect the alignment of partitions created with this tool.
Accepted input values.- -H Number of heads (1-255. default 255) (256 in expert mode, use at your own risk)
- -S Number of sectors (1-63, default 63)
File System
If you mount your disk with the option noatime you could lower the number of writes to your disk.- Open /etc/fstab in your favourite text editor as root. [sudo gedit /etc/fstab]
- Locate the SSD you want to optimize.
- Identify which parameter is currently in use. Possible values are atime, noatime, realtime.
- If applicable, change the value to noatime.
- Restart system.
There are some options available for ext4/ext3.
This section is only meant as curiosa. Using it probably won't effect performance.
You could achieve write alignment using the option strip-width. The first thing you'll want to do is to make sure that the partition you're going to use starts exactly on an erase block.
Find the starting sector using [sudo fdisk -lu]. If it starts on a value that are an even multiple of 1024. Then you're ready to proceed.
[sudo mke2fs -t ext4 -E stripe-width=128 /dev/sda1]
Since the default file system sector size is 4kB, stripe-width=128 will result in 512kB alignment. The file system will now try to align each write at the start of an empty erase block.
sda1 indicates that we want to create our file system on the first partition on /dev/sda.
You could create your file system without a journal. This is not recommended as you might experience a data loss after an unclean shutdown.
[mke2fs -t ext4 -O ^has_journal /dev/sda]
Setting up a RAM disk (wiki)
Before you try this out, make sure you have plenty of free RAM.
To create a RAM drive we're going to use tmpfs.
To mount the system temp folder in tmpfs.- Open /etc/fstab in your favourite text editor as root. [sudo gedit /etc/fstab]
- Add tmpfs /tmp tmpfs defaults,noatime,mode=1777 0 0 at the end of the file.
- Restart system.
All temporary files will now be written to your RAM instead of to your disk.
To verify this, use the command df. Search for lines begging with temps.
Code:
tmpfs 1996928 23404 1973524 2% /tmp
This tweak could also be used to create a general purpose Ram disk.- Create an empty folder as a root. [sudo mkdir /media/Ramdisk]
- Open /etc/fstab in your favourite text editor as root. [sudo gedit /etc/fstab]
- Add tmpfs /media/Ramdisk tmpfs defaults,noatime,mode=1777 0 0 at the end of the file.
- Restart system.
- Optional. Create a link to your newly created folder at a place of your convenience.

Originally Posted by
TortureTest
Some remarks:
- Some people also suggest the use of RAM disks for /var/tmp or /var/log.
This can be done in the same way as setting up a RAM disk for /tmp
(see b2bde4's guide). Note that the system will be unable to umount
/var/log cleanly when shutting down (since the device is busy)
but this will not harm (who cares if temporary data on the RAM disk
is lost?)
Move Firefox cache to RAM disk
This might not be useful if you're on a very slow modem connection and restarts your computer very often.- Open Firefox.
- Type about:config in the search bar.
- Right click on any row.
- Select New > String from the popup menu.
- Add browser.cache.disk.parent_directory and press enter.
- Close Firefox.
Use about:cache to verify.
I/O Scheduler (wiki)
Changing scheduler could improve the speed of the SSD.

Originally Posted by
Pigeon
Do not do not do not do not use the anticipatory (default for for 2.6 up to 2.6.18) scheduler or the cfq (default for 2.6.19-current) scheduler. These schedulers achieve a remarkable speedup on standard, platter hard drives by pausing after each read: usually after a process performs a read, it will read again (presumably grabbing another chunk of the same file) in quick succession. This trick will help alleviate seek times, which is the biggest detriment to hard drive performance. (note that at one point, this 'feature' of cfq was broken) You and I do not have this performance disadvantage. The noop and deadline schedulers do not perform this 'advanced logic' that serves little purpose for SSDs other than slowing them down.
However, deadline and noop are not created equal. Deadline will re-order reads and writes, attempting to decrease latency, etc. Noop will do absolute no logic of any kind - it is a simple fifo. It's really designed for people with dedicated RAID hardware that will perform all of this logic for them. Sometimes this is useful - if you have an eeepc and underclock it to 800MHz for maximum battery life, you really need every CPU cycle you can get, and noop can be a decent idea.
However, if you have a reasonably fast system, you're better served by deadline. It gives more priority to reads over writes: delays caused by waiting for io is typically caused because of a delay from reading, not writing.
To find out which schedulers are available on your system and which one is currently in use, use the command cat /sys/block/sda/queue/scheduler. The one in use is marked by [].
Code:
noop anticipatory deadline [cfq]
To temporarily change scheduler during runtime.- Login as root [sudo -i]
- echo deadline > /sys/block/sda/queue/scheduler
- Logout the root shell [logout]
To make this change permanent you could add appropriate lines to /etc/rc.local. You could also edit /boot/grub/menu.lst.

Originally Posted by
TortureTest
Some remarks:
- Setting the scheduler should probably be done automatically during boot.
If there are only SSDs in the system and no regular HDDs, one can select
deadline globally by adding the kernel parameter elevator=deadline in the
kernel parameter line of the boot loader.
Another way is editing /etc/rc.local or /etc/init.d/boot.local,
depending on the Linux distribution. There one can directly add a line
echo deadline > /sys/block/sda/queue/scheduler
This will only change the scheduler for the specified device, so
this is the way to go on a mixed system with both SSDs and HDDs.
Using the kernel parameter in GRUB might not be permanent during a kernel upgrade.
Instead find the line beggining with # kopt=root=UUID= and add the parameter elevator=noop to it. Don't ever remove the starting # from this line.
When it's done, run the command sudo update-grub.
Tools
You can use hdparm to check your read speed, even though the results are somewhat limited.
Code:
sudo hdparm -t /dev/sda
sudo hdparm -t --direct /dev/sda
You could also use dd to to check your speed.
Code:
4KB reads. 0 offset (skip). Read (count) 200MB data.
sudo dd if=/dev/sda1 of=/dev/null bs=4k skip=0 count=51200
Without count, Use ^c (control-c) to abort.

Originally Posted by
TortureTest
Some remarks:
- If you want to know how much I/O traffic you have on the SSD, you can
check with iostat -m -d /dev/sda. This displays MB_read and MB_wrtn
for the given drive (measured since system startup). iostat also works
for individual partitions. It is provided by the sysstat package.
Swap file

Originally Posted by
TortureTest
Some remarks:
- Kernel swappiness is a controversial topic. The standard setting (60) for
kernel swappiness has the effect that inactive (but started) applications
will be moved to swap after some time. If the swap partition is placed
on a regular HDD in order to reduce wear of the SSD, then reloading the
application from swap can take several seconds. This causes annoying
delays and bad responsiveness of the system when you return from a
coffee break, for example. The solution is setting kernel swappiness
to zero, by adding a line vm.swappiness = 0 to /etc/sysctl.conf.
A temporary change for trying out the effect is possible by calling
echo 0 > /proc/sys/vm/swappiness (as root) from the command line.
Raid
If you want to use raid but don't have a dedicated hardware raid card, you should instead create a Linux software raid array. Don't use the integrated raid controller on your motherboard. There is nothing to be gained unless your going to dual boot from it.
If you created a raid array on Windows using Windows drivers, you probably won't be able to access it using Linux.

Originally Posted by
devsk
I just posted in another thread about issues I was having with reads being slower than writes in RAID0 and not getting quite the twice the performance of a single Vertex. In fact my reads were slower in RAID0 than in the single drive. I was getting like 220MB/s in RAID0 vs. 260-270MB/s in single drive.
...
Secure Erase

Originally Posted by
mlord1
On Linux, this is done as follows (assuming /dev/sda is the drive):
hdparm --security-set-pass NULL /dev/sda
hdparm --security-erase NULL /dev/sda
...
Making a backup of your system and then restore it

Originally Posted by
b2bde4
Making a backup of your system and then restore it (Tested with Ubuntu)
Making backups of a Linux system involves a few easy steps.
- The use of a Live CD to prevent system changes during backup.
- Copy all files to a new location.
- Remember partition UUID.
Restoring the backup involves a few more steps.
- Copy backup files to their previous location.
- Restore partition UUID.
- Restore GRUB.
...
Bookmarks