Ext2 to Ext3 - Mini How-to
by Brent Norris
Written: 10/4/01
Things you will need:
- Newest kernel (goto Kernel.org)
- Alan Cox's -ac patches
- Latest Version of e2fsprogs
- Linux Box
What to do
- Un{b/g}zip and untar the kernel source into the
/usr/src
- Un{b/g}zip Alan's patch.
-
cd
into the resulting/usr/src/linux
directory. - Run the following command:
patch -p1 < ../patch-ac#
This will apply Alan's patch to the fresh kernel source. - Configure your kernel to include support for ext3 (under the filesystems submenu).
- Compile the kernel in the usual way.
- Don't forget to add it to lilo.
-
cd
to whatever directory you have the e2fsprogs and Un{b/g}zip and untar them. -
cd
to the resulting directory and run a./configure && make && make install
- Now you have two options
- Run a
tune2fs -j /dev/hdx#
for a previously made partition, this will create a .journal file in the/
directory. - Run a
mke2fs -j
on a new partition. This will create the filesystem with a journal that cannot be seen inside the filesystem. - Now edit the
/etc/fstab
file and remove the ext2 entries for the filesystems that you have converted. Replace them with ext3 - now
sync
and reboot. - select your new kernel
- Once it has booted login and run a
df -hT
this will show you all mounted filesystems and what type they are. Hopefully yours now say ext3 - If the above is correct then cycle the power on your machine and see if it comes up without an
fsck
. If this works... Congratulations you are done.
Why do it?
C'mon surely a Geek Factor will kick in here? No? Well ok then here are some facts to help you move forward. First if you are here in Bowling Green then you should know that the power grid sucks. I have lost track of the number of times the power has flipped. Then your machine starts the lengthy process of reboot and fsck
. Do you really have to time to wait through that? Or how about the fact that it is possible for the fsck
to move your important files (be they porn, mp3s or that all important term paper on "the mating habits of dust bunnies in the wild") into the lost+found
directory where they lose their titles and meaning to your life. All avoidable with this. Plus it will give you a serious lead in the races with your other geeks to see who can boot their machine faster. : )
Why use ext3?
Hey!! Why do I have to keep justifying myself to you? No wait, you are reading this cause you care, right? Ok then here are my thoughts on it. Many people think that reiserfs is the best of the journaling filesystems because it is the one that is already in the kernel. INCORRECT!!!! -2 points for being a sheep. In truth reiserfs is in the vanilla linux kernel more for the fact that Hans Reiser whined and complained until it was added. Hey Linus is a person too. After a while it is easier to give in than to fight. Kernel 2.4.0 was released and Hans felt rather "strongly" about the fact that reiser was not in it. Thus 2.4.1 was released with reiserfs in it. That has since accomplished some of what Hans wanted. It has given him a head start in the attempts to have a somewhat defacto standard journaling filesystem for Linux. Unfortunately what his mouth could accomplish his filesystem could not keep up with. Initial releases of ReiserFS had problems correcting themselves, had issues with journaling properly, and in truth just plain lost peoples data. I don't know about you but these were reasons that I wanted to switch to a journaling filesystem. Plus the stuff about having to re-format the partition and such makes it a real hassle. While most of the Linux distros were eagerly jumping on the ReiserFS bandwagon, redhat performed its own testing and used Alan Cox and his patches to test out ReiserFS. They deemed it too unstable and did not put it into their install. Only later did they release a heavily patched kernel to support ReiserFS. XFS: in truth I have messed little with XFS. I have heard several issues with it and lots of small files, but like I said I have not tested this. I also beleive that XFS partitions must be specially partitioned just like ReiserFS and as such if you want a root partition that is running it you are pretty much going to have to do a fresh install. As you can see from the process I wrote up there earlier that you do not have to repartition or even worry about a backup of the data. All the filesystem does is create a journal and keep it up to date with the actual filesystem. Unless you have a file named .journal
then I cannot see a way that you will lose any data. Ext3 was written by the people that wrote Ext2 who better to know the code and what it does? fsck
has been tried and tested, very few bugs are left in the code and it has not been known to randomly delete data from a hard drive like the reiser fsck has been known to do. Plus in truth I don't like the way Hans Reiser treats people who say there are things wrong with his filesystem, nor do I like the idea of his filesystem being put into the kernel just because he was the squeaky-ist wheel.