Installed Linux and Windows Is Gone? How to Get Your Files Back

Installed Ubuntu or Mint and now Windows or your files are gone? Boot menu problem vs erased disk, what not to do next, and how the data is recovered.

You set out to try Linux alongside Windows, or to put Ubuntu, Mint or Fedora on an old laptop, and now Windows has gone. Perhaps the computer boots straight into Linux with no sign of Windows in the menu, or perhaps the installer did far more than you expected and your Documents, photos and work files are nowhere to be seen. What happens next matters a great deal, because the steps people usually take to “fix” it are the ones most likely to make the loss permanent.

First, work out which situation you are in

A Linux installation can go wrong in several quite different ways, and the chances of getting your files back vary a lot between them.

  • Windows is still there but will not start. The Linux boot loader (usually GRUB) has replaced the Windows Boot Manager as the first boot option, and Windows simply is not listed. The Windows partition and your files are normally untouched.
  • The Windows partition was shrunk to make room. If the resize finished, Windows usually survives. If it was interrupted by a power cut, a flat battery or a crash, the partition can be left damaged or showing as unknown.
  • The wrong partition or disk was chosen. In a manual (“something else”) install it is easy to format the Windows partition or a second data drive by mistake, especially when both disks are a similar size.
  • “Erase disk and install” was selected. The installer creates a new partition table and file system across the whole disk, then copies Linux onto it. Some of the old data is overwritten straight away.

Stop using the computer

Whichever case applies, every minute the new Linux system runs it writes to the disk: updates, logs, caches, browser data and anything you save. If the old Windows data is still sitting in the space Linux now considers free, those writes can land on top of it. Shut the machine down and do not boot it again until you have decided what to do.

In particular, avoid:

  • reinstalling Windows over the top to “get back to how it was” – a fresh install overwrites far more than Linux did;
  • running partition repair or recovery tools from the same Linux system and saving the results back to the same disk;
  • letting Windows run CHKDSK on a partition that was resized or partly overwritten, because it can “repair” the damage by discarding file records;
  • repeatedly re-running the installer to try different options.

When Windows is only missing from the boot menu

If you chose an install alongside Windows and the resize completed, the most likely problem is the boot order rather than lost data. Many computers have a one-time boot menu (often F12, F9, F11 or Esc at power-on, depending on the make) that lists “Windows Boot Manager” separately. If Windows starts from there, your files are fine; back them up before changing anything else. Changing the boot order in the firmware settings is usually enough to make Windows the default again.

Be aware that if BitLocker or Windows device encryption is enabled, changes to the boot configuration can trigger a BitLocker recovery screen. Have your recovery key to hand (it is often saved in your Microsoft account) before experimenting.

When the disk was erased or the wrong partition was formatted

This is more serious, but not always hopeless. Formatting a partition with ext4 or another Linux file system writes new structures in specific areas of the disk rather than wiping every sector, so on a traditional hard drive much of the old file content may still be physically present until it is overwritten. How much can be recovered depends on how long Linux has been running and how much has been copied onto the disk since.

SSDs are a different matter. Linux installers and modern Linux systems commonly issue TRIM (discard) commands to the SSD, telling it which blocks are no longer in use. The drive can then erase those blocks internally, and once that has happened the data is gone for good. If the files were on an internal SSD and the disk was erased, the realistic chances are lower, so it is important to act quickly.

A second internal hard drive or an external drive that was formatted by mistake is often in a better position, because nothing else is usually written to it after the format. Disconnect it and leave it alone.

How a recovery is approached

A sensible recovery never works on the original disk. The first step is to make a complete sector-by-sector image, then search that copy for the remains of the old NTFS partition: its boot sector, the Master File Table and the folder structure. Where the original NTFS records survive, files often come back with their names and folders intact. Where they have been overwritten, content can sometimes still be found by its file signatures, though without original names.

If the drive itself is also showing signs of failure – slow, clicking or disappearing – imaging it needs specialist equipment, and that is a job for a lab rather than software. Our hard drive data recovery and laptop data recovery services cover both situations.

Before you try Linux again

  • Back up everything you care about to an external drive or cloud storage first, and check the backup opens.
  • Unplug external and second drives during the installation.
  • Read every installer screen; “Erase disk” is often the default option.
  • Consider trying Linux from a live USB, or on a spare disk, before installing it on your main computer.

Talk to us before doing anything else

If an installation has wiped Windows or your files, switch the computer off and call Data Doctor on 020 7394 2529 for a free initial consultation. We can explain what is likely to be recoverable in your case before any work is agreed. You can read more about our data recovery services, or visit us at Unit 1 The Willows, 80 Willow Walk, London SE1 5SY.

Need this recovered? Stop using the device and call 020 7394 2529 — the first consultation is free.