Detected size incorrect; Bad starting sector (CHS and LBA don't match)

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
spongy
Posts: 4
Joined: 26 Sep 2022, 06:35

Detected size incorrect; Bad starting sector (CHS and LBA don't match)

#1 Post by spongy »

I have a 32GB micro SD card that someone else was using and at one point had several hundred or thousand files (jpg/avi) on it. Since I was not the one using it, I do not know if it was accidentally formatted or if some error occurred during use, but I do know that all these old files disappeared and ~50 new images were recorded to the card before I was informed of the issue.

My computer recognizes the card as a 32GB card, and I can view the 50 new images. But running testdisk, it appears as a ~250GB disk and gives the warning "Bad starting sector (CHS and LBA don't match)". Is there a way to fix this in an attempt to recover more from the card?

Thanks for any possible help. Here is the log.

Code: Select all


Mon Sep 26 01:15:27 2022
Command line: TestDisk

TestDisk 7.1, Data Recovery Utility, July 2019
Christophe GRENIER <grenier@cgsecurity.org>
https://www.cgsecurity.org
OS: Darwin, kernel 17.7.0 (Darwin Kernel Version 17.7.0: Fri Oct 30 13:34:27 PDT 2020; root:xnu-4570.71.82.8~1/RELEASE_X86_64) x86_64
Compiler: GCC 4.0
Compilation date: 2019-07-07T19:17:13
ext2fs lib: 1.42.8, ntfs lib: libntfs-3g, reiserfs lib: none, ewf lib: none, curses lib: ncurses 5.4
Hard disk list
Disk /dev/disk0 - 500 GB / 465 GiB - 976773168 sectors (RO), sector size=512
Disk /dev/disk2 - 268 GB / 250 GiB - 524290048 sectors (RO), sector size=512
Disk /dev/rdisk0 - 500 GB / 465 GiB - 976773168 sectors (RO), sector size=512
Disk /dev/rdisk1 - 498 GB / 464 GiB - 974368768 sectors, sector size=512
Disk /dev/rdisk2 - 268 GB / 250 GiB - 524290048 sectors (RO), sector size=512

Partition table type (auto): Intel
Media is opened in read-only.
Disk /dev/rdisk2 - 268 GB / 250 GiB (RO)
Partition table type: Intel

Analyse Disk /dev/rdisk2 - 268 GB / 250 GiB - 524290048 sectors (RO)
BAD_RS LBA=32 4294967295
FAT32 at 32/0/1
Should be marked as FAT32
Info: size boot_sector 61849568, partition 61849568
FAT1 : 36-7585
FAT2 : 7586-15135
start_rootdir : 15136 root cluster : 2
Data : 15136-61849567
sectors : 61849568
cluster_size : 64
no_of_cluster : 966163 (2 - 966164)
fat_length 7550 calculated 7549
FAT differs, FAT sectors=0-16/7550
heads/cylinder 0 (FAT) != 1 (HD)
sect/track 0 (FAT) != 1 (HD)
set_FAT_info: name from BS used
get_geometry_from_list_part_aux head=1 nbr=2
get_geometry_from_list_part_aux head=8 nbr=2
get_geometry_from_list_part_aux head=16 nbr=2
get_geometry_from_list_part_aux head=32 nbr=2
Current partition structure:
Should be marked as FAT32
Warning: number of heads/cylinder mismatches 0 (FAT) != 1 (HD)
Warning: number of sectors per track mismatches 0 (FAT) != 1 (HD)
 1 P FAT32 LBA                     32   61849599   61849568 [NO NAME]

Warning: Bad starting sector (CHS and LBA don't match)
No partition is bootable

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

Re: Detected size incorrect; Bad starting sector (CHS and LBA don't match)

#2 Post by recuperation »

IF your 32 GB card is recognized by Testdisk as being 256 GB you most likely have a hardware problem with that card. You can still try to generate an image of that card using ddrescue as described in the manual and have Testdisk and other software search within that image file. Otherwise consult a professional recovery service.

spongy
Posts: 4
Joined: 26 Sep 2022, 06:35

Re: Detected size incorrect; Bad starting sector (CHS and LBA don't match)

#3 Post by spongy »

Thanks, using ddrescue as described and then running PhotoRec helped me find 862 files. On a separate note, trying with brute force enabled generated a large 800+ MB jpg file before I stopped it.

Testdisk said no partition was found--log as follows--and I did not have the energy to bother digging further, especially since PhotoRec already helped me recover what I believe to be most of the files.

If this is a hardware problem as you suggest, I take it that it is inadvisable to use this card anymore? Would formatting help at all with making it safe to use? Why does the size appear correctly in disk utility, but not in Testdisk? (Not doubting you, just don't understand how this works.)

Aforementioned Testidsk log:

Code: Select all

Tue Sep 27 20:46:00 2022
Command line: TestDisk

TestDisk 7.1, Data Recovery Utility, July 2019
Christophe GRENIER <grenier@cgsecurity.org>
https://www.cgsecurity.org
OS: Darwin, kernel 17.7.0 (Darwin Kernel Version 17.7.0: Fri Oct 30 13:34:27 PDT 2020; root:xnu-4570.71.82.8~1/RELEASE_X86_64) x86_64
Compiler: GCC 4.0
Compilation date: 2019-07-07T19:17:13
ext2fs lib: 1.42.8, ntfs lib: libntfs-3g, reiserfs lib: none, ewf lib: none, curses lib: ncurses 5.4
Hard disk list
Disk /dev/disk0 - 500 GB / 465 GiB - 976773168 sectors (RO), sector size=512
Disk /dev/rdisk0 - 500 GB / 465 GiB - 976773168 sectors (RO), sector size=512
Disk /dev/rdisk1 - 498 GB / 464 GiB - 974368768 sectors, sector size=512
Disk /dev/rdisk2 - 31 GB / 29 GiB - 61849568 sectors (RO), sector size=512

Partition table type (auto): None
Media is opened in read-only.
Disk /dev/rdisk2 - 31 GB / 29 GiB (RO)
Partition table type: Intel

Analyse Disk /dev/rdisk2 - 31 GB / 29 GiB - 61849568 sectors (RO)
Current partition structure:
No partition is bootable

search_part()
Disk /dev/rdisk2 - 31 GB / 29 GiB - 61849568 sectors (RO)
FAT32 at 6/0/1
Should be marked as FAT32
FAT1 : 36-7585
FAT2 : 7586-15135
start_rootdir : 15136 root cluster : 2
Data : 15136-61849567
sectors : 61849568
cluster_size : 64
no_of_cluster : 966163 (2 - 966164)
fat_length 7550 calculated 7549
FAT differs, FAT sectors=0-16/7550
heads/cylinder 0 (FAT) != 1 (HD)
sect/track 0 (FAT) != 1 (HD)
set_FAT_info: name from BS used

FAT32 at 6/0/1
FAT: cluster=2(0x2), pos=15136
     FAT32 LBA                      0   61849567   61849568 [NO NAME]
     FAT32, blocksize=32768, 31 GB / 29 GiB
Partition not added.
FAT32 at 6/0/1
Should be marked as FAT32
FAT1 : 36-7585
FAT2 : 7586-15135
start_rootdir : 15136 root cluster : 2
Data : 15136-61849567
sectors : 61849568
cluster_size : 64
no_of_cluster : 966163 (2 - 966164)
fat_length 7550 calculated 7549
FAT differs, FAT sectors=0-16/7550
heads/cylinder 0 (FAT) != 1 (HD)
sect/track 0 (FAT) != 1 (HD)
set_FAT_info: name from BS used

FAT32 at 6/0/1
FAT: cluster=2(0x2), pos=15142
FAT: cluster=771(0x303), pos=64358
FAT: cluster=1540(0x604), pos=113574
FAT: cluster=2309(0x905), pos=162790
     FAT32 LBA                      6   61849573   61849568 [NO NAME]
     FAT32, blocksize=32768, 31 GB / 29 GiB
This partition ends after the disk limits. (start=6, size=61849568, end=61849573, disk end=61849568)
Disk /dev/rdisk2 - 31 GB / 29 GiB - 61849568 sectors (RO)
Check the harddisk size: HD jumper settings, BIOS detection...
The harddisk (31 GB / 29 GiB) seems too small! (< 31 GB / 29 GiB)
The following partition can't be recovered:
     FAT32 LBA                      6   61849573   61849568 [NO NAME]
     FAT32, blocksize=32768, 31 GB / 29 GiB

Results

interface_write()
 
No partition found or selected for recovery
simulate write!

write_mbr_i386: starting...
write_all_log_i386: starting...
No extended partition

TestDisk exited normally.

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

Re: Detected size incorrect; Bad starting sector (CHS and LBA don't match)

#4 Post by recuperation »

spongy wrote: 28 Sep 2022, 02:08 Thanks, using ddrescue as described and then running PhotoRec helped me find 862 files. On a separate note, trying with brute force enabled generated a large 800+ MB jpg file before I stopped it.

Testdisk said no partition was found--log as follows--and I did not have the energy to bother digging further, especially since PhotoRec already helped me recover what I believe to be most of the files.

If this is a hardware problem as you suggest, I take it that it is inadvisable to use this card anymore? Would formatting help at all with making it safe to use? Why does the size appear correctly in disk utility, but not in Testdisk? (Not doubting you, just don't understand how this works.)
You posted two different log files and comparing the second to the first I get the impression that you have removed a 250 GB drive and connected your 32 GB SD card.
I doubt that the SD card changed it size. I guess you connected and disconnected different drives.

spongy
Posts: 4
Joined: 26 Sep 2022, 06:35

Re: Detected size incorrect; Bad starting sector (CHS and LBA don't match)

#5 Post by spongy »

No, what I meant was that the second post was after I ran ddrescue, as you had suggested. I then ran PhotoRec and Testdisk on the image.

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

Re: Detected size incorrect; Bad starting sector (CHS and LBA don't match)

#6 Post by recuperation »

I can't follow. You duplicated a 250 GB drive into a 32 GB file?
This issue lacks explanation.

spongy
Posts: 4
Joined: 26 Sep 2022, 06:35

Re: Detected size incorrect; Bad starting sector (CHS and LBA don't match)

#7 Post by spongy »

But it was not a 250GB drive. I had a 32GB micro SD card. I don't know why Testdisk said it was 250GB. You suggested it was a hardware issue with the card and to use ddrescue. I used ddrescue to make an image of the 32GB card and somehow was able to get information back from the image. I definitely did not switch cards.

When I plug in this 32GB micro SD card into my computer, my disk utility sees a card reader and says its capacity is 268GB for some reason. Within the card reader, it sees the micro SD card and says its capacity is 32GB. Testdisk said nothing about 32GB for the card, only for the image.

Locked