AB9IL.net

Linux on Solid State Drives

Disclosure: AB9IL.net is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program such that this site earns advertising fees by linking to Amazon.com. If you make a qualifying purchase after clicking a link on this website, the associate affiliated with this site may earn a comission at no cost to you.


#Advert: Go parabolic with a fabulous Prostar laptop.

New Features: Global Quick Tune Internet SDR List Improve Your Radio Knowledge at "YouTube SDR School"
Article Index --- click here to unfold ---
Newest Pages NEW: Trumpists Kicking the Hornets Nest
NEW: Introduction to Catbird Linux
NEW: Skywave Linux Updated to ver 4.1
NEW: i3wm: Using i3-ipc to Float Windows
How to Record from WebSDR and OpenWebRX Sites
Programmatic RTL-SDR Frequency Claibration
Public KiwiSDR Lists
Malaysia Airlines Flight MH17: Simply Mass Murder
The Anonymous Cathay Pacific Employee Letter to Hong Kong
For For Cathay Crews Crossing Borders With Electronics
Photo Gallery 9: The New Life Movement in China, 1944
E Pluribus Unum: From Many, One, Dammit
HFGCS Quick Tune SDR List
The Robert Mueller Iron Triangle Speech
A Rant About One Party Rule
Best OpenWebRX and WebSDR Servers
SDR School via YouTube
ADALM-PlutoSDR on Linux Systems
MOFO Linux: Defeating State Censorship and Surveillance
Linux: Distros, Code, and Nifty Software NEW: Introduction to Catbird Linux
NEW: Skywave Linux Updated to ver 4.1
NEW: i3wm: Using i3-ipc to Float Windows
Skywave Linux: HPSDR, WebSDR, and RTL-SDR ready to run.
Siduction Linux with the Cinnamon Desktop
Siduction Linux with the LXQT Desktop
Andy's Ham Radio Linux 15 and QtRadio
Booting Multiple Linux Disc Images with Grub2
Porteus Linux Hard Drive Installation
UPDATED: MOFO Linux - For Unrestricted Internet
Aptosid with LXDE
Asus EeePC 1215N with Linux
Autostart Tweaks for KDE3 and KDE4
Broadband Speed Tweaks For Linux
Fixing the Firefox 3 Rendering Bug
Linux on Solid State Drives
Linux Wireless Interface Driver Updates
Setting Polkit to Automount USB Devices
Sidux with LXDE
Fixing Skype Inverted Video
SLAX Remix - kernel upgrades
Flash Drive Linux - Introduction
Flash Drive Knoppix 5.3 - Part 1
Flash Drive Knoppix 5.3 - Part 2
Flash Drive Knoppix 6.0 - Part 1
Flash Drive Knoppix 6.0 - Part 2
Flash Drive SLAX - Part 1
Flash Drive SLAX - Part 2
Flash Drive Bluewhite64 - Part 1
Flash Drive Bluewhite64 - Part 2
Flash Drive Linux - Basic Customization
SLAX Customization - Part 1
SLAX Customization - Part 2
Bluewhite64 Customization - Part 1
Bluewhite64 Customization - Part 2
Long Range Wi-Fi Basics of Long Range Wireless Networking
Linear Focus Parabolic Wi Fi Antenna
High Gain Wi Fi Dish Antenna
High Gain Helical Wi Fi Antenna
High Gain Yagi Wi Fi Antenna
High Power Wireless Adapters
Wi Fi Extender Antenna for Routers
Belkin F5D7050 External Wi Fi Antenna
Linksys WUSB54GC External Antenna Mod
Compat Wireless Linux Drivers
Installing WPA_Supplicant for Wi-Fi Security
Linux Wireless Interface Driver Updates
Linux Wireless Interface Driver Support
NetworkManager and Consolekit
RT73 Wireless Drivers for Linux Kernel 2.6.27+
RT2860 Wireless Drivers for Linux Kernel 2.6.27+
Radio: Amateur Radio, Aero Radio, Shortwave, etc NEW: Programmatic RTL-SDR Frequency Claibration
NEW: Public KiwiSDR Lists
NEW: GHFS Quick Tune SDR List
UPDATED: Best OpenWebRX and WebSDR Servers
UPDATED: Skywave Linux: HPSDR, WebSDR, and RTL-SDR ready to run.
CubicSDR on Debian, Ubuntu, and Linux Mint
Dump1090 for Linux Mint 17.1 and Siduction 2014.1
Software Defined Radio - An Introduction
QS1R Direct Sampling SDR
Chaining SDR Audio Interfaces
FLEX-6000 Direct Sampling SDR
UPDATED: RTL2832 Software Defined Radio
WebSDR Digimode Reception
Enabling FLASH in Jack Audio
Realtime Software Audio Processing
Liberation Technology MOFO Linux - For Unrestricted Internet
Veracrypt Encryption for Linux
Veracrypt Encryption for Windows
Using Google Within China
Popcorn Time and Flixtor for Uncensored Streaming Media
DNS Encryption using DNSCrypt
Galaxy Nexus Privacy and Robustness Enhancements
Galaxy SIII Privacy and Robustness Enhancements
Flash Drive Encryption for Linux
Flash Drive Encryption for Windows
Multihop VPN Connections for Strong Internet Privacy
Open and Free DNS Server List
OpenVPN Cloaking against Deep Packet Inspection The Serval Mesh Phone Project
Skype's Robust Security
Man in the Middle Wireless Security Risks
Wireless Security and Surveillance
Digital Audio Adjusting Audio Dynamics in VLC
Backing Track Prep Guide
Ipod Music Processing Guide
How To Record Record Live Music Performances
Realtime Software Audio Processing
Chaining SDR Audio Interfaces
Aerospace Radio, Aviation, Pontification, and Opinion NEW: Trumpists Kicking the Hornets Nest
NEW: The Anonymous Cathay Pacific Employee Letter to Hong Kong
NEW: For For Cathay Crews Crossing Borders With Electronics
NEW: E Pluribus Unum: From Many, One, Dammit
NEW: HFGCS Quick Tune SDR List
NEW: The Robert Mueller Iron Triangle Speech
NEW: A Rant About One Party Rule
Captains Authority Versus Autocratic Airline Management
Malaysia Airlines Flight MH17: Simply Mass Murder
Malaysia Airlines Flight MH370 - A Media Circus
High Gain Air Band Antennas
Apollo Unified S Band Communications
Chinese Anti-Stealth VHF Radar
Oceanic Communications - Procedures, Equipment, Voice and HFDL
Boeing 737NG Radio Equipment
Boeing 767 Radio Equipment
NAOC-TACAMO Monitoring
My Flight on 9/11
Joshua Chamberlain's Leadership Tips
Special Operations Forces Truths
TWA 800: Just Give Me Some Truth
Photo Gallery Aviation Photo Gallery 1: Snapshots From My Journeys
Aviation Photo Gallery 2: On the Road With ATA Airlines
Aviation Photo Gallery 3: More ATA Airlines
Aviation Photo Gallery 4: Southwest Airlines is the Borg Empire
Aviation Photo Gallery 5: Starting Over, Moving On...
Aviation Photo Gallery 6: More Viva Macau
Aviation Photo Gallery 7: Mainland China Airline Flying
Aviation Photo Gallery 8: Chinese Smog and Fog
NEW: Photo Gallery 9: The New Life Movement in China, 1944
Broadcasting BBC Radio Blooper - Adolf Merckle
TV DXing the World Trade Center
New York TV after 9/11
Live Music Recording Adjusting Audio Dynamics in VLC
Backing Track Prep Guide
Ipod Music Processing Guide
How To Record Record Live Music Performances
Radio Poetry and Arts In Distress, by David Wagoner
Just A Radio Operator, by Robert A. Wallace
Radio Circuit Modifications ATS-909 Modifications
ATS-909 Manuals
ATS-909 Alignment Procedure
ATS-909 Alignment Spectrograms
Very Low Frequency (VLF) Radio Internet Based VLF Radio Listening
Windows Tips Windows Performance Enhancement Tips
A Faster Windows 7
Windows 7 SSD Setup

