Liquidstate

The digital home of Bryan Ross
  • rss
  • Home
  • About
  • Photos

Converting from Ext2 to Ext3 filesystems

September 11, 2007

The tune2fs program can add a journal to an existing ext2 file system without altering the data already on the partition.If the file system is already mounted while it is being transitioned, the journal will be visible as the file .journal in the root directory of the file system. If the file system is not mounted, the journal will be hidden and will not appear in the file system at all. To convert an ext2 file system on the first partition of the disk /dev/sdb to ext3, log in as root and type:
[root@server] /sbin/tune2fs -j /dev/sdb1
[root@server] mount -o remount /dev/sdb1

Obviously, you will need to change this to match the filesystem you want to change. You can find out the device name for a partition, and check whether its using ext2 or ext3 by looking in /etc/mtab.

After you have converted the filesystem, be certain to change the partition type from ext2 to ext3 in /etc/fstab. If you forget to do this, the filesystem should still mount, but will still be in the backward compatible Ext2 mode.

If you are transitioning your root file system, you will probably also have to update your initrd image in order to boot with your new ext3 filesystem. To create this, you can use the mkinitrd program.
[root@server] mkinitrd -f /boot/initrd-($uname -r).img $(uname -r)

mkinitrd should automatically sense (using ‘lsmod’) that you are now using ext3, and insert the relevant modules into the initrd ram disk image for you. Again, if you fail to update the initrd ram disk image, the system should still boot, but the root file system will be mounted as ext2 instead of ext3. As before, you can check the status by viewing /etc/mtab.

Categories
Linux
Tags
disks, Linux
Trackback
Trackback

« Performance testing with Bonnie++ How to fix a failed RAID-1 array »

Navigation

  • Apple (1)
  • Diving (60)
  • Linux (11)
  • Microsoft (2)
  • Sailing (24)
  • Uncategorized (2)

Photos (view gallery)

IMG_1768IMG_1759IMG_1769IMG_1767IMG_1755IMG_1761IMG_1775IMG_1754IMG_1756

Meta

  • Log in
  • Entries RSS
  • Comments RSS
  • WordPress.org
rss Comments rss valid xhtml 1.1 design by jide powered by Wordpress get firefox