2

I'm using Fedora.

I don't know why my NTFS (/dev/sda3) partition is changed to "Unknown". I can't read this partition. My important files are located in there and I have to change it back to ntfs without losing data. enter image description here Any helps would be great appreciated.

P.S:

I think this problem occurred since I reformatted /boot/efi partition in /dev/sda1

UPDATE

I also tried to READ-ONLY /dev/sda3 :

sudo mount -r -t ntfs-3g /dev/sda3 /mnt/ -o force

But it returns this error :

NTFS signature is missing.
Failed to mount '/dev/sda3': Invalid argument
The device '/dev/sda3' 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?

UPDATE 2

I also ran test disk :

sudo testdisk /dev/sda3

And testdisk says :

Partition sector doesn't have the endmark 0xAA55

And after testdisk Analyse :

The following partition can't be recovered:
     Partition               Start        End    Size in sectors
>  HPFS - NTFS          31779 193 31 47669  65 12  255264768

3 Answers3

1

My important files are located in there and I have to change it back to ntfs without losing data.

Safer approach is to try recover the data without changing anything on the 'patient'.

NTFS (or another file system) switching to unknown or RAW can be caused by several things, some times in-place repair is possible but it is always more risky than recovering the data by copying it to another drive.

  • To mount a partition's file system we need correct offset to boot block so if partition table points to wrong sector file system may be seen as RAW. This is potentially fixable provided boot sector and file system are intact.

  • Then boot block needs to be intact and point to file system structures correctly. This is potentially fixable provided the file system itself is intact.

  • The file system meta data itself needs to be intact. If partition table is pointing to correct location and boot block to MFT (as we're dealing with NTFS) but MFT is corrupt file system will be seen as RAW by Windows.

Partition sector doesn't have the endmark 0xAA55

Last two bytes in partition table and boot block should be 0x55AA or depending on direction in which you want to read 0xAA55. If they're not it's an indication the structure is corrupt although theoretically it could be just those two bytes I suppose.

Safer approach (vs. in situ repair)

Best solution IMO is recover data by copying to another drive. An example of an inexpensive tool that can be used for this is DMDE. In case file system meta data is slightly corrupted you may need to only select the partition and click 'open volume'.

0

Force NTFS Read-Only Mount

Perhaps you can try forcibly mounting the partition as ntfs in read-only mode?

mount -r -t ntfs-3g /dev/sda3 /media/mymounteddrive -o force

-1

This solution is for an older version of Linux, but the same concept should translate to the same method that can be applied to newer versions as well.

However, from my understanding, it may have been possible that the Master Boot Record has been overwritten or corrupted in some kind of way.

If you have the ability to do so, first attempt to try and restore the MBR through Linux.

However, this could possibly be easily fixed by using >sfdisk

sfdisk /dev/sda -i -c 1 07

You may also want to use TestDisk to detect any issues

For Fedora specifically the following steps may help.

With Fedora CD Boot your computer with the first CD of Fedora in your CD drive (You have to enable your PC to boot from the cdrom, which you can set in the BIOS settings). At the installation boot prompt that you get, enter the following command:

boot: linux rescue

Press Enter. The installer will ask you a few questions like the language you would like to use, the type of keyboard etc. Then, if you have linux previously installed on your machine, the Fedora installer will automatically detect it and mount it in the /mnt/sysimage directory. Once the linux partition is mounted, you are dropped into the command shell prompt. The next step is to make your newly mounted directory the root (or parent) directory. This you do by running the chroot command as follows:

# chroot /mnt/sysimage
# _

Make sure to restore GRUB:

# grub-install /dev/hda