Solid State Drives (SSDs) are great. They have no moving parts, are shock resistant, consume less power, produce less heat, and are orders of magnitude faster than conventional drives. A key reason for the increased speed and durability is the lack of moving parts. With no motors or high current components, there is less power needed to operate an SSD. Another advantage of solid state design is the vast reduction of seek time, since there is no longer a need to precisely move a read / write head to a specific place on the drive. These advantages make it possible for modern solid state drives to provide fantastic storage performance AND operate for a very long time before failure. In fact, the newest SSDs will probably outlast the computers in which they are installed.

There are two issues of greater concern for SSD users: write amplification and overall longevity. Write amplification is a term describing the fact that writing a small block of data to an SSD may involve copying and rewriting a much larger block on the drive, at the expense of time and write events. Longevity relates to the fact that there is a limit to the number of times that data can be written to a solid state drive. Therefore, it is in the user's interest to eliminate all writes that are not necessary, and use RAM as much as possible for things such as log files, temporary data, web cache, etc. Respecting these limits can extend the life of an SSD well beyond the life expectancy of other computer components.

velociraptor: a conventional hard disk

A conventional hard drive
with spinning disks.

SSD speed graph - performance superior to hard drives

SSD speeds are considerably faster
than conventional drives.

A solid state drive (SSD) is not limited by moving parts!

A solid state drive with
fast seek times and no moving parts!

Linux can work quite well on solid state drives. However, the system's default behavior is optimized for conventional hard drives. After some minor edits to files controlling system behavior, a Linux system can make very efficient use of its resources and perform orders of magnitude faster than with legacy "spinning disk" storage. System adjustments given here focus on these changes:

