GParted resized FAT32 partition and Windows can't read it Topic is solved

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
Ronson
Posts: 17
Joined: 14 Jun 2016, 20:44

GParted resized FAT32 partition and Windows can't read it

#1 Post by Ronson »

I used GParted to extend a FAT32 partition on a flash drive so the entire flash drive is used. However, something is wrong because if I plug the flash drive in to Windows 7 I am asked to reformat the flash drive. Strangely, Ubuntu seems to have no trouble reading the file system. I cloned the flash drive with the messed up partition/filesystem. I tried running TestDisk 7.0 on the clone. I selected Disk /dev/sdc - 31 GB / 29 GB and Proceed. On the next screen Intel was already selected so I pressed Enter. Then Analyse was selected so I pressed Enter and I saw the following:

Image

Then I ran the Quick Search and saw the following:

Image

I pressed Enter and then selected Write and pressed Y to confirm. Then I saw the message about needing to reboot for the changes to take effect. I quit the TestDisk program and rebooted but Windows still wants me to format the flash drive so I didn't fix the problem. Any suggestions?

Ronson
Posts: 17
Joined: 14 Jun 2016, 20:44

Re: GParted resized FAT32 partition and Windows can't read it

#2 Post by Ronson »

I looked at the original drive again in GParted and saw that the drive contains only an extended partition with a FAT32 logical partition with some unpartitioned megabytes at the begging and end. Windows probably isn't recognizing the filesystem because it doesn't recognize a stand-alone extended partition. I tried cloning the drive and making a small primary partition at the beginning but that didn't help Windows recognize the extended partition. I tried cloning only the logical FAT32 partition to another drive and running Testdisk on the clone. I was able to restore the root directory but everything else was corrupt. Ubuntu seems to read the original drive without any issues so I might quit trying to fix the issue by using Testdisk and use rsync to copy everything to another flash drive.

User avatar
cgrenier
Site Admin
Posts: 5432
Joined: 18 Feb 2012, 15:08
Location: Le Perreux Sur Marne, France
Contact:

Re: GParted resized FAT32 partition and Windows can't read it

#3 Post by cgrenier »

Your screenshot shows TestDisk listing the partition as *(bootable). If you choosed to write this partition table, the partition will not be listed as extended.
You can also try testdisk, advanced, boot, rebuildbs, list. If you can list your files, choose write, confirm, Quit and try again to access your files from Windows.

Ronson
Posts: 17
Joined: 14 Jun 2016, 20:44

Re: GParted resized FAT32 partition and Windows can't read it

#4 Post by Ronson »

Thank you for your reply.
cgrenier wrote: 07 Nov 2017, 20:30 Your screenshot shows TestDisk listing the partition as *(bootable). If you choosed to write this partition table, the partition will not be listed as extended.
I tried that and the partition became a primary but the files still weren't viewable in Windows.
cgrenier wrote: 07 Nov 2017, 20:30 You can also try testdisk, advanced, boot, rebuildbs, list. If you can list your files, choose write, confirm, Quit and try again to access your files from Windows.
I tried this, too. I was able to get a list of the root directory but the file/dir names were random alphanumeric characters in 8.3 format. If I tried to list the contents of a subdirectory then I'd get a message telling me the filesystem may be corrupt or something close to that. I tried doing write and confirm just to see if I could get something readable in Windows but I only got a message from Testdisk telling me the write failed.

User avatar
cgrenier
Site Admin
Posts: 5432
Joined: 18 Feb 2012, 15:08
Location: Le Perreux Sur Marne, France
Contact:

Re: GParted resized FAT32 partition and Windows can't read it

#5 Post by cgrenier »

Try PhotoRec 7.1-WIP to recover your data. It will not recover the original filenames but it's better than nothing.

Ronson
Posts: 17
Joined: 14 Jun 2016, 20:44

Re: GParted resized FAT32 partition and Windows can't read it

#6 Post by Ronson »

cgrenier wrote: 13 Nov 2017, 20:31 Try PhotoRec 7.1-WIP to recover your data. It will not recover the original filenames but it's better than nothing.
It is still readable in Linux so if nothing else works then I'd rather use rsync to copy everything to another drive. That way I can keep the file names.

However, I think I figured out the reason TestDisk was having trouble with the clone drive. The cloning software I used showed the clone has a partition ID of 0x7 (NTFS, exFAT) and the original flash drive had a partition ID of 0xb (FAT32). Seems like the cloning software had no trouble finding the lost partition on the original drive but was setting the wrong partition ID on the clone. I changed the clone partition to 0xb. The software also has an option for changing a partition from extended to primary so I used that on the clone. Changing the partition ID and making it primary didn't make the file system readable so I started TestDisk. I selected disk /dev/sdc, Intel, Advanced, Boot,

Image

selected Rebuild BS, some scanning happened and I was able to browse the file system.

Image

Then I selected Write, quit TestDisk, removed the drive and reconnected it. Rebuilding the BS worked. Now Windows Disk Management shows I have a primary partition and chkdsk finds no issues with the filesystem.

Locked