1 (edited by wkhan69 2017-11-13 22:55:45)

Topic: [SOLVED] 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

2

Re: [SOLVED] 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!

3

Re: [SOLVED] 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.

4

Re: [SOLVED] 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?

5

Re: [SOLVED] 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.
Will

6

Re: [SOLVED] Error formatting USB stick in ext4

Thank you to report us the successful issue.
smile

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

Re: [SOLVED] 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 e3fsprogs version 1.43.7 or later?

8

Re: [SOLVED] Error formatting USB stick in ext4

We have not 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.