SSD in Unix tweaks

@dmin

Gawd
Joined
Jul 15, 2010
Messages
786
I can find threads all over the place about windows SSD tweaks but does anyone have some good links to optimize a ssd in either Fedora or Ubuntu? Maybe OpenBSD.

I have 2 drives right now a mushkin callisto dlx 60gb and a ocz vertex 30gb.

The only thing I did was create a small ramdisk for my browser's temp files...

Thanks.
 
Well since you probably don't run a kernel that supports TRIM on RAID yet, you would have to reserve space to prevent performance degradation:

1. perform secure erase on drive unless its a brand new drive, destroying all data currently on it
2. create partition spanning about 80% of the entire capacity, leaving the other space unused and unpartitioned; guaranteeing that no host writes will happen to that area; which is what this trick is all about.

Modern SSDs consider all space to be spare space, unless a write happens to that location, where it becomes active (either static or dynamic allocation). As you don't have TRIM yet, this would reserve your drive's performance best over time. Even with TRIM this may lead to better performance on modify/small write-heavy filesystems, like system drives (on UNIX: think your /var and /tmp). Using tmpfs for /tmp is highly recommended; gone are those useless writes. And its much faster anyway for the purpose.

Good luck!
 
On top of that: align the partitions to ~ 1MB marks

You can do this by partitioning into 512 byte blocks with fdisk under linux.

"fdisk -u /dev/<device>" will do it.

Start first sector at ~ 2048. Leave 20% empty as before If you make more than 1 partition make sure they are 1MB apart.

If you use another layer on top of partition layer (such as LVM) make sure the PV size is a multiple of 1MB as well as make sure the metadata is on the 1MB mark (search for a post by theodore tso for info).

If you do md/raid make sure you keep 1MB partition size in mind. I'd also make sure to format ext3/ext4 with optimal parameters.

I don't remember all the links off the top of my head but if you can't find them with some googling, post back & i'll look them up. I have them bookmarked on one of my computers.
 
Recent Ubuntu releases do that by default now, and leave 1MiB offset; the same Windows Vista and 7 use and generally a good setting.
 
Recent Ubuntu releases do that by default now, and leave 1MiB offset; the same Windows Vista and 7 use and generally a good setting.

I think this is starting with 10.04. AFAIK 10.04 will still not optimize mdadm/lvm2 and ext3/ext4 formatting parameters....Someone correct me if I'm wrong.
 
Last edited:
Thanks!
The only decent article I found was mostly for netbook remix... I'm hoping for enough disk speed to have a mobile oracle 11g server on my laptop.
 
I'm just worry that the constant writes of the database will degrade the disk over time.
 
Not if you reserve enough spare space; reserve 50% if you want to be really sure. Though that also means you can only use half of the storage space on your SSD. Make sure you follow the procedure above; making one big partition and just leaving free space inside your filesystem will not work.
 
Back
Top