Gparted partition resize gone wrong - failed to read last sector
Solution 1
After few minutes of digging I have found this guide which uses ntfs-3g
package to recover broken ntfs partition.
Great tool! I can recommend it to everyone.
Solution 2
This did the job for me:
sudo ntfsfix /dev/sda1
Where sda1 is the NTFS partition with the issue.
After that command and next restart into windows, it will check the disk and things will work fine again.
Related videos on Youtube
Patryk
Software Engineer C++/Go/shell/python coder Linux enthusiast Github profiles: https://github.com/pmalek https://github.com/pmalekn
Updated on September 18, 2022Comments
-
Patryk over 1 year
I have tried to resize (shrink) my NTFS partition so that I will be able to get more space for my
ext4
Ubuntu's (12.04 64 bit) partition but after the partition has been resized I am unable to mount it. I used Gparted to do this.I assume there is a problem somewhere with the partition table but I do not know where and how to fix it.
This is what I get in Gparted information window on NTFS partition:
GParted overview screenshot
fdisk -l
andmount /dev/sda5 /media/d
root@UBUNTU:/home/XXX# mount /dev/sda5 /media/d Failed to read last sector (718198764): 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 to mount '/dev/sda5': Invalid argument The device '/dev/sda5' doesn't seem to have a valid NTFS. Maybe the wrong device is used? Or the whole disk instead of a partition (e.g. /dev/sda, not /dev/sda1)? Or the other way around? root@UBUNTU:/home/XXX# fdisk -l Disk /dev/sda: 500.1 GB, 500107862016 bytes 255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x68beefda Device Boot Start End Blocks Id System /dev/sda1 19 27262991 13631486+ 27 Hidden NTFS WinRE /dev/sda2 * 27262992 27467791 102400 7 HPFS/NTFS/exFAT /dev/sda3 27467792 232267775 102399992 7 HPFS/NTFS/exFAT /dev/sda4 232267793 976771071 372251639+ f W95 Ext'd (LBA) /dev/sda5 232267795 918867967 343300086+ 7 HPFS/NTFS/exFAT /dev/sda6 968046592 976771071 4362240 82 Linux swap / Solaris /dev/sda7 950468608 968044543 8787968 83 Linux Partition table entries are not in disk order
-
Matthew Lock almost 9 yearsGreat! ntfsfix seems to at least get my Windows partition booted into chkdsk and is now busy trying to fix the disk.
-
frakman1 over 3 yearsThis worked for me on UNRAID that uses slackware when I tried to mount a Windows drive. The command I used to mount was
mount -t ntfs-3g -o fmask=133,dmask=022,gid=users,uid=1000 /dev/sdg1 /mnt/disks/2TB_SATA