Recover Deleted Windows Files with Linux
In this article
Yes, you can recover deleted Windows files using a Linux live USB or a Linux installation on another drive. Linux can access NTFS and exFAT partitions, and its open-source recovery tools often work where Windows utilities fail—especially when the drive is unbootable or the file system is damaged. This guide explains the process, the tools involved, and the limitations you need to know before you start.
Why Linux Can Recover Windows Files
Windows uses NTFS (New Technology File System) for most internal drives and exFAT for many USB sticks and SD cards. Linux has mature, read-write support for both through the NTFS3 and exFAT kernel drivers, so a Linux system can mount a Windows drive just like any other storage device. More importantly, Linux recovery tools work at a lower level than typical Windows file-recovery software: they scan the raw disk for file signatures and metadata, which means they can find files even when the file system's directory entries are gone.
This is especially useful when Windows itself won't boot—for example, after a failed update, a corrupted boot sector, or a malware infection. A Linux live USB lets you bypass Windows entirely and access the drive from a clean environment, which also reduces the chance of new data overwriting the files you want to recover.
How File Deletion Works on NTFS
When you delete a file in Windows, it is not physically erased. The file system marks the space as available, and the file's name is removed from the directory index, but the actual data blocks remain on the disk until something else writes over them. This is why recovery is possible—and why you should stop using the drive immediately after deletion.
There are two common deletion scenarios:
- Recycle Bin deletion: The file is moved to a hidden folder ($Recycle.Bin) and can usually be restored from Windows itself. Linux can also read this folder if you need to recover a file after emptying the Recycle Bin.
- Shift+Delete or permanent deletion: The file's directory entry is removed immediately, and the space is marked as free. This is where Linux recovery tools become necessary.
Understanding this distinction helps you choose the right tool: if the file is in the Recycle Bin, you may only need to mount the drive and copy it out; if it was permanently deleted, you need a file-carving tool.
What You Need Before You Start
Before attempting recovery, gather the following:
- A USB drive (at least 4 GB) to create a Linux live environment, or a second computer with Linux installed.
- Another storage device with enough free space to hold the recovered files—do not save recovered files back to the same drive you are recovering from.
- Time and patience: scanning a large drive can take hours, and the results are not always perfect.
The most important rule is to stop using the Windows drive immediately. Every new file written, every program installed, and even some background Windows tasks can overwrite the deleted file's data blocks, making recovery impossible.
Step-by-Step Recovery Process
Here is a general workflow that works with most Linux recovery tools:
- Create a Linux live USB. Download an Ubuntu or Linux Mint ISO and use a tool like Rufus (on Windows) or the built-in USB writer on Linux to make a bootable drive.
- Boot from the live USB. Choose "Try Ubuntu" or the equivalent option—do not install Linux yet.
- Identify the Windows drive. Open a terminal and run
lsblkorfdisk -lto list all disks. Look for the NTFS partition (usually labeled with a size and a partition type like "Microsoft basic data"). - Mount the drive (if possible). Use the file manager to click the Windows partition, or mount it manually with
sudo mount /dev/sdXY /mnt/windows. If the file system is corrupted, skip this step and proceed to raw scanning. - Run a recovery tool. Depending on the situation, use one of the tools described below.
- Save the recovered files to your external drive. Never write to the source drive.
If the drive is severely damaged, you may need to use testdisk to repair the partition table or photorec to carve files from raw data. Both are included in the testdisk package, which you can install with sudo apt install testdisk on Debian/Ubuntu systems.
Choosing the Right Tool
Linux offers several recovery tools, each suited to different situations:
- TestDisk: Best for repairing partition tables, restoring deleted partitions, and fixing boot sectors. Use this if the drive is not recognized or if partitions have disappeared.
- PhotoRec: A file-carving tool that scans raw disk sectors for known file signatures (JPEG, DOCX, ZIP, etc.). It works even if the file system is destroyed, but it loses original filenames and folder structure—recovered files are named like
f1234567.jpg. - extundelete / ext4magic: For Linux file systems only, not Windows. Do not use these on NTFS.
- ntfsundelete (from ntfsprogs): A command-line tool specifically for NTFS that can recover recently deleted files by scanning the MFT (Master File Table). It can restore filenames and timestamps.
- ddrescue: Not a recovery tool per se, but it creates a sector-by-sector image of a failing drive. Use this first if the drive has physical damage—then run recovery tools on the image instead of the drive.
For most users, TestDisk followed by PhotoRec is the most practical combination: TestDisk fixes the structure, and PhotoRec recovers the files that remain.
Common Problems and Misconceptions
One frequent misconception is that Linux can "undelete" files as easily as it can on ext4 with the extundelete tool. In practice, NTFS does not have a simple undelete command, and recovery is never guaranteed. The file system may have already overwritten the data, especially if the drive has been used for a while after deletion.
Another issue is that PhotoRec recovers files without their original names. If you need to find a specific document among thousands of recovered files, you may have to open each one or use the grep command to search for text inside them. This is a major drawback for users who need organized results.
Also, if the Windows drive is encrypted with BitLocker, Linux cannot read it without the recovery key. You will need to unlock the drive first, which requires the 48-digit recovery key or the password. Without it, recovery is impossible.
Finally, some users try to recover files to the same drive. This is a critical mistake—the recovery tool may overwrite the very data you are trying to save. Always use a separate drive.
When Linux Recovery Works Best
Linux recovery is most effective in these scenarios:
- The drive is unbootable but physically healthy.
- You deleted files recently and have not used the drive much since.
- The partition table is corrupted but the data blocks are intact.
- You need to recover specific file types (photos, documents, videos) rather than an entire folder structure.
It is less effective when the drive has been heavily used after deletion, when the file system is encrypted, or when the drive has physical damage. In those cases, professional data recovery services may be the only option, but they are expensive and not guaranteed.
Frequently Asked Questions
Can I recover files from a Windows drive that won't boot?
Yes. Booting from a Linux live USB gives you access to the drive without starting Windows. If the drive is recognized and the partition is intact, you can mount it and copy files. If the partition is damaged, use TestDisk to repair it or PhotoRec to scan raw data.
Will Linux recovery tools preserve file names?
It depends. Tools like ntfsundelete and TestDisk can restore original names if the directory entries are still present. PhotoRec, however, recovers files based on content signatures and assigns generic names like f1234567.jpg. If you need original names, try ntfsundelete first.
Is it safe to use Linux on a Windows drive?
Yes, as long as you do not write to the drive. Mounting it read-only or using recovery tools in read-only mode is safe. However, if you run a file system check or repair tool that writes to the drive, you risk further damage. Always make a backup image first if possible.
How long does recovery take?
A full scan with PhotoRec can take several hours for a 1 TB drive, depending on the speed of the drive and the USB connection. A quick scan with ntfsundelete may take only minutes if the MFT is intact. Patience is essential.
What if the drive is encrypted with BitLocker?
You need the BitLocker recovery key (a 48-digit number) or the password to unlock the drive. Linux can mount BitLocker-encrypted partitions using the dislocker tool, but only if you have the key. Without it, the data is inaccessible.
Can I recover files after emptying the Recycle Bin?
Yes, but the chances decrease over time. The files are still on the disk until overwritten. Use PhotoRec to scan for file signatures, or try ntfsundelete to find recently deleted entries. The sooner you attempt recovery, the better.