1 (edited by wkhan69 2018-02-12 04:39:16)

Topic: Error formatting USB stick in ext4

Hi all,
Newbie with GParted 0.25.0, running on debian stretch (9.1.0).  I've tried to flash a 16GB usb stick in ext4 format and I get the following error.  I tried a different usb stick, and the same error occured.  However, I tried formatting the same USB stick in ext4 with partition magic on a windows 10 PC, and it worked perfectly.

GParted 0.25.0 --enable-libparted-dmraid --enable-online-resize

Libparted 3.2
Format /dev/sdd1 as ext4  00:05:24    ( ERROR )
calibrate /dev/sdd1  00:00:00    ( SUCCESS )
path: /dev/sdd1 (partition)
start: 8064
end: 30320639
size: 30312576 (14.45 GiB)
clear old file system signatures in /dev/sdd1  00:00:08    ( SUCCESS )
write 512.00 KiB of zeros at byte offset 0  00:00:00    ( SUCCESS )
write 4.00 KiB of zeros at byte offset 67108864  00:00:00    ( SUCCESS )
write 512.00 KiB of zeros at byte offset 15519449088  00:00:00    ( SUCCESS )
write 4.00 KiB of zeros at byte offset 15519973376  00:00:00    ( SUCCESS )
write 8.00 KiB of zeros at byte offset 15520030720  00:00:00    ( SUCCESS )
flush operating system cache of /dev/sdd  00:00:08    ( SUCCESS )
set partition type on /dev/sdd1  00:00:01    ( SUCCESS )
new partition type: ext4
create new ext4 file system  00:05:15    ( ERROR )
mkfs.ext4 -F -L "" /dev/sdd1  00:05:15    ( ERROR )
Creating filesystem with 3789072 4k blocks and 948416 inodes
Filesystem UUID: 195a1d42-07f6-4dc9-9ee1-00609da33ed0
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208

Allocating group tables: done
Writing inode tables: done
Creating journal (16384 blocks): done
Writing superblocks and filesystem accounting information:
mke2fs 1.43.4 (31-Jan-2017)

Warning, had trouble writing out superblocks.

I tried using this USB stick in other servers that read ext4 and it doesn't get detected.  The one formatted by partition magic works good in all systems.  I tried creating a partition from scratch and that didn't help.  Any suggestions?

Thanks,  Will


Re: Error formatting USB stick in ext4

Warning, had trouble writing out superblocks.

The above message indicates that there was a hardware problem when writing to the USB drive.  This could be as simple as a loose connection or as serious as a failing USB drive.

Different versions of software and different file systems may write to different areas of the USB drive, and this can result in one version working with no errors and another encountering issues.

If it were my USB drive, I would try to test it to see if it is beginning to fail.  You might do that by writing zeros to the entire USB drive to ensure that that works correctly.  If there is a failure writing to any block then that could indicate a failing USB drive.  Be sure to backup all your data first!


Re: Error formatting USB stick in ext4

That's what I thought first, but when I tried another USB stick, the same thing happened.  As well, when I take the same USB stick and format it with Partition Magic on windows, it works fine.


Re: Error formatting USB stick in ext4

The command that fails is:

mkfs.ext4 -F -L "" /dev/sdd1

mkfs.ext4 is part of e2fsprogs.  We base GParted Live on Debian SID so we include the latest version that is packaged for SID when we create GParted Live.  From the log I see the version is mke2fs 1.43.4.

While I think it unlikely, perhaps there is a bug in mkfs.ext4?

What is the version of mkfs.ext4 on the distro that works?


Re: Error formatting USB stick in ext4

Hi gedakc,

I have checked my version of e2fsprogs (mke2fs), and it is the latest (1.43.4-2) according to synaptic.   However, when I went to the e2fsprogs website, they do have a more uptodate version (1.43.7), which they strongly urged to update.  Anyway, I installed this version manually, and my problem went away! 

So, you are correct, there is a bug in version 1.43.4.  ...version 1.43.7 hasn't made it to the latest stable for debian stretch yet, that's why it wasn't flagged for an update.  I assume it will make it there eventually. 

Thanks a lot for your help.


Re: Error formatting USB stick in ext4

Thank you to report us the successful issue.

If so, you can edit your initial post to add [SOLVED] to the thread title. This will help people facing a similar problem.

*** It is highly recommended to backup any important files before doing resize/move operations. ***

7 (edited by wkhan69 2018-02-12 05:05:28)

Re: Error formatting USB stick in ext4

I'm just curious, are you going to make a note to the gparted download page to tell users they must first install e2fsprogs version 1.43.7 or later?


Re: Error formatting USB stick in ext4

We have no plans to update the download page because GParted Live 0.30.0-1 already includes a newer e2fsprogs version (1.43.6-1 at time of build).  We have no control over the versions that distros install, which is one reason we highly recommend using GParted Live, which we build and test.


Re: Error formatting USB stick in ext4

Hi all,
Just an update.  It looks like the problem is not fixed.  When I tried the above version (1.43.7) to format USB sticks that I afterwards inserted into a macbook pro (that has the pluggins to read ext4), the USB sticks could not be read.  I formatted another USB stick in ext4 using a synology NAS, and it worked fine in my macbook pro.  I tried updating e2fsprogs to 1.43.8 (which came out after my last post), and it didn't help.  So, I'll keep waiting for some more advanced version and try it then.