DEV Community

Michael Mirosnichenko
Michael Mirosnichenko

Posted on

How to Restore Hard Disk Capacity and Recover Missing Space

If the disk space in your computer is incorrectly displayed, or free disk space decreases, or the overall disk performance deteriorates, all that may happen for a number of reasons. Read this article to find out how to restore original capacity of a hard disk and recover the missing disk space.

How to Restore Hard Disk Capacity and Recover Missing Space

Whatever are the causes behind the incorrectly displayed disk space, there are a few ways to eliminate them and restore the seemingly lost space. In today’s article, we will examine the most widespread causes behind this issue and suggest a couple of methods to solve the problem.

YouTube:

Ways to restore original hard disk capacity

Before we proceed, all causes may be divided into several categories as follows: common system issues, failure to display a disk when it is connected, and a considerable loss of disk space.

For each category, we will try to find effective solutions to diagnose and eliminate the problem.

Eliminate common system issues

In this part, we will focus on obvious causes which can be eliminated by modifying certain system settings and you can gain more disk space, as a result.

1. When the declared disk capacity differs from the real figure
Modern storage devices are manufactured in a variety of capacity types: 500 GB, 1TB, 2 TB and so on.

However, when checking the hard disk size in the Windows operating system with the help of the Disk Management app, you can see that the actual disk size is always a dozen gigabytes less than advertised by the manufacturer. The cause of this difference lies in the methods used to calculate those gigabytes by the disk manufacturer and the Windows operating system. Let’s see how it happens, with the example of a 1 TB hard disk. Open the app in any way you find convenient, for example, by pressing the key shortcut Windows + X which brings up a context menu where you can select the line Disk Management.

Disk Management app

Hard disk manufacturers stick to the averaged value of 1 GB = 1000 MB, 1 MB= 1000 KB and 1 KB = 1000 bytes, while the operating system works with real-life figures: 1 GB = 1024 MB, 1 MB = 1024 KB and 1 KB = 1024 bytes. According to the manufacturer, a 1 TB hard disk capacity is 1 000 000 000 000 bytes. However, when the operating system determines the actual disk space available, it converts the commercial figures into real values. As a result of this conversion, the approximate capacity is determined as 931 GB (1 000 000 000 000/1024/1024/1024). If a simple check indicates that the space you think was lost is actually the difference resulting from the conversion from commercial to system values, there is nothing to worry about, and the disk space is used properly, without losing a single byte.

Hard disk manufacturers stick

2. Hidden partitions
Many computing devices, especially laptops, come supplied with some hidden partitions, for example, a recovery partition or a system-reserved partition.

Additionally, recent versions of the Windows operating system (beginning with Windows 7) create hidden partitions after the installation; these include an EFI system partition for UEFI, and a system-reserved partition for the more obsolete BIOS.

Some of those hidden partitions will be displayed in Disk Management. Other hidden partitions will be available for viewing and editing only when you use third-party applications for displaying hidden partitions – and there are plenty of them on the Internet. Installing and using them is very easy and takes little time, so even novice users can master these apps.

displaying hidden partitions

As some partitions are vital for the full-fledged work the operating system and its security (for example, the ones involved in system recover or booting), Windows hides them to prevent undesired effects related to system errors or virus attacks, and it is hardly recommended to delete such partitions in an attempt to win a few gigabytes more. However, if you don’t need to keep certain hidden partitions (for example, you have already created a system backup copy), they can be removed to gain more disk space.

3. Divide disk space
Before a new hard disk can be used for storing data, you should partition it at your choice so that it will have one or more partitions, which depends on the disk capacity and the tasks you are going to deal with.

Windows File Explorer displays all disks connected to a computing device but a disk which is unallocated cannot be opened. A warning from the operating system will inform you about it.

Windows File Explorer

The Disk Management app will help you to understand the status for the connected storage device and see if it is ready for work. Open the app as described a bit earlier in this article, and find the disk containing unallocated space. Right-click on the unallocated space and choose New Simple Volume in the context menu.

Disk Management app

The operating system will start the service to create simple volumes, where you will have to give some settings, step by step: partition size, drive letter, file system, allocation unit size (i.e. cluster size) and volume label (at your choice) for the new partition, confirm the quick format mode, and finalize creating the partition.

