The examples in this document assume that you just have one big partition for your root filesystem and don't have separate mounts for /home, /usr, etc. It's ok if you do have separate partitions for those, but you'll need to have enough free space to copy those to the new jfs partition, and modify the /etc/fstab file to remove them or change the mount points as necessary. Finally, my root filesystem is on /dev/hda5 and the new partition that I'm going to format as JFS is /dev/hda6. This is system specific though, so you'll need to substitute the right partitions from your system.
Something else to consider is that we will need to patch and recompile the kernel to add support for JFS. This isn't hard to do, but if you've never recompiled a kernel before, this probably shouldn't be your first experience with it.
The following sections describe the steps necessary to build a JFS root filesystem and boot from it.
#cd /usr/src #rm linux #tar -xvzf /tmp/linux-2.4.3.tar.gz #mv linux linux-2.4.3 #ln -s linux-2.4.3 linux #mkdir jfs #cd jfs #tar -xvzf /tmp/jfs-0.3.1-patch.tar.gz #cd /usr/src/linux #patch -p1 < ../jfs/jfs-2.4.0-v0.3.1-patch #patch -p1 < ../jfs/jfs-common-v0.3.1-patchConfigure the kernel using make config, make menuconfig, or make xconfig (whichever you prefer). In the section labeled "Code maturity level options", turn on the item that says "Prompt for development and/or incomplete code/drivers." In the section labeled "File systems" turn on the option for "JFS filesystem support." Make sure to turn on JFS support so that it is compiled into the kernel, NOT as a module. Configure the rest of the kernel as needed for your system. Build the kernel with a make dep; make clean; make bzImage and if necessary, make modules; make modules_install. Then, copy the new kernel into /boot.
#make dep #make clean #make bzImage #cp arch/i386/boot/bzImage /boot/vmlinuz-2.4.0-jfsNow we need to build the JFS utilities. These are the tools for formatting a JFS filesystem, checking it for errors, extending the size, and more.
#cd fs/jfs/utils #make #make installNext, we need to add an entry for LILO so that we can boot with our new kernel that can use a JFS filesystem. Edit /etc/lilo.conf and add an entry for the new kernel similar to this:
image=/boot/vmlinuz-2.4.0-jfs label=jfsboot read-only root=/dev/hda5Run /sbin/lilo to to activate the new configuration and reboot into the new kernel.
#mkfs -t jfs /dev/hda6 mkfs.jfs development version: $Name: v0_3_1 $ Warning! All data on device /dev/hda6 will be lost! Continue? (Y/N) y \ Format completed successfully. 5120608 kilobytes total disk space.
#mkdir /jfsvol #mount -t jfs /dev/hda6 /jfsvol #cd / #cp -a bin etc lib boot dev home usr var [...] /jfsvol #mkdir /jfsvol/proc
LABEL=/ / ext2 defaults 1 1We want to change that to say:
/dev/hda6 / jfs defaults 1 1You can now unmount /jfsvol. Edit /etc/lilo.conf to point to the new root partition. I'm paranoid, so I like to just copy and paste the one I already have for the jfs kernel and modify the root= line to point to the new partition. You'll also need to give it a new label. The new section on my system looks like this:
default=jfsboot2 ... image=/boot/vmlinuz-2.4.0-jfs label=jfsboot2 read-only root=/dev/hda6Make sure that you run 'lilo' again before you reboot.
/dev/hda6 on / type jfs (rw) none on /proc type proc (rw) none on /dev/pts type devpts (rw,gid=5,mode=620)Assuming everything works well, and you don't want or need to go back to your old system, the old root partition can now be reformatted as JFS and turned into a /home mount, or anything else you want.