Cannot write to disk (sector mismatches 4096 (FAT) != 512 (HD))

How to use TestDisk to recover lost partition
Forum rules
When asking for technical support:
- Search for posts on the same topic before posting a new question.
- Give clear, specific information in the title of your post.
- Include as many details as you can, MOST POSTS WILL GET ONLY ONE OR TWO ANSWERS.
- Post a follow up with a "Thank you" or "This worked!"
- When you learn something, use that knowledge to HELP ANOTHER USER LATER.
Before posting, please read https://www.cgsecurity.org/testdisk.pdf
Locked
Message
Author
AleXSR700
Posts: 3
Joined: 10 Aug 2021, 19:01
Location: Germany

Cannot write to disk (sector mismatches 4096 (FAT) != 512 (HD))

#1 Post by AleXSR700 »

Hello everyone,
I was using an SSD with a Raspberry Pi and it suddenly stopped working.
I had some concerns with the case I was using as it was showing a block size of 4096 although I was pretty sure the drive was 512. Anyhow, it worked and worked and now, suddenly, no more.

I replaced the case with a StarTech USB3S2SAT3CB adapter and want to get my drive up and running again- Restoring data would be great, getting the drive to work is more important though.

I ran Testdisk and it seems to recognize everything but I cannot write. I had also tried fdisk from a Knoppix Live DVD which also could not write any changes.

Can anybody help me get the drive up and running again? As I said, if the only way, I don't mind destroying all data just to be able to use the drive again.

Thank you very much :)
Alex


Here is the log

Code: Select all


Tue Aug 10 19:55:29 2021
Command line: TestDisk

TestDisk 7.2-WIP, Data Recovery Utility, May 2021
Christophe GRENIER <grenier@cgsecurity.org>
https://www.cgsecurity.org
OS: Windows 8 (9200)
Compiler: GCC 9.3, Cygwin32 3001.4
ext2fs lib: 1.45.3, ntfs lib: 10:0:0, reiserfs lib: none, ewf lib: 20140608, curses lib: ncurses 6.1
disk_get_size_win32 IOCTL_DISK_GET_LENGTH_INFO(\\.\PhysicalDrive0)=1000204886016
disk_get_size_win32 IOCTL_DISK_GET_LENGTH_INFO(\\.\PhysicalDrive1)=256060514304
disk_get_size_win32 IOCTL_DISK_GET_LENGTH_INFO(\\.\C:)=1000150663168
filewin32_getfilesize(\\.\D:) GetFileSize err Incorrect function.

filewin32_setfilepointer(\\.\D:) SetFilePointer err Incorrect function.

Warning: can't get size for \\.\D:
disk_get_size_win32 IOCTL_DISK_GET_LENGTH_INFO(\\.\E:)=33554432
Hard disk list
Disk \\.\PhysicalDrive0 - 1000 GB / 931 GiB - CHS 121601 255 63, sector size=512 - SanDisk SDSSDH3 1T00, S/N:20513V803898, FW:415000RL
Disk \\.\PhysicalDrive1 - 256 GB / 238 GiB - CHS 31130 255 63, sector size=512 - ASMT ASM105x, S/N:B0CD87654321

Partition table type (auto): Intel
Disk \\.\PhysicalDrive1 - 256 GB / 238 GiB - ASMT ASM105x
Partition table type: Intel

Analyse Disk \\.\PhysicalDrive1 - 256 GB / 238 GiB - CHS 31130 255 63
Geometry from i386 MBR: head=25 sector=20


test_FAT()
 1 P FAT32 LBA                0   4  5     4  24 20      65536
sector_size  0
cluster_size 0
reserved     0
fats         0
dir_entries  0
sectors      0
media        00
fat_length   0
secs_track   0
heads        0
hidden       0
total_sect   0
check_part_i386 failed for partition type 0C
check_part_i386 2 type EE: no test
Current partition structure:
Invalid FAT boot sector
 1 P FAT32 LBA                0   4  5     4  24 20      65536
 1 P FAT32 LBA                0   4  5     4  24 20      65536
 2 P EFI GPT                  0   0  2     0   4  4        255
No partition is bootable

search_part()
Disk \\.\PhysicalDrive1 - 256 GB / 238 GiB - CHS 31130 255 63
check_FAT: number of bytes per sector mismatches 4096 (FAT) != 512 (HD)

block_group_nr 1

recover_EXT2: "e2fsck -b 32768 -B 4096 device" may be needed
recover_EXT2: s_block_group_nr=1/1907, s_mnt_count=0/4294967295, s_blocks_per_group=32768, s_inodes_per_group=8192
recover_EXT2: s_blocksize=4096
recover_EXT2: s_blocks_count 62514432
recover_EXT2: part_size 500115456
Filesystem created: Wed May 19 09:04:42 2021
     Linux                    0  32 33 31130 223  5  500115456
     ext4 blocksize=4096 Large_file Sparse_SB Backup_SB, 256 GB / 238 GiB