The operating system will start the service to create simple volumes

4. Internal system protection takes up too much space
When checking properties of a specific partition in different ways (especially it applies to the system partition, C:), you may notice some discrepancies in how much disk space is displayed as used – for the same actual device. Right-click on the partition (let it be local disk C:) and select Properties from the context menu.

Internal system protection takes up too much space

In the Properties window that opens, switch to the General tab to see the amount of used disk space equal to 74.5 GB.

In the Properties window

However, when you open the partition and view properties of all its files you may discover that the real used disk space is 64.4 GB, which is 10.1 GB less than the previous figure.

the partition and view properties

The difference in disk used space could have been allocated for system protection.

System protection is an integrated function that regularly creates and stores backup information on system files and settings of the computer, and it also keeps previous versions of files that have been modified. All these files are saved to restore points which are created before important system events such as installing new applications or updating device drivers. That is why using the system protection feature on a regular basis improves the overall security level – but at the cost of taking quite a large chunk of disk space. However, you can somewhat reduce the amount of space used by modifying protection level.

Do it by using the Control Panel, which can be opened in a number of ways. For example, click on the Start button which you can find in the lower left corner of the Taskbar to open the main Windows menu. Use the scroll bar to examine the list of installed apps, find the group Windows System and open the nested menu. Select Control Panel.

Control Panel

In its window, find and select System.

System

The system information window opens; look to the left and click on the System Protection hyperlink.

System Protection hyperlink

In the new System Properties window, jump to the tab System Protection to find Protection settings, select the required disk (for example, local disk C:) and click Configure.

System Properties window

In the section Disk Space Usage, the new system protection window for local disk C:\ will suggest you to set the maximal disk usage for the system protection feature. Adjust the max usage slider to reduce it to the figure you prefer. As the disk space reserved for system protection fills up, older restore points will be deleted automatically to make room for new ones. The less is the max usage value you have selected, the more often system restore points are updated. Additionally, you can remove all restore points by clicking on the Delete button and free extra disk space if necessary. Then click Apply and ОК for the changes to take effect.

Disk Space Usage

5. The hibernation and paging files may also take up much space
Both of them, the hibernation file (hiberfil.sys) and paging file (pagefile.sys), are hidden system files located in the root folder of the partition where the operating system is installed. By default, they are “invisible” and are not shown until you force the settings for all hidden system files to be displayed.

hiberfil.sys

The Windows operating system reserves the space for its hibernation file immediately during the installation. The size of this file is set in accordance with the amount of system memory (RAM) available for a specific computer. In most cases, the default value does not exceed 75% of the total RAM available. If you want, you can disable this feature or reduce the size of the hibernation file.

So if you are not interested in having a hibernation file (hiberfil.sys) on your PC, here is how it can be disabled. Open the Command Prompt with administrator rights. There are many ways to do it. For example, click on the Search button fashioned like a magnifying glass on the Taskbar next to the Start button. In the search field that appears, type command or cmd. In the Best match area, right-click on the result you are looking for and select Run as administrator in the context menu.

Command Prompt with administrator rights

In the window that opens, type the following command powercfg -h off and press the Enter key.

powercfg -h

In the new line, type the command exit to leave the program.

When you do it, the file hiberfil.sys will disappear from the root directory, and the disk space it used to occupy will be ready for new data to be recorded. However, if you want to keep the hibernation mode, you can reduce the disk space it uses by running the following command in the Command Prompt with administrator rights: powercfg -h -size 50% (you can set any percentage, but it should never be less than the value specified in this example). When the command is executed, the size of the hibernation file will be shrunk to the percentage you have set.

Now let’s have a look at the paging file (pagefile.sys) and the disk space it occupies.

Usually, the operating system keeps files, apps and other data which is often used in your work with the computer, in the system memory (RAM), because it can read data from RAM much faster than from the hard disk. However, when the entire capacity of the system memory is used up, Windows will transfer some data from RAM back to the hard disk, and place it into the paging file. The actual size of pagefile.sys is variable and depends directly from the number of programs running on a specific computer, the size of the system memory and the maximal size of the paging file as configured in the computer’s settings. Having a pagefile.sys file is very important as insufficient amount of RAM may result in errors or crashes of certain applications of even the entire operating system which usually happens when the system memory is full.

