You’re running Linux on your PC, but you also have Windows installed. It’s a dual boot, but sometimes you’d like to share data between the two operating systems.
But something is stopping you: Windows.
It seems that Windows 10 is locking the C: drive, leaving you unable to access data in Linux. So what can you do about it? Surprisingly, the solution is quite simple.
Why Access Your Windows Data in Linux?
Dual booters (specifically those running Windows and Linux on one computer) have a problem that affects Windows 8 and 10. When using the Linux operating system it’s impossible to access the Windows drive.
For example, you might have some images that you want to edit in Linux. Perhaps there is a video you want to watch; you might have some documents you wish to work on. Worst still, you might have downloaded a Linux installer while using Windows to save time.
But attempting to access the drive in Linux results in an error message. Typically, you’ll see a couple of boxes pop up. One will exclaim “The NTFS partition is hibernated” while the other will advise that it “Failed to mount” the device. So what are you doing wrong?
Like a small woodland animal, Windows has a hibernation mode. This is employed in Windows 8 and 10, specifically. Shutting down Windows in the usual way will hibernate the system.
This essentially means that everything in memory is committed to the hard disk drive (HDD) for the duration of hibernation. When you come to switch on your computer (or open your laptop), it isn’t actually powering up; rather, it is restoring the data from the HDD back into memory.
You probably know that Windows has some other power management modes. These are:
- Shut Down: The option to switch off your computer.
- Sleep: A low-power mode that retains the current session.
- Hibernate: Saves the current session to the HDD until the computer restarts.
- Hybrid: A combination of sleep and hibernate, enabling a fast restart. It is usually disabled on laptops.
When you attempt to access your Windows partition in Linux, and you see the error message referring to the partition being “hibernated,” this is because the drive is locked to Windows. Vital data is stored on the HDD, awaiting the operating system being reinitialized.
Disabling Hybrid Boot on Windows
This method of putting the computer into hibernation instead of shutting it down is called “Hybrid Boot.” To get around its limiting effect on Linux dual booters, you’ll need to disable it. Three options are available here:
- Don’t shut down your PC to access Linux.
- Permanently disable Hybrid Boot.
- Delete the hibernation file.
These options are explained further below.
Restart, Don’t Hibernate
The easiest solution is to ensure that your computer has not gone into hibernation. Without hibernated data on your HDD, you’ll be able to access the Windows partition from Linux without any trouble.
Interestingly, when you use the Restart option in Windows, the computer does a full shut down. Rather than committing the session data to HDD, everything is closed down, then rebooted. As long as you’re quick selecting your preferred OS at the GRUB menu, you’ll be able to boot into Linux. Once running, browse to the Windows drive on your system HDD; it should now be accessible.
Disable Hybrid Boot
Rather than avoiding Hybrid Boot, it can be disabled.
First, open the Windows Control Panel by pressing WIN+R and entering control panel. Next, select Hardware and Sound > Power Options > Change what the power buttons do, then Choose what the power buttons do in the left-hand column.
Here, look for Change settings that are currently unavailable, then look for Turn on fast start-up (recommended). This will be checked by default; to disable the feature, remove the check, and Save changes.
In future, when you shut down your computer, it will do so properly, as older versions of Windows did. Note that doing this comes at the cost of slower startup times when you boot into Windows.
Delete the Hibernation File
An extreme option is to delete the hibernation file from within Linux. If you rely on this, the hibernation file, hiberfil.sys, is automatically deleted when the C: drive is mounted in Linux (although if you use an SSD, it should be disabled)
However, this will cause any unsaved work to be lost, so choose delete your hibernation file only after consideration.
To do this, open the Disks tool (usually found in the Accessories menu). Open this, then select the drive that contains your Windows partition. You should be able to identify this by the size and manufacturer of the disk. If you have multiple devices, check them all; you’ll spot the Windows partition as it will be formatted with the NTFS file system format.
When you have found the Windows partition, select it, then click the Gear button, and select Edit mount options.
At the top of the window, disable Automatic Mount Options. Then in the Mount Options box, input:
Confirm this by clicking OK, then enter your password when prompted. You should now be able to mount the partition in your Linux file manager and browse for the files you need. Even if Hybrid Boot is enabled in Windows, the hibernation file will be deleted. Great, eh?
Well, maybe not. What if you have a dual boot set up with Linux as the default option? A Windows Update will reboot your computer, sending it into Linux. If Windows Update runs without your knowledge, you could lose valuable data in the hibernation file. This could prove devastating.
A safer alternative would be to use the read-only mode for the Windows partition when accessing it from Linux. This will mean that any changes you wish to make to files must be saved locally on the Linux partition.
Sharing Data Between Windows and Linux
Whichever method you choose to work around the C: drive being locked to Windows, you’ll be able to copy, move, open, and edit your files. Although it’s straightforward to access the Windows C: drive in Linux, there are alternatives you might prefer.
- Use a USB drive or SD card to store data.
- Add a dedicated HDD (internal or external) for shared data.
- Use a network share (perhaps a NAS box) or USB HDD connected to your router.
- Employ your cloud storage as a network share.
All of these can be explored in more detail via our look at sharing data between Windows and Linux computers.
Note that it is also possible to view Linux data from Windows. You’ll need DiskInternals Linux Reader for this. Once installed, the utility will scan your HDD for Linux partitions, and display them in a Windows Explorer-like user interface. These files and folders can then be browsed and opened in Windows (if compatible).
Download: DiskInternals Linux Reader (Free)