enable ext4 features

my ext4 home partition dates back several years and is lacking a few benefical flags/attributes (64bit, metadata_csum) when compared to the rest of the system.

the arch wiki holds some infos on how to activate these flags on existing filesystems:

https://wiki.archlinux.org/index.php/Ext4#Enabling_metadata_checksums

on the other hand, you find (dated?) statements like: "Obviously, 64bit mode cannot (currently) be enabled on existing filesystems" over here:

https://ext4.wiki.kernel.org/index.php/Ext4_Metadata_Checksums

what do think of enabling these ext4 features on the fly? is it worth the trouble. anyone done this before?

first you will have to add module to kernel

Enabling metadata checksums

When a filesystem has been created with e2fsprogs 1.44 or later, metadata checksums should already be enabled by default. Existing filesystems may be converted to enable metadata checksum support.

If the CPU supports SSE 4.2, make sure the crc32c_intel kernel module is loaded in order to enable the hardware accelerated CRC32C algorithm [7]. If not, load the crc32c_generic module instead.

To read more about metadata checksums, see the ext4 wiki.

then reboot on installer USB

Convert existing filesystem

Note: A filesystem should not be mounted -- > reboot with USB install manjaro
--> in case it goes wrong do a backup BEFORE

First the partition needs to be checked and optimized using e2fsck :

e2fsck -Df /dev/path/to/disk

Convert the filesystem to 64bit:

resize2fs -b /dev/path/to/disk

Finally enable checksums support:

tune2fs -O metadata_csum /dev/path/to/disk

1 Like

hi stephane,

thanks for answering.

i have reinstalled majaro with the help of calamares not too long ago, so except for /home, all partitions have been adjusted before and offer these extra flags already.

my cpu supports sse 4.2, though i have not yet added crc32c_intel hook to GRUB_CMDLINE_LINUX_DEFAULT.

the question that bothers me: is it recommended to apply these changes to an existing filesystem - or perhaps is it recommended at all?

the second link even states it is currently(?) impossible to do so? having 64bit metadata_csum support to me, seems a good thing to have - but i could also imagine that it will slow down things?

or, to work around this, better consider booting into manjaro-live, reformat /home with kdeparted, than install grsync and sync my backup to new /home in live-mode? probably fstab and permissions would have to be altered accordingly to my previous installation though...

so many choices, i just thought i share this with you guys and girls and see what you think about it, well that's it :slight_smile:

the second link in first post is very old, it is from 2013, so the arch wiki entry seems the way to go in order to also enable a 64bit flag on existing ext4 fsystems -- this should be no prob as of e2fsprogs 1.45.2-1 (june 2019).

concerning the modprobing of crc32c_intel module, this seems to be the default on my manjaro installation already:

lsmod:

Module                  Size  Used by
crc32c_generic         16384  0
crc32c_intel           24576  8

so, i think i'll give this a try.

what is the current calamares default ext4 fs features for a ssd /home partition? i might add else missing features in one rush.

Not 100% sure, but I think it's just the defaults from /etc/mke2fs.conf, and mount options are probably defaults,noatime.

i see, will have a look at it, thanks torvic.

in case anyone recently did an installation of manjaro-18.0.4-stable-x86_64.iso -- could you please give me the output for your /home partition

sudo dumpe2fs -h /dev/sdXN

Those who use ext4 encryption feature encrypt should be careful with that command as it prints the encryption salt. But it's not enabled by default, just thought that it would be worth a mention.

1 Like

true, but my only interrest is the ssd's filesystem features anyways. please make sure to leave out the rest :slight_smile: