mkfs.ext4 unbelievably slow formatting 1TB partition

Issues related to applications and software problems
Posts: 33
Joined: 2011/03/22 17:32:25
Location: Boston

Re: [solved] mkfs.ext4 unbelievably slow formatting 1TB partition

Post by LMHmedchem » 2020/02/25 18:08:35

hunter86_bg wrote:
2020/02/19 18:41:47
For me the performance is 50% lower than the other ssd.
You should expect better performance.

Move all data away , then create 1 single partition (use all defaults).
I need at least 3 partitions on this drive. How should I create the paritions? Should I use GParted or should I use fdisk? For now I will create 1 partition and test it.

I think that GParted just hacks up an fdisk command but I don't know the set of options that it uses by default. The first partition on the drive is ntfs and needs to be approximately 250GB. Can I use GParted to create an ~250GB ntfs partition that starts at the beginning of the drive?

How do I determine the exact size in MB to use for an ~250GB partition that will be properly aligned (be a multiple of 4096)? I presume that starting it at the beginning will help but what should the last allocated block be.
hunter86_bg wrote:
2020/02/19 18:41:47
Your worst enemy is the disk allignment. If you need to leave a gap - it should be divisible by 4096.
There are 2MB of unallocated space before the first partition. I don't know if that is the correct amount for the first partition to start on a sector boundary. I get different answers with 512 and 4096 sector sizes. If I know where to start and end the first partition to have it properly aligned, then I think I can go from there.

The output of hdparam seems to indicate that the physical sector size is 512 where I would expect it to be 4096.

Code: Select all

sudo hdparm -I /dev/sdb

ATA device, with non-removable media
	Model Number:       Samsung SSD 860 EVO 2TB                 
	Logical		max	current
	cylinders	16383	16383
	heads		16	16
	sectors/track	63	63
	CHS current addressable sectors:   16514064
	LBA    user addressable sectors:  268435455
	LBA48  user addressable sectors: 3907029168
	Logical  Sector size:                   512 bytes
	Physical Sector size:                   512 bytes
	Logical Sector-0 offset:                  0 bytes
	device size with M = 1024*1024:     1907729 MBytes
	device size with M = 1000*1000:     2000398 MBytes (2000 GB)
	cache/buffer size  = unknown
	Form Factor: 2.5 inch
	Nominal Media Rotation Rate: Solid State Device
Is this correct? If so, that doesn't make sense.


Posts: 2016
Joined: 2015/02/17 15:14:33
Location: Bulgaria

Re: mkfs.ext4 unbelievably slow formatting 1TB partition

Post by hunter86_bg » 2020/03/05 15:04:29

Why I mentioned the alingment?!?
Your first partition ended at - 511991549.
Next one started at 511995904.

511995904 - 511991549 is 4355 and it shouldn't be like that, as everything that follows won't be aligned.

For partitioning - anything modern (bad example is fdisk from CentOS 7.0) is enough. I prefer to use fdisk & gdisk but you can use parted, cfdisk (tui based fdisk) , etc.

For the sizing use this example:

Code: Select all

 fdisk /dev/disk
 Select default  start
 For end  -> +250G
 Set  type
 Repeat using  +<Size>K/M/G for the end  boundary
Just test with a large partition - if speed is low - RMA the ssd.
Otherwise, if speed is OK - then it was an alignment.

User avatar
Forum Moderator
Posts: 29171
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: mkfs.ext4 unbelievably slow formatting 1TB partition

Post by TrevorH » 2020/03/05 16:31:32

It's the start sector of the partition that matters, not where it ends. And 511995904 is evenly divisible by 2048 (1MB) so should be fine.
CentOS 6 will die in November 2020 - migrate sooner rather than later!
Info for USB installs on
CentOS 5 is dead, do not use it.
Full time Geek, part time moderator. Use the FAQ Luke

Post Reply

Return to “CentOS 7 - Software Support”