We ❤️ Open Source
A community education resource
Repairing a corrupted Windows drive with Linux Mint tools
How Linux Mint, ntfsfix, and ClamAV rescued a corrupted NTFS drive and extended hardware life.
When a friend’s ten-year-old Windows 10 laptop became unusable, Linux tools provided an unexpected rescue for her important Microsoft Publisher files. All her important files had been backed up by Microsoft OneDrive, which was a relief when we logged into the new computer. My friend is a Microsoft Publisher user, and Microsoft has announced the end of life for Publisher in October 2026. Since she’s an Office 365 user, she has until then to export all her Microsoft Publisher files as PDFs or lose the information.
The ten-year-old laptop had become unusable, locked up mid-application with Windows errors, and refused to budge. It was an i3 with 4 gigabytes of RAM that started as a Windows 8 laptop and was upgraded to Windows 10 about five years ago. It had seen better days, but I suggested to my friend that I might be able to resurrect it so she could continue using it with the 2021 version of Microsoft Publisher, which will no longer receive updates. She said, “Sure, I’m happy to have you work your magic!”
Diagnosing the problem with Linux Mint
I took the laptop home and did a live boot with Linux Mint MATE 22.2, but the Windows drive would not mount. It gave me an error message:
$ wrong fs type, bad option, bad superblock on /dev/sda6
I ran fsck on the drive and got more messages indicating that a bad block existed and needed to be repaired. How could I fix the error from within this live boot environment? That’s when I discovered ntfsfix, a program already loaded in the live boot environment.
Read more: 15 open source backup solutions
Fixing the NTFS partition with ntfsfix
I used lsblk to determine the exact location of the NTFS disk in the disk system and issued the following command:
$ sudo ntfsfix -b -d /dev/sda6
There are several options for the command:
ntfsfix v2022.10.3 (libntfs-3g)
Usage: ntfsfix [options] device
Attempt to fix an NTFS partition.
-b, --clear-bad-sectors Clear the bad sector list
-d, --clear-dirty Clear the volume dirty flag
-h, --help Display this help
-n, --no-action Do not write anything
-V, --version Display version information
In my case, I used the -b (clear-bad-sectors) and -d (clear-dirty) flags. That command fixed the problem I had with the NTFS partition, and I was now able to download and install Clam Antivirus to clean up the suspected malware causing the issue.
Scanning for malware with ClamAV
I installed ClamAV with:
$ sudo apt install clamav
Then I was ready to scan the disk for viruses and malware. I opened a terminal in the mounted Windows drive and entered the following command:
$ sudo clamscan -irv --remove
Those clamscan options: i prints only infected files, r scans directories recursively, and v provides detailed output during the scan. The --remove option deletes any files that are found to be infected. Be careful with that last option.
The laptop has an i3 CPU and 4 GB RAM, and scanning a 400-gigabyte drive was lengthy. It took overnight to complete, but when I started the laptop in the morning, I was able to log in without difficulty. My friend is delighted at the prospect of extending the life of her access to Microsoft Publisher.
The power of Linux troubleshooting tools
In the end, what began as a seemingly hopeless situation with a locked-up Windows 10 laptop turned into a valuable lesson in resourcefulness. By combining the flexibility of a Linux live boot, the repair power of ntfsfix, and the thoroughness of ClamAV, I was able to breathe new life into aging hardware and preserve access to software that is nearing its end of support.
For my friend, this means more time to safely transition her Publisher files, and for me, it’s a reminder that with the right tools and a bit of persistence, even a decade-old machine can still serve a meaningful purpose.
More from We Love Open Source
- 15 open source backup solutions
- 12 everyday technologies powered by Linux
- 10 open source tools you can start using today
- 6 must-read Linux and open source tutorials of the year
- How to create Windows boot disks on Linux without special tools
This article is adapted from “How Linux Mint, NTFSFix, and ClamAV Saved Microsoft Publisher” by Don Watkins, and is republished with permission from the author.
The opinions expressed on this website are those of each author, not of the author's employer or All Things Open/We Love Open Source.