After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 657118 - Error while partitioning on USB-pendrive
Error while partitioning on USB-pendrive
Status: RESOLVED INCOMPLETE
Product: gparted
Classification: Other
Component: application
0.7.0
Other Linux
: Normal normal
: ---
Assigned To: gparted maintainers alias
gparted maintainers alias
Depends on:
Blocks:
 
 
Reported: 2011-08-22 21:35 UTC by Ulf Zibis
Modified: 2013-02-01 08:22 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
GParted error report (4.28 KB, text/html)
2011-08-22 21:35 UTC, Ulf Zibis
Details
error details (8.58 KB, text/html)
2011-08-28 16:59 UTC, Ulf Zibis
Details
success details (9.28 KB, text/html)
2011-08-28 17:02 UTC, Ulf Zibis
Details

Description Ulf Zibis 2011-08-22 21:35:43 UTC
Created attachment 194433 [details]
GParted error report

See attachment.
Comment 1 Curtis Gedak 2011-08-26 15:35:47 UTC
From the attachment it appears that there is an inconsistency with the backup sector in the FAT file system.

If you have Windows you might try running chkdsk on the drive to try to fix this problem.

Alternatively you might try using the dosfsck command to see if it can resolve this discrepancy.

Did either of these above approaches resolve the problem?
Comment 2 Ulf Zibis 2011-08-26 21:04:05 UTC
Thanks for your explanation.
The original partition was created by Ubuntu's start-media creator, creating a life-USB-system with 3 GB persistent range, so the inconsistency seems to be caused by it.
The intention was to shrink the single partition to 4 GB to have space for a 2nd 12 GB partition for data sharing.
Unfortunately I have overwritten the media, so I can't give more info, except that I could boot Ubuntu from that broken media.

Additionally, I'm wondering, that the error log reports
Media byte 0xf8 (hard disk),
because Windows determines "removable media", and for that Windows only mounts the 1st partition, regardless if there are more.
Comment 3 Ulf Zibis 2011-08-26 22:51:36 UTC
Now I tried again on my new Ubuntu-Live installation.
First I run chkdsk /F /X from Windows which found 1 lost file, and corrected.

The same error occurred, but I couldn't post it because of bug 657480.
Comment 4 Curtis Gedak 2011-08-27 20:22:34 UTC
Can you try to run "chkdsk" from Windows?
Comment 5 Ulf Zibis 2011-08-27 20:42:43 UTC
You mean to run "chkdsk" again after the failed GParted attempt?
After it, "chkdsk" from Windows returned OK.
Comment 6 Curtis Gedak 2011-08-28 15:28:35 UTC
The inconsistency with the backup sector is preventing GParted from being successful in resizing the FAT file system.

My hope was that chkdsk on this FAT file system would fix the inconsistency.  Then when the discrepancy is fixed GParted should be able to continue with the resize operation.

If Windows chkdsk will not fix the problem and dosfsck will not fix the problem then I don't know what tool will fix the inconsistency.

Can you try the GParted resize operation after running Windows chkdsk?
Comment 7 Ulf Zibis 2011-08-28 16:57:26 UTC
> Can you try the GParted resize operation after running Windows chkdsk?
I just did, see comment 3.
Comment 8 Ulf Zibis 2011-08-28 16:59:23 UTC
Created attachment 194976 [details]
error details

Another try
Comment 9 Ulf Zibis 2011-08-28 17:02:28 UTC
Created attachment 194977 [details]
success details

Surprise:
The 4th attempt worked, regardless the inconsistency with the backup sector.
Comment 10 Curtis Gedak 2011-08-28 23:30:08 UTC
I am beginning to think that a hardware problem is the root cause.

My reasoning is as follows:

1) The section of the log file in comment #8 indicates that the device /dev/sdc1 has somehow disappeared while GParted was working on it.  This is highly unusual.

<--- begin log snippet --->
dosfsck -a -w -v /dev/sdc1
     	
dosfsck 3.0.9 (31 Jan 2010)
dosfsck 3.0.9, 31 Jan 2010, FAT32, LFN
open: No such file or directory
<--- finish log snippet --->

2) Another indicator is that the list of discrepancies seems to be changing since the first post.

3) The final clincher is that the 4th attempt worked.


It is difficult to pin down the exact cause with absolute certainty.  As a general rule software errors are almost always reproducible with the same set of steps.  Hardware errors tend to be more random in nature.

