MakeTechEasier
  • Home
  •  
  • About
  •  
  • Archives
  •  
  • Jobs
  •  
  • Advertise
  •  
  • Contact Us
  • Windows
  • Linux
  • Mac
  • Internet
  • WordPress
  • iPhone
  • Android
  • All Categories
    • Android RSS
    • Firefox RSS
    • Gaming RSS
    • Google RSS
    • google chrome RSS
    • Internet RSS
    • iPhone/iPod Touch RSS
    • Linux RSS
    • Mac RSS
    • Mobile RSS
    • OpenOffice RSS
    • PC Hardware RSS
    • Review RSS
    • Roundup RSS
    • Windows RSS
    • Windows Mobile RSS
    • WordPress RSS
    • WordPress Plugins RSS
  • rss icon
  • email icon
  • facebook icon
  • twitter icon

How To Upgrade From Ext3 To Ext4 Without Formatting The Hard Disk

Posted by: Damien on April 21st, 2009
  • 51 Comments
  • Share

ext4Yesterday, we have discussed some of the new features in Ubuntu 9.04 Jaunty. In that article, I did mention that the new filesystem – ext4 is stable, fast and backward compatible with ext2 and ext3. Today, we will look at how you can upgrade your existing ext3 filesystem to ext4 without reformating your hard disk.

Disclaimer: Anything that deals with the filesystem hack always involve certain risks. While we have tested it out and get it working on our systems, there is no guarantee that it will work for you. We shall not be responsible for any data loss or hard disk crash. Before you try this, please remember to BACKUP your system and important files.

Step 1: Upgrade your existing Ubuntu

First for all, upgrade your existing Ubuntu to Ubuntu 9.04. You can skip this step if you have already upgraded to Ubuntu 9.04.

Press Alt + F2 on your keyboard and type in

update-manager -d

The Update Manager will appear. Click on the Upgrade button.

dist-upgrade

Depending on your Internet connection, the upgrade could last for several hours.

At the same time, proceed to Ubuntu website and download the Ubuntu 9.04 LiveCD iso.

After you have downloaded the LiveCD, burn it into a CD or use the USB Startup Disk Creator (System -> Administration -> USB Startup Disk Creator) to create a bootable USB drive.

Once the system completes the upgrading, restart your computer and play around with it to make sure that it is working fine in your system.

When you are happy with the result, reboot the computer again, this time boot into your LiveCD.

Step 2: Upgrading to Ext4

Go to System->Partition Editor. This will show all the partition in your hard disk. Record down the filesystem ID of the partition that you want to convert to ext4.

gparted

Close the Partition Editor. Open a terminal, type the following:

sudo tune2fs -O extents,uninit_bg,dir_index /dev/XXXX

Replace XXXX by the filesystem ID that you have recorded just now.

Once that is done, type the following to fixed your partition:

sudo fsck -pf /dev/XXXX

Don’t forget to replace XXXX with your filesystem ID.

Mount your filesystem

sudo mount -t ext4 /dev/XXXX /mnt

Open the fstab file:

gksu gedit /mnt/etc/fstab

and change the ext3 entry to ext4. Save and exit.

edit fstab

Back to the terminal, we need to reinstall the grub bootloader.

sudo grub-install /dev/XXX

This time, replace the XXX by the filesystem without the number. For example, sudo grub-install /dev/sda

Close the terminal and restart the computer. Reboot into ubuntu 9.04.

In the terminal, type

df -T

You should see your filesystem mounted as ext4 now

check filesystem type

That’s all. Enjoy!


Damien Oh is the owner and chief editor of Make Tech Easier

Tags: ext3, ext4, format, Linux, partition, Ubuntu
1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...

Share and Enjoy!

  • Rss feed
  • StumbleUpon It!
  • Del.icio.us
  • reddit

Related Posts

  • How to Reformat an External Hard Drive to NTFS Format In Ubuntu Hardy
  • How To Auto-mount Your NTFS Partition In Ubuntu
  • How To Restore Grub In Ubuntu
  • How to Boot & Install Ubuntu Ibex From a USB Thumb Drive
  • How To Dual Boot Ubuntu Gutsy And Mac OSX Leopard 10.5.1

