How I Fixed an NTFS Drive That Wouldn't Mount in Lubuntu
How I Fixed an NTFS Drive That Wouldn't Mount in Lubuntu
The Problem
I use Lubuntu (a light version of Ubuntu Linux) on my PC. I also have a second hard drive full of old Windows data. One day I clicked two partitions of that drive in the file manager and got this scary message:
Error mounting /dev/sdb2 at /run/media/lukas/LuKaS WaLtEr: wrong fs type, bad option, bad superblock on /dev/sdb2, missing codepage or helper program, or other error
The other partition on the same drive opened fine. A third one just said "Unknown error when mounting". The drive had worked perfectly in Windows for days, so I thought my data was gone.
It wasn't. This post is the full fix, step by step, written so a beginner (and future me) can follow it without panic. If you see this error on an NTFS drive, your data is almost always still there.
Words you will see in this post
- Mount: making a drive's contents available as a folder you can open.
- Partition: one section of a hard drive. One drive can have several, like rooms in a building.
- NTFS: the file system Windows uses.
- Terminal: the black window where you type commands. Press Ctrl+Alt+T to open it.
Why It Happens
The short answer: the drive was left in an "unclean" state, and Linux is much stricter about that than Windows.
Think of a hard drive as a building and each partition as a room. Every room has its own index (called the file table, or $MFT) that records where each file is stored. A problem with one room's index does not affect the other rooms. That is why one partition on my drive opened and two did not.
Common causes of a damaged or "dirty" index:
- Windows Fast Startup or hibernation. "Shut down" in Windows does not fully close the drive, so it stays marked as in use.
- A power cut or forced shutdown while the drive was being used.
- Unplugging the drive without ejecting it.
- A failing drive. This is less common, and we check for it in Step 6.
Why did Windows not complain? Windows quietly repairs small problems at boot. Linux does not. It refuses to mount a dirty volume (or mounts it read-only) to protect your data. The error looks dramatic, but it is Linux being careful.
In my case, ntfsfix reported "$MFTMirr does not match $MFT". That means the file table and its backup copy disagreed, which is a software problem and not a hardware one.
Step 1: Find Out Which Partition Is Broken
Open the terminal and run:
lsblk -fThis lists every drive and partition with its file system, label, UUID and mount point. Find the row with your drive's label (for example "LuKaS WaLtEr"). Note three things: the name (like sdb2), the file system (like ntfs), and the UUID.
In my case:
Partition | Label | File system | Status |
|---|---|---|---|
sdb1 | (none) | ntfs | Would not mount |
sdb2 | LuKaS WaLtEr | ntfs | Would not mount |
sdb5 | DaNiEl | ntfs | Mounted fine |
The device name /dev/sdb2 is not permanent. It can change if you plug in a pen drive or reorder drives, so always run lsblk -f first and use the name you see today.
If the file system says ntfs, continue to Step 2. If it says something else, such as exfat or ext4, the fix is different.
Step 2: Repair the File Table with ntfsfix
ntfsfix is a small Linux tool that fixes common NTFS problems. Run it on the broken partition (use your own partition name from Step 1):
sudo ntfsfix /dev/sdb2Enter your password when asked. Nothing shows while you type it, and that is normal.
A good result looks like this:
Processing of $MFT and $MFTMirr completed successfully.
Setting required flags on partition... OK
Going to empty the journal ($LogFile)... OK
NTFS partition /dev/sdb2 was processed successfully.If it still refuses to mount later, clear the "dirty" flag too:
sudo ntfsfix -d /dev/sdb2Two mistakes I made, so you can skip them
- A stray space. I typed
/dev /sdb2instead of/dev/sdb2and got "ERROR: Too many arguments". The device path is one word with no spaces. - Using
-nand expecting a fix.-nmeans "no action". It only shows what it would do and changes nothing, so the next mount still fails. Run the command without-nfor the real repair.
ntfsfix only patches the basics. It is not a full replacement for Windows chkdsk, but for a mismatch like mine it was enough.
Step 3: Mount It Manually (Read-Only First)
The file manager only shows a vague error. The terminal tells you the real reason, and it often works when the file manager does not. First create an empty folder to act as the mount point, then mount the partition into it:
sudo mkdir -p /mnt/lukas
sudo ntfs-3g -o ro /dev/sdb2 /mnt/lukas/mnt/lukasis just a folder name I chose. You can use any name.ntfs-3gis the driver that reads and writes NTFS on Linux. If the command is missing, install it withsudo apt install ntfs-3g.romeans read-only. Nothing on the drive can be changed, so it is the safest first try.
If the command prints nothing, it worked. Look at your files:
ls /mnt/lukasIf you see an error
If it complains about an "unsafe state" or "hibernated", force the mount:
sudo ntfs-3g -o ro,force /dev/sdb2 /mnt/lukasIf it still fails, read the system log. The last lines usually name the exact problem:
sudo dmesg | tail -20To open the folder in the file manager, press Ctrl+L and type /mnt/lukas.
Step 4: Remount With Read and Write Access
Once you can see your files, switch to a normal read-write mount so you can edit and save:
sudo umount /mnt/lukas
sudo ntfs-3g -o rw,uid=1000,gid=1000 /dev/sdb2 /mnt/lukasumountdetaches the drive (it is spelled "umount", not "unmount").uid=1000,gid=1000makes your user the owner of the files. Check your own number withid -u. For the first user on most systems it is 1000.
If it refuses because of "unsafe state" or "hibernated", force it:
sudo ntfs-3g -o rw,force,remove_hiberfile,uid=1000,gid=1000 /dev/sdb2 /mnt/lukasremove_hiberfile throws away Windows hibernation data. That is fine if you only care about your files and do not plan to resume a hibernated Windows session.
Step 5: Mount It Automatically on Every Boot
A manual mount disappears when you restart. To make it permanent, add a line to /etc/fstab, the file Linux reads at startup to decide which drives to mount.
1. Save a backup copy of the file first. A typo in fstab can cause boot problems, so this is your safety net:
sudo cp /etc/fstab /etc/fstab.bak2. Add the line. Use the UUID from lsblk -f (the UUID, not sdb2, because the UUID never changes):
echo 'UUID=E6F08914F088EC5D /mnt/lukas ntfs-3g defaults,uid=1000,gid=1000,nofail 0 0' | sudo tee -a /etc/fstabWhat each part means:
Part | Meaning |
|---|---|
| Which partition, identified by its permanent ID |
| The folder where it appears |
| The driver to use |
| Normal options, with you as the owner |
| Boot normally even if this drive has a problem |
| Skip backup and disk-check at boot |
The nofail option is important. Without it, a problem with this drive could stop your PC from booting properly.
3. Test it now, without rebooting:
sudo umount /mnt/lukas
sudo mount -a
ls /mnt/lukasmount -a mounts everything listed in fstab. If you see your folders, it works and it will mount on every restart. If it prints an error, fix the line before rebooting. You can restore the backup with sudo cp /etc/fstab.bak /etc/fstab.
To do the same for a second partition, repeat with its own UUID and its own folder (for example /mnt/sdb1).
One side effect: a drive listed in fstab usually stops showing as a clickable icon in the file manager. Open it with Ctrl+L and type /mnt/lukas, or drag the folder into the sidebar to bookmark it.
Step 6: Check That the Drive Itself Is Healthy
An NTFS error is usually a software problem, but it is worth ruling out a dying disk. Install the health tool and run a quick check on the whole drive (sdb, not sdb2):
sudo apt install smartmontools
sudo smartctl -H /dev/sdbIf it says PASSED, the drive is fine. For more detail, run sudo smartctl -a /dev/sdb and look at two lines: Reallocated_Sector_Ct and Current_Pending_Sector. Both should be 0. Growing numbers mean the disk is failing, so copy your important files to another disk and plan to replace it.
Backing Up Your Important Files
A drive that has shown errors should not be the only place your data lives. Check the folder size and your free space first:
du -sh /mnt/lukas/foldername
df -h ~du shows the folder size and df shows free space on your main disk. Then copy it:
mkdir -p ~/backup
cp -rv /mnt/lukas/foldername ~/backup/Folder names with spaces need quotes, like "/mnt/lukas/stock market". Large copies can take 10 to 30 minutes, so wait until the terminal prompt comes back before closing it.
To check that the copy matches the original:
rsync -rcn --progress /mnt/lukas/foldername/ ~/backup/foldername/If it prints no file names, every file matches. Ideally keep a second copy on a pen drive or external disk, because two partitions on the same drive are not a real backup.
Quick Fix If It Happens Again
If a drive refuses to mount after a power cut or bad shutdown, this is the whole fix. Run lsblk -f first and replace sdb2 with your own partition name.
sudo ntfsfix -d /dev/sdb2
sudo mount -a
ls /mnt/lukasIf the drive is not in fstab, mount it by hand instead of mount -a:
sudo ntfs-3g -o rw,uid=1000,gid=1000 /dev/sdb2 /mnt/lukasIf that fails, add force, or mount read-only and copy your files out:
sudo ntfs-3g -o ro,force /dev/sdb2 /mnt/lukasIf nothing works
- Plug the drive into a Windows PC, open Command Prompt as Administrator and run
chkdsk E: /f(replaceE:with the drive letter). This is the most reliable full repair. - Turn off Fast Startup in Windows: Control Panel, Power Options, "Choose what the power buttons do".
- If you only need your files, try the recovery tools TestDisk or PhotoRec (
sudo apt install testdisk). They can copy files off even when the drive will not mount. - Do not format the partition until your data is safely copied somewhere else.
How to Stop It Coming Back
No setting can promise that a drive will never have a problem, but these habits make it much less likely:
- Always use Shut Down or Restart. Do not cut the power or hold the power button while drives are in use.
- Run
sudo umount /mnt/lukasbefore unplugging an external drive. - If you also use Windows, turn off Fast Startup and shut down fully.
- Use a surge protector or UPS if your electricity is unstable.
- Keep a copy of your most important files on a second physical disk.
Common mistakes
- Typing a space in the device path (
/dev /sdb2). - Using the wrong partition name because the letters changed.
- Running
ntfsfix -nand expecting a repair. - Leaving out
nofailin fstab. - Formatting the partition when only a repair was needed.
Conclusion
The scary "wrong fs type, bad superblock" error did not mean my data was lost. It meant Linux found a dirty NTFS file table and refused to mount it. Three tools solved it: ntfsfix to repair, ntfs-3g to mount, and fstab to make it permanent. Keep the quick-fix commands handy, and back up what matters.
SUMMERY .......
1. Unmount and remount it read-write:
sudo umount /mnt/lukas
sudo ntfs-3g -o rw,uid=1000,gid=1000 /dev/sdb2 /mnt/lukasIf it refuses because of an “unsafe state” or “hibernated”, force it:
sudo ntfs-3g -o rw,force,remove_hiberfile,uid=1000,gid=1000 /dev/sdb2 /mnt/lukasThis discards any Windows hibernation data, which is fine since you only want your files.
2. Make it mount automatically on every boot. Check whether the fstab line from earlier is still there:
tail -3 /etc/fstabIf you don’t see a line starting with UUID=E6F08914F088EC5D, add it:
echo 'UUID=E6F08914F088EC5D /mnt/lukas ntfs-3g defaults,uid=1000,gid=1000,nofail 0 0' | sudo tee -a /etc/fstabThen test it:
sudo umount /mnt/lukas
sudo mount -a
ls /mnt/lukasIf you see your folders, it works, and it will mount on every restart.
3. Fix the file manager icon and click-to-mount (optional). The icon vanishes because of the fstab entry. If you prefer clicking the drive, remove that line and use this instead:
sudo mkdir -p /etc/udisks2
echo -e '[defaults]\nntfs_drivers=ntfs-3g' | sudo tee /etc/udisks2/mount_options.conf
sudo rebootAfter the reboot, clicking “LuKaS WaLtEr” should mount it like “DaNiEl”. Use either the fstab method or this one, not both.
4. Stop it breaking again: if you ever boot Windows, turn off Fast Startup and shut down fully. In Linux, unmount before unplugging with sudo umount /mnt/lukas.







Comments
Post a Comment