Management Windows 10 and SSDs Lead image: Lead Image © Sergiy Serdyuk, 123RF.com
Lead Image © Sergiy Serdyuk, 123RF.com
 

Optimizing Windows 10 for SSDs

Ready for Takeoff

Not all PC settings – traditionally optimized for magnetic hard disks – are suitable for solid state drives. We show you how to configure Windows 10 for optimal operation with SSDs. By Thomas Joos

Many users find flash memory appealing, thanks to steadily falling prices and good performance. If you use solid state drives (SSDs) on computers, you should check some of the configuration options to be sure they make best use of the disks and to avoid premature failure. Windows 7 is the first Microsoft operating system to support SSDs correctly. Windows 8/8.1 and Windows 10 have extended this support.

Drivers and BIOS Settings

To make optimal use of SSDs, enable Advanced Host Configuration Interface (AHCI) mode in the BIOS/UEFI. This is not only faster than IDE mode, but also provides additional features, such as native command queuing. Thus, commands can be better managed and run because the tasks can be performed by the SSD itself. Of course, Windows also requires the matching driver for the SSD, which must be enabled for the controller to which you have connected the SSD; you can check this in the Device Manager (Figure 1):

1. Open the Device Manager by running devmgmt.msc.

2. Navigate to the driver for the controller and invoke its properties.

3. Switch to the Driver tab.

4. Click on Driver Details.

5. Load the driver with "ahci" in its name.

The driver for the SSD controller must support AHCI.
Figure 1: The driver for the SSD controller must support AHCI.

Paging Files and SSDs

Many tips state that users should deactivate the paging file on SSDs. Conversely, other instructions indicate that the paging file makes sense on SSDs. Windows uses the paging file to store data from memory temporarily that the operating system does not currently require or for which Windows does not have enough physical memory space. Deactivating the paging file in Windows, even if you use SSDs, is not meaningful according to Microsoft because doing so will slow down the computer. Windows performs significantly more reads than writes in the paging file, which is why you can benefit from keeping the paging file on the SSD. Microsoft explains [1] that the ratio between read and write access is 40:1 and recommends activating the paging file. Although the discussion refers to Windows 7, the statement remains valid for Windows 8.1 and for Windows 10.

Measuring Performance

In Windows 8.1 and Windows 10, you cannot create a performance index for a computer as you could in Windows 7. However, you can display the appropriate data. Without additional tools, you can obtain an overview as to whether the SSD and the rest of the hardware are working properly. To do so, start the metric by typing winsat formal or winsat prepop at the command prompt. Toward the bottom of the list you will see the read and write speeds of the SSD, so you can pretty quickly determine the performance.

Next, display the result in PowerShell with:

Get-WmiObject -Class Win32_WinSAT

The performance measurement provides information in the following areas:

If you are using an SSD, the values should be close, and DiskScore should reach at least a value of 8.

AS SSD Benchmark

AS SSD Benchmark [2] freeware is very helpful when determining SSD performance. Well-known comparison websites, such as Tom's Hardware [3], use the tool to compare disks. An installation is not necessary; you can start immediately. In addition to measuring speed, the tool tells you whether the first logical sector of the partition is stored appropriately for SSD disks, which is one of the most important performance indicators for SSD drives but is unimportant for traditional hard drives. A page is the smallest unit of an SSD. Windows uses clusters, also known as allocation units, to manage storage. You define them when formatting a disk. If the operating system's allocation unit is larger than the page of the SSD, Windows has to address several pages when saving and distribute changes across two pages, causing a major performance hit – but more on that later.

After downloading and launching AS SSD Benchmark, click Start to test the disk performance. The tool uses various tests and copying actions to check the SSD, without using operating system cache. The tool writes a 1GB file on the disk and then reads it back. In another test, the tool checks the read and write performance with random 4K blocks (Figure 2).

Measuring the performance of hard drives with AS SSD Benchmark shows the performance advantages SSDs offer.
Figure 2: Measuring the performance of hard drives with AS SSD Benchmark shows the performance advantages SSDs offer.

After the tests, results of the compression test are displayed as a graphic. The x-axis reflects the compressibility of the data and the y-axis the data rate of the SSD. From the results, in megabytes per second (MBps), you can compute the I/O rate in operations per second (IOPS). The developer specifies the following formulas:

Total result = 0.15(Seq-write_rate)+0.1(Seq-read_rate)+2(4k-read_rate)+4k-write_rate+4-64thrd-write_rate+1.5(4-64thrd-read_rate)

Read result = 0.1(Seq-read_rate)+4k_read_rate+4_64thrd_read_rate

Write result = 0.1(Seq-write_rate)+4k write_rate+4-64thrd_write_rate

To start various copy tests, go to the Tools menu. The tool then creates several folders on your hard drive and begins to copy data – with the operating system cache enabled. The results are, thus, dependent to a great extent on performance aspects of the operating system, which is why the performance of the installed Windows system can be tested at the same time. In practice, many components play a role in the performance of the computer.

Data Mirroring

