Loading...

Speed up my Linux Book

:heavy_exclamation_mark: This post is older than a year. Consider some information might not be accurate anymore. :heavy_exclamation_mark:

As a special daily deal I bought the Kingston SSDNow V300 240 GB for my linux notebook, Lenovo Thinkpad Edge S430. This post is going to illustrate the differences and performance gain due to the upgrade.

General

The basic procedure:

  • backup data
  • test hdd speed with ssd caching
  • swap hdd with ssd
  • install ubuntu 14.04.03 LTS
  • test ssd speed
  • enable trim support for the Kingston SSDNow V300

Test hdd speed

My Thinkpad has already a builtin SSD. This was used as caching device for the regular hdd. Testing the current read and write speed. Reading

bk201@edge:~$ df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/bcache0    451G  103G  325G  25% /
none            4,0K     0  4,0K   0% /sys/fs/cgroup
udev            7,8G  4,0K  7,8G   1% /dev
tmpfs           1,6G  1,3M  1,6G   1% /run
none            5,0M     0  5,0M   0% /run/lock
none            7,8G   80K  7,8G   1% /run/shm
none            100M   52K  100M   1% /run/user
/dev/sda1       236M   98M  126M  44% /boot
bk201@edge:~$ sudo hdparm -Tt /dev/bcache0
/dev/bcache0:
 Timing cached reads:   15372 MB in  2.00 seconds = 7691.04 MB/sec
 Timing buffered disk reads: 378 MB in  3.00 seconds = 125.94 MB/sec

Writing

bk201@edge:~$ dd if=/dev/zero of=/tmp/output bs=8k count=10k; rm -f /tmp/output
10240+0 records in
10240+0 records out
83886080 bytes (84 MB) copied, 0,094371 s, 889 MB/s

Swap hdd with ssd

pd024447_hard_disk_drive_assembly_01

Ubuntu installation

Due to my 16 GB RAM, there is no need or recommendation for a swap space on a SSD. Therefore install and partition manually.

Test ssd

After the super fast installation of Ubuntu Desktop, the following layout exists.

tan@edge:~$ df -h
Filesystem      Size  Used Avail Use% Mounted on
udev            7.8G   12K  7.8G   1% /dev
tmpfs           1.6G  1.3M  1.6G   1% /run
/dev/sda1       220G  3.9G  205G   2% /
none            4.0K     0  4.0K   0% /sys/fs/cgroup
none            5.0M     0  5.0M   0% /run/lock
none            7.8G   80K  7.8G   1% /run/shm
none            100M   84K  100M   1% /run/user
/dev/sdb1        15G  105M   14G   1% /boot
/dev/mmcblk0p1   15G   38M   14G   1% /downloads

The previous SSD, which was used as caching device, is now used as boot partition. A 16 GB SD-Card is used for downloads. It was spare and this place has usually a high write incidents. Writing to it is also sufficient, even if you have fiber :-) .

tan@edge:~$ sudo hdparm -Tt /dev/sda
/dev/sda:
 Timing cached reads:   12800 MB in  2.00 seconds = 6403.59 MB/sec
 Timing buffered disk reads: 1174 MB in  3.00 seconds = 391.08 MB/sec
tan@edge:~$ sudo hdparm -Tt /dev/sdb
/dev/sdb:
 Timing cached reads:   14624 MB in  2.00 seconds = 7317.32 MB/sec
 Timing buffered disk reads: 748 MB in  3.00 seconds = 249.32 MB/sec
tan@edge:~$ sudo hdparm -Tt /dev/mmcblk0p1
/dev/mmcblk0p1:
 Timing cached reads:   13158 MB in  2.00 seconds = 6582.90 MB/sec
 Timing buffered disk reads:  82 MB in  3.04 seconds =  26.96 MB/sec

For approx. 60 EUR a reasonable super cheap upgrade and working and programming with IntelliJ is as fast as with my Macbook Pro.

Enable trim support

As of Ubuntu 14.04, scheduled TRIM is enabled by default for Intel, SAMSUNG, OCZ, Patriot and Sandisk SSDs. If you have another brand, you could disable the vendor check by running the following command:

sed -i 's/exec fstrim-all/exec fstrim-all --no-model-check/g' /etc/cron.weekly/fstrim

In the end the file contents should look like this

root@edge:~# cat /etc/cron.weekly/fstrim
#!/bin/sh
# call fstrim-all to trim all mounted file systems which support it
set -e
# This only runs on Intel and Samsung SSDs by default, as some SSDs with faulty
# firmware may encounter data loss problems when running fstrim under high I/O
# load (e. g.  https://launchpad.net/bugs/1259829). You can append the
# --no-model-check option here to disable the vendor check and run fstrim on
# all SSD drives.
exec fstrim-all --no-model-check
ssd