Install Linux on an SSD: Difference between revisions
Line 24: | Line 24: | ||
Modify /etc/rc.local (or /etc/rc.d/boot.local on '''openSUSE''') and insert just before 'exit 0' | Modify /etc/rc.local (or /etc/rc.d/boot.local on '''openSUSE''') and insert just before 'exit 0' | ||
echo deadline > /sys/block/sda/queue/scheduler | echo deadline > /sys/block/sda/queue/scheduler | ||
=3. Use TRIM= | |||
3.1 first, check if your SSD supports the TRIM command | |||
hdparm -I /dev/sda | egrep "Enabled|TRIM" |
Revision as of 17:01, 14 November 2011
When you want to install Linux to an SSD, there are a lot of things to think about. This wiki post will look at all those things.
1. start your partitons on a 4k boundary
Because SSD's use 'blocks' of 4k in size, you must line up the partition boudaries on a block boudary for the best performance.
In fact, it is even better to start your partitons on a 512k block boundary. To do that, start fdisk with the parameters '-H 32 -C 32 -c' and create a completely new partitiontable.
fdisk -H 32 -C 32 -c
Note: Intel SSD's uses smaller blocks so use a different command:
fdisk -H 16 -S 16 -c
2. Optimize I/O
To adjust the stripe width and stride of an EXT4 filesystem, use this command to create a new filesystem:
mkfs.ext4 -E stride=128,stripe-width=128 /dev/sdaX
where sdaX is of course your ssd partition.
To tune an already existing filesystem, you can use:
tune2fs -E stride=128,stripe-width=128 /dev/sdaX
Intel users should use the value 32 for the stripe width
Use a different scheduler
You can also use a different i/o scheduler, the deadline scheduler, because the one that is used as a standard in the kernel is optimized for magnetic hard drives.
Modify /etc/rc.local (or /etc/rc.d/boot.local on openSUSE) and insert just before 'exit 0'
echo deadline > /sys/block/sda/queue/scheduler
3. Use TRIM
3.1 first, check if your SSD supports the TRIM command
hdparm -I /dev/sda | egrep "Enabled|TRIM"