It seems logical to clone the operating system from the previous hard disk after buying an SSD; however, one problem when mirroring Windows 10 to an SSD is the relationship between the start of the boot partition and the storage blocks of the hard drive (alignment). This problem occurs whenever you move the operating system from a magnetic hard drive to an SSD instead of installing from scratch. If the start of the boot partition and storage blocks do not match, SSD performance is compromised and its lifespan shortened: The boot partition, rather than starting at the beginning of a sector, begins in the middle, because the filesystem clusters do not match the SSD pages. To check, call for the StartingOffset data on the command line:

wmic partition get name, startingoffset

Then, call the filesystem data of the corresponding hard disk:

fsutil fsinfo ntfsinfo c:

Check the Bytes Per Cluster value: You have to divide the StartingOffset value by the Bytes Per Cluster. The result has to be a whole number. If this is not the case, you should consider reinstalling Windows 10 on the SSD.

The alignment specification in the AS SSD Benchmark displays whether the allocation of the operating system optimally matches the pages of an SSD. The tool reports that no allocation unit of the filesystem is simultaneously stored in two blocks on the SSD. However, the tool does not detect whether the boot partition itself is set up optimally.

Although you can make subsequent changes by downloading various additional tools, the results are not perfect. You can avoid such problems by re-installing Windows 10 on an SSD.

CrystalDiskInfo

CrystalDiskInfo is another interesting tool for measuring the performance of SSDs and conventional hard disks [4]. The software is available as an installable version and is also portable for USB sticks. Additionally, CrystalDiskInfo can check the state of your SSD. In the Features line, you can see which technologies the hard disk supports (Figure 3). In addition to alignment and the optimum ratio between boot partitions and flash cells, TRIM also plays an important role in the use of SSDs. If you delete data in Windows, it remains on the hard disk and is only deleted from the file allocation table. The actual file data is still stored on the hard drive. Windows overwrites this data when the operating system needs the space.

CrystalDiskInfo uses SMART data to detect the health of hard disks.
Figure 3: CrystalDiskInfo uses SMART data to detect the health of hard disks.

However, data deletion does not work the same way on SSDs. The storage blocks must be completely deleted first before they can be rewritten. Windows 10 supports the TRIM technology and tells the SSD which storage blocks it can delete. However, many current SSDs come with technologies that internally delete storage blocks via the controller and the internal firmware.

SSDs that do not support any kind of TRIM suffer from decreasing performance as more data is saved on the system. In this case, the hard disk needs to monitor data deletion. With TRIM, Windows 10 can help delete data and thus take the load off the disk. You can check TRIM support in Windows 10 by entering

fsutil behavior query DisableDeleteNotify

If you see DisableDeleteNotify=0, then TRIM is supported, whereas DisableDeleteNotify=1 indicates deactivation. With the command

fsutil behavior set disablenotify 0

you can enable TRIM in Windows 10.

As soon as CrystalDiskInfo has launched, you will see the temperature of the hard disk. This important indicator lets you know whether the PC is keeping the hard drive cool. If the hard disk is too hot when used, it can be destroyed. The tools also list the SMART messages of the installed disk and output warnings if a disk is not working properly.

When using SSDs, it is interesting to note that CrystalDiskInfo can read the existing functions as well as the status of the firmware. In particular, the firmware is responsible for the SSD's performance and should always be as up to date as possible. You can graphically display the different data and the state of the disk by clicking Option | Diagram.

Updating Firmware on SSDs

To improve the performance of SSDs, you should always install the latest firmware on the device. If the manufacturer makes a new version, you should download and install it, then reboot your PC. Many manufacturers, such as Samsung, offer management programs for their SSDs that measure performance and run firmware updates (Figure 4).

Samsung offers its own management software for its SSDs.
Figure 4: Samsung offers its own management software for its SSDs.

SuperFetch and Prefetch

Many tuning tools enable automatic defragmentation of boot files during startup. This doesn't give you any noticeable performance improvements with normal hard disks, but it is actually harmful for SSDs, which is why you should disable the feature. Open the registration editor (regedit), navigate to HKEY_LOCAL_MACHINE | SOFTWARE | Microsoft | Drfg | BootOptimizeFunction, and set the OptimizeComplete value to No to disable the function.

The Windows memory manager SuperFetch determines user behavior and immediately optimizes memory so that frequently used applications are temporarily stored in RAM and available quickly. The technology can also distinguish behavior through time; thus, it is possible for office applications to be optimized during office hours and leisure programs or games to be optimized during the weekend. However, this function no longer makes sense with SSDs and puts a strain on the hard disk.

Windows 10 automatically disables this service when installing on an SSD, although you can deactivate it retroactively using the system service manager (services.msc). Also, disable the SuperFetch and Prefetch functions in the registry by opening the registry editor, navigating to the HKEY_LOCAL_MACHINE | SYSTEM | CurrentControlSet | Control | Session Manager | Memory Management PrefetchParameters entry, and setting the EnablePrefetcher and EnableSuperfetch values to 0.

Optimizing Energy Options

