Trying to repair the boot sector on SanDisk sd card

Using TestDisk to repair the filesystem
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
applegatetech
Posts: 1
Joined: 06 Mar 2023, 04:56

Trying to repair the boot sector on SanDisk sd card

#1 Post by applegatetech »

I have sandisk 32 GB sd card that will not format.
When I select analyze I get this error.

check_FAT: Unusual media descriptor (0xf0!=0xf8) Warning: number of heads/cylinder mismatches 4 (FAT) != 255 (HD) Warning: number of sectors per track mismatches 16 (FAT) != 63 (HD) 1 * FAT32 LBA 0 32 33 3880 27 51 62331904 [NO NAME] Warning: Bad starting head (CHS and LBA don't match)

I tried Advanced ~ Boot ~ org.bs then rebuild bs and both failed with Write error: Can't overwrite FAT32 backup boot sector
Is this fixable?
Thanks

This is my log

Code: Select all

Sun Mar  5 18:15:33 2023
Command line: TestDisk

TestDisk 7.2-WIP, Data Recovery Utility, February 2023
Christophe GRENIER <grenier@cgsecurity.org>
https://www.cgsecurity.org
OS: Windows 8 (9200)
Compiler: GCC 11.2, Cygwin 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)=120034123776
disk_get_size_win32 IOCTL_DISK_GET_LENGTH_INFO(\\.\PhysicalDrive1)=31914983424
disk_get_size_win32 IOCTL_DISK_GET_LENGTH_INFO(\\.\C:)=59843280896
disk_get_size_win32 IOCTL_DISK_GET_LENGTH_INFO(\\.\D:)=31913934848
Hard disk list
Disk \\.\PhysicalDrive0 - 120 GB / 111 GiB - CHS 14593 255 63, sector size=512 - PNY CS900 120GB SSD, S/N:PNY21112103080100A20, FW:CS900613
Disk \\.\PhysicalDrive1 - 31 GB / 29 GiB - CHS 3880 255 63, sector size=512 - Realtek PCIE Card Reader, FW:1.00

Partition table type (auto): Intel
Disk \\.\PhysicalDrive1 - 31 GB / 29 GiB - Realtek PCIE Card Reader
Partition table type: Intel

Analyse Disk \\.\PhysicalDrive1 - 31 GB / 29 GiB - CHS 3880 255 63
Geometry from i386 MBR: head=256 sector=63
BAD_RS LBA=2048 16450622
FAT32 at 0/32/33
check_FAT: Unusual media descriptor (0xf0!=0xf8)
Info: size boot_sector 62331904, partition 62331904
FAT1 : 80-7687
FAT2 : 7688-15295
start_rootdir : 15296 root cluster : 2
Data : 15296-62331903
sectors : 62331904
cluster_size : 64
no_of_cluster : 973697 (2 - 973698)
fat_length 7608 calculated 7608
heads/cylinder 4 (FAT) != 255 (HD)
sect/track 16 (FAT) != 63 (HD)
set_FAT_info: name from BS used
Current partition structure:
check_FAT: Unusual media descriptor (0xf0!=0xf8)
Warning: number of heads/cylinder mismatches 4 (FAT) != 255 (HD)
Warning: number of sectors per track mismatches 16 (FAT) != 63 (HD)
 1 * FAT32 LBA                0  32 33  3880  27 51   62331904 [NO NAME]

