There is already quite a lot of questions regarding SSD disks with Ubuntu.

But the technology moves forward. Are there any new things I need to know moving to SSD?

I'm planning to buy a fast 120GB SSD for my laptop and put the default installation there. ext4 will be a good choice?

Then what? Do I still need any optimizations?

The performance will be already better than on regular HDD, so I guess my primary goal is optimizing for lifetime.

link|improve this question

Please create a separate question for backup solution. IMO, it's good to have clean answer on a clean single question. I've removed last part, but you can see it in history in case if you want to copy-paste it. – Andrejs Cainikovs Dec 9 '11 at 17:52
possible duplicate of Optimizing the OS for SSDs – Jorge Castro Dec 9 '11 at 19:14
feedback

3 Answers

up vote 5 down vote accepted

Fast tuning course for your SSD on Ubuntu:

filesystem

Arch wiki mentions few preferable options for SSD file system - one of them is unstable, others are ext* ones. I assume ext4 is one of the best picks.
Note: In case of ext4 you may want to use discard mount option.

fstab

# <file system> <mount point> <type> <options>                                  <dump>  <pass>
proc            /proc         proc   nodev,noexec,nosuid                        0       0
tmpfs           /tmp          tmpfs  nodev,nosuid,noatime,mode=1777             0       0
/dev/sda1       /             ext4   defaults,noatime,discard,errors=remount-ro 0       1
/dev/sda2       /home         ext4   defaults,noatime,discard,user_xattr        0       2
/dev/sda3       /windows      ntfs   defaults,noatime,discard,umask=007,gid=46  0       0

Few important things here are:

  • For systems with >=2 gigs of memory, locating /tmp in the RAM is desirable.
  • No swap partition. Nowadays it's needed only for hibernation, since modern machines has pretty big amount of RAM.
  • noatime and discard options. Info is here.

scheduler

Consider switching from the default scheduler, which under most Linux distro's is cfq (completely fair queuing), to the noop or deadline scheduler for an SSD. Using the noop scheduler, for example, simply processes requests in the order they are received, without giving any consideration to where the data physically resides on the disk. This option is thought to be advantageous for SSDs since seek times are identical for all sectors on the SSD.

Add following to /etc/rc.local:

# SSD performance tuning
echo noop > /sys/block/sda/queue/scheduler

info

one two

link|improve this answer
Without swap, and with /tmp in RAM, it's very easy to get to an out of memory situation, as a lot of programs use /tmp as a storage space (for example Brasero for storing DVD images). – arrange Dec 9 '11 at 19:19
1  
Not really. tmpfs by default is 10% of RAM. The size can be adjusted using size option though. – Andrejs Cainikovs Dec 11 '11 at 21:54
1  
Brasero is a bad example, it shouldn't do that in the first place as Lennart Poettering explains in his blog 0pointer.de/blog/projects/tmp.html – LiveWireBT May 12 at 11:56
feedback

I suggest to place only those things which are read at boot time on the SSD any maybe applications which require much time to load.Data and logs and other uncritical things I would locate on a normal HDD.Also you could setup your ubuntu to only load a big initramfs from SSD at boot time and not write back changes to ssd.This has the benefit, that changes to this partition are not persistent which is sth like a protection for your boot system.Therefor you would need much more RAM of course.

I would e.g. place the partitions /, /etc, /usr, /boot, /lib 32/64 on SSD while sth like

/opt, /bin, /sbin, /root, /home and even swap (increase RAM!!!) on HDD

Wikipedia says:

The Linux kernel supports the TRIM function starting with version 2.6.33. The ext4 file system is supported when mounted using the "discard" parameter. The most recent disk utilities (and therefore installation software that make use of them) also apply proper partition alignment.

For backups there are many ways, simplest of which is (r)sync plus cron job.

link|improve this answer
Do you know what each of the locations are used for? All mentioned locations except for /root, /home and swap should be put on the SSD for speed because it's mostly read-only. For speed benefit, put /var on the SSD too. – Lekensteyn Dec 9 '11 at 17:44
Depends on what you intend to speed up and how big your SSD is. 120 GB should be enough, okay, but with smaller SSD you reach borders easily. – Michael K Dec 9 '11 at 17:47
The / partition for Kubuntu Oneiric takes 4.5GB on my SSD. 20GB is sufficient for / minus /home. The efforts for tweaking the filesystem layout, spreading it over several partitions is not worth it. – Lekensteyn Dec 9 '11 at 18:15
feedback

UPS is required.
In the file /etc/sysctl.conf
vm.dirty_writeback_centisecs = 15000
vm.swappiness = 10

Find the configuration file daemon, usually /etc/syslog.conf или /etc/rsyslog.d/ and all the paths of the form /var/log/ change by writing a minus sign ("-") in front of ways.
Before
mail.err /var/log/mail.err
After
mail.err -/var/log/mail.err

use FS btrfs and use the option "-o ssd"

More http://vasilisc.com/speedup_ubuntu_eng#speedup_fs

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.