Differences

This shows you the differences between two versions of the page.

Link to this comparison view

guides:how-to-convert-ext2-to-ext4 [2016-08-24 11:39:34] (current)
shaun.reitan created
Line 1: Line 1:
 +====== How to convert a EXT2 file system to EXT4 ======
 +There may be a time when you need to convert a EXT2 file system to EXT4. This guide will help you through that process.
 +
 +<note warning>​These commands will make changes to your file system! Make sure you have a working backup before completing these steps!</​note>​
 +
 +===== First ensure your filesystem is not mounted! =====
 +Before proceeding you should make sure your file system is not currently mounted. If the file system your going to be doing this too is your root file system then you should boot off a recovery disk or live env.  You must make sure your disk is not in use!
 +
 +===== Force check the filesystem =====
 +Again, we cannot stress this enough. Make sure your FS is not mounted. ​ If it is, you going to cause damage!
 +
 +First run the following command.
 +<code console>
 +fsck /​dev/​mapper/​VolGroup00-LogVol00
 +</​code>​
 +
 +Chances are the FS is going to say it's clean. If it's not let it do it's thing and you can skip the next step. If the FS is clean, we are going to force a check on the FS.
 +<code console>
 +fsck -f /​dev/​mapper/​VolGroup00-LogVol00
 +</​code>​
 +
 +===== Convert to EXT4 =====
 +We can not use tune2fs to convert the filesystem to EXT4 using the following command.
 +
 +<code console>
 +tune2fs -O extents,​uninit_bg,​dir_index,​has_journal /​dev/​mapper/​VolGroup00-LogVol00
 +</​code>​
 +
 +===== Run final fsck check =====
 +Yep, we need to run fsck one last time! We are again forcing a fsck check, make sure the device is not in use!
 +
 +<code console>
 +fsck -f /​dev/​mapper/​VolGroup00-LogVol00
 +</​code>​
 +
 +
 +===== Verify the FS is now EXT4 =====
 +You can verify your device is now EXT4 by running the following command.
 +
 +<code console>
 +blkid /​dev/​mapper/​VolGroup00-LogVol00
 +</​code>​
 +
 +
 +
 +
 +
 +