Saturday, December 13, 2008

Adding Reiser4 and Ext4 support in the 2.6.27 kernel

I recently bought a new hard drive, and thought that I might try some "new" filesystems that I haven't used before. Therefore I went with the Reiser4 (not supported in the kernel, and won't be in the near feature for several reasons) and Ext4 (which will be in 2.6.28).

To add support for these file systems we need to patch the kernel with the official patches that we can find here and here respectively. Download the files (to your desktop in this case) and extraxt them into your kernel directory.

# cd ~/Desktop/
# gunzip reiser4-for-2.6.27.patch.gz
# bzip2 -d 2.6.27-ext4-2.bz2
# sudo cp reiser4-for-2.6.27.patch 2.6.27-ext4-2 /usr/src/linux/
# cd /usr/src/linux

Then su and type in you password (or do the rest with sudo). To apply the patch we use the command "patch", with the -p argument.

# patch -p1 < reiser4-for-2.6.27.patch
# patch -p1 < 2.6.27-ext4-2

Then we need to enable it.

# make menuconfig

and enable the new filesystems that exists under the "File Systems". Build the kernel and install it.

# make all modules_install
# make install

Then let's cross our fingers and hope it works!