#pragma section-numbers on #format wiki #pragma supplementation-page on {{{#!wiki caution This HOWTO is only preliminary draft, so no stable version right now. Also better let the author work on it untill this notice is removed, thanks. Use the discussion page for any comment. Stable version to be found: * [[http://www.tldp.org/HOWTO/text/Ext4-Migration-HOWTO|Text version]] * [[http://tldp.org/HOWTO/Ext4-Migration-HOWTO/index.html|Html multiple pages]] * [[http://www.tldp.org/HOWTO/html_single/Ext4-Migration-HOWTO|Html single page]] * [[http://tldp.org/HOWTO/pdf/Ext4-Migration-HOWTO.pdf|PDF]] And other formats as well (may be) on the [[http://tldp.org/docs.html#howto|Stable HOWTOs page]] If necessary use the [[http://wiki.tldp.org/Ext4-Migration-HOWTO?action=supplementation|Discussion page]] to give comments. }}} == Discussion Page Content if any == <> == HOWTO == <> = Beginning = == Licence == {{{ Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts and no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License". }}} [[http://wiki.tldp.org/LdpWikiDefaultLicence#GNUFreeDocumentationLicense|GNU Free Documentation License]] == HOWTO Content == = Ext4-Migration-HOWTO = Karagasidis Dimitris<
>[[mailto:dkaragasidis@gmail.com|dkaragasidis@gmail.com]]<
>[[http://www.gatoni.gr/|http://www.gatoni.gr]]<
> == Table Of Contents == 1. Introduction 1. Before You Start 1. Preparing the Kernel 1. Getting the Kernel Sources 1. Applying the Latest Ext4 Patchset 1. Configuring, Compiling and Installing the Kernel 1. Configuring GRUB 1. Installing necessary utilities 1. Getting the latest version of e2fsprogs 1. Installing e2fsprogs 1. Using the ext4 file system 1. Creating a new ext4 partition 1. Converting an existing ext3 partition to ext4 1. References == Introduction == Ext4 is the next generation of ext2 and ext3 file systems, which dominate in the world of GNU/Linux systems. After more than two and a half years of development, ext4 is finally considered safe for use in production environments and the first stable version is inlcluded in Linux 2.6.28. This document covers all the necessary steps to migrate from ext3 to the new ext4 file system, since no GNU/Linux distribution supports the new file system by default, yet. == Before you start == There are few things that you should keep in mind before you start. First of all, back up all your important data. A mistake during this operation may result in partial or complete data loss. Currently, no stable version of grub can boot a kernel from an ext4 partition. So, make sure that your /boot directory, which contains the kernel (or kernels) and grub configuration files, is located on a different ext3 partition, which will not be converted to ext4 afterwards. Last but not least, you'll need development tools such as the GNU Compiler Collection, to compile the kernel and install utilities that are necessary for the procedure of migration to the new file system. == Preparing the kernel == === Getting the kernel sources === First of all, we need to get the latest stable version of Linux, which has support for ext4. At the time I write this lines, this version is 2.6.28.5. Go to [[|The Official Kernel Archives]] and download the ''full source'' of the latest stable kernel. This may take a while, depending on your line -the kernel source is approximatelly 50MB. After you download the kernel sources, extract them to /usr/src/ directory. Don't forget to link /usr/src/linux to /usr/src/linux-VERSION. ` gatoni@gentooBox ~ $ tar -xvjf linux-2.6.28.5.tar.bz2 -C /usr/src/<
> gatoni@gentooBox ~ $ ln -s /usr/src/linux-2.6.28.5 /usr/src/linux<
>` === Applying the latest ext4 patchset === As stated on official ext4 wiki, it's highly recommended to apply the latest [[|ext4 patchset]] to the kernel source. Once you download the patchset, move it to the source directory, extract it and apply it to the kernel source using the patch program. ` gatoni@gentooBox /usr/src/linux $ bunzip2 2.6.28-ext4-4.bz2<
> gatoni@gentooBox /usr/src/linux $ patch -p1 < 2.6.28-ext4-4<
>` === Configuring, compiling and installing the kernel === Before compiling the kernel, we should configure it. I suppose you're familiar with the the procedure of configuring a Linux kernel. In case you're not, a good starting point is the README file which is located in the kernel source's directory. Use `make menuconfig` to start the interactive kernel configuration utility. ` gatoni@gentooBox /usr/src/linux $ make menuconfig ` To enhance your kernel with support for ext4 filesystem, you should enter the ''file systems'' menu, and select ''The Extended 4 (ext4) file system'' to be built-in. Do not forget to select ''The Extended 3 file system'' support to be built-in to your kernel, since you will not be able to access your /boot directory or any other ext3 file systems you might have and wish to keep! After you finish configuring the kernel, you must compile it. Don't forget to do `make modules_install` in case you configured any parts of kernel as modules. ` gatoni@gentooBox /usr/src/linux $ make ` The compilation may take quite a while depending on your hardware. After it's done, you must copy the new kernel image to your /boot partition. It's highly recommended to keep your old kernel, in case something goes wrong. So make sure you don't overwrite your existing kernel. ` gatoni@gentooBox /usr/src/linux $ cp arch/x86/boot/bzImage /boot/linux-2.6.28.5_ext4 ` === Configuring GRUB === To be able to boot our new kernel, we must configure our boot loader, first. I'll describe the procedure of configuration of GRUB boot loader, since most mainstream GNU/Linux distributions use it as default. We'll append another boot entry to the GRUB configuration file, without modifying the ones that exist, so you can always boot your stable and working kernel, in case the new one has any issues. Open `/boot/groub/grub.conf` with your favourite editor. Now, you'll need to add a boot entry which has the following form: ` title ''title in boot menu''<
> root ''device''<
> kernel path/to/kernel root=root device<
>` For example, an entry might look like this: ` title Gentoo ( Linux 2.6.28.5, Ext4 Support )<
> root (hd0,0)<
> kernel /boot/linux-2.6.28.5_ext4 root=/dev/sda3<
>` For more information, refer to [[|GRUB manual]]. After adding a boot entry for our new ext4-enhanced kernel, save your changes and quit.