site  contact  subhomenews

mke2fs created wrong block size

March 19, 2020 — BarryK

I posted recently to the Puppy Forum about RAM error in my old HP tower workhorse PC:

http://murga-linux.com/puppy/viewtopic.php?t=118273

...after cleaning and reinserting the RAM sticks a few times, the PC was working again. However, my confidence in the reliability of this PC has dropped. For EasyOS, etc., development work, I need absolute confidence in the hardware. The last thing I need is "bit rot" due to a RAM stick acting up.

So decided to take the plunge, and buy a new computer. I thought about buying the components, but doing the sums realised that a ready-built PC is cheaper. Just want what is the minimal that is fast enough and has enough features, and chose this, for AU$719:

https://www.officeworks.com.au/shop/officeworks/p/lenovo-ideacentre-desktop-computer-i3-silver-510s-0gs-sl510s0gi3

Officeworks sell it as a "510S-0GS", however on the label it is identified as "510S-071CB". Beautifully constructed, very small but has everything I need -- first time I ever acquired a tower PC with Bluetooth and wi-fi built-in!

img1

It has an Intel i3 CPU, optical drive, 256GB NVME SSD with Windows 10 Home, PCI-E 1X and 16X expansion slots, and a bay for a 3.5 inch drive. I put in a 8TB hard drive, so as to consolidate files currently spread across a few drives.

Now getting onto the title of this post, a problem with ext4 block size...

I created partitions on the hard drive. One is a 1.3GB fat32 esp, for UEFI bootup purpose. One big ext4 approximately 6.3TB partition, a swap partition, and numerous smaller ext4 partitions. One of those smaller partitions is 48GB, intended to be the working-partition for EasyOS -- but much to my surprise, GParted created it with a block size of only 1024 bytes. GParted created the 6.3TB filesystem with 4096 block size, as expected.

Block size of ext4 filesystems should be 4096 bytes, to match x86_64 page size. This is required for filesystem encryption to work. GParted calls the 'mkfs.ext4' utility to do the actual job, and this automatically decides on the block size. It will only choose a 1024 byte block size for a very small partition.

But, something has gone wrong, and 'mkfs.ext4' chose 1024 for the 48GB partition. I went though the exercise of deleting all partitions and recreating them in GParted -- and this time it was correct, the 48GB partition has a 4096 byte block size!

Very odd indeed. Something to watch out for, so I have put a warning into this page:

https://easyos.org/install/how-to-install-easyos-on-your-hard-drive.html

...I also put in a recommendation not to disable the journal for SSDs. The above link explains how to fix the block size, if perchance you ever encounter this problem.

Hey, one thing I won't miss -- my old HP tower sounded like an aeroplane taking off, and served as a room heater. The Lenovo is very quiet and remarkably cool.  

Tags: easy