1

Topic: [Solved] Trying to check my corrupted dual-booted Windows 10 partition

I tried to check my Windows 10 partition because it corrupted when I dual-booted my Windows 10 with Endeavour, but it just gave me the following error:

GParted 1.3.1

configuration --enable-libparted-dmraid --enable-online-resize

libparted 3.4

========================================
Device:    /dev/sda
Model:    ATA TOSHIBA MQ01ABF0
Serial:    97TLT5LYT
Sector size:    512
Total sectors:    976773168
 
Heads:    255
Sectors/track:    2
Cylinders:    1915241
 
Partition table:    gpt
 
Partition    Type    Start    End    Flags    Partition Name    File System    Label    Mount Point
/dev/sda1    Primary    2048    1023999    hidden, diag    Basic data partition    ntfs    Recovery    
/dev/sda2    Primary    1024000    1228799    boot, esp    EFI system partition    fat32        
/dev/sda3    Primary    1228800    1261567    msftres    Microsoft reserved partition    unknown        
/dev/sda4    Primary    1261568    651020287    msftdata    Basic data partition    ntfs        
/dev/sda8    Primary    651020288    659304447    swap        linux-swap        
/dev/sda6    Primary    659304448    660942847    boot, esp        fat32        /boot/efi
/dev/sda7    Primary    660942848    975628287            ext4        /
/dev/sda5    Primary    975628288    976771071    hidden, diag        ntfs        

========================================
Check and repair file system (ntfs) on /dev/sda4  00:00:03    ( ERROR )
         
calibrate /dev/sda4  00:00:03    ( SUCCESS )
         
path: /dev/sda4 (partition)
start: 1261568
end: 651020287
size: 649758720 (309.83 GiB)
check file system on /dev/sda4 for errors and (if possible) fix them  00:00:00    ( ERROR )
         
ntfsresize -i -f -v '/dev/sda4'  00:00:00    ( ERROR )
         
ntfsresize v2017.3.23 (libntfs-3g)
Failed to read last sector (869509111): 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).
ERROR(22): Opening '/dev/sda4' as NTFS failed: Invalid argument
The device '/dev/sda4' doesn't have a valid NTFS.
Maybe you selected the wrong partition? Or the whole disk instead of a
partition (e.g. /dev/hda, not /dev/hda1)? This error might also occur
if the disk was incorrectly repartitioned (see the ntfsresize FAQ).

I also tried "Attempt Data Rescue" but it just gave me

No file systems found on /dev/sda
The disk scan by gpart did not find any recognizable file systems on the disk.


I'm new to Linux and I don't know what to do.

2

Re: [Solved] Trying to check my corrupted dual-booted Windows 10 partition

The best tools to check and repair ntfs filesystems are those of ms windows. As ntfs specification is is closed source, it isn't obvious to make open source tools for such tasks. That's why it is often recommended to make a "recovery cd/dvd" just after o.s. installation. From that disc you can boot the computer and perform some basic checks. If you don't have a recovery disc from your own installation you can perhaps use any similar disc from another installation of the same o.s. version.

Before attempting any partitioning related operation you have to fully shut down the o.s., no just go to "sleep" or "hibernate" mode, otherwise filesystem corruption can occur. GParted doesn't proceed to any risky operation if it detects that the filesystem isn't healthy.