Warning: Bad starting head (CHS and LBA don't match)

search_part()
Disk \\.\PhysicalDrive1 - 31 GB / 29 GiB - CHS 3880 255 63
FAT32 at 0/32/33
check_FAT: Unusual media descriptor (0xf0!=0xf8)
FAT1 : 80-7687
FAT2 : 7688-15295
start_rootdir : 15296 root cluster : 2
Data : 15296-62331903
sectors : 62331904
cluster_size : 64
no_of_cluster : 973697 (2 - 973698)
fat_length 7608 calculated 7608
heads/cylinder 4 (FAT) != 255 (HD)
sect/track 16 (FAT) != 63 (HD)
set_FAT_info: name from BS used

FAT32 at 0/32/33
FAT: cluster=2(0x2), pos=17344
     FAT32 LBA                0  32 33  3880  27 51   62331904 [NO NAME]
     FAT32, blocksize=32768, 31 GB / 29 GiB

Results
   * FAT32 LBA                0  32 33  3880  44  4   62332928 [NO NAME]
     FAT32, blocksize=32768, 31 GB / 29 GiB

interface_write()
 1 * FAT32 LBA                0  32 33  3880  44  4   62332928 [NO NAME]
write!

write_mbr_i386: starting...
write_all_log_i386: starting...
No extended partition
You will have to reboot for the change to take effect.

Interface Advanced
Geometry from i386 MBR: head=256 sector=63
BAD_RS LBA=2048 16450622
FAT32 at 0/32/33
check_FAT: Unusual media descriptor (0xf0!=0xf8)
Info: size boot_sector 62331904, partition 62331904
FAT1 : 80-7687
FAT2 : 7688-15295
start_rootdir : 15296 root cluster : 2
Data : 15296-62331903
sectors : 62331904
cluster_size : 64
no_of_cluster : 973697 (2 - 973698)
fat_length 7608 calculated 7608
heads/cylinder 4 (FAT) != 255 (HD)
sect/track 16 (FAT) != 63 (HD)
set_FAT_info: name from BS used
 1 * FAT32 LBA                0  32 33  3880  27 51   62331904 [NO NAME]
     FAT32, blocksize=32768, 31 GB / 29 GiB

fat32_boot_sector
 1 * FAT32 LBA                0  32 33  3880  27 51   62331904 [NO NAME]
     FAT32, blocksize=32768, 31 GB / 29 GiB
FAT32 at 0/32/33
check_FAT: Unusual media descriptor (0xf0!=0xf8)
Info: size boot_sector 62331904, partition 62331904
FAT1 : 80-7687
FAT2 : 7688-15295
start_rootdir : 15296 root cluster : 2
Data : 15296-62331903
sectors : 62331904
cluster_size : 64
no_of_cluster : 973697 (2 - 973698)
fat_length 7608 calculated 7608
heads/cylinder 4 (FAT) != 255 (HD)
sect/track 16 (FAT) != 63 (HD)
Boot sector
check_FAT: Unusual media descriptor (0xf0!=0xf8)
Warning: number of heads/cylinder mismatches 4 (FAT) != 255 (HD)
Warning: number of sectors per track mismatches 16 (FAT) != 63 (HD)
OK

Backup boot sector
Bad

First sectors (boot code and partition information) are not identical.
Second sectors (cluster information) are not identical.
Third sectors (second part of boot code) are not identical.

A valid FAT Boot sector must be present in order to access
any data; even if the partition is not bootable.
copy original boot sector over backup boot
file_win32_pwrite(544,3,buffer,2054(0/32/39)) write err
Write error: Can't overwrite FAT32 backup boot sector

fat32_boot_sector
 1 * FAT32 LBA                0  32 33  3880  27 51   62331904 [NO NAME]
     FAT32, blocksize=32768, 31 GB / 29 GiB
FAT32 at 0/32/33
check_FAT: Unusual media descriptor (0xf0!=0xf8)
Info: size boot_sector 62331904, partition 62331904
FAT1 : 80-7687
FAT2 : 7688-15295
start_rootdir : 15296 root cluster : 2
Data : 15296-62331903
sectors : 62331904
cluster_size : 64
no_of_cluster : 973697 (2 - 973698)
fat_length 7608 calculated 7608
heads/cylinder 4 (FAT) != 255 (HD)
sect/track 16 (FAT) != 63 (HD)
Boot sector
check_FAT: Unusual media descriptor (0xf0!=0xf8)
Warning: number of heads/cylinder mismatches 4 (FAT) != 255 (HD)
Warning: number of sectors per track mismatches 16 (FAT) != 63 (HD)
OK

Backup boot sector
Bad

First sectors (boot code and partition information) are not identical.
Second sectors (cluster information) are not identical.
Third sectors (second part of boot code) are not identical.

A valid FAT Boot sector must be present in order to access
any data; even if the partition is not bootable.

 1 * FAT32 LBA                0  32 33  3880  27 51   62331904 [NO NAME]
     FAT32, blocksize=32768, 31 GB / 29 GiB
rebuild_FAT_BS p_fat12 0, p_fat16 0, p_fat32 1
fat_find_type(max_offset=487032, p_fat12=0, p_fat16=0, p_fat32=1, debug=1, dump_ind=0)
file_win32_pread(544,16,buffer,69734(4/86/57)) read err: read after end of file
file_win32_pread(544,16,buffer,69735(4/86/58)) read err: read after end of file
file_win32_pread(544,16,buffer,69736(4/86/59)) read err: read after end of file
file_win32_pread(544,16,buffer,69737(4/86/60)) read err: read after end of file
file_win32_pread(544,16,buffer,69738(4/86/61)) read err: read after end of file
file_win32_pread(544,16,buffer,69739(4/86/62)) read err: read after end of file
file_win32_pread(544,16,buffer,69740(4/86/63)) read err: read after end of file
file_win32_pread(544,16,buffer,69741(4/87/1)) read err: read after end of file
file_win32_pread(544,16,buffer,69742(4/87/2)) read err: read after end of file
file_win32_pread(544,16,buffer,69743(4/87/3)) read err: read after end of file
file_win32_pread(544,16,buffer,69744(4/87/4)) read err: read after end of file
file_win32_pread(544,1,buffer,69744(4/87/4)) read err: read after end of file
file_win32_pread(544,1,buffer,69745(4/87/5)) read err: read after end of file
file_win32_pread(544,1,buffer,69746(4/87/6)) read err: read after end of file
file_win32_pread(544,1,buffer,69747(4/87/7)) read err: read after end of file
file_win32_pread(544,16,buffer,317477(19/194/21)) read err: read after end of file
file_win32_pread(544,16,buffer,318630(19/212/40)) read err: read after end of file
file_win32_pread(544,16,buffer,318631(19/212/41)) read err: read after end of file
file_win32_pread(544,16,buffer,318632(19/212/42)) read err: read after end of file
file_win32_pread(544,1,buffer,318632(19/212/42)) read err: read after end of file
file_win32_pread(544,1,buffer,318633(19/212/43)) read err: read after end of file
file_win32_pread(544,1,buffer,318634(19/212/44)) read err: read after end of file
file_win32_pread(544,1,buffer,318635(19/212/45)) read err: read after end of file
file_win32_pread(544,16,buffer,319837(19/231/50)) read err: read after end of file
file_win32_pread(544,16,buffer,319838(19/231/51)) read err: read after end of file
file_win32_pread(544,16,buffer,319839(19/231/52)) read err: read after end of file
file_win32_pread(544,16,buffer,319840(19/231/53)) read err: read after end of file
file_win32_pread(544,1,buffer,319840(19/231/53)) read err: read after end of file
file_win32_pread(544,1,buffer,319841(19/231/54)) read err: read after end of file
file_win32_pread(544,16,buffer,320915(19/248/57)) read err: read after end of file
file_win32_pread(544,16,buffer,320916(19/248/58)) read err: read after end of file
file_win32_pread(544,16,buffer,320917(19/248/59)) read err: read after end of file
file_win32_pread(544,16,buffer,320918(19/248/60)) read err: read after end of file
file_win32_pread(544,16,buffer,320919(19/248/61)) read err: read after end of file
file_win32_pread(544,16,buffer,320920(19/248/62)) read err: read after end of file
file_win32_pread(544,16,buffer,320921(19/248/63)) read err: read after end of file
file_win32_pread(544,16,buffer,320922(19/249/1)) read err: read after end of file
file_win32_pread(544,16,buffer,320923(19/249/2)) read err: read after end of file
file_win32_pread(544,16,buffer,320924(19/249/3)) read err: read after end of file
file_win32_pread(544,16,buffer,320925(19/249/4)) read err: read after end of file
file_win32_pread(544,16,buffer,320926(19/249/5)) read err: read after end of file
file_win32_pread(544,16,buffer,320927(19/249/6)) read err: read after end of file
file_win32_pread(544,16,buffer,320928(19/249/7)) read err: read after end of file
file_win32_pread(544,1,buffer,320928(19/249/7)) read err: read after end of file
file_win32_pread(544,1,buffer,320929(19/249/8)) read err: read after end of file
file_win32_pread(544,1,buffer,320930(19/249/9)) read err: read after end of file
file_win32_pread(544,1,buffer,320931(19/249/10)) read err: read after end of file
file_win32_pread(544,16,buffer,344885(21/119/24)) read err: read after end of file
file_win32_pread(544,16,buffer,344886(21/119/25)) read err: read after end of file
file_win32_pread(544,16,buffer,344887(21/119/26)) read err: read after end of file
file_win32_pread(544,16,buffer,353000(21/248/12)) read err: read after end of file
file_win32_pread(544,16,buffer,353001(21/248/13)) read err: read after end of file
file_win32_pread(544,16,buffer,353002(21/248/14)) read err: read after end of file
FAT32 at 80(0/33/50), nbr=1856
FAT32 at 109(0/34/16), nbr=1
FAT32 at 789(0/45/3), nbr=1
FAT32 at 790(0/45/4), nbr=1
FAT32 at 791(0/45/5), nbr=1
FAT32 at 1899(0/62/42), nbr=1
FAT32 at 1900(0/62/43), nbr=1
FAT32 at 1901(0/62/44), nbr=1
FAT32 at 1902(0/62/45), nbr=1
FAT32 at 1903(0/62/46), nbr=1
FAT32 at 7682(0/154/29), nbr=1
FAT32 at 7683(0/154/30), nbr=1
FAT32 at 7684(0/154/31), nbr=1
FAT32 at 7686(0/154/33), nbr=1
FAT32 at 7687(0/154/34), nbr=1
FAT32 at 7688(0/154/35), nbr=1856
FAT32 at 7717(0/155/1), nbr=1
FAT32 at 8397(0/165/51), nbr=1
FAT32 at 8398(0/165/52), nbr=1
FAT32 at 8399(0/165/53), nbr=1
FAT32 at 9507(0/183/27), nbr=1
FAT32 at 9508(0/183/28), nbr=1
FAT32 at 9509(0/183/29), nbr=1
FAT32 at 9510(0/183/30), nbr=1
FAT32 at 9511(0/183/31), nbr=1
FAT32 at 15290(1/20/14), nbr=1
FAT32 at 15291(1/20/15), nbr=1
FAT32 at 15292(1/20/16), nbr=1
FAT32 at 15294(1/20/18), nbr=1
FAT32 at 15295(1/20/19), nbr=1
first_fat 80, second_fat 7688
FAT : 32, reserved=80, fat_length=7608
sectors_per_cluster 64
next_free 11, free_count 773116
fat32_find_root_cluster(sectors_per_cluster=64,no_of_cluster=973697,reserved=80,fat_length=7608,expert=0,first_free_cluster=11)
cluster 2, etat=1, found=1,nb_subdir=5,nb_subdir_ok=5
prev cluster(2)=>0
             New / Current boot sector
FAT32
sector_size  512 512
cluster_size 64 64
reserved     80 80
fats         2 2
dir_entries  0 0
sectors      0 0
media        F8 F0
fat_length   0 0
secs_track   63 16
heads        255 4
hidden       2048 0
total_sect   62331904 62331904
fat32_length 7608 7608
flags        0000 0000
version      0.0  0.0
root_cluster 2 2
info_sector  1 1
backup_boot  6 2
free_count   uninitialised 773326
next_free    uninitialised 243
Extrapolated boot sector and current boot sector are different.
Write new boot!
file_win32_pwrite(544,3,buffer,2048(0/32/33)) write err
Write error: Can't write new FAT boot sector

 1 * FAT32 LBA                0  32 33  3880  27 51   62331904 [NO NAME]
     FAT32, blocksize=32768, 31 GB / 29 GiB

fat32_boot_sector
 1 * FAT32 LBA                0  32 33  3880  27 51   62331904 [NO NAME]
     FAT32, blocksize=32768, 31 GB / 29 GiB
FAT32 at 0/32/33
check_FAT: Unusual media descriptor (0xf0!=0xf8)
Info: size boot_sector 62331904, partition 62331904
FAT1 : 80-7687
FAT2 : 7688-15295
start_rootdir : 15296 root cluster : 2
Data : 15296-62331903
sectors : 62331904
cluster_size : 64
no_of_cluster : 973697 (2 - 973698)
fat_length 7608 calculated 7608
heads/cylinder 4 (FAT) != 255 (HD)
sect/track 16 (FAT) != 63 (HD)
Boot sector
check_FAT: Unusual media descriptor (0xf0!=0xf8)
Warning: number of heads/cylinder mismatches 4 (FAT) != 255 (HD)
Warning: number of sectors per track mismatches 16 (FAT) != 63 (HD)
OK

Backup boot sector
Bad

First sectors (boot code and partition information) are not identical.
Second sectors (cluster information) are not identical.
Third sectors (second part of boot code) are not identical.

A valid FAT Boot sector must be present in order to access
any data; even if the partition is not bootable.

TestDisk exited normally.

Locked