The Linux file systems
EXT3 have now gone outdated. It is the time to convert the old file systems to the latest one,
EXT4 filesystem is faster and more reliable than the previous versions.
You don’t have to reinstall the system; you can simply convert your existing file system to
EXT4 by keeping the stored data unaffected.
So, how to migrate the
ext3 partition to
First backup all your data then follow the given steps.
1. First of all, check for your kernel.
uname –r command to know the kernel you are using:
Proceed with the next step if you have kernel 2.6.28-11-generic or higher.
[email protected]:/# uname -r 3.16.0-4-amd64
2. Boot from Ubuntu Live CD and start to convert the filesystem to ext4
Run the following command to convert from
sudo bash tune2fs -O extents,uninit_bg,dir_index,has_journal /dev/sda1
For converting from
ext4, run the command:
sudo bash tune2fs -O extents,uninit_bg,dir_index /dev/sda1
/dev/sda1 is the drive
/ partition name to be converted. To get a list of all partitions, use the command:
4. Check the filesystem for errors:
sudo commands, run
fsck command to fix any repair issue that might have occurred during the above steps:
e2fsck -pf /dev/sda1
5. Mount the filesystem
Run sudo mount command to mount the partition:
sudo mount -t ext4 /dev/sda1 /mnt
You can check
/mnt directory to ensure that the previous data is present there unaffected.
6. Update the filesystem type in fstab file
/etc/fstab file of your original system. If you mounted it to
/mnt, then the path is
Search for previous file system reference
(ext2 or ext3) and edit it to
ext4. Save the changes made to the file and exit.
7. Update grub
Now run the sudo bash command to refresh grub:
Once all done, unmount
/dev/sda and reboot the system.
cd /tmp umount /mnt shutdown -r now
If there is some damage to the Linux file system, you can fix it using
fsck utility. It works well for
ext4 File Systems. To Repair Linux
ext4 file system, run the following commands as root user.
– First un-mount the file system:
/dev/sda1 in the above command with the name of the damaged filesystem.
eg. umount /dev/sda3 or umount /home
Here, Fs-Name can be a device name, mount point, ext2 label, UUID specifier
For example, Run:
fsck -t ext3 /dev/sda1
– Here, using (‘-t’ or ’.’ you can specify the file system type)
– Pass the ‘y’ or ’N’ option along with the fsck command like this:
fsck -y /dev/sda3. Or you can type it every time the system asks yes or no while
– After running the
fsck command the system would check for errors in the file system.
– Remount the system after
fsck process has been completed.
Note: If you are cautious about any of the commands given above, I would like to suggest you that instead of trying the above manual tools opt for some automatic file system conversion and repair tool for Linux.
If want to run the manual steps given above ‘don’t forget to backup all you data before proceeding.
Fsck failed to repair the Linux file systems?
No worries, you can try out the Linux recovery tools that allow you to recover the inaccessible data from any Ext4, Ext3, Ext2, exFAT, FAT32, FAT16, and FAT12 file system based LINUX volumes in an easy and safe way as compared to the manual mode.