Popular Posts

  • Turn Your Ubuntu Hardy to Mac OSX Leopard 498 comment(s)
  • Turn Your Ubuntu Intrepid Into Mac OSX Leopard 311 comment(s)
  • 28 Coolest Firefox About:Config Tricks 122 comment(s)
  • How To Boot And Install Windows 7 From USB Flash Drive 122 comment(s)
  • Best 101 Free Computer Software For Your Daily Use 101 comment(s)

Enjoyed the article? Subscribe to Make Tech Easier today to get your daily updates of technology tutorials, tips and tricks.

Enter your email:

21 pingbacks/trackbacks (Click to open)

  • Linx am 11. 4. 2009 bis 21. 4. 2009 | tuxtux
  • Ubuntu 9.04 Jaunty Jackalope sale mañana « Gabuntu
  • IRC: #boycottnovell @ FreeNode: April 22nd, 2009 - Part 2 | Boycott Novell
  • IRC: #boycottnovell @ FreeNode: April 22nd, 2009 - Part 2 | All about MICROSOFT
  • Cómo pasar de ext3 a ext4 sin formatear | MuyLinux
  • Nueva Version de Ubuntu 9.04 “Jaunty Jackalope” « Cristian Recabarren Ortiz
  • Cómo pasar de ext3 a ext4 sin formatear « Tecnologia, Actualidad,y mucho mas….
  • Linux » Blog Archive » Cómo pasar de ext3 a ext4 sin formatear
  • Nueva Version de Ubuntu 9.04 “Jaunty Jackalope” « Cristian Recabarren Ortíz
  • wangyingqi’s blog » Ubuntu???????ext3?ext4
  • HowtoMatrix » How To Upgrade From Ext3 To Ext4 Without Formatting The Hard Disk
  • ?? Ext3 ? Ext4 » sshlog
  • Pasar de ext3 a ext4 sin formatear | Snapcodex
  • Linx am 11. 4. 2009 bis 21. 4. 2009 - testomat
  • Ronaldo Richieri » links for 2009-07-12
  • links for 2009-07-18 « Where Is All This Leading To?
  • Ext3 or ext4? That and upgrading to Jaunty | ProDevTips - dev notes and tutorials
  • ???? ?? ?????? ????? ???? ??????? ??? ex4 - ????? ?????? ?????
  • links for 2009-10-30 « Caiwangqin’s delicious bog
  • De Ext3 a Ext4 sense formatejar el sistema de fitxers « Microwordpress de @jrosell
  • Screenshots Tour of Ubuntu Karmic Koala 9.10 Beta – Make Tech Easier
[Click to close]

