Version 6 (modified by jaho, 13 years ago) (diff)

--

SSD Setup

The following is a short tutorial on how to setup a Solid State Drive on Linux and use it for swap space and storing temporary files. Upon completion of this procedure you should have a faster system in general and particularly a more responsive LAG. Note that all the commands listed below should be run as super user.

Installation

To install an SSD drive you need to connect it with two cables: SATA data cable and a power cable. Turning off the workstation to do it is not necessary, but is recommended. If there are no spare cables inside your case it should be fine to use those that connect the optical drive as it is not being used anyway. The picture below shows the cables that need to be plugged into SSD.

http://topsolidstatedrives.com/wp-content/uploads/2012/02/SATA-Power-And-Data-Cables.jpg

SATA and power cables which need to be connected.

Partitioning

Run gparted as root and select your new device from the list in the top-right corner. It should be called something like /dev/sdc and have 112GB capacity. Create one partition of size 122880MB with linux-swap file system and next partition with the remaining space as ext4 filesystem.

gparted - ssd setup

Gparted - partitioned SSD.

Setting up the swap space

To move the swap space you first need to check where is it already mounted:

cat /etc/fstab | grep swap

The firt column will tell you the mount point which should be something like /dev/mapper/vg0-lv1. Now, assuming your newly created swap partition is on /dev/sdc1, run:

swapoff -v /dev/mapper/vg0-lv1
mkswap /dev/sdc1
swapon -v /dev/sdc1

You can confirm that a 12GB swap has been created by running free.

Editing /etc/fstab

To make the permanent changes to the filesystem you have to edit /etc/fstab file. Comment out or delete the line with swap in it and the line starting with tmpfs. At the and of the file add the following two lines:

/dev/sdb1    swap    swap    defaults    0 0
/dev/sdb2    /tmp    ext4    defaults,discard,noatime,rw,nosuid,noexec    0 0

Your fstab file should be similar to the one below:

fstab - ssd setup

/etc/fstab file after modification.

To apply the changes and properly setup the /tmp folder run:

mount -a
chown root:root /tmp
chmod 1777 /tmp

To confirm all worked you can now run df and see your /dev/sdc2 mounted on /tmp.

Attachments (2)

Download all attachments as: .zip