Convert ext2 or ext3 or ext4 in Linux without losing data

Convert ext2 to ext3, How to Convert ext2 to ext4 filesystem, how to convert ext3 to ext2, convert ext3 to ext4 in linux, how to convert linux filesystems

Convert ext2 or ext3 or ext4 in Linux without losing data
This article shows you how to convert one filesystem to another filesystems in linux without losing the data. By default, Linux will have anyone of these filesystems Ext2, ext3, ext4 and xfs. It doesnt matter the disk partition is a standard partition or LVM Partition.

We will discuss the below scenarios.

1. How to convert ext2 filesystem to ext3 filesystem in Linux
2. How to convert ext3 filesystem to ext2 filesystem in Linux.
3. How to convert ext2/ext3 filesystem to ext4 filesystem in Linux

For example, Lets see how to convert the below disk partition /dev/sdb1 which is mounted on /mnt1 with ext2 filesystem and this volume has some data. It doesnt matter the disk partition is a standard partition (/dev/sdb1) or LVM (/dev/volgroup01/lvol01). If you are going to do this conversion on LVM, just replace the /dev/sdb1 with your logical volume. Always take a backup before doing this kind of activities which is recommended.
[root@server ~]# df -h /mnt1
Filesystem      Size  Used Avail Use% Mounted on
/dev/sdb1       248M  199M   38M  85% /mnt1
[root@server ~]# mount | grep -i /mnt1
/dev/sdb1 on /mnt1 type ext2 (rw,relatime,seclabel,stripe=8192)
1. How to convert ext2 filesystem to ext3 filesystem in Linux without losing the Data.
Unmount the disk from the mount point.
[root@server ~]# umount /dev/sdb1
To convert ext2 to ext3 filesystem, Use tune2fs command along with "-j" option which enables the journaling.
[root@server ~]# tune2fs -j /dev/sdb1
tune2fs 1.42.9 (28-Dec-2013)
Creating journal inode: done
Mount the partition using mount command.
[root@server ~]# mount /dev/sdb1 /mnt1
Check the filesystem type of the mountpoint.
[root@server ~]# mount | grep /mnt1
/dev/sdb1 on /mnt1 type ext3 (rw,relatime,seclabel,stripe=8192,data=ordered)
Filesystem type got changed from ext2 to ext3 as expected.

2. How to convert ext3 to ext2 filesystem in Linux without losing the data.
Unmount the disk from the mount point.
[root@server ~]# umount /dev/sdb1
To convert ext3 to ext2 filesystem, Use tune2fs command along with "-O ^has_journal" option to disable the journaling features.
[root@server ~]# tune2fs -O ^has_journal /dev/sdb1
tune2fs 1.42.9 (28-Dec-2013)
Creating journal inode: done
Mount the partition using mount command.
[root@server ~]# mount /dev/sdb1 /mnt1
Check the filesystem type of the mountpoint.
[root@server ~]# mount | grep /mnt1
/dev/sdb1 on /mnt1 type ext2 (rw,relatime,seclabel,stripe=8192)
Filesystem type got changed from ext3 to ext2 as expected.

3. How to convert ext2/ext3 filesystem to ext4 filesystem in Linux without losing the Data.
Unmount the disk from the mount point.
[root@server ~]# umount /dev/sdb1
To convert ext2/ext3 to ext4 filesystem, Use tune2fs command along with "-O extents,uninit_bg,dir_index" option enable the journaling features.
[root@server ~]# tune2fs -O extents,uninit_bg,dir_index /dev/sdb1
tune2fs 1.42.9 (28-Dec-2013)
Creating journal inode: done
Mount the partition using mount command.
[root@server ~]# mount /dev/sdb1 /mnt1
Check the filesystem type of the mountpoint.
[root@server ~]# mount | grep /mnt1
/dev/sdb1 on /mnt1 type ext4 (rw,relatime,seclabel,stripe=8192)
Filesystem type got changed from ext2/ext3 to ext4 as expected. Your data will be remain same.

Thanks for reading our post. share with your friends. We appreciate your feedback, Leave your comments if any.
We have more articles to be updated soon. To not miss any updates, Follow us on social networking sites and Subscribe us on our Youtube channel.

Keywords : Convert ext2 or ext3 or ext4 in Linux without losing data, How to Convert ext2 to ext3, How to Convert ext2 to ext4, How to Convert ext2 to ext3 without losing data, convert ext2 to ext3 online, convert ext3 to ext4, convert ext3 to ext2, convert ext3 to ext4 without losing data, how to convert ext3 to ext4, convert ext3 to ext4 in linux, convert ext4 to ext2, convert ext4 to ext3, how to convert linux filesystem, how to convert ext3 to ext4 in linux, how to convert ext2 to ext3 filesystem in linux, how to convert ext3 to ext4 in redhat linux
May 24, 2016

Post a Comment

[disqus][facebook][blogger]

Contact Form

Name

Email *

Message *

Powered by Blogger.
Javascript DisablePlease Enable Javascript To See All Widget