Tuesday, December 2, 2008

Converting Ext2 Filesystems to Ext3

Ext2 is a fragmentation, redundant enough to be reliably regenerated on error yet diskspace efficient, fast, and adaptable. But when the computer is rebooted or powered off without correctly shutting down, Ext2 filesystems are placed in an error state. When the computer comes back up, the user is confronted with some mildly confusing, and very intimidating, messages and choices. Should he let the filesystem correct itself? Warning, this can lose data!
Journalized filesystems are made to eliminate such error messages.
You can boot with Linux Live CD (BOSS Live CD)
do following steps..

Converting from Ext2 to Ext3

Log in as root
  • umount /dev/hda10 //where hda10 is a device,on which filsystem we want to convert
    • If you can't unmount it, then remount it read only (mount -o remount,ro /dev/hda10)
  • tune2fs -j /dev/hda10
  • Edit /etc/fstab, and for /dev/hda10, change ext2 to ext3
  • mount /dev/hda10
  • /sbin/shutdown -h now
  • mount | grep /dev/hda10
    • If it's not shown as ext3, reboot, if still not, troubleshoot
    • Otherwise, you're done
if still you are getting error in # dmesg |tail for command #mount /dev/hda10 /mnt ..

JBD: no valid journal superblock found:

..means still journal is not created run this command once again #tune2fs -j /dev/hda10
if your / was ext2 and now you have converted in ext3 then we require to recreate initrd.
#cd /boot
#mv /boot/initrd.img-2.6.22-3-486 /boot/initrd.img-2.6.22-3-486_bkup
#mkinitrd initrd.img-2.6.22-3-486
#reboot

Converting from Ext3 back to Ext2



No comments: