Start » Net technologies » Storage » How to refresh stored data with Linux and Windows

How to refresh hard disk drive data

How to refresh stored data with Linux and Windows

Updated: 01/03/2020.

In addition to making website backups (and other data backups), it is important to make sure those backups are in good condition. In this post I’ll write how to simply maintain the integrity of data stored on local (and external) storage drives – both Hard Disk Drives (HDD) and Solid State Drives (SSD).

Contents:

  1. Data degradation with time
    1.1. Hard Disk Drive (HDD) data degradation
    1.2. Solid State Drive (SSD) data degradation
  2. Stored data (and backup) preservation
    2.1. Refreshing data on Hard Disk Drives (HDD)
    2.2. Refreshing data on Solid State Drives (SSD)


1. Data degradation with time

1.1. Hard Disk Drive (HDD) data degradation

Hard disks write data on magnetic disks. With a head used for reading and writing (equivalent of a gramophone needle, only without any physical contact, only electro-magnetic induction is used).

What can get broken here?

  • Electric motor that keeps it spinning can get broken.
  • Electronic controller can get broken – from bad power source, moisture, or just aging.
  • Very high and/or very low temperatures, as well as high moisture can speed up degradation.
  • Shocks, or strong vibrations, especially while a disk is working, can physically damage disks with data.
  • Bearings on which disks rotate can get stuck from long time without use.
  • Disks get de-magnetized in time, all of themselves. Very slowly, but surely.
  • Presence of a strong magnet can corrupt data, or drastically speed up the demagnetization process.

1.2. Solid State Drive (SSD) data degradation

SSD-s, unlike HDD-s, don’t have any moving parts and don’t use magnet disks. This is why they are much more resistant to vibrations and magnetic fields. Still they aren’t perfect and have their downsides which, in terms of data retention, are:

  • Bad power supply can damage the electronics, which makes all the data unusable.
  • Data holding cell deterioration over time – based on the number of read and write cycles.
  • Data loss if drive isn’t powered on (used) over a certain period of time.


2. Stored data (and backup) preservation

How to preserve stored data?

First and foremost: good quality motherboard and power supply. I like to say: if you aren’t sure what’s good, go with SeaSonic (Amazon affiliate link) – you won’t go wrong. Good computer power supply and good quality motherboard are often neglected, but they save both time and money in the long run, by making the components last longer and run better.

Next up is an UPS. Sudden power loss can sometimes damage equipment, including drives. When it comes to UPS, I really can only recommend APC (Amazon affiliate link). The model I currently use is APC Back-UPS 950VA (model BX950U-GR, with “Schuko” standard plugs).

Keeping drives in a dry place (with little air moisture) and at room temperature (best between 15 and 30 degrees °C, or 60 to 90 °F).

When it comes to hard disks (HDD), it is good to keep them away from any magnets.

In the following chapters, I’ll explain how to refresh the stored data.


2.1. Refreshing data on Hard Disk Drives (HDD)

Chapter 1.1. explains HDD data deterioration. To refresh hard disk stored data, it must be re-written. Either at a new location, or over the same location. It suffices to do this once a year, unless the disks are stored in hot/cold/humid area, or close to strong magnetic fields (in which case this should be done once per month).

Do not attempt procedures from this chapter with SSD-s! For them the procedures are given in chapter 2.2.

For Windows operating system users, an excellent free tool is DiskFresh (direct download link).

It is simple to use. Once it is run, it shows a list of drives, along with a read-only mode option (in which case there is no data refreshing, of course). It works with any FAT32 and NTFS file system.

DiskFresh menu example
DiskFresh menu – just check the drives you wish to refresh (1) and choose the refresh option (2)
Picture 1


For Linux users, especially with Ext4 file system, best option is badblocks. Note: badblocks works very slowly with NTFS and FAT32 partitions. For those, it is best to have a Windows with DiskFresh (either using a virtual machine, or a dual boot system).

Command prompt command for refreshing data on a partition is the following:

sudo badblocks -f -b 4096 -p 1 -c 32768 -nsv /dev/PARTITION

Where “PARTITION” is the name of a partition. This can be found in Linux Mint by using “Disk” application (can be found under Accessories menu). Or using the command:

sudo fdisk -l

This is what it looks like using Disk application:

Choose disk (1) Choose partition (2) Read the partition's device info (3)
Choose disk (1)
Choose partition (2)
Read the partition’s device info (3)
Picture 2


Command for refreshing data on the partition in picture 2 (sdb3) looks like this:

Badblocks data refresh command
Badblocks data refresh command
Picture 3


There’s a warning in line 3 that the partition is mounted (like external USB drive). If I hadn’t used the “-f” switch, it wouldn’t run. Of course, if you do this operation on mounted drives, make sure not to dismount them until it is finished.

I’ll explain the other switches as well:

  • “-f” forces the program to run even with a mounted drive.
  • “-b 4096” sets a block size do the given number of bytes. For this use case it is a good default that speeds up the process.
  • “-p 1” specifies the number of passes to 1, ie. not to start it over again several times.
  • “-c 32768” the number of blocks tested at once. For computers with 4 GB of RAM and more, a value this high can speed up the process (though take more RAM of course).
  • “-nsv” “n” parameter says to use non-destructive method (to not destroy the data), “s” is for enabling progress tracking and “v” is for showing it on the screen (verbose mode), so that you can see if the program got “stuck”.

Disk defragmentation has nothing to do with refreshing data and it is a separate topic, related to performance. For Linux file systems (Ext4), defragmentation is needless, just make sure to always have at least 20% free space on each partition. For NTFS and FAT32 it is useful if data is often written-deleted (goes only for hard disks).


2.2. Refreshing data on Solid State Drives (SSD)

With SSD-s, even though they have no magnet disks, or moving parts, stored data will degrade if they are not being used (not powered on). Consumer grade SSD-s should be powered on at least once every 6 months. For server grade SSD-s, it is advisory at least once per month.

So all you need to do is connect the drive to a computer and browse the contents. Less than a minute should do. Just open an image, or edit a text file. Then leave the drive on for at least 10 minutes. It will automatically refresh the cells that need refreshing.

Share...

Leave a Comment

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.