Micro Mart - 10 March 2016_

(Nancy Kaufman) #1

Issue 1404 19


£5 SSD


tasks. For the latter, I decided that it might be nice to have the
responsiveness of an SSD.
A media server needs lots of storage, and SSDs in the terabyte
range still demand a sizeable price premium compared to their
mechanical cousins.
Video recordings, especially in HD,require quite a lot of disk space,
but the network imposes a far narrower bottleneck than any disk
I/O, soread speed is notreally an issue when streaming. It’s alsoa
good idea to limit write operations on an SSD. Recording operations,
particularly pausing LiveTV, involve almost constant disk writes.
Using a small SSD for the operating system and a large
mechanical drive for storage meant that I could get the
responsiveness of an SSD for the OS operations while keeping
down the overall costs.
I obtained a brand new 8GB SLCmode SSD for £5 plus £
postage. It was about a quarter of the size of a traditional 2.5” drive.


MakingItAllFit
Of course, making use of one of these as the main drive for a PC
requires a little planning.
Even a standard Linux distro can easily fit in 8GB or less.
Depending on application, that might well be enough. For example,
it would be ample for an internet gateway or a DIY NAS.
For a media server or desktop system, however, there are three
locations that could be a problem.


/swap
In Linux, virtual memory is supported by the swap partition, which
is the equivalent of theWindows pagefile. Therecommended size
for a swap partition is twice the size of available RAM. As I had
4GB of memory, this would have used my entire SSD. A Linux
system with 4GB of memory or more may never actually use swap.
In fact you may be able to dispense with it altogether if you wish,
as it’s mainly used to support suspend and hibernation modes.


/home
The home partition holds all of the user’s data. This comprises
configuration files, internet cache, images, documents, emails and
videos etc., and it can grow quite large. It’s also where downloaded
files usually arrive. As I intended to occasionally use this as a
desktop system, it would probably become too large for the SSD.


/var
This is where all of the system’s variable data lives. In here are log
files, spool files, the apt package cache and many more small,
frequently changing files, which makes it a bad candidate for an


SSD anyway. Many applications also keep a cache or store their
data in here. MythTV, the main application for my distro of choice,
Mythbuntu, uses /var to store gigabyte-gobbling media files.
I also use a program called Zoneminder for managing Security
cameras, which likewise defaults to this location for image and
video storage.
Of course, with Linux you can have many different partition
schemes, but I finally decided to use the 8GB SSD as /, theroot
drive , and put three partitions on the hard disk. These were an
8GB /swap partition and a 40GB /home, leaving about 950GB for
/var, where the bulk of the data wouldreside.To do this, select
custom partitioning during installation.

MakingItWorkBetter
In operation, my system is nice andresponsive, despite running on a
fairly low-power AMD AM1 Kabini MiniITX system. However, there
are some tweaks you can apply to make it even better.

ChooseTheRightFilesystem
UnlikeWindows or Macs, Linux can make use of many filesystems,
and there are many opinions as to the best for SSDs.
Ext3 and Ext4 are the most common choices. They are both
journalling filesystems, which means that theyrecord each change
before they make it. Although this makes them morereliable in
the case of a crash or power failure, it does increase the number
of write operations. Other filesystems such as Ext2 do not do
this. By and large, the extra writes are tolerable because they
increasereliability. Btrfs is another filesystem, which has additional
optimisations for SSDs.
Ext4 is the default for most distros these days, and it supportsTrim.

EnableTrim
Many distros enableTrim by default.To see if an installed filesystem
on an SSD supportsTrim, you can run it manually in a terminal by
typing:sudo fstrim /
If you get the error ‘fstrim: /: FITRIM ioctl failed: Operation not
supported’, then your filesystem does not supportTrim.
Trim releases unused sectors and is executed daily by default in
many distros, but only forrecent filesystems such as Ext4, and only
for Samsung, OCZ, Patriot, SanDisk and Intel drives.
There are severalreasons for this, but you can force trim (for
supported filesystems) for other makes of drive.
First, we need to back up the file we’ll be editing.
To do this, in a terminal, type: cp /etc/cron.daily/fstrim /etc/cron.
daily/fstrim.bak
To edit the file, we’ll be using nano, which is a user-friendly
command-line based editor. It has the advantage of the commands
being displayed at the bottom of the screen.

An SSD can makea


real difference to a PC’s


responsiveness, but most of


the benefits apply to loading


applications or data such as


high-resolution images



Free download pdf