Does CentOS 5.x support ext4?

Posted on

Does CentOS 5.x support ext4? – Managing your servers can streamline the performance of your team by allowing them to complete complex tasks faster. Plus, it can enable them to detect problems early on before they get out of hand and compromise your business. As a result, the risk of experiencing operational setbacks is drastically lower.

But the only way to make the most of your server management is to perform it correctly. And to help you do so, this article will share nine tips on improving your server management and fix some problem about linux, centos, ext3, ext4, .

I believe the default OS file system in CentOS 5 is ext3.

Is it possible to use ext4 on Centos 5.x, or only on 6.x? Can I upgrade an existing ext3 filesystem to ext4?

Solution :

In addition to Kenny Rasschaert’s answer:

You can find a nice explanation here:

http://www.debian-administration.org/article/Migrating_a_live_system_from_ext3_to_ext4_filesystem

Be warned that it can be dangerous and you should make a backup before attempting to do this.

Converting a root filesystem to ext4

Converting a root filesystem is a bit more tricky because you cannot unmount it, as your system is running on it. Nevertheless it is still possible to do it without using an external bootable media. You should do this in a single-user mode.

First step is to modify your /etc/fstab file to say “ext4” instead of “ext3” for root partition. This is important because you will be operating on a read-only filesystem later, and will not be able to make the change, and this would result in your system unable to mount a root filesystem on next boot.

Let us assume that root partition is /dev/sda1, so your /etc/fstab should look something like this.

/dev/sda1 / ext4 defaults 0 1

Now remount the root filesystem read-only.

mount -o remount,ro /

Then run a filesystem check on the root filesystem.

fsck.ext3 -pf /dev/sda1

It will tell you to reboot the system. That may be a good idea, so simply boot into single-user mode and remount it read-only again. It is fine even though we have already modified /etc/fstab, because ext3 can be mounted as ext4 without conversion.

Next, enable all the ext4 features on the root filesystem.

tune2fs -O extents,uninit_bg,dir_index /dev/sda1

And run run a filesystem check on the root filesystem again. It will find and fix errors. This is normal.

fsck.ext4 -yfD /dev/sda1

You can now reboot to your new ext4 system, and enjoy faster filesystem check times, better performance, and all the improvements of ext4. Well, almost; read the next section.

According to the Red Hat docs, ext4 is supported in version 5.6 and above.

Install the e4fsprogs package for ext4 utilities. In versions older than 5.6, these utilities may be found in the package ext4dev.

This could be too old, but the default grub in CentOS 5 can’t boot from ext4.
Just found this in the hard way – got kernel panic after converting /root (thus /boot) to ext4.

Check here for a working procedure:
http://blog.endpoint.com/2013/06/converting-root-filesystem-from-ext3-to.html

Note that have to install e4fsprogs before the procedure, and replace the “tune2fs” with “tune4fs”.

Leave a Reply

Your email address will not be published.