51 Responses

  • Debianero Rumbero says:
    April 21, 2009 at 5:31 pm

    As a disclaimer maybe you’d add that ext4 is ready in general but many user-land applications are not ready for ext4 yet.

    Reply
  • hussam al-tayeb says:
    April 21, 2009 at 6:11 pm

    did you just tell people to fsck a partition without unmounting it first?????

    Reply
    • Icewind says:
      April 22, 2009 at 5:54 pm

      Yes, but he does tell you to use a live-cd, so the drive isn’t mounted in the first place.

      Reply
      • djsonik says:
        April 24, 2009 at 12:32 am

        Crap. I did it, and didn’t read the ‘use LiveCD’ part, because it was in the same step as upgrading to 9.04, which I already did, and just assumed that I should fsck it anyways, despite the warning. I was able to boot into ubuntu after a few tries, but stuff is acting weird. I might as well reinstall fresh… >_>

        I know it is completely my fault for not reading directions fully, but I think you should make the notice you need to use a LiveCD a little more prevalent for idiots like me. :P Otherwise, the article was well written. All things considered, at least I learned a lesson. :)

        djsonik

        Reply
  • shamil says:
    April 22, 2009 at 2:13 am

    Just don’t use ext4 yet. It’s considered stable, but really is not. There is a risk of data loss currently.

    Reply
  • hussam al-tayeb says:
    April 22, 2009 at 6:05 pm

    Good, I see that now :)
    Great article then Damien :)

    Reply
  • Jarige says:
    April 23, 2009 at 6:50 pm

    Nice guide! Only it ruined my /home partition. I can now boot, but when I log in, it gives some error about /home/jarik (jarik is login name) not available or something, en then I click Yes or No. One of them will log me in, but only a blue screen appears (Blue is the color setting of the login screen) and nothing happens.
    I have followed all steps, exept for the gksu gedit /mnt/etc/fstab because that file was somehow empty :O
    I got a dual boot Vista/Ubuntu 9.04. Vista is on C:\ (sda1) I’ve got a second harddrive D:\ (sdb) for Data and an HP_recovery (E:\ or sda2).
    Ubuntu is installed on my external harddrive (sdc) and has got an NTFS partition for Windows (250GB sdc1 ) a swapfile for Linux (2GB sdc3) and \home partition (which is screwed up, 50GB sdc2) and of course where ubuntu is installed (8GB sdc5)
    And somehow there’s a sdc4 linking to sdc5 (it has always been there)

    Can anyone help me getting my account back on plz?
    Luckily I decided to backup most important data to my DATA drive :D
    If there’s anything I can do for you to help me better, just ask me.

    Reply
    • Damien says:
      April 28, 2009 at 6:23 am

      Your situation is a bit more complicated, because you have plenty of partition.

      My suggestion:

      Boot into LiveCD.

      Open a terminal, (assuming your sdc5 is the filesystem folder and is in ext3 format)

      sudo mount -t ext3 /dev/sdc5 /mnt

      gksu gedit /mnt/etc/fstab

      and change the ext3 entry to ext4 (only for the /home partition). Save and exit.

      Reboot the computer.

      Reply
  • Jarige says:
    April 23, 2009 at 6:54 pm

    This screwed up my /home partition. I did everything exept for the grub install and ‘gksu gedit /mnt/etc/fstab’. fstab was empty somehow, so I couln’t edit that.
    I converted my /home partition and my installation partition to ext4.
    If there’s anything I can do to help you help me better, plz ask me!

    Reply
    • jimbob says:
      April 24, 2009 at 10:47 pm

      I believe the fstab is located in /etc/ so try ‘gksu gedit /etc/fstab’

      Reply
  • Ubuntufan says:
    April 24, 2009 at 3:58 am

    Thank you for sharing your experience.

    Reply
  • Giorgio Beltrammi says:
    April 25, 2009 at 9:14 pm

    Hi everybody,
    this useful, and well done article, was translated in Italian language and published in Ubuntu-Inside italian Blog.

    http://ubuntu-inside.blogspot.com/2009/04/aggiornare-da-ext3-ext4-senza.html

    I want to thank you :-)

    Reply
  • Tomas Gustavsson says:
    April 27, 2009 at 4:27 pm

    I have an entryped root partition on my laptop, installed with the ubuntu alternate CD. Everyone should run full disk encryption right :-).
    Anyway I figured out how to mount the encrypted partition as well, See http://blog.ejbca.org/2009/04/migrating-ext3-to-ext4-on-encrypted.html

    After setting up cryptsetup and lvm the commands above works just perfect.

    Reply
  • Tomas Gustavsson says:
    April 27, 2009 at 4:29 pm

    I have an encrypted root filesystem installed with the alternate ubuntu installer. After figuring out how to set up cryptsetup and lvm from the live cd the commands above works prefect. See http://blog.ejbca.org/2009/04/migrating-ext3-to-ext4-on-encrypted.html.

    Reply
  • Linuxfun says:
    April 28, 2009 at 7:07 am

    Thank you for this usefull how to.

    Reply
  • Jarige says:
    April 28, 2009 at 10:23 am

    Ok, my problem is solved now. I’m running Ubuntu 9.04 on Ext4 :D
    I actually figured it out myself by trying gksu gedit /mnt/etc/fstab again, and this time it did show the file I should have editted in the first place.
    Thank you for the help :D
    Great guide, but should have been a bit more clear on part when you should insert the LiveCD.

    Reply
  • Rex Mundi says:
    April 28, 2009 at 8:38 pm

    I followed exactly what you recommented. It worked, perfectly, Thanks.

    Reply
  • Rex Mundi says:
    April 28, 2009 at 8:38 pm

    It worked perfectly.

    Reply
  • Carlos says:
    April 29, 2009 at 12:34 pm

    I upgraded my / and /home partitions successfully. Hovewer, I had an error when reinstalling grub with the suggested command (sudo grub-install /dev/XXX). Grub complained about not finding the /boot directory corresponding to that partition. To circumvent the error, I used:

    sudo grub-install –root-directory=/mnt /dev/XXX

    Reply
    • Raúl says:
      May 2, 2009 at 3:35 am

      Thanks a lot Carlos.. that tip help me a lot… I feel like @djsonik… I feel so stupid because I don’t read carefully this great post…

      Muchas gracias, espero que me entiendas… me había comenzado a preocupar cuando me apareció ese problema con el boot…

      Reply
    • vpxavier says:
      May 6, 2009 at 7:02 am

      Thank you for the How-to Damien.
      I had the error described by Carlos with ubuntu 9.04 installed on ext3 that I wanted to upgrade to ext4.

      @Carlos: thank you for your tip that solved my problem but the correct command is not “sudo grub-install –root-directory=/mnt /dev/XXX” but “sudo grub-install –root-directory=/mnt /dev/XXX”

      Reply
  • Bicho Pro says:
    May 3, 2009 at 2:25 pm

    Excuse my bad English…

    Work 99% on my laptop with jaunty. Just when is necessary reinstall grub, the command return something like no drive, or not bios, something like that, but i type the Carlos command and reboot…

    Im happy now with ext4 and my data is safe, thanks for the tutorial.

    Too many thanks from Chile

    Reply
  • leonidas says:
    June 3, 2009 at 5:32 pm

    But, how would one go to convert his ‘/’ partition (that he setup as ext4 when installing Jaunty), BACK to ext3 without losing data, or the OS in general?

    I have my /home as ext3 (from previous hardy installation) and when I installed jaunty I setup / as ext4, but the system is very very unstable, and I’m thinking that is the issue.

    Reply
  • Tomas says:
    June 4, 2009 at 7:03 am

    Kernel 2.6.28 in Jaunty seems to be unstable on a lot of systems. I reinstalled my system with ext3 cause I though ext4 made it unstable, but it was the kernel. Now I’m running 2.6.17 instead of 28 and it’s working fine (with ext3 though).

    Reply
  • Roland says:
    June 16, 2009 at 4:47 am

    I installed 9.04 and followed your instructions and it works great
    Thank you.

    Reply
    • Damien says:
      June 17, 2009 at 6:11 am

      I am glad it works great for you.

      Reply
  • cocolocko says:
    June 28, 2009 at 3:38 pm

    Works great on my actual upgradet Ubuntu v9.04 64bit!
    Thank you and go ahead ;)

    Greetings

    Reply
  • Zoowey says:
    July 2, 2009 at 1:16 am

    Absolutely great guide. However, I should note that if you also want to convert your /home partition, once you mount it and run “gksu gedit /mnt/etc/fstab” you will be greeted with a blank fstab. I recommend you change both your /home and root partition in the fstab to ext4 after mounting the root partition then continue on to converting the /home partition.

    Reply
  • m3wt says:
    October 16, 2009 at 3:39 am

    it worked!! thank you thank you thank you!!!!

    Reply
  • CTAC says:
    October 22, 2009 at 12:30 am

    Worked for me on the forth attempt, thank you!
    My question is, my root and home are on different partitions, so now I need help converting /home file system to ext4.

    Reply
