TuxPPC
TuxPPC
home   |   submit: news, guide,   |   volunteer   |     |  


Sponsored by
Sponsored by PowerMax.com

Buy iMac


News Editions

About iMac

About Linux

Getting Started

Getting Help

User Resources

Advertisement

Distributions

Software Picks






Search

 

Links
  iMacLinux Edition Saturday, 14 June 2003  



Posted by on Thursday December 13th, 2001 04:03:41 AM
ext3 is a journalized filesystem built on top of ext2. What this means, is that we basically have a disk partition formatted in ext2, but on top of that, we add a journal, which records all the changes done to the disk. When a crash occurs, the disk can rapidly be repaired using the data stored in the journal. But the ext3 filesystem also brings some other improvements, such as a better overall performance and improved data integrity features.

If you consider switching you current Linux partitions to ext3, this HowTo is for you.

Although ext3 and ext2 partitions remain fully compatible, ext3 has a lot of advantages. For instance, when your computer crashed (which should not happen too often in Linux, but it does...), all the disks that were not cleanly unmounted had to be verified by fsck when mounted again. On large disks with many files that check could take 10 minutes or even more. With ext3, the disk can be checked and repaired within a few seconds.

ext3 offers improved data integrity features, avoiding that garbage data gets saved into your files when a severe crash occurs. Also, as ext3 and ext2 remain fully compatible, the ext2 fsck program which has proven to be very efficient over the past years can be used to fix ext3 disks in case of very serious disk errors.

Also, the ext3 driver improves the overall speed of your disks by optimizing data access.

And finally, the most important advantage of ext3 is the easy transition. Converting an ext2 partition to ext3 can be done "on the fly" without the need to unmount your disks or even worse reformat them. And, you can also easily switch back to ext2, with the same comfort, if ever you can find a valid reason to do so.

So let's get started. On PPC machines, you need an ext3 capable kernel, recent versions of mount and fsck and or later.

Yellow Dog Linux 2.1 and SuSE 7.3 both are up to date on ext3 and you won't need any upgrades to switch to ext3. On other distributions or on older versions of YDL or SuSE, you have to verify that you have a recent 2.4.x kernel with ext3 support enabled and the latest version of the util-linux package (above all of the mount command) and of the e2fprogs package.

How those packages are provided is often distribution specific, so check for updates on your distro site.

If you want to compile your own kernel, under the filesystems menu, select ext3. Please also select "JBD debugging support", as it will produce useful diagnostics if something goes wrong. I highly recommend compiling those into the kernel and not as modules.

Once you have made sure that your software is recent enough, you'll have to do the following to update to ext3:

To convert an ext2 partition (eg. /dev/hda7) to ext3, type this as root into a terminal:

tune2fs -j /dev/hda7 (Of course you have to replace hda7 by the relevant partition on your system)

The partition does not need to be unmounted to do this. The command creates the journal system on top of the existing ext2 file system and does not modify any of your data on the disk.

If you want to create a new ext3 filesystem on an empty partition, do the following:

mke2fs -j /dev/hda8 (Of course you have to replace hda8 by the relevant partition on your system)

Well, that was already it for the conversion! Next thing to do is to modify the relevant entries in /etc/fstab

Open /etc/fstab (as root) in your favourite editor. Identify the line that is relevant for the partition that you have changed to ext3 and change ext2 to ext3 as Type indication.

The line will then look like this:

/dev/hda12 / ext3 defaults 1 1

instead of:

/dev/hda12 / ext2 defaults 1 1

Simple, isn't it? Save the changes.

A last step we want to do is to disable the annoying file system checks we know from ext2. On an ext2 volume, the file system is checked by fsck on every 20th mount or after 180 days, whichever comes first. As ext3 partitions don't need that much attendance and are able to repair themselves, we can disable those checks. To do so, simply type (always as root...):

tune2fs -i 0 -c 0 /dev/hda7 (Of course you have to replace hda7 by the relevant partition on your system)

Note that it may not be bad to run a manual fsck on the partition sometimes, just to make sure the partition is really clean. (I usually do it every few month)

So, all that's left to do now is to reboot and you can enjoy your ext3 enabled system :) As always, if there are any questions, comments or concerns, .

