1

Topic: The Check Option - Caused an issue....

Since check warns that you could loose your data I'm not sure that what I'm reporting is a bug or not.  Ever since I have been trying to make a switch from windows to linux, there is one option that has been holding me back.  In linux there is no simple check disk.  I thought I found one in gparted.  It made sense to me because it looks like it is a graphical interface for a simple fsck command.  I decided to give it a try on one of my USB drives.  The USB drive was formated to FAT32.  I used gparted to unmount the drive and then I ran check.  It gave me the warning and I said ok to that.  It ran the command and everything checked out fine.  And yet something about the drive changed.  While Linux has no problems seeing and using the drive, Windows gives me an error message telling me that it does not recognize the format and asks me to format.  Windows is not the only OS that wouldn't recognize it anymore.  I also have a TV with a USB port that is able to playback mp4 videos.  It also could no longer see the drive.  When I ran gparted again, I checked to see what file system was on the drive.  It said fat 32.  I moved the data off the drive and now I have it connected to a windows computer reformatting it.  I'm curious if any of you can replicate this issue. 

It is probably this one:  https://www.bhphotovideo.com/c/product/ … 0_USB.html

2

Re: The Check Option - Caused an issue....

What GNU/Linux distribution or Live Media did you use to run GParted?

I suspect that you encountered the following bug in the libparted library:
Bug 759916 - fat(32) resizing generates boot sector(s) with invalid jump instruction and pseudo-random boot code

The issue can be fixed by hexediting the partition to replace the first three bytes with "eb 58 90" as mentioned in the bug report.  This should make the file system recognizable by Windows.

To avoid the problem in future be sure to use GParted from a distro that contains the patch, such as GParted Live.

3

Re: The Check Option - Caused an issue....

gedakc wrote:

What GNU/Linux distribution or Live Media did you use to run GParted?

I suspect that you encountered the following bug in the libparted library:
Bug 759916 - fat(32) resizing generates boot sector(s) with invalid jump instruction and pseudo-random boot code

The issue can be fixed by hexediting the partition to replace the first three bytes with "eb 58 90" as mentioned in the bug report.  This should make the file system recognizable by Windows.

To avoid the problem in future be sure to use GParted from a distro that contains the patch.

What GNU/Linux distribution:  Linux Lite 3.2 64bit based on Ubuntu 16.04 LTS

Gparted Version: 0.25.0

4

Re: The Check Option - Caused an issue....

Root cause of the issue confirmed.  Ubuntu 16.04 does not contain the upstream patch according to the Ubuntu Parted Changelog.

Perhaps you could report the issue upstream to Ubuntu or even Debian?

As mentioned before, you can hexedit and change the first three bytes to be "eb 58 90" so that Windows will recognize the FAT16/32 file system.

5

Re: The Check Option - Caused an issue....

gedakc wrote:

Root cause of the issue confirmed.  Ubuntu 16.04 does not contain the upstream patch according to the Ubuntu Parted Changelog.

Perhaps you could report the issue upstream to Ubuntu or even Debian?

As mentioned before, you can hexedit and change the first three bytes to be "eb 58 90" so that Windows will recognize the FAT16/32 file system.

I have never hexedit before, and don't know how.  What version of Gparted should I have installed?  It appears that in my Gparted Live CD collection I have version 0.25.0-3 64 bit and I also have the same version in a 32 bit.  I think reporting this issue to Ubuntu needs to be done.

6

Re: The Check Option - Caused an issue....

gregorylock wrote:

What version of Gparted should I have installed?

The problem is not in the GParted source code.  The problem is in the parted 3.2 source code.  Hence it does not matter which version of GParted you use.  The key thing is to use a patched version of parted when resizing FAT file systems.  This patched version is included on recent GParted Live images.

To fix recognition of the FAT file system after the problem has occurred, the file system needs the first three bytes to be set to "eb 58 90".

7 (edited by gregorylock 2017-03-04 22:04:54)

Re: The Check Option - Caused an issue....

gedakc wrote:
gregorylock wrote:

What version of Gparted should I have installed?

The problem is not in the GParted source code.  The problem is in the parted 3.2 source code.  Hence it does not matter which version of GParted you use.  The key thing is to use a patched version of parted when resizing FAT file systems.  This patched version is included on recent GParted Live images.

To fix recognition of the FAT file system after the problem has occurred, the file system needs the first three bytes to be set to "eb 58 90".

I can understand that some people would use gparted to resize the FAT.  But I don't understand why the check option does this.  Why does the check option need to do that?

8

Re: The Check Option - Caused an issue....

The "Partition -> Check" option tries to ensure that the file system is healthy, and that the file system fills the partition.  If the file system does not fill the partition then the "Check" operation will try to grow the file system to fill the partition.

Note that this is a Partition Check, not just a file system check.