Repair ntfs on linux

How to repair bad sectors on ntfs partition [duplicate]

I accidentally unplug the power line of my laptop, which seems cause some bad sectors on my hard drive. The partitions of that hard drive are all in ntfs format, is there a tool or a way to repair it under Ubuntu?

bad sectors can not be repaired. You can try ntfsfix , but, IMO , the Linux tools to repair NTFS partitions are not as good as the Microsoft tools. Try to repair from within windows and if you do not use windows consider an alternate file system.

1 Answer 1

Firstly, before doing anything else, I would check the extent of the damage done to the hard drive since that will in part determine the next step. Check the SMART data through Disk Utility ( palimpsest from a terminal). In Disk Utility, select the drive in question and click the «SMART Data» button to view information about the number of disk errors that have been reported.

Take careful note of the «Reallocated Sector Count» and especially the «Uncorrectable Sector Count». Either any amount of uncorrectable sectors, or an excessive amount of reallocated sectors, is an immediate red flag that you should back up your data and replace the drive.

If you see signs of damage at this point but decide to proceed in making alterations to the filesystems anyway, you are doing so at your own risk!

You have a couple options to try to fix corrupt ntfs volumes:

In my experience, using Windows chkdsk is usually the best option, since ntfs is inherently a part of the Windows world, and Linux tools that operate on it are just reverse-engineered solutions. This of course requires that you have a bootable Windows installation on the disk already.

Equivalently, you can run ntfsfix from Ubuntu which will mark the partition in question as ‘dirty’ so that Windows will automatically run chkdsk on it the next time it’s booted. Take note that ntfsfix is not a Linux replacement for chkdsk , as stated in the ntfsfix manual.

Читайте также:  Unified driver configurator linux

If you can’t run chkdsk , you may want to try reading up on and running testdisk , a powerful data recovery tool that can fix inaccessible ntfs partitions and make various repairs, but it depends on exactly what kinds of symptoms (if any) you’re currently seeing.

Again, if you suspect the integrity of your data is in question you shouldn’t hesitate to back up your drive before proceeding, since any further writes may make the problem worse, especially if there’s physical damage.

Источник

How to Fix NTFS Partition Failed to Mount Error in Linux

In this article, we will show how to fix NTFS failed to mount errors such as “Failed to mount ‘/dev/sdax’: Input/output error, NTFS is either inconsistent, or there is a hardware fault, or it’s a SoftRAID/FakeRAID hardware”.

The following screenshot shows an example of an NTFS failed to mount error.

NTFS - Failed to mount ‘/dev/sdax’: Input/output error

To fix this error, you can use ntfsfix, a tiny and useful utility that fixes some common NTFS problems. A ntfsfix is part of the ntfs-3g package (an open-source implementation of NTFS) and it repairs several fundamental NTFS inconsistencies, resets the NTFS journal file, and schedules an NTFS consistency check for the first boot into Windows.

To run it on our computer, you need to install the ntfs-3g package as follows.

----------- On Debian, Ubuntu & Mint ----------- $ sudo apt-get install ntfs-3g ----------- On RHEL, CentOS & Fedora ----------- $ sudo yum install epel-release $ sudo yum install ntfs-3g

Once you have the ntfs-3g package installed, run the ntfsfix command, provide the NTFS partition that has issues as an argument as shown.

Fix NTFS Failed to Mount Error

To perform a dry-run where ntfsfix doesn’t write anything but only shows what would have been done, use the -n or —no-action option.

A ntfsfix has another useful switch -b or —clear-bad-sectors for clearing the list of bad sectors. This feature is particularly useful after cloning an old disk with bad sectors to a new disk.

Also, ntfsfix supports clearing the volume dirty flag if the volume can be fixed and mounted. You can invoke this feature bypassing the -d option as shown.

Читайте также:  Essential linux device drivers

Note: ntfsfix can only repair some NTFS partition errors. If it fails, chkdsk will probably succeed. If you have windows installed, you can also load Windows and run its disk checking program, chkdsk.

A nftsfix is a useful tool for fixing some common NTFS problems. For any questions or comments, reach us via the feedback form below.

Источник

Fix corrupt NTFS partition without Windows

