Toolbox for mass storage

Amy Walters, 123RF.com

Amy Walters, 123RF.com

Intensive Care

Linux provides several tools for maintaining mass storage. Gnome Disks combines the most important functions into one interface.

Hard drives, because of their complex mechanics, are sensitive to vibration, heat, voltage fluctuations, and power outages. Since the 1990s, hardware providers, notably IBM and Compaq, have pondered how to improve performance security. The resulting different technologies ultimately resulted in the 1996 Self-Monitoring Analysis and Reporting Technology (SMART) standard that monitors many hard drive hardware parameters and triggers alarms when thresholds are crossed. Although the parameters haven't been fully normalized, they've been embedded in the firmware of almost all hard drives in various forms.

Jumble

Even though all SATA hard drives in familiar form factors support SMART, their corresponding values aren't always readable. External drives running over the USB bus in particular reveal the data only when the USB-to-SATA bridge electronics provide a data tunnel, which isn't the case with many of the cheaper external drives.

The same is true for external mass storage with universal plugs. Even some of the more high-quality external hard drives that operate with combined USB and Firewire ports to the computer can't have their SMART values read for lack of bridge functions – even if the hard disk on the external device is SATA compliant.

Even high-quality server hard drives that comply with the SAS specification don't always cooperate with the SMART. They need to support the SAT standard to translate the SCSI commands in the SATA command set. If in doubt when purchasing a new hard drive, you should carefully read the specifications. The manufacturer usually indicates in the data sheets if a mass storage device is SMART-compliant.

Software

To prevent data loss from corrupt mass storage, Linux provides countless tools and programs, including the Smartmontools, which are found in practically all distribution repositories. After installation, these tools provide extremely powerful testing capabilities on the command line that offer a huge number of parameters due to the range of functionalities.

Such functionality comes at a price, however. For example, it can be hard to figure out what you're looking for and seeing. A much simpler solution is to work with a graphical front end to Smartmontools, such as GSmartControl, which is also found in all major distribution repositories. A special place for such graphic interfaces for monitoring hard drives is reserved for Gnome Disks [1], which you can also install on other desktops beside Gnome. It combines monitoring software with different utilities for disk partitioning and benchmarking, so it can replace several conventional graphical front ends for monitoring and maintaining mass storage devices.

First Start

After successfully installing the gnome-disk-utility package available in all major Linux distribution repositories (including Ubuntu) in 32-bit or 64-bit versions, type disks into the HUD. Clicking on the Disks utility then opens the program without requiring root privileges (Figure 1).

Figure 1: The Gnome Disks interface is a clear one.

The program window is clear and highly intuitive. On the left, arranged vertically, are all the drives the utility has discovered. On the right are the details for a selected drive in a large area of the window.

Gnome Disks displays the partitions table as a horizontal bar and shows the current "health" of the storage devices as the Assessment on the right, along with its current temperature. Optical drives show data only for the currently inserted media. There is no traditional menu bar, and only one menu item: Disks , which contains three options.

Intrinsic Value

To view the detailed SMART values for a storage device, click the gear symbol in the upper right corner. This opens a selection menu with, among others, the option SMART Data and Tests… . A new window appears with details about the current state of the drive. The software doesn't list all the available attributes and values as some other tools do – just the current ones that the drive itself reports. The Assessment column reports the current health (Figure 2).

Figure 2: The Gnome Disks assessment window provides further details.

If you're confronted with unclear values, click the Start Self-test button at the bottom left of the program window to start one of three test routines. A test can take a few hours, depending on the disk size. To launch the test, select it from the menu and enter the root password. Gnome Disks then displays the test progress and eventually its results (Figure 3).

Figure 3: The test routines show the progress with a bar.

More Power

Especially for traditional hard drives for mobile applications, it has become customary in recent years to factory-implement aggressive power-saving settings for the battery. You previously needed to correct these aggressive values for battery mode in Linux with a manual configuration of the parameters with help from the hdparm command.

In Gnome Disks, however, you can simply use the Drive Settings… menu item. Activate the Advanced Power Management through a button and adjust the slider somewhere between the end values Save Energy and Improve Performance . You can also use a slider to adjust the standby time for hard drives.

Performance

The performance tests that Gnome Disks provides go far beyond the capabilities of a mere status query. You can use them to derive the write and read rates of each partition, where you can define the number of samples for evaluating these rates.

To start the tests, select the partition and click the little gear symbol under it. Choose Benchmark… and Gnome Disks will take you through a few steps to determine how extensive a test you want and whether you want a pure read or write test. Before you embark on a write test, however, be sure to back up the partition to avoid any data loss risk. Gnome Disks then asks for your root password and executes the routine. The speed tests results appear graphically and meaningfully in a new window (Figure 4).

Figure 4: Gnome Disks determines fairly quickly if your mass storage is a hare or tortoise in terms of speed.

If you want to get speed results for the entire disk instead, click in the upper right on the gear button. In the resulting menu, select Drive Performance Test… . Gnome Disks then leads you through the same steps as for the individual partitions and displays the values for the entire drive.

Changes

If the speed tests show that the drive is not up to its full potential because of a misconfiguration, you can deal with this by modifying the partitions. You don't need any additional software to do so; Gnome Disks handles this quite well. Highlight the affected drive and the respective partition in the left pane. Clicking the gear button below it opens the Create Disk Image… and Restore Disk Image… menu items.

Before editing a partition, be sure to make an image copy first to eliminate any chance of data loss while modifying the data structure. The IMG file that contains the image is best saved in a folder on an external backup drive – to enable reconstruction in case of data loss.

Make configuration changes using primarily the Edit Partition Type… and Edit Mount Options… menu items. Pay particular attention when selecting a non-Linux filesystem when modifying the filesystem type for a heterogeneous environment. Other operating systems will recognize very few filesystems. If in doubt, FAT16 or FAT32 should prove the safest options.

The actual disk reformatting is done through the Format… menu item. In the resulting dialog, enter the desired filesystem and choose whether you want to have it encrypted with LUKS. You also have the option of overwriting the existing sectors with zeros. This step can slow down reformatting considerably, although it completely removes old data safely.

Please note, however, that this process is not suitable for modern SSD disks. In this case, the internal controller manages the data storage, and data cannot be reconstructed in the same way as with hard drives. You can use Gnome Disks, however, to reliably clean up existing mobile device storage if, for example, you want to sell it (Figure 5).

Figure 5: Gnome Disks isn't limited to one filesystem.

Hang-Ups

Gnome Disks lets you mount and unmount partitions on the fly and set the desired mount options. To unmount an already mounted filesystem, click the little square underneath the graphical drive bar. This disables the filesystem, which often involves some intensive work.

If, instead, you want a previously inactive partition to be mounted automatically at startup or to set up password authentication for it when mounting, you can make the necessary modifications graphically through the Edit Mount Options… menu item. You can also get to the function using the gear button directly below the graphical disk indicator. The tool opens a clear dialog where you make the desired settings but warns explicitly against any ill-advised modifications that could render a system unusable (Figure 6).

Figure 6: Mounting and unmounting is easily done in a graphical dialog.

Conclusion

Gnome Disks proves to be an easy-to-use and useful tool for more than just the Gnome desktop, and it combines many features of the hdparm , smartctl , dd , and mount terminal commands. It may not provide their full range of functions, but it gives you the important and most frequently used ones. As a result, even beginners can get along well with Gnome Disks. The software should be a standard part of every user's desktop.