Thursday, December 27, 2007

Convert -File System- ext2 to ext3

Lets get started.

If you can un-mount the partition which needs the change, perfect. Else you can remount it in
read-only mode

mount -o remount,ro /dev/xxx

If you want to un-mount the partition and it complains that the device/resource is busy, you can use a little brute force to get things done if you are sure nobody else is using it.


lsof | grep "<mount point>" | awk '{print $2}' | xargs kill -9

The above command may disturb other users logged in and  if they are using the machine. You should be sure that the machine is not shared with anyone else, hence make sure before you do. If the above trick does not work, you know what it does I hope, hence you can try do it yourself some other way. Once done, you can un-mount the partition. Next step is


tune2fs -j /dev/xxx

This will create ext3 file system in the partition specified. Once this is over "without any errors" you should change the "file system type" in /etc/fstab and make it ext3. Then do a


mount -a

To check whether its mounted properly and the file system type, do

mount

No comments: