1

I resized the NTFS partition in my external hard drive by shrinking it and then I created a 2nd fat32 partition starting from the end of the 1st partition. I also switched the boot flag from the NTFS partition to the FAT32 partition.

After quitting parted, the new FAT32 partition automounts when plugged in but the 1st NTFS partition can't be mounted using either udisksctl or manual mounting. The latter gives me:

[user@host mnt]# mount /dev/sdd1 /mnt/volume
ntfs_attr_pread_i: ntfs_pread failed: Input/output error
Failed to calculate free MFT records: Input/output error
NTFS is either inconsistent, or there is a hardware fault, or it's a
SoftRAID/FakeRAID hardware. In the first case run chkdsk /f on Windows
then reboot into Windows twice. The usage of the /f parameter is very
important! If the device is a SoftRAID/FakeRAID then first activate
it and mount a different device under the /dev/mapper/ directory, (e.g.
/dev/mapper/nvidia_eahaabcc1). Please see the 'dmraid' documentation

I've tried ntfsfix /dev/sdX to repair the ntfs partition, the output below says it fixed the problem, but I still can't mount it:

    [user@host mnt]# ntfsfix /dev/sdd1
Mounting volume... Failed to read last sector (976769198): Invalid argument
HINTS: Either the volume is a RAID/LDM but it wasn't setup yet,
   or it was not setup correctly (e.g. by not using mdadm --build ...),
   or a wrong device is tried to be mounted,
   or the partition table is corrupt (partition is smaller than NTFS),
   or the NTFS boot sector is corrupt (NTFS size is not valid).
FAILED
Attempting to correct errors... Failed to read last sector (976769198): Invalid argument
HINTS: Either the volume is a RAID/LDM but it wasn't setup yet,
   or it was not setup correctly (e.g. by not using mdadm --build ...),
   or a wrong device is tried to be mounted,
   or the partition table is corrupt (partition is smaller than NTFS),
   or the NTFS boot sector is corrupt (NTFS size is not valid).
FAILED
Failed to startup volume: Invalid argument
Failed to read last sector (976769198): Invalid argument
HINTS: Either the volume is a RAID/LDM but it wasn't setup yet,
   or it was not setup correctly (e.g. by not using mdadm --build ...),
   or a wrong device is tried to be mounted,
   or the partition table is corrupt (partition is smaller than NTFS),
   or the NTFS boot sector is corrupt (NTFS size is not valid).
Trying the alternate boot sector
The alternate bootsector is usable
Set sector count to 937497952 instead of 976769199
Rewriting the bootsector
The boot sector has been rewritten

Processing $MFT and $MFTMirr...
Reading $MFT... OK
Reading $MFTMirr... OK
Comparing $MFTMirr to $MFT... OK
Processing of $MFT and $MFTMirr completed successfully.
Setting required flags on partition... OK
Going to empty the journal ($LogFile)... OK
Checking the alternate boot sector... FIXED
NTFS volume version is 3.1.
NTFS partition /dev/sdd1 was processed successfully.
  • Could it be the flag I changed or is it the shrinking and growing which is causing this problem?
  • The end size shown by parted was different to what fdisk and lsblk showed. The latter was 465G while parted showed 500G so it was a bit confusing which one to follow. I ended up using 500G because I was using parted not fdisk.
  • Are there any known solutions to restoring the partition so that it can be mounted again?

update

Tried chkdisk /f and chkdisk /r in windows and "I'm getting corrupt master file table, chkdsk aborted".

  • Did you remember to resize the NTFS filesystem before you shrank the partition it lived in? – jw013 Jun 5 '18 at 17:20
  • You can try building a Windows VM using MS's free VM images, and use disk manager in the VM to figure what's wrong with the partition. – ajeh Jun 5 '18 at 17:22
  • @jw013 the NTFS filesystem was the only partition in the hard drive. Thats why I dont understand why there are problems. I shrank the NTFS partition from 500G down to 480G and then created a fat32 partition from 480G all the way to the end. – MyWrathAcademia Jun 5 '18 at 17:35
  • @ajeh I am in windows right now. Disk manager shows the file system as raw and when I click on it it returns "the file or directory is corrupted and unreadable. – MyWrathAcademia Jun 5 '18 at 17:38
  • 1
    @jw013, I found the answer to my question here. I find it astonishing that the previous link I posted didnt warn readers about resizing the filesystem first when the disk contains data. – MyWrathAcademia Jun 5 '18 at 17:56
0

Could it be the flag I changed or is it the shrinking and growing which is causing this problem?

Your problem was caused by the shrinking and growing. Such operations are ALWAYS dangerous and thus if the data is important should never be done without backups on-hand.

Are there any known solutions to restoring the partition so that it can be mounted again?

The best solution is to not bother restoring it and instead format the partition anew and restore your files from backup.

If that's not possible your second best option is to attempt fixing the partition within Windows.

Your third option is to delete the FAT partition and resize the NTFS partition back to the way it was. Maybe a second dose of ntfsfix will fix it after that, but by this point don't expect any miracles.

ntfsfix is a utility that fixes some common NTFS problems. ntfsfix is NOT a Linux version of chkdsk. It only repairs some fundamental NTFS inconsistencies, resets the NTFS journal file and schedules an NTFS consistency check for the first boot into Windows.

You may run ntfsfix on an NTFS volume if you think it was damaged by Windows or some other way and it cannot be mounted. - https://linux.die.net/man/8/ntfsfix

  • thanks. I will delete the fat32 partition and restore the NTFS filesystem back to its original size, then try ntfsfix one more time. If that doesn't work I will format the single partition and start afresh. – MyWrathAcademia Jun 5 '18 at 17:49
  • I tried windows chkdsk /r /f won't even attempt to fix it, the process aborts. I'm trying option 1 now but the device is being initialised with zeroes so can't won't know for some time. – MyWrathAcademia Jun 5 '18 at 19:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.