I installed Ubuntu 12.10, and I don't know why, I have an ext2 partition.
- How can I convert this
ext2
file system to anext4
? - Will I lose all my data?
I installed Ubuntu 12.10, and I don't know why, I have an ext2 partition.
ext2
file system to an ext4
?
Follow the instructions detailed in this post: Convert ext2/3 to ext4
The short version for the impatient:
then
If you cannot unmount because it's your system partition, then of course you will need to first boot from another system like a Live CD.
And no, you will not lose data. Unless something very weird happens, in which case you will have to reach to your backup. (You do have backups, of course. Right?)
A lot has changed in ext4 since the article linked to in the accepted answer was written. There are a lot more ext4 features that can be enabled now. To convert an ext2 filesystem to a full-featured ext4 (at the time of this writing), The command is:
There really isn't a set "ext2", "ext3", or "ext4" any more. There is a whole spectrum of features. To see the features enabled for your extX filesystem, use the command:
The core set of features for ext2 are: ext_attr,resize_inode,filetype,sparse_super,large_file. Generally, ext3 is considered to be ext2 plus a journal. And ext4 is basically ext3 plus any combination of the rest of the available features. In the future they may name it ext5, 6 or 7. Really it's all one filesystem family with a variable set of features.
To find out what the most current set of extWHATEVER features are at the time you read this, the best thing you can do is just create a small filesystem and look at its feature list. For ext4 it is:
Look at the line that says "Filesystem features:" and it will tell you what features have been included on that filesystem. At the time of this writing it is:
Once you do that, you can create your own method for updating your extX to the extLATEST. Do a dumpe2fs on the filesystem you want to upgrade and compare the features on it to the features on your test ext filesystem. For any or all of the features that are missing on the old filesystem you:
Once you are done adding the features, force a filesystem check with:
And you have just now ensured your extX is now the extLATEST with all the available features.
As an alternative, you can enable some of the features of ext4 by running the following command, and rebooting: