How to fix corrupted Windows NTFS file system with Ubuntu

When it comes to repairing a corrupted Windows installation, Ubuntu has its uses as well.

If you happen to break your file system or Master Boot Record on Windows, don't worry, all is not lost. You can use Ubuntu to fix problems related to the Windows operating system. This technique should work on any Ubuntu-based Linux distribution.

Download, Install and Start Ubuntu

Those of you who already have dual-boot Ubuntu and Windows computers can skip this step.

Prepare a USB, download the official Ubuntu installation ISO.

Once done, now it's time to create a new Ubuntu bootable USB. There are several tools to create a bootable USB from an ISO file, but you can use balenaEtcher because it has an intuitive, easy-to-use interface. All you need to do is select the ISO file and device, then click Flash.

If you're dual-booting, here's a simple step: Choose Ubuntu instead of Windows on boot. For live USBs and CDs, you'll need to enter the BIOS setup when the PC boots (usually by pressing F2 or Del) and arrange the boot devices to prioritize the bootable USB device or CD drive before the main hard drive. .

If you did everything correctly, you should see the Ubuntu bootloader appear. From here, you'll want to boot directly into the working OS by selecting Try Ubuntu. After a minute or two, you should see the screen appear and ready to get started.

Fix corrupted Windows NTFS partition

Fortunately, you can schedule an NTFS consistency check to attempt to repair a corrupted Windows NTFS partition from Ubuntu, but you'll need to install some packages first. This should work with any NTFS drive that refuses to mount in Ubuntu.

Open a Terminal and install NTFS-3G by typing the following command:

sudo apt install ntfs-3g

Now you can set up the repair of your Windows installation. First, locate your Windows partition. In Terminal, enter:

sudo fdisk -l

Output:

How to fix corrupted Windows NTFS file system with Ubuntu Picture 1How to fix corrupted Windows NTFS file system with Ubuntu Picture 1

You are looking for an entry that resembles the following:

/dev/sda9 * 638 12312 93773824 8.9G Microsoft basic data

The important bit is that /dev/sda9 indicates where the Windows partition is mounted and "Microsoft basic data" indicates that the partition is a Microsoft Windows formatted device. You can also identify the Windows drive by looking at the size of the partition (8.9G).

So in this case, /dev/nvme0n1p9 means Windows is using an NVMe SSD and its partition number is 9. Normally, if your Windows partition is on the hard drive, the device name will be /dev/sdax, where x is a number.

Armed with this information, you must use the ntfsfix command to attempt to repair the partition. Type the following into the Terminal:

sudo ntfsfix /dev/

Replace with your Windows partition (eg /dev/nvme0n1p9) and enter the password. NTFS-3G will now mount your drive and check if it's consistent, and any errors found will be automatically corrected.

How to fix corrupted Windows NTFS file system with Ubuntu Picture 2How to fix corrupted Windows NTFS file system with Ubuntu Picture 2

Restart your PC to assess the situation, and if all goes well, you should see Windows booting up without any problems.

Fix broken Master Boot Record

If you have problems with Windows' Boot Record then you can also fix it from within Ubuntu. Assuming you've booted into Ubuntu, open Terminal and run:

sudo os-prober

Then, recreate the GRUB configuration file by entering the following in the command line:

sudo update-grub

How to fix corrupted Windows NTFS file system with Ubuntu Picture 3How to fix corrupted Windows NTFS file system with Ubuntu Picture 3

GRUB will now identify the Windows EFI partition on your storage device and attempt to add it to the entry. You'll probably want to reboot your machine now, just make sure you unplug any working CD/USB devices.

Alternatively you can use LILO bootloader. Install it on your system first by typing:

sudo apt install lilo

Enter the password to proceed with the installation. You may receive a few warnings during the process.

Now you know the device name for the Windows installation partition. If you missed it, enter:

sudo fdisk -l

Find the "Microsoft basic data" partition relevant to your Windows installation and enter:

sudo lilo -M /dev/ mbr

Replace with your Windows partition (e.g. /dev/sda2) and press Enter. LILO will attempt to restore the Master Boot Record. Again, reboot the system to check if the problem persists.

Recover data from Windows partition on Ubuntu

If you're having issues with your Windows installation and have tried everything and it still doesn't work, there's still hope. Don't forget that you can mount the partition and save as much data as you think you'll need. Using Terminal, enter the following commands one by one:

sudo mkdir /media/windows sudo ntfs-3g -o force,rw /dev/ /media/windows

Replace it with the location of your Windows partition and the drive will appear on the desktop. The mkdir command created a directory where the Windows file system would be mounted and then, using the ntfs-3g command, you mounted the file system to the newly created directory.

Copy any important data from the Windows file system to the Linux partition. You can then transfer it to a removable media and restore it after troubleshooting the Windows installation.

You can use almost any other Linux distribution to fix such problems with Windows. Some distributions like SystemRescue and Ultimate Boot CD focus entirely on troubleshooting and repairing problems related to booting the operating system, file system, etc.

If the Ubuntu desktop appeals to you, then perhaps you should consider installing Ubuntu on your Windows computer. Or even better, you can dual-boot Ubuntu with Windows, but first make sure you're aware of the risks associated with dual-booting.

4 ★ | 3 Vote