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 an ext4?
  • Will I lose all my data?

Follow the instructions detailed in this post: Convert ext2/3 to ext4

| improve this answer | |
  • Will I lose all my data? How do I know if my boot partition is SEPARATE? Should I do the Step 3 or not? – Lucio Nov 2 '12 at 19:21
  • 3
    You won't lose you're data, unless you do something incorrectly. If you're worried about data loss, you should always back it up somewhere else first. You can use mount to show what partitions are mounted where. You can also run sudo parted list to print a list of partitions. – dobey Nov 2 '12 at 20:14
  • The command sudo parted list doesn't work, but sudo parted -l does. – Lucio Jan 13 '13 at 22:23
  • Note that this only enables some of the features of ext4. Some can not be enabled without reformatting. – psusi Aug 26 '13 at 2:21
  • 1
    Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference. – jrg Jun 15 '17 at 17:11

The short version for the impatient:

dev=/dev/sdXn # <-- Adjust this


umount $dev && tune2fs -O extents,uninit_bg,dir_index,has_journal $dev && e2fsck -v -pf $dev

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?)

| improve this answer | |
  • Reformat the drive
  • Yes

As an alternative, you can enable some of the features of ext4 by running the following command, and rebooting:

sudo tune2fs -O has_journal,uninit_bg,extents /dev/sda1
| improve this answer | |
  • 1
    The partition may not be /dev/sda1 ... ? – Clive van Hilten Nov 2 '12 at 18:39
  • @user30275, obviously.... – psusi Nov 2 '12 at 18:56
  • to psusi - in which case you should have pointed this out to the OP – Clive van Hilten Nov 3 '12 at 9:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.