Are you able to test the device to see if it is failing or somehow not maintaining a good connection?
Comment 11 Ulf Zibis 2011-09-02 23:04:34 UTC
(In reply to comment #10)
> I am beginning to think that a hardware problem is the root cause.
I'm afraid, you're right.

I did not have any problems copying data e.g. large mp3-files or videos on this device. All seemed ok.
But I too had problems to install Ubuntu on this device, but in the end it seemed to work.
Maybe the device has failures while _excessively_ writing/moving data on it, as it happens while installing Ubuntu of moving partitions. But how to verify this?

> Are you able to test the device to see if it is failing or somehow not
> maintaining a good connection?
Don't know how to do this, maybe by chkdsk /F /R ?
But I'm afraid stress my USB-flash-RAM too much.
Comment 12 Curtis Gedak 2011-09-03 15:41:10 UTC
Hardware problems can be tricky to isolate.

If you have access to another computer I would suggest trying the same actions using the USB stick on the other computer.  If all problems disappear, then the original computer is likely at fault.  If the problems continue then it is likely that there is a problem with the USB stick.

In the case of hard disk drives, the manufacturers often provide software for testing the disk drives.  You might try searching for this test software for your USB stick.

Another alternative would be to try overwriting the entire USB stick with zeroes to determine if there are any problems encountered while writing to all of the sectors on the device.  To do this you can use the dd command and the special device /dev/zero as the input file.

Please let us know how you make out.
Comment 13 Ulf Zibis 2011-09-03 17:38:15 UTC
Curtis, thanks for your excessive efforts.
I will try to check all this error sources some day, and let you know the result. For now, I will go on with other work to do.
Comment 14 Akhil Laddha 2011-10-17 05:33:20 UTC
Ulf, ping, do you have any update for the bug ?
Comment 15 Tobias Mueller 2012-02-08 09:33:03 UTC
Closing this bug report as no further information has been provided. Please feel free to reopen this bug if you can provide the information asked for.
Thanks!
Comment 16 Ulf Zibis 2013-01-29 18:55:32 UTC
(In reply to comment #12)
> Hardware problems can be tricky to isolate.
> 
> To do this you can use the dd command and the
> special device /dev/zero as the input file.

Which block size you would suggest, e.g. to not over-stress the devices maximum write cycles.
Comment 17 Curtis Gedak 2013-01-31 21:23:09 UTC
(In reply to comment #16)
> (In reply to comment #12)
> > Hardware problems can be tricky to isolate.
> > 
> > To do this you can use the dd command and the
> > special device /dev/zero as the input file.
> 
> Which block size you would suggest, e.g. to not over-stress the devices maximum
> write cycles.

Since this involves overwriting all of the sectors, I would suggest choosing a block size that is a multiple of the logical/physical sector size shown by the command:

sudo fdisk -l -u
Comment 18 Ulf Zibis 2013-01-31 22:04:14 UTC
(In reply to comment #17)
> sudo fdisk -l -u

As you can see below, it says 512 bytes, but I can't believe that, as I remember to have read somewhere, that the segments, which are erased at once on a flash media are something about 32..64 KiB.
But maybe 64 x 32 x 512 = 1 MiB would be secure.

===========================================================================
XX:~$ sudo sfdisk -l -u /dev/sdb
nicht erkanntes Format – benutze Sektoren

Festplatte /dev/sda: 60801 Zylinder, 255 Köpfe, 63 Sektoren/Spur
<snip>

Festplatte /dev/sdb: 15600 Zylinder, 64 Köpfe, 32 Sektoren/Spur
Warnung: Die Partition sieht aus, als sie gemacht worden
  für C/H/S=*/256/18 (anstelle von 15600/64/32).
Für diese Auflistung nehme ich diese Geometrie an.
Einheit = Sektoren von 512 Bytes, Zählung beginnt bei 0

   Gerät  boot.   Anfang      Ende  #Sektoren Id  System
/dev/sdb1   *      3504  31950719   31947216   c  W95 FAT32 (LBA)
		Anfang: (c,h,s) erwartet (0,194,13) gefunden (0,1,1)
		Ende: (c,h,s) erwartet (1023,255,18) gefunden (990,255,18)
/dev/sdb2             0         -          0   0  Leer
/dev/sdb3             0         -          0   0  Leer
/dev/sdb4             0         -          0   0  Leer
XX:~$ sudo sfdisk -g /dev/sdb
/dev/sdb: 15600 Zylinder, 64 Köpfe, 32 Sektoren/Spur
XX:~$ sudo sfdisk -G /dev/sdb
/dev/sdb: 6933 Zylinder, 256 Köpfe, 18 Sektoren/Spur
ich@Ulfuntu:~$
Comment 19 Mike Fleetwood 2013-02-01 08:22:33 UTC
(In reply to comment #18)
> As you can see below, it says 512 bytes, but I can't believe that, as I
> remember to have read somewhere, that the segments, which are erased at once on
> a flash media are something about 32..64 KiB.
> But maybe 64 x 32 x 512 = 1 MiB would be secure.

Yes, just use 1 MiB as the block size for dd.

I've seen mention of erasure block sizes being between 128K and 4M over
the years, presumably depending on the capacity and age of the device.

I use a 1M block size when using dd to zero flash devices and spinning
hard drives alike.  It reduces overhead in the OS and sends big sequential
writes to the underlying device which is always the best.

Cylinders and heads are meaningless numbers on flash drives completely
fictitious spinning hard drives.