Rebuilding onto an unsupported filesystem (using XFS as an example)

[Anecdote below is from when I was forced to do an emergency server rebuild under stressful conditions, but nonetheless decided to go out of my way to convert over the the XFS journaling filesystem, as part of that process. Since this happened in 2001, all software versions mentioned are long obsolete; support for journaling filesystems is now routine, and few admins would now go to the lengths described. However, I've retained the description because it lists generically steps sufficient to convert to any arbitrary filesystem, and thus is of ongoing interest.]

From: (Rick Moen)
Date: Mon May 14 00:59:01 2001
Subject: [svlug] On Penguinizing the PowerBook 520

[Snip material about a system rebuild that is not relevant to this topic]

Thursday evening, I was finally able to take a breather and ponder what type of system I was going to rebuild onto. Given power outages and other mishaps, it seemed timely to try one of the journaling filesystems — but I needed to hurry, having already had two days of downtime. ReiserFS has recently become stable enough, but its fsck utility is acknowledged to be still useless. ext3 was a possibility (on 2.2.x). Both were probably slower than the third possibility, SGI's XFS, which is wonderful on Irix, but required some pretty scarily pervasive kernel modifications to port to Linux. And it is available as third-party patches to 2.4.2 or 2.4.3, only. Generally, I would have preferred 2.2.19 over any of the 2.4.x releases, which still seem a bit raw. (Are the filesystem corruption bugs truly gone?) Eventually, I decided on kernel 2.4.3 with the two patches necessary for XFS (one to add the driver, and the second to rip out and replace parts of the kernel). I'd still rather be on 2.2.19, but what can you do?

The first step was to upgrade Debian 2.2 "potato" to support kernel 2.4.x support packages listed (and made available) here: (Probably simply upgrading to the "woody" AKA "testing" development branch would have taken care of this, but I was in a hurry.) Note that you have to enable initrd (initial RAMdisk) support in lilo to make this work. Details here:

[Snip other rebuild details.]

Next, I got the 2.4.3 kernel sources (since there's no XFS for 2.4.4, yet,*other than CVS checkouts), patched it, and compiled. As I mentioned elsewhere, there's a nasty bug in the aic7xxx driver's Makefile.** Fix is described here:
Then, it compiles. Edit lilo configuration, re-run /sbin/lilo, reboot. Make an XFS filesystem. Good, I can mount it!

Copy /usr over to it. Delete that tree from the cramped temporary root filesystem. Remount /usr from the XFS partition. Edit /etc/fstab ("root=" line). Reboot, to make sure it comes up properly. Good! Make another XFS filesystem. Copy / over to it. This becomes my maintenance partition, for emergency recoveries in the future. Edit /etc/lilo.conf and /etc/fstab to use it as my temporary root filesystem until I can rebuild the regular one. Reboot; it works. Go to sleep.

Friday morning, I go off for the workday. When I have a chance, I remotely log back into my server from work, reformat the original root filesystem as XFS, mount it on /mnt, copy the temporary root filesystem to it, edit /etc/fstab and /etc/lilo.conf again, reboot. Wait. Wait. No response to ping. Damn.

Friday evening, I come home: Apparently, it choked on the root filesystem's mount options, which I had carried forward from the Debian defaults, like this:

/dev/sda2 / ext2 defaults,errors=remount-ro 0 1

Except I had just edited the "ext2" to "xfs". The "errors=remount-ro" seemed to have caused the system to come up with that filesystem mounted read-only. The moment I edited that to "rw" and rebooted, everything was fine. I copied back all my backed-up datafile trees, then set about deciding what daemon software to run.

[Snip post-build configuration and software choice, and discussion of an unrelated Linux-on-Macintosh installation issue.]

From: (Rick Moen)
Date: Mon May 14 16:54:01 2001
Subject: [svlug] On Penguinizing the PowerBook 520 (was: svlug digest, Vol 1 #757 - 13 msgs)

begin Al Udal quotation:

> That was very instructive lesson in system rescue operations, thank
> you.

No problem. The process itself was pretty discouraging, and long, but it came out all right. I still have to yank the 9 GB IBM drive, and see if it's still under warranty.

I also forgot to mention a few other things:

[Snip material not directly relevant.]

By the way, for those considering taking Debian (and derived) systems to the Debian-testing branch and kernel 2.4.x with the XFS journaling filesystem, I've posted the necessary links here:

Some longer-term lessons:

[What I posted at :]

Re: Debian and SGI XFS? (Score: 2, Informative)
by Anonymous on Monday, May 14 @ 20:47:25 BST
Some hyperlinks would probably be handy:

You'll also need to have packages kernel-package (recommended but not essential), perl, dpkg, patch dpkg-dev, fileutils, libc6-dev, gcc, debianutils, make, libdb3-dev, and libncurses5-dev. The 2.4.2 and 2.4.3 kernel sources are no longer available as .debs, but you can get tarballs [ ]. If you'll be using 2.4.3's Adaptec SCSI aic7xxx driver, you'll also need to fix a broken Makefile
[ ] before you'll be able to successfully compile the kernel.

Date: Thu, 14 Mar 2002 19:28:53 +1100
From: hogan
Subject: Re: Loading Kernel modules on install
X-Mailer: Sylpheed version 0.7.2 (GTK+ 1.2.10; i386-debian-linux-gnu)

I successfully used the ISO mentioned at:
which links to:

This uses the 2.4.x kernel - so has the more current 8139too instead of the dodgy rtl8139 driver ("more current" and "dodgy" are based on my experience).

The .de page also has boot floppies.


From: hogan
Subject: Re: Loading Kernel modules on install
X-Mailer: Sylpheed version 0.7.2 (GTK+ 1.2.10; i386-debian-linux-gnu)

To explain where XFS is in Debian in official terms..
Debian Weekly News
Debian Weekly News - March 13th, 2002
XFS based Boot Floppies. Two people are working towards integration of XFS into Debian's boot-floppies. Eduard Bloch created the first installations CD image for Woody and XFS which can be downloaded from [6]here. Angelo Ovidi started a new project on SourceForge called [7]XFDeb. He already created a rescue disk based on kernel 2.4.14 and XFS 1.0.2 and is going to create the root and drivers floppies, too. His aim is to unify his work with Ionut Georgescu's [8]Debian installer with SGI XFS support to offer the XFS journaling file system as an option at installation time.***


* As should be obvious, this is no longer the case.

** And this bug is long gone.

*** Bloch, Ovidi, and Georgescu's images have been joined by others, since. See my Debian installers page.