Cancel reply

Leave a Comment




Comment

Please Note: Comments maybe under moderation after you submit your comments so there is no need to resubmit your comment again

write for MTE

Latest Posts

  • OfficeMedium – A Social Collaboration Platform For The Small Business + Free Promotions
  • MakeTechEasier Is Now Hosted On KnownHost
  • KTorrent: KDE’s BitTorrent client
  • How to Create a Customized Toolbar for Your Browser
  • 13 Ways To Customize Ubuntu Netbook Remix For Better Usability

Our Writers

  • Damien Oh - Chief Editor
  • Sharninder - Geeky Ninja
  • Joshua Price
  • Tavis J. Hampton - Lantern Torch
  • Shevonne Polastre - FreeAgentWriter
  • Trevor Dobrygoski
  • Soumen Halder - Ampercent
  • Tanmay Ahmed - Tech-Tips-Geek
Make Tech Easier on Facebook
Jobs by SimplyHired
Job Widgets

Copyright

All the articles (including the text, images and tutorials) are properties of MakeTechEasier.

You cannot copy whole tutorials, either in English or translate to another language without our permission.

Write for us

Writing a tutorial or article for MakeTechEasier is a great way to get exposure and give back to the community.

Read More Details

Suggestions

We need your help to help us serve you better! This is YOUR site, so if you have suggestions/feedbacks on how we can improve it for you, please let us know! We do our best to make this place better!

Make a Suggestion

Navigation

  • Home
  • About Us
  • Advertise
  • Archives
  • Contact Us

Copyright © 2007-2010 Make Tech Easier | All Right Reserved.