
SSD is getting common. I have two SSD disks: 64GB SSD PATRIOT, 30G OCZ Vertex Series SATA II OCZSSD2-1VTX30G. One for Ubuntu (x61s), the other for Windows XP (eeepc). It is time to write down what I did for the optimization.
My Ubuntu notebook is loaded with Karmic 9.10, using ext4 file system.
Notes about this page were taken for the web: (via aspireonezg5, loxal, kubuntuforums, wiki.debian.org.hk)
Edit /etc/fstab, add the following
tmpfs /tmp tmpfs defaults,noatime,mode=1777 0 0
none /var/tmp aufs noatime,br:/tmp=rw:/var/tmp=ro 0 0
none /var/log aufs noatime,br:/tmp=rw:/var/log=ro 0 0
none /var/cache aufs noatime,br:/tmp=rw:/var/cache=ro 0 0
* Add either "elevator=noop" or "elevator=deadline" to the line that starts "GRUB_CMDLINE_LINUX_DEFAULT" of /etc/default/grub, then run "sudo update-grub2". It can also be done by edit /etc/rc.local file as mentioned below.
GRUB_CMDLINE_LINUX_DEFAULT="elevator=noop quiet splash"
* If NOT edit grub as mentioned above, edit /etc/rc.local file
# Set sda to use deadline scheduler
# Note: if these changes don't seem to take, try pasting them into a root console
# (or with sudo) manually once then reboot
echo deadline > /sys/block/sda/queue/scheduler
echo 1 > /sys/block/sda/queue/iosched/fifo_batch
Tell Firefox to cache data in /tmp: open Firefox and type "about:config" in the browser window; click "I'll be careful, I promise!" and then create (or edit) the key browser.cache.disk.parent_directory and give it the value "/tmp". Use "about:cache" to verify.
Tweak /etc/sysctl.conf file
# I added to reduce disk activity to 240 seconds
vm.dirty_ratio = 40
vm.dirty_background_ratio = 1
vm.dirty_writeback_centisecs = 24000
# I added to reduce the use of swap space
vm.swappiness = 0
Modify /etc/rc.local file, before "exit 0"
# mount ramdrives to /var/tmp
for dir in "/var/tmp" ; do
test=`mount | grep " on $dir "`
if [ "$test" = "" ]; then
sz="50K"
md="1777"
case "$dir" in
/var/tmp )
sz="500M"
md="1777"
;;
esac
mount -t tmpfs -o size=$sz,noatime,mode=$md tmpfs $dir
fi
done
Tune /etc/fstab for ext4 file system performance
[...]
UUID=xx / ext4 noatime,barrier=0,nobh,commit=100,nouser_xattr 0 1
UUID=xx /home ext4 noatime,barrier=0,data=writeback,nobh,commit=100,nouser_xattr 0 2
[...]
If you don't have a battery-backed storage environment, you should not deactivate this mount option.
(I actually didn't apply any of them)
Modify /etc/fstab file
tmpfs /var/log tmpfs defaults 0 0
tmpfs /tmp tmpfs defaults 0 0
tmpfs /var/tmp tmpfs defaults 0 0
Modify /etc/rc.local file
for dir in apparmor apt news cups dist-upgrade fsck gdm installer samba unattended-upgrades
do
if [ ! -e /var/log/$dir ]
then
mkdir /var/log/$dir
fi
done
via hwarf
Edit /etc/fstab file for tmpfs and noatime/nodiratime modification
tmpfs /var/log tmpfs defaults 0 0
tmpfs /tmp tmpfs defaults 0 0
tmpfs /var/tmp tmpfs defaults 0 0
/dev/sda2 / ext4 defaults,noatime,nodiratime 0 0
Edit the /etc/grub.conf file. Add "elevator=noop" to the kernel line.
The following to /etc/rc.local file
# Economize the SSD
sysctl -w vm.swappiness=1 # Strongly discourage swapping
sysctl -w vm.vfs_cache_pressure=50 # Don't shrink the inode cache aggressively
# As in the rc.last.ctrl of Linpus
echo ondemand > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
echo ondemand > /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor
cat /sys/devices/system/cpu/cpu0/cpufreq/ondemand/sampling_rate_max > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/sampling_rate
echo 1500 > /proc/sys/vm/dirty_writeback_centisecs
echo 20 > /proc/sys/vm/dirty_ratio
echo 10 > /proc/sys/vm/dirty_background_ratio
echo 1 > /sys/devices/system/cpu/sched_smt_power_savings
echo 10 > /sys/module/snd_hda_intel/parameters/power_save
echo 5 > /proc/sys/vm/laptop_mode
<a href="http://twitter.com/#search?q=%23Decrease" target="_blank" class="litwitter">#Decrease</a> power usage of USB while idle
[ -w /sys/bus/usb/devices/1-5/power/level ] && echo auto > /sys/bus/usb/devices/1-5/power/level
[ -w /sys/bus/usb/devices/5-5/power/level ] && echo auto > /sys/bus/usb/devices/5-5/power/level
/sbin/setpci -d 197b:2381 AE=47
/sbin/modprobe pciehp
/sbin/modprobe sdhci
by the way, this page at ocztechnologyforum is worthy checking.
- 作者:cail
- 版权声明:署名-非商业性使用-禁止演绎 CC BY-NC-ND 3.0
- 原文网址:http://en.dogeno.us/?p=6109
- 最后修改时间:2010年1月4日 17:07 PDT
Previous:
信手拈来 之 漫画中的中国
Next:
Do NOT put the card in the pocket - fix Thinkpad hibernation error
3 Responses to “Karmic Koala with Solid State Disk: How to Optimize Ubuntu for SSD”
Leave a Reply
blog by cail
- » the Paper Link - my latest Creation for PubMed users
- » How to use ImageJ to analyze images?
- » 2shRNA - design oligos for RNAi
- » Play background music
- » about this blog
- » about me
Hot in 'How-To'
- analog - analog/digital - digital, VGA - DVI - HDMI - 74,613 views
- Ez-12 windsurfer antenna - 54,001 views
- Import custom ringtones to iPhone via iTunes (no jailbreaking required) - 47,074 views
- How to add new ringtones to iPhone - 42,493 views
- Use GParted to align partitions on a SSD hard drive for better performance - 40,981 views
[...] The experience is great with these SSD drives. Superior speed increase! However, I did find some stuttering with the old warp, even after the system wide optimization. [...]
[...] SWAP Partition, Journaling Filesystems, … on a SSD? Karmic Koala with Solid State Disk: How to Optimize Ubuntu for SSD How to optimize Ubuntu for SSD? Linux – Tips, tweaks and [...]
[...] http://en.dogeno.us/2010/01/karmic-with-solid-state-disk-how-to-optimize-ubuntu-for-ssd/ [...]