Solid State Disk

From Gentoo Linux Wiki

Jump to: navigation, search

Solid State Disks are high-speed, high-capacity Flash disks. Because of some of their properties, if you treat them like SSDs instead of like regular HDDs, you can increase their performance and lifetime.

Contents

[edit] Some rules to keep in mind

  • SSDs have a limited amount of writes, so you will not want to use them as swap, which needs a lot of writes
  • SSDs have good random access (better than HDDs)
  • SSDs have high reliability
  • SSDs do not need special filesystems which spread the load across the disk, they often have their own controller and using a loadspreader anyway will actually hurt your SSD!

[edit] Limited writes

Note: This section is only relevant if /var/tmp/portage/ happens to live on your SSD, in which case you'll want to make it live on tmpfs instead.

SSDs have a limited amount of writes, so you will want to compile in tmpfs, because compiling involves a lot of disk I/O. Make sure you have enough RAM.

Note: Although the impact of this problem has declined over the years, it is still present. The erase blocks are very big, so a lot of small writes result in huge effective writes.

[edit] CCache


If you use ccache with portage, carefully consider where the cache is being stored. By default it is stored in ~/.ccache/, but if this directory is stored on the SSD you will be using the limited number of writes. This ccache can be moved in /etc/make.conf by adding the environment variable CCACHE_DIR=/var/tmp/ccache where /var/tmp/ccache is a directory stored on either a traditional HDD or a tmpfs.

[edit] HDD/SSD combination

You can combine the speed of SSDs with the capacity of HDDs. To do this, the recommended setup is to save your root filesystem, and most importantly directories like /bin/, /usr/ and /boot/, on your SSD, and save your media and high-capacity directories like /home on your HDD. This way, programs can load very quickly using your SSD, but you can still save that 138GiB of media files on your HDD. An example /etc/fstab would look like this:

File: /etc/fstab
/dev/sda1		/boot		ext2		noauto,noatime	1 2
/dev/sda2		/		ext4		noatime		0 1
/dev/sda3		/tmp		ext4		noatime		0 0
/dev/sda4		/var		ext4		noatime		0 0
/dev/sdb1		/home		ext4		noatime		0 0
/dev/sdc1		/mnt/media	ext4		noatime		0 0

Where sda is SDD, sdb and sdc are the HDDs. The noatime flag is highly recommended for SSDs (if not specified, every read access will update the access time stamp, leading to a write access even if files are not written to).

[edit] Scheduler optimization

On many sites you are suggested to use the noop scheduler with your SSD. While this might be true for the Intel X-25 drives which are optimized for random read/write operation, it is a performance killer for most other SSDs which are optimized for contiguous read/write (a lot of JMicron-based SSDs are). The cfq scheduler gives much better performance for these drives.

Personal tools