Google Analytics

Tuesday, November 23, 2010

Upgrading the root file system on a Linode to ext4

The ext4 file system has been around for a while now, so I figured I'd migrate my Linode's ext3 partition to it for some of the reasons listed here.

The major downsides would be that I wouldn't be able to use some nice tools that Linode provide, such as their automatic partition resizing and automatic backup solution, and their rescue distribution, Finnix, doesn't support it. (Edit: Their rescue distribution does now support ext4.)

Obviously you'd want to make sure you have a full backup before proceeding with this. I didn't, but I'm an idiot.

First you need to make sure you're using a recent kernel — probably 2.6.30 or higher. This is because some applications had made bad assumptions. I'm using the latest 2.6 Paravirt that Linode provides, which is My system is Ubuntu 10.10 64-bit.
  1. From the Linode Platform Manager, restart in rescue mode.
  2. Run the following commands to update Finnix with a recent e2fsprogs that supports ext4:
    1. apt-get update
    2. apt-get install debian-archive-keyring e2fsprogs
  3. Perform the actual ext4 conversion:
    1. tune2fs -O extents,uninit_bg,dir_index /dev/xvda (It will no longer be ext3 compatible after running this.)
    2. e2fsck -fDC0 /dev/xvda
  4. Shutdown and boot up through the Linode Platform Manager
  5. The system should automatically mount the partition as ext4.
Even though the system mounted the partition successfully I figured I'd change the /etc/fstab to reflect the new file system.