Converting from Ext3 back to Ext2

There may come a time when you want to convert back to Ext2. For directories other than the root directory or /usr, it’s pretty easy. The following once again uses the example of /dev/hda10 mounted to directory /test:

  • umount /dev/hda10
  • tune2fs -O ^has_journal /dev/hda10
  • e2fsck /dev/hda10
  • Edit /etc/fstab to change /dev/hda10 to mount type ext2
  • mount /dev/hda10

The tune2fs command removes the journal inode, and the e2fsck command completes that removal.

Back-Converting the root directory


The root directory is a challenge for a number of reasons. First, it must be mounted for the system to run, but it must be unmounted to run the e2fsck command. Also, different distros behave different ways. The mkinitrd command varies widely between distros. The preceding works on a Red Hat 8.0 machine, but other machines might require other solutions. We’ll assume that /dev/hda1 is /boot, while /dev/hda2 is the root directory (/).

  • Log in as root
  • Edit /etc/fstab to change the /dev/hda2 line from ext3 to ext2
  • reboot
  • Log in as root
  • mv initrd-2.4.18-26.8.0.img initrd-2.4.18-26.8.0.img.ext3
  • mkinitrd initrd-2.4.18-26.8.0.img 2.4.18-26.8.0
  • Place your Knoppix CD in the CD drive
  • reboot
  • Notice you are now booted to Knoppix
  • Ctrl+Alt+F2 to access a root prompt
  • umount /dev/hda1
  • umount /dev/hda2
  • tune2fs -O ^has_journal /dev/hda2
  • e2fsck /dev/hda2
  • mount -t ext3 /dev/hda2 /mnt/hda2
    • This should fail. If it does, it proves that the partition no longer has a journaling inode.
  • reboot
  • Remove the Knoppix CD and press Enter as prompted
  • Notice you are now booted to the original operating system (hopefully)
  • Log in as root
  • Execute a mount command to verify an Ext2 root partition.

Back Converting the /usr directory

Assume that /usr is mounted by /dev/hda4

  • Place your Knoppix CD in the CD drive
  • reboot
  • Notice you are now booted to Knoppix
  • Ctrl+Alt+F2 to access a root prompt
  • umount /dev/hda4
  • tune2fs -O ^has_journal /dev/hda4
  • e2fsck /dev/hda4
  • mount -t ext3 /dev/hda4 /mnt/hda4
    • This should fail. If it does, it proves that the partition no longer has a journaling inode.
  • reboot
  • Remove the Knoppix CD and press Enter as prompted
  • Notice you are now booted to the original operating system (hopefully)
  • Log in as root
  • Execute a mount command to verify an Ext2 /usr partition.

 

source:troubleshooters.com/linux/ext2toext3.htm