vanutsteen.nl => nerds only A blog on rails, php, computing, my bass guitar and stuff

Upgraded to an ssd

on in Linux

For the holidays I bought myself a new ssd: One of them fancy Samsung 840 pro’s:

Samsung 840 pro

After reading up on some sites how to use a ssd with Ubuntu / Linux:

I decided to use the noatime option in my /etc/fstab, create a cronjob to execute the fstrim command and use the vm.swapiness option.

/etc/fstab
1
2
3
4
5
6
7
8
9
10
# /boot was on /dev/sda5 during installation
UUID=bd07fb52-4772-4a77-a195-f3c950148e65 /boot           ext4    defaults,noatime          0       2
# /home was on /dev/sda11 during installation
UUID=a0a57286-bb79-4c02-b16d-58900e92b18b /home           ext4    defaults,noatime           0       2
# /tmp was on /dev/sda7 during installation
UUID=25241cbe-18f5-420c-86bf-0376953ff23a /tmp            ext4    defaults,noatime           0       2
# /usr was on /dev/sda8 during installation
UUID=f55780c2-0f22-49a4-891c-f9bdd2d9d305 /usr            ext4    defaults,noatime           0       2
# /var was on /dev/sda9 during installation
UUID=851bf8ea-c65b-4c4d-9149-6da6b56fdad8 /var            ext4    defaults,noatime           0       2
crontab -l
1
2
3
4
5
6
7
  #fstrim voor ssd
  @monthly              /usr/bin/sudo /sbin/fstrim /boot
  @monthly              /usr/bin/sudo /sbin/fstrim /
  @monthly              /usr/bin/sudo /sbin/fstrim /tmp
  @monthly              /usr/bin/sudo /sbin/fstrim /usr
  @monthly              /usr/bin/sudo /sbin/fstrim /var
  @monthly              /usr/bin/sudo /sbin/fstrim /home

And I had to give my user access to sudo fstrim without using a password:

/etc/sudoers.d/leon
1
leon ALL = NOPASSWD: /sbin/fstrim

Now for the swapiness:

/etc/sysctl.conf
1
2
3
# only swap when absolutely necessary (for ssd)
# sysctl -w vm.swappiness=0
vm.swappiness = 0

I used sysctl -w vm.swappiness=0 to change the swappiness without requiring a reboot.

I didn’t have to change the scheduler because according to cat /sys/block/sdb/queue/scheduler the scheduler was already set to noop (noop [deadline] cfq). Maybe it’s the new standard for Ubuntu 12.10 or maybe the did some trick on detecting an ssd?

The last thing I did was upgrading to the latest firmware (DXM04B0Q) which unfortunately required a Windows box to prepare a usb stick with Samsung’s Magician Software.

Comments