file_win32_pread(604,8,buffer,500117704(31130/226/17)) read err: read after end of file
file_win32_pread(604,11,buffer,500117751(31130/227/1)) read err: read after end of file
file_win32_pread(604,6,buffer,500117762(31130/227/12)) read err: read after end of file
file_win32_pread(604,8,buffer,500117888(31130/229/12)) read err: read after end of file
file_win32_pread(604,8,buffer,500118016(31130/231/14)) read err: read after end of file
file_win32_pread(604,8,buffer,500118144(31130/233/16)) read err: read after end of file

Results
   * Linux                    0  32 33 31130 223  5  500115456
     ext4 blocksize=4096 Large_file Sparse_SB Backup_SB, 256 GB / 238 GiB
file_win32_pread(604,2,buffer,264192(16/113/34)) read err: read after end of file

   * Linux                    0  32 33 31130 223  5  500115456
     ext4 blocksize=4096 Large_file Sparse_SB Backup_SB, 256 GB / 238 GiB
Can't open filesystem. Filesystem seems damaged.
Can't open backup.log file: No such file or directory
interface_load

interface_write()
 1 * Linux                    0  32 33 31130 223  5  500115456
Change partition type:
   * Linux                    0  32 33 31130 223  5  500115456
     ext4 blocksize=4096 Large_file Sparse_SB Backup_SB, 256 GB / 238 GiB
Change partition type:
   * FAT32                    0  32 33 31130 223  5  500115456
     ext4 blocksize=4096 Large_file Sparse_SB Backup_SB, 256 GB / 238 GiB

interface_write()
 1 * Linux                    0  32 33 31130 223  5  500115456
write!

write_mbr_i386: starting...
file_win32_pread(604,1,buffer,0(0/0/1)) read err: read after end of file

Partition: Read error
Store new MBR code
file_win32_pwrite(604,1,buffer,0(0/0/1)) write err
write_all_log_i386: starting...
No extended partition

Partition: Write error

Interface Advanced
file_win32_pread(604,1,buffer,0(0/0/1)) read err: read after end of file
New options :
 Dump : No
 Align partition: Yes
 Expert mode : No

Partition: Read error
file_win32_pwrite(604,1,buffer,0(0/0/1)) write err
Write error: Can't write new MBR code.
file_win32_pread(604,1,buffer,0(0/0/1)) read err: read after end of file

Partition: Read error
file_win32_pwrite(604,1,buffer,0(0/0/1)) write err
Write error: Can't clear partition table.

TestDisk exited normally.

recuperation
Posts: 2721
Joined: 04 Jan 2019, 09:48
Location: Hannover, Deutschland (Germany, Allemagne)

Re: Cannot write to disk (sector mismatches 4096 (FAT) != 512 (HD))

#2 Post by recuperation »

When looking at the read and write errors in the log file I assume your SSD is at least partly broken.
Please post your SMART parameters. Extraction is described here:

viewtopic.php?f=5&t=10910

AleXSR700
Posts: 3
Joined: 10 Aug 2021, 19:01
Location: Germany

Re: Cannot write to disk (sector mismatches 4096 (FAT) != 512 (HD))

#3 Post by AleXSR700 »

Good morning,

I apologize for the late reply. I was away fro work for a few days and could not check remotely.

I attached the two files created.

Again, thank you for your help :)

Alex
Attachments
myreport2.txt
(5.47 KiB) Downloaded 221 times
myreport.txt
(5.47 KiB) Downloaded 202 times

recuperation
Posts: 2721
Joined: 04 Jan 2019, 09:48
Location: Hannover, Deutschland (Germany, Allemagne)

Re: Cannot write to disk (sector mismatches 4096 (FAT) != 512 (HD))

#4 Post by recuperation »

I can't see something extraordinary in the log file.
With 42 sectors being reallocated I can't tell if that error matters in case of using a SSD, too.

Run a self-test and open a case with your manufacturer.

AleXSR700
Posts: 3
Joined: 10 Aug 2021, 19:01
Location: Germany

Re: Cannot write to disk (sector mismatches 4096 (FAT) != 512 (HD))

#5 Post by AleXSR700 »

How do I run a self-test or what do you mean by that?

The manufacturer does not seem to care. No warranty left, no support. Send it in or dump it. -.-

recuperation
Posts: 2721
Joined: 04 Jan 2019, 09:48
Location: Hannover, Deutschland (Germany, Allemagne)

Re: Cannot write to disk (sector mismatches 4096 (FAT) != 512 (HD))

#6 Post by recuperation »

You would run smartmontools and start a device selftest with the -t parameter

https://linux.die.net/man/8/smartctl

A short introduction to smartmontools can be found here:

viewtopic.php?f=5&t=10910

Locked