GParted screenshot showing different partitions

MY NTFS Partition has gotten corrupt somehow (it’s a relic from the days when I had Windows installed). I’m putting the debug output of fdisk and blkid here. At the same time, any OS is unable to mount my root partition, which is located next to my NTFS partition. I’m not sure if this has anything to do with it, though. I get the following error while trying to mount my root partition (sda5)

mount: wrong fs type, bad option, bad superblock on /dev/sda5, missing codepage or helper program, or other error In some cases useful info is found in syslog - try dmesg | tail or so ubuntu@ubuntu:~$ dmesg | tail [ 1019.726530] Descriptor sense data with sense descriptors (in hex): [ 1019.726533] 72 03 11 04 00 00 00 0c 00 0a 80 00 00 00 00 00 [ 1019.726551] 1a 3e ed 92 [ 1019.726558] sd 0:0:0:0: [sda] Add. Sense: Unrecovered read error - auto reallocate failed [ 1019.726568] sd 0:0:0:0: [sda] CDB: Read(10): 28 00 1a 3e ed 40 00 01 00 00 [ 1019.726584] end_request: I/O error, dev sda, sector 440331666 [ 1019.726602] JBD: Failed to read block at offset 462 [ 1019.726609] ata1: EH complete [ 1019.726612] JBD: recovery failed [ 1019.726617] EXT4-fs (sda5): error loading journal 

GParted Screenshot showing error

When I open gparted (using live CD), I get an exclamation next to my NTFS drive which states Is there a way to run chkdsk without using windows ? My attempt to run fsck results in the following :

ubuntu@ubuntu:~$ sudo fsck /dev/sda fsck from util-linux-ng 2.17.2 e2fsck 1.41.14 (22-Dec-2010) fsck.ext2: Superblock invalid, trying backup blocks. fsck.ext2: Bad magic number in super-block while trying to open /dev/sda The superblock could not be read or does not describe a correct ext2 filesystem. If the device is valid and it really contains an ext2 filesystem (and not swap or ufs or something else), then the superblock is corrupt, and you might try running e2fsck with an alternate superblock: e2fsck -b 8193

Update: I was able to fix the NTFS partition running chkdsk off Hiren’s BootCD, but it seems that the superblock problem still remains. Update 2: Fixed superblock issue using e2fsck -c /dev/sda5

Читайте также:  Daemon in linux example

Источник

How to fix a read-only NTFS partition on Linux?

Over the past ten years of Linux usage, I have frequently switched from Windows to Linux without properly restarting the Microsoft OS, which has caused me problems with NTFS/Windows partitions. To fix these problems, I was obliged to restart my Linux distro so that I could reboot the «hibernated Windows OS»; it was annoying.

One day I said there must be a way less painful, so I went to my favorite web browser, Firefox, and did a simple search to find the helpful «ntfsfix» tool that got me rid of that annoyance. To not be stingy, I decided to share with you how to use this small and powerful tool.

What is ntfsfix?

ntfsfix is ​​a command-line tool that can fix some common NTFS issues.

«It repairs some fundamental NTFS inconsistencies, resets the NTFS journal file, and schedules an NTFS consistency check for the first boot into Windows,» explains Ubuntu.

Check out my list of the best reliable and cheap external HDD/SSD available on the market:

How to fix a read-only NTFS partition/disk on Linux?

  • Open a terminal window;
  • Make sure that the utility is there. Otherwise, you can get it by installing the NTFS-3G package:

ِ Check: ntfsfix -v or Install: sudo apt install ntfs-3g (Change the last command line depending on the distribution you are using.)

  • Umount the device & mount it again;
  • Congratulations, you have fixed a problem that took me months in a minute.

📣Do you know another utility that can fix this problem? Tell us in the comments.

If you find Linux-Tech&More helpful, consider supporting it on Open Collective. For more supporting options, contact me.

Science teacher, PhD student, Master degree in Microbial biotechnology , Microbiologist, designer, video editor, podcaster & blogger. linkedin portfolio github

Comments are welcomed and encouraged on this blog. Spam, abusive and off-topics comments will be deleted. Please read our Comments policy before commenting.

Источник

Оцените статью
Adblock
detector