1

Topic: Lost filesystem after shrinking NTFS partition

I have Fedora 3.14.27-100.fc19.x86_64 and GParted 0.18.0. I used GParted to shrink an NTFS partition a few gigabytes on a 40 GB WD hard drive. Then I booted in to Windows 7 and found the filesystem or partition is gone. Windows wanted me to format the HDD. I declined. I started CHKDSK for a few seconds then realized that's probably a bad plan and pressed Ctrl+C to stop it. What did GParted do? I need the files on the drive. Is there a way to fix the problem? When I try to access the filesystem on the drive in Fedora I get the following error message:

Error mounting /dev/sdc1 at /run/media/User1/DC3C0C393C0C10E6: Command-line `mount -t "ntfs" -o "uhelper=udisks2,nodev,nosuid,uid=1000,gid=1000,dmask=0077,fmask=0177" "/dev/sdc1" "/run/media/User1/DC3C0C393C0C10E6"' exited with non-zero exit status 18: Failed to open ntfs attribute: No such file or directory
Failed to load $MFT: No such file or directory
Failed to mount '/dev/sdc1': No such file or directory

2

Re: Lost filesystem after shrinking NTFS partition

How did you shrink the partition?

Did you shrink the end of the partition to the left?
Or did you move the start of the partition to the right?

In either case if GParted was permitted to complete then the NTFS file system on the partition should have been in good shape.  In the latter case if the start of the partition was moved then the Windows boot code may have needed repair.

You might try booting using the latest GParted Live to see if it can recognize your NTFS partition.

3

Re: Lost filesystem after shrinking NTFS partition

I shrank the partition from the end. The drive was bootable but I don't need it to boot any more. I do need the files from it.
I updated to Fedora 4.6.3-300.fc24.x86_64 and GParted 0.26.1. I still have the same problem. GParted shows there is a partition and the partition is the size I wanted- a few GB smaller. However, GParted won't do anything more with the partition. Even a check and repair operation fails.


========================================
GParted 0.26.1 --enable-libparted-dmraid --enable-online-resize

Libparted 3.2

Check and repair file system (ntfs) on /dev/sda1  00:00:01    ( ERROR )
       
calibrate /dev/sda1  00:00:01    ( SUCCESS )
       
path: /dev/sda1 (partition)
start: 2048
end: 72355839
size: 72353792 (34.50 GiB)

check file system on /dev/sda1 for errors and (if possible) fix them  00:00:00    ( ERROR )
       
ntfsresize -i -f -v /dev/sda1  00:00:00    ( ERROR )
       
ntfsresize v2016.2.22 (libntfs-3g)
Failed to open ntfs attribute: No such file or directory
Failed to load $MFT: No such file or directory
ERROR(2): Opening '/dev/sda1' as NTFS failed: No such file or directory
========================================


If I try to select the drive in Fedora's File Manager I get this error:

Error mounting /dev/sda1 at /run/media/User1/DC3C0C393C0C10E6:
Command-line `mount -t "ntfs" -o
"uhelper=udisks2,nodev,nosuid,uid=1000,gid=1000" "/dev/sda1" "/run/
media/User1/DC3C0C393C0C10E6"' exited with non-zero exit status
18: Failed to open ntfs attribute: No such file or directory
Failed to load $MFT: No such file or directory
Failed to mount '/dev/sda1': No such file or directory

4

Re: Lost filesystem after shrinking NTFS partition

You might try using photorec to scan the disk surface looking for files it recognizes to recover.  Please note that this tool does not maintain filenames or directory structure so it will be a tedious process.

Alternatively since you already started and cancelled CHKDSK, you might consider running it to it's conclusion.  In the current state the file system is broken.

If you wish to preserve the ability to recover as many files as possible, then I highly recommend making an image copy of the drive before attempting the recovery process.  That way you can always go back to the current state and try again.