Thứ Tư, Tháng Hai 12, 2025
spot_img
HomeTechnologyHow to fix corrupted Windows NTFS file system with Ubuntu

How to fix corrupted Windows NTFS file system with Ubuntu

When it comes to repairing broken Windows installations, Ubuntu also has its uses. 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 Windows operating system. This technique will work on any Ubuntu-based Linux distribution.

Download, install and boot Ubuntu

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

Prepare a USB, download the official Ubuntu installation ISO.

Once completed, now it's time to create a new bootable Ubuntu USB. There are several tools to create bootable USB from ISO files, 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 press Flash.

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

If you did everything correctly, you should see the Ubuntu bootloader appear. From here, you will want to boot directly into the active operating system by selecting Try Ubuntu. After a minute or two, you will see the screen appear and be ready to get started.

Fix Windows NTFS partition corruption

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

Xem thêm  How to set ChatGPT as Firefox default search engine

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

sudo apt install ntfs-3g

You can now set up repairing your Windows installation. First, locate your Windows partition. In Terminal, enter:

sudo fdisk -l

Output:

Identify the Windows NTFS file system
Identify the Windows NTFS file system

You are looking for an item that resembles the following:

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

The important bit is /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 a hard drive, the device name will be /dev/sdaxin there x is a number.

Armed with this information, you must use the ntfsfix command to attempt to repair the partition. Enter the following into 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 that it is consistent, and any errors found will be automatically corrected.

Repair NTFS partition on Ubuntu
Repair NTFS partition on Ubuntu

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

Fix corrupted Master Boot Record

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

sudo os-prober

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

sudo update-grub
Run the commands os-prober and update-grub
Run the commands os-prober and update-grub

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've unplugged any active CD/USB devices.

Xem thêm  How to play Tien Len Mien Nam, TLMN card game rules

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 partitions “Microsoft basic data” 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 problems with your Windows installation and have tried everything to no avail, 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 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 command ntfs-3gyou have mounted the file system into 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 fixing problems with your 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.

Xem thêm  How to make YouTube less distracting

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 are well aware of the risks involved in dual booting.

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments