From the man mke2fs
page and this link it appears that the defaults for formatting an ext4 filesystem are very lazy and leave a lot of the writing work to be finished after the drive is mounted for the first time, and every subsequent time until the work is finished. Most annoyingly, it will very slowly write to the drive every few seconds until it's done.
This could be especially bad for a flash drive (card/USB drive) that could have an extremely large block / page size, so writing just a few bytes actually writes to 256k, 512k, or a meg or more. And some flash drives could have an extremely low 1000 write cycles (or maybe 5000 or 10,000, possibly 100,000). Much lower than a hard drive, and even a hard drive would probably benefit more from doing all the writes at once, then being able to sit idle when it really should be idle. And I'm not sure how long it will keep slowly writing to the drive, some people say it could be a few minutes, or a few days. This seems like the worst way to "format" a flash drive.
Excerpt from the man page:
-E extended-options
Set extended options for the filesystem. Extended options are
comma separated, and may take an argument using the equals ('=')
sign... The following extended options are supported:
...
lazy_itable_init[= <0 to disable, 1 to enable>]
If enabled and the uninit_bg feature is enabled, the inode
table will not be fully initialized by mke2fs. This speeds
up filesystem initialization noticeably, but it requires the
kernel to finish initializing the filesystem in the back‐
ground when the filesystem is first mounted. If the option
value is omitted, it defaults to 1 to enable lazy inode table
zeroing.
lazy_journal_init[= <0 to disable, 1 to enable>]
If enabled, the journal inode will not be fully zeroed out by
mke2fs. This speeds up filesystem initialization noticeably,
but carries some small risk if the system crashes before the
journal has been overwritten entirely one time. If the
option value is omitted, it defaults to 1 to enable lazy
journal inode zeroing.
So, if you can initially format (or re-format) the filesystem, this should eliminate the lazy slow format and get it all done at once:
mkfs -t ext4 -E lazy_itable_init=0,lazy_journal_init=0 /dev/sdxN
Best Answer
hdparm
is a standard CLI for testing disk speed and the drives don't have to be mounted (when doing read tests).The first drive is an SSD and the second drive is a USB pen drive.