However, some computers may have settings that create an excessively large paging file which means more time spent when processing the applications that are running at a certain moment. In such situation, you can try reducing the size of the paging file or even remove it completely so have more free disk space.

In order to access paging file settings, open Control Panel using the method described earlier in this article, find System and click on it. In the vertical menu on the left, click on the link Advanced system settings.

Advanced system settings

In the System Properties window that appears, jump to the tab Advanced, select Performance, and click Settings.

System Properties window

At the top of the new page, find the tab Advanced, look down to find Virtual memory and click Change.

Virtual memory and click Change

In the virtual memory settings page, uncheck the box for Automatically manage paging file size to configure settings manually. Select the required hard disk to see three options for managing the paging file:

  • Select Custom size and enter the maximal paging file size in the corresponding slot.
  • The option System managed size suggests that the paging file size will be determined by the operating system depending on its needs.
  • Finally, the option No paging file removes this file from your computer. When you decided on what kind of paging file you need, click Set to save the changes you have made.

virtual memory settings

After the hibernation file size and the paging file size have been modified, additional disk space will be freed, and you can use this space to write new data.

6. Wrong allocation of disk space
When you view how much disk space the operating system allocated for storing s specific file, it is often the case that the real size of the file is considerably less than the space it does occupy on the hard disk.

Wrong allocation of disk space

The cluster size is what causes such irrational disk space allocation. It is a single block for storing and managing data, and the maximal limit to its size is set when a partition is formatted. One cluster can contain the contents of a single file regardless of how big that file is. As shown in the example (see picture above), a file with the size of 2,302 bytes takes up 4,096 bytes on the hard disk because this is the set cluster size for the selected file system. The rest of the space is neither occupied nor available for storing other files, which means it is simply lost. If a file is larger than the cluster size, the operating system will allocate several clusters to store such file, so that their total size is more than the actual file size. Hence, the disk space used to store a file will always be larger than the actual file size. To reduce the difference between the file size and the disk space that files actually occupy on the disk, you can decrease the cluster size and optimize using the disk space.

As we said before, the cluster size is set when formatting a partition. So you can run the format process again to change the cluster size and choose a more optimal value.

You should remember, though, that all data saved to such partition will be erased, so it’s better to copy important information to another partition.

To start the format process, open Windows File Explorer, select the required partition and right-click on it. Select Format from the context menu that appears.

Windows File Explorer

In the new window, choose the file system and set the desired value of the cluster size.

file system and set the desired value of the cluster size

Then click Start to begin disk formatting. When it’s over, the partition will have the settings you have selected.

Fix problems with disk access and displaying

Often, when an external hard disk is connected, the operating system of your computer cannot recognize it properly, which means losing available disk space and access to the data stored on such device. There could be several causes why it happens: poor connection between the disk and the computer, problems with the software in charge of managing the device and its operation, system errors triggered by various internal and external factors, malware effects and so on. Today, we are going to find out how to fix any of these effectively.

1. Check cables and connectors
When connecting an external storage device, make sure that cables and USB ports of your computer work correctly. Try plugging the disk cable into another port, or check the port which you think might be out of order with another device which is 100% healthy and working. This way you can see if the port in question is all right. When using a USB hub, try connecting the disk directly to the computer, because some hubs cannot supply enough power for an external drive to work properly.

If you checked the ports and cables, but the external disk is still not displayed in the disk management window, try connecting it to another computer to see whether the disk itself is faulty, or it is your computer that is glitching. If the disk is not displayed with another computer either, there are high chances that the problem is in the disk (it might be damaged) and you may have to replace it. If things turn out that way, you shouldn’t use the disk, and if it contained important data, it can be recovered with the help of specialized software tools – you will learn more about it in the final part of this article.

2. Update the device driver
If the external hard disk works fine with another computer, it means the operating system in your computer might have some driver issues. You can see if that is true by using the Device Manager app. You can open it in a number of ways: from the Windows File Explorer, from the main Windows menu, from the Control Panel app etc. The quickest way is this: press the combination of keys Windows + X, and find Device Manager in the menu that appears.

Update the device driver

Top comments (0)