Storage drives of all types almost always work reliably and without abnormalities under Linux. Nevertheless, the system offers a few adjustment screws for optimization.
The following SSD and HDD tricks can help in everyday Linux life.
Hard drives and SSDs are the most important components in computers because they are responsible for reliable data storage. It’s more than annoying when a hard drive fails and important files are lost in the process. The mechanical drives are sensitive to drops or knocks, and temperatures that are too high can cause failure. SSDs are much more robust, although here too – as with all electronic components – heat dissipation must be guaranteed. The health of a drive and whether it delivers the transfer rate that can be expected can be determined under Linux with on-board resources and additional tools.
Drives and kernel drivers
SATA controllers for connecting hard disks and SSDs can be found in every PC or server. The necessary drivers are included in the Linux kernel and ensure that the drives can be addressed early on when the system is started. Even relatively new adapters for the fast USB 3.2 Gen2x2 or for Thunderbolt do not cause any problems under Linux. With external USB drives, the basic commissioning should always succeed. If a USB drive hangs spontaneously during operation or is not automatically recognized, there are usually other reasons: faulty USB ports, poor quality cables or insufficient power supply. All operating systems are then affected.
Manage drives and partitions
Tool for drives: The Gnome-Disks tool offers the most important functions for hard drives and SSDs. You can change partitions or define mount points.
The tool provides a good overview of the drives
(Package: “gnome-disk-utility”). Ubuntu users can find it with a search for “drives” via “activities”, in Linux Mint go to “Accessories -› Drives “in the menu. The tool can format, delete and resize partitions. You can access the options after selecting a partition by clicking the button with the gearwheels or Shift-F10. There is also the “Performance test for partitions” menu item, which you can use to measure read and write speeds.
You can access other internal hard drives in the file manager under “Other locations” (Linux Mint: “Go to -› Computer ”). If a partition is to be mounted at system start-up, click on the desired partition and after Shift-F10 go to “Edit mount options”. Turn off “User Session Preferences”. If necessary, change the path after “Mount point” to the name of the partition, for example. You can then mount the partition using the “Play” button.
Gnome-Disks shows – if a sensor is available – the temperature of drives and provides information on the status. If you want to know more, press the key combination Ctrl-S and can then determine the SMART values (Self-Monitoring, Analysis and Reporting Technology). “The drive is OK” should appear after “General Assessment”. Otherwise, it’s time to think about an exchange. For SSDs, look at the “wear-leveling-count” line. In the “Normalized” column for new SSDs there is a value of “100”, which is reduced over time. Before it gets close to “0”, you should replace the drive.
Turn off unused drives
Disable hard disks: Via Gnome Disks you can specify when a drive should automatically switch to standby mode. However, this does not work with all devices.
A second hard drive, which is only used for backups, for example, does not have to be running all the time. In Gnome-Disks you call up the “Drive Settings” with Ctrl-E. Activate the option “Apply settings for standby waiting time” and set the time period after which the drive should automatically switch to standby mode. There can also be the “APM” (Advanced Power Management) tab, on which you can alternatively move the slider towards “Save energy” (faster stand-by) or “Improve performance”. If drives do not offer these options, the settings are not available.
The hard disk can be switched off immediately via Ctrl-E and “Get ready now”, which is usually also audible. Note that too many start / stop cycles will result in premature wear. In the terminal you can use
sudo hdparm –C /dev/sd[x]
check whether the switch-off has actually taken place. When the hard disk is running, the tool outputs “active / idle”, “standby” shows the standby mode.
If the standby mode does not work, the hd-idle tool can help. You can find out how to install and use it on the English-language website http://hd-idle.sourceforge.net. hd-idle also supports USB drives.
Conversely, if you want to prevent USB drives from being permanently switched off (to avoid waiting times for access), you can use a cron job for this. To
add the following line:
*/5 * * * * /bin/touch /dev/sd[x] &>/ dev/null
In the example, it is accessed every five minutes. Replace the placeholder “[x]“By the name of the drive.
Firmware updates under Linux
Firmware updates are available for hard drives and SSDs that fix errors or improve performance. The manufacturers usually only provide Windows tools. Ubuntu 20.04 and Linux Mint 20 come with a tool with which the updates can also be carried out under Linux. It should be installed by default. If not, bring that with you
sudo apt install fwupdate
to. Under Gnome, fwupd runs automatically in the background and the Gnome Software Center provides information about available firmware updates. If you want to check this, you will receive it in the terminal
sudo fwupdmgr get-devices
a list of discovered devices. The three command lines
sudo fwupdmgr get-updates
bring the firmware database up to date, download updates – if available – and carry out the installation. So far, not all manufacturers have contributed to the firmware database. At the moment Dell, HP, Lenovo and Logitech are mainly represented.
To search the database for manufacturer and device name, go to https://fwupd.org.