Another thing you could try is the testdisk software (https://www.cgsecurity.org/wiki/TestDisk). This software is contained in the GParted live media as well as in its own live disc from its official web site. Often it is able to analyse and repair broken / corrupted partition table data and partition boot sector data.

*** It is highly recommended to backup any important files before doing resize/move operations. ***

3

Re: [Solved] Trying to check my corrupted dual-booted Windows 10 partition

The NTFS file system thinks it is larger that it's partition.

ntfsresize v2017.3.23 (libntfs-3g)
Failed to read last sector (869509111): Invalid argument

Do you know how this might have come about?  Have you done any file system / partition resizing?  What tool did you use?  Where they apparently successful?

Run this query command:

sudo ntfsresize --info --force /dev/sda4

4 (edited by skullnoober 2021-10-26 06:24:02)

Re: [Solved] Trying to check my corrupted dual-booted Windows 10 partition

mfleetwo wrote:

The NTFS file system thinks it is larger that it's partition.

ntfsresize v2017.3.23 (libntfs-3g)
Failed to read last sector (869509111): Invalid argument

Do you know how this might have come about?  Have you done any file system / partition resizing?  What tool did you use?  Where they apparently successful?

Run this query command:

sudo ntfsresize --info --force /dev/sda4

Yeah, I tried shrinking the windows 10 partition to give endeavour os more space, but before, I checked how much space it had to know how much space to keep for it, also I only formatted the previous os root partition (manjaro) and the 800 mb fat32 partition that i made for dual booting, all of this was made in the installation's tool to resize and do these things, the endeavour partition was successful, but apparently the windows 10 one wasn't.
Edit: Ran the command you suggested above, and obtained these results:

ntfsresize v2021.8.22 (libntfs-3g)
Failed to read last sector (869509111): 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).
ERROR(22): Opening '/dev/sda4' as NTFS failed: Invalid argument
The device '/dev/sda4' doesn't have a valid NTFS.
Maybe you selected the wrong partition? Or the whole disk instead of a
partition (e.g. /dev/hda, not /dev/hda1)? This error might also occur
if the disk was incorrectly repartitioned (see the ntfsresize FAQ).

5

Re: [Solved] Trying to check my corrupted dual-booted Windows 10 partition

class413 wrote:

The best tools to check and repair ntfs filesystems are those of ms windows. As ntfs specification is is closed source, it isn't obvious to make open source tools for such tasks. That's why it is often recommended to make a "recovery cd/dvd" just after o.s. installation. From that disc you can boot the computer and perform some basic checks. If you don't have a recovery disc from your own installation you can perhaps use any similar disc from another installation of the same o.s. version.

Before attempting any partitioning related operation you have to fully shut down the o.s., no just go to "sleep" or "hibernate" mode, otherwise filesystem corruption can occur. GParted doesn't proceed to any risky operation if it detects that the filesystem isn't healthy.

Another thing you could try is the testdisk software (https://www.cgsecurity.org/wiki/TestDisk). This software is contained in the GParted live media as well as in its own live disc from its official web site. Often it is able to analyse and repair broken / corrupted partition table data and partition boot sector data.

Does the Windows 10 iso work? I heard that it works, but I'm still unsure. If that fails, I'll try the testdisk software.

6

Re: [Solved] Trying to check my corrupted dual-booted Windows 10 partition

Try this to attempt to fix it:

sudo ntfsfix /dev/sda4

References:
1. How to fix a damaged/corrupted NTFS filesystem/partition without losing the data on it
2. Unable to mount NTFS Partition after resizing - "Failed to read last sector"
3. Unable to Mount NTFS Partition [solved]
4. Failed to read last sector (xxxxxxxxx): Invalid argument

7

Re: [Solved] Trying to check my corrupted dual-booted Windows 10 partition

Update: I think the Windows 10 iso is corrupted, because neither Etcher nor WoeUSB were able to flash it. I ran

sudo ntfsfix dev/sda4

and hete is what I got:

Failed to determine whether dev/sda4 is mounted: No such file or directory
Mounting volume... Failed to access 'dev/sda4': No such file or directory
Error opening 'dev/sda4': No such file or directory
FAILED
Failed to startup volume: No such file or directory
Failed to access 'dev/sda4': No such file or directory
Error opening 'dev/sda4': No such file or directory
Volume id corrupt. You should run chkdsk.

8

Re: [Solved] Trying to check my corrupted dual-booted Windows 10 partition

Update: Ran the following command:

sudo ntfsfix -d /dev/sda4

It gave a good result, and i restarted, it wanted me to check the disc or skip it, so I let it scan it, and it did its business and sent me back to the automatic repair, what now? Is there anything else that I can do with the ntfsfix command?

9

Re: [Solved] Trying to check my corrupted dual-booted Windows 10 partition

You accidentally missed "/" in front of "dev".

10

Re: [Solved] Trying to check my corrupted dual-booted Windows 10 partition

mfleetwo wrote:

You accidentally missed "/" in front of "dev".

Ah, damn, yeah thats why it didnt work, i tried it the first time like the above and i booted back to windows it was checking my drive and then it sent me back to the automatic repair, I then did it again, as you suggested, and it worked like a miracle, thank you so much!