Search for Linux

The Fine Print: The following comments are owned by whoever posted them.
(Reply)

by on Friday December 14th, 2001 08:26:48 AM
I tried to upgrade to ext3. Yaboot installed fine, linux compiled OK (patched 2.2) and booted fine, tunefs was smooth, it even reboted with fstab changed to mount as ext3 and all was well. Then the test - pulling the power cable out the back. Yaboot didn't want to know and said the paritition was corrupted. I had to reinstall everything damnit. It's put me off that sort of thing for a good while.
by Barry on Friday December 14th, 2001 08:34:37 AM
RE: "On PPC machines, you need an ext3 capable kernel, recent versions of mount and fsck and yaboot 1.3.5 or later. Yellow Dog Linux 2.1 and SuSE 7.3 both are up to date on ext3 and you won't need any upgrades to switch to ext3. " My installation of YDL 2.1 displays the following on starting up: "Welcome to yaboot version 1.3.4-ydl"
by on Saturday December 15th, 2001 06:00:48 AM
That's weird, might be an issue with patched 2.2? All the people on 2.4 I heard of had a smooth transition. Did u try a fsck on it after it failed to boot?
by on Saturday December 15th, 2001 06:03:06 AM
According to their web page, YDL 2.1 has support for ext3. Maybe they use an enhanced yaboot 1.3.4? I'll try to find out...

In the meantime, if you want to be safe, better get your hands on yaboot 1.3.6

by on Tuesday January 01st, 2002 12:37:44 PM
Make sure you have an alternative method of booting an ext3 compatible kernel, especially if your bootloader doesn't natively support ext3. This is the case with the current version of quik if you use quik on your oldworld machine. BootX is cool with ext3, as it reads the kernel off your Mac OS partition.

At any rate, consider configuring yaboot to also load a kernel from an HFS or HFS+ partition, besides your normal ext3 partion. That will save lots of fustration.

If you use Quik, make sure to copy the kernel to a Mac OS partition and keep BootX handy.

Or even better, make sure you have a bootable ext3 compatible emegergency CD. You can't go wrong with that.

Walters' unstable Debian installer and kernel from should help you out.

by on Wednesday January 02nd, 2002 04:23:36 AM
As ext3 can still be mounted as ext2, this should not be an issue I think... Of course I haven't tried myself, but I don't see why the kernel should not be loadable from an ext3 partition. The old bootloader should simply see it as "ext2" partition.
by on Sunday January 13th, 2002 09:36:40 AM
Hi

In the article, it is mentioned that an ext3 filesystem does not need a fsck following a system crash. This is most certainly NOT the case.

A journalling filesystem logs changes which will be made to the filesystem. If the power fails during an operation which changes the state of the filesystem, the data in the journal can be used perform appropriate repairs.

Note that the data in the journal is ONLY valid if the kernel filesystem code is working 100% correctly. In the case of a system crash this is NOT guaranteed. When the kernel crashes due to hardware failure or a kernel bug, then it has unknown internal state, and the journal may NOT contain correct data. When this occurs, even journalled filesystems should be fscked.

The system which invokes a fsck every 20th mount is there to detect filesystem inconsistencies introduced by hardware failure, by kernel bugs, and by the phase of the moon. It is just as necessary on ext3 as it is on ext2. You can remove it if you wish, but ext3 gives you nothing extra to make this check unnecessary.

All filesystems (including journalled ones) should be periodically fscked as routine maintenance. In theory, you shouldn't have to unless there are bugs in the kernel or hardware. I can assure you that bugs exist in both.

Cheers, Alan
by on Sunday January 13th, 2002 11:58:00 AM
Yep, that's certainly correct. That's also why i suggested to periodically do a manual fsck on ext3 disks.
Furthermore, I don't think that such problems will occur very often. Kernels provided with recent distributions, which most users (should) use, usually are pretty stable. And even if you do use home brewn kernels, the risk of a severe kernel bug is in my opinion not that high. I've been using Linux for many years by now and never lost any data. (be it with ext2 or ext3) Of course, better safe than sorry :)
As for the hardware failures, well, i guess in most of these cases, fsck won't help either.

  Legal and Privacy Notices Copyright © 2001