#Advert: ASUS has your next laptop, powerful and elegant.


FSTAB EDITS TO REDUCE SSD WRITES

The first system adjustment is to mount volumes using the noatime option. By default Linux will write the "time last accessed" attribute to files. This can reduce the life of your SSD by causing a lot of writes. Using the noatime mount option turns this off.

The next adjustment will implement the use of a ramdisk instead of the SSD to store temporary files. These temporary files are written and rewritten frequently, and are best kept in RAM and off the solid state drive. This also increases overall system speed, especially on more modern systems equipped with ample memory.

Open your fstab file for editing, using one of the following command lines (depending on what you prefer to use):

~$ sudo gedit /etc/fstab  
OR...
~$ sudo nano /etc/fstab   
OR...
~$ sudo kwrite /etc/fstab

Look at the line specifying partitions on the SSD. It will look similar to this:

UUID=1eea26d7-6893-4779-827b-150412c94703         /                 ext2           relatime         0      1

Replace "relatime" with "noatime" to stop the system from writing the last access times as discussed above. Next, add the following lines to fstab to put temporary and log files in RAM instead of on the solid state drive:

tmpfs   /tmp       tmpfs   defaults,noatime,mode=1777   0  0
tmpfs   /var/log   tmpfs   defaults,noatime,mode=0755   0  0
tmpfs   /var/spool tmpfs   defaults,noatime,mode=1777   0  0
tmpfs   /var/tmp   tmpfs   defaults,noatime,mode=1777   0  0

Reboot the computer. Then, verify the filesystem mounting changes by executing the "df" command:

~$ df
Filesystem           1K-blocks      Used Available Use% Mounted on
tmpfs                  2030804         4   2030800   1% /lib/init/rw
tmpfs                  2030804         4   2030800   1% /tmp
tmpfs                  2030804       364   2030440   1% /var/log

SSD OPTIMIZED INPUT - OUTPUT SCHEDULING

An I/O scheduler decides the order in which applications are given access to the SSD for writes and reads. In Linux, the default I/O scheduler in Linux is called CFQ, Completely Fair Queuing. CFQ generally works well, but it is not perfect for SSDs. Its default behavior is to give drive access on a first come - first serve basis. Sometimes overall system performance can be enhanced by using a different scheduling order. Also, there are schedulers which cause less wear on solid state drives. Two of the better I/O schedulers for SSDs are noop and deadline, and they are faster than CFQ when an application is writing large files.

To see the current scheduler in use for a disk on your system (and alternative I/O schedulers), use the "cat" command to view the scheduler file. The active scheduler will be in brackets:

~$ cat /sys/block/sda/queue/scheduler
noop anticipatory deadline [cfq]

To change the I/O scheduler of a disk to deadline (temporarily - until shutdown or reboot), use the "echo" command to write "deadline" into the scheduler file. Sudo is needed for root priveleges. In this example, drive sda will be set to use "deadline" with the option "fifo_batch":

~$ sudo echo deadline > /sys/block/sda/queue/scheduler && sudo echo 1 > /sys/block/sda/queue/iosched/fifo_batch

Note: disk sda is shown; substitute sdb, hda, or whatever device for which you want to change scheduling.


A drive's I/O default scheduler can be set automatically at boot time by entering the proper option into the boot loader. For example, a system using GRUB2 or GRUB-PC would need the option set inside the file /etc/grub.d/10_linux (look near line 80):

linux	/ root= ro 

Use your text editor (as root) to add the "elevator=deadline" option just prior to ""

linux	/ root= ro elevator=deadline 

After editing the 10_linux file, issue (as root) the command "update-grub" rewrite the config file GRUB uses during boot time.


MOVE FIREFOX’S CACHE TO RAM

One of the things that makes Firefox such a fantastic web browser is its flexibility. It can be configured to do so many things, and do them well. Moving the cache into RAM enhances the browser's speed and reduces writes to the SSD. Be aware that each user on the computer has their own Firefox configuration. Repeat the following steps for all user accounts on the system.

Open Firefox, type about:config in the address bar, and press Enter. Promise to be careful! In an empty space on the screen, right-click and create a new String:

value browser.cache.disk.parent_directory

Set the new string value to:
/tmp

The above system tweaks will optimize your Linux computer for usage of solid state drive storage. As the Linux kernel develops, many of these enhancements will be incorporated and we will see SSD optimized system behavior as the default. Stay tuned, and enjoy lightning fast computing with solid state drives!

Back up your data regularly, regardless of the storage medium used! Any device can have the bad luck to fail just after you save your most precious data...



Tags: ssd, ssd setup, ssd config

©2005 - 2020 AB9IL, All Rights Reserved.
About, Contact, Privacy Policy and Affiliate Disclosure, XML Sitemap.