Because SSDs consume less power than magnetic hard drives, an energy-saving mode is of little value for SSDs. Therefore, you can adjust the energy settings of Windows 10 to support SSDs and leave the hard disk enabled. From the start menu, choose Power Options | Power & sleep | Additional power settings. For the currently enabled power plan, click the Change plan settings link and then the Change advanced power settings link. Under Hard disk | Turn off hard disk after, select the value Never in the drop-down box.

Restoring Data on SSDs

More and more data in companies are stored on SSDs or flash drives. If files are lost, you have to take a different approach when restoring data to SSDs than you would for magnetic disks. Many recovery tools work with normal hard disks as well as with SSDs, but some tools support SSDs better and can recover files more efficiently. The tools not only help restore data on SSDs but also help recover lost data on USB sticks and SD cards.

When you save a Word document to a normal hard disk while editing, Windows always stores the file in the same place. The file grows with time, but it can be found easily by employing additional tools. However, SSDs work differently. The SSD controller stores each version to a different location on the SSD, which naturally complicates the recovery of data.

If a file has been deleted, you first have to find out which version you want to restore – a bit of a problem with frequent saves. The first step to restoring lost data on SSDs is to find the different versions. Only then should you start the restore. Sometimes it might be useful to restore multiple versions, which I'll show you how to do below.

One reason for data loss is that individual memory cells on SSDs and other flash drives can break down and become unreliable over time. If data is stored in compromised areas, it often cannot be restored. If the controller detects such areas, it marks them and, from then on, prevents data from being stored there. You can display such information with SDD management tools.

Therefore, it makes sense to install the vendor management tools on computers with SSDs and to check the SSDs regularly. On SSDs and other storage drives, it's not uncommon for no fewer than 128 storage units to be affected by bad sectors. Even if just one page is defective, the controller marks the entire area as unusable. The remaining 127 pages are basically still readable, but the controller blocks access to them.

Restoring Data

If you store data on SD cards, USB sticks, or SSDs, just one click is all it takes to delete all the files. Even if the confirmation queries in Windows and the recycle bin are deactivated or the recycle bin is full, additional tools need to be used to restore the data.

Because of TRIM technology, mentioned previously, you have to be careful when restoring. With normal hard disks, files marked as deleted can be overwritten immediately without doing anything to the data in those files. However, SSDs and other flash memory devices do not work this way: The controller truly has to delete existing data that are no longer needed. Controllers normally run these processes if a certain memory area is idle, which means that on SSDs and flash drives, it is possible a deleted file has in fact been completely removed, and not just its entry in the filesystem's allocation table.

The sooner you notice that data is deleted, the easier it will be to restore it. If the deletion process occurred a while ago, restoring can cause significant problems and decrease the chances of being able to recover the file. Another important aspect in this context is booting the computer. During every Windows startup, the operating system overwrites deleted files on SSDs and flash drives. If you want to restore data, you should avoid rebooting.

If you have already shut down the computer, you should not boot the operating system; instead, use a rescue CD or DVD. If you do not have any access to the hard disk at all, the controller itself is usually defective. In this case, additional tools will not help you either. In rare cases, management tools by SSD vendors or experts who specialize in defective hardware (e.g., Kroll Ontrack [5] or Stellar [6]) can help.

If the drives are encrypted and the controller is defective, major problems will arise when restoring the data. Even after "secure deletion" of data using additional tools, the data is often unrecoverable (which is the original purpose) and, if so, then only by specialists.

Recuva Freeware

Recuva [7] is the most popular tool for recovering data on SSDs and flash drives. To begin, install the software on the computer with the deleted data and accept the default options. On launching, Recuva comes up with a wizard that supports data recovery.

The procedure is always the same: First, you select the data you want to recover and where it was stored. Second, you scan the disk for deleted files; however, the tool rarely finds deleted files on SSDs. Therefore, the best thing to do is search the computer once again with a deep scan. Whereas a simple scan takes only a few seconds, a deep scan can take several hours. After scanning, Recuva shows the deleted files it found. You can then restore your desired files.

If neither the normal scan nor the deep scan find all deleted files, you can click Switch to advanced mode and then choose Options. In the Actions tab, you can choose to display hidden files and zero-byte files, as well as securely overwritten files. These options are useful if, for example, you have formatted a drive. You will only find the data again with these options, if at all.

After scanning, Recuva displays the files it found in a preview. If the tool cannot display a preview, the files are often destroyed, and at best, only parts of them can be restored. In addition to the preview, you can display the files as a list. The color of a file indicates its status. Recuva distinguishes between green (easily recoverable), yellow (partially defective), and red (destroyed) data. However, do not rely solely on the colors; a restore test is always useful. To restore files, select them, press the Recover button at bottom right, select the directory for the restored files, and check the files when done.

Conclusions

Windows 10 offers good support for SSDs. In most cases, the operating system automatically adapts to suit the type of storage medium. Nevertheless, it can't hurt to understand the possibilities of SSDs and perhaps achieve some performance improvements. Installing the appropriate management software and following the corresponding optimization suggestions is also useful.