Change a Partition from ext3 to ext4

Since the last openSUSE Version we have the Option to make Partitions in ext4. In my case i have made the Rootpartition in ext4 and other Partitions in ext3. No i have found an HowTo for changing the other Partitions to ext4. I have changed the original Informations to the openSUSE needs.

First of all, please change your Runlevel, through typing „init 3“ into the Konsole. Then we have a clean Konsole. After logging in with „root„, we have the full Access to the Partitions.

If you type „mount„, you get the Partitions List. In the follwowing Paragraphs  we describe the Situation if „/dev/sda2“ is your Partiton, you need to change.

Then we go through „cd /“ into our Root. If we try to unmount our „/dev/sda2“ the Kernel says us, that he can’t unmount, because the Partition is in use. Now we have to type „fuser -km /dev/sda2“ and then we can unmount with „umount /dev/sda2„.

After Unmounting we type „tune2fs -O extents,uninit_bg,dir_index /dev/sda2„. Keep in mind, that the „O“ isn’t an digit, just an „dash on“.

Now we can type „fsck /dev/sda2„. FSCK says us, the some Points are changed, and if we say „Yes„, fsck repairs all needed things.

If that all runs without Errors, we finally type „mount -t ext4 /dev/sda2 /home (or what is needed)„.

To finishing your settings you have to go to „/etc/fstab„, and change your Entry /dev/sda2 from ext3 to ext4.

After rebooting, you’re working on ext4. Have a lot of fun 🙂

Thanks a lot to Distrowatch for claryfining this Point.

Über saigkill
openSUSE Ambassador, openSUSE Marketing Team, Weekly News Team, openFATE Screening Team and BuildService.

3 Responses to Change a Partition from ext3 to ext4

  1. Heart1010 says:

    …how can I do that for the root partition?

  2. Andreas Schmidt says:

    Take care if you are doing this for root partition => it won’t work.

    Better try

    Ext4 ext4 is the default filesystem for openSuSE 11.2. Converting to ext4 from earlier versions should be done just like on any other initrd-based system:

    1. Run tune2fs -O extents,uninit_bg /dev/ROOT
    2. Change ext3 to ext4 in /etc/fstab
    3. Add „ext4“ to INITRD_MODULES in /etc/sysconfig/kernel
    1. Run sudo mkinitrd (takes about 2 min here, dunno why)
    4. Run e2fsck on the ROOT fs. As this is currently mounted, you might want to change into single user mode (init 1) and remount read-only (mount -o remount,ro /) or just reboot and the bootprocess will complain a bit and run e2fsck anyway – don’t know if this is The Right Thing To Do though.


    When it already happened:

    I finally got the system running again by
    booting a live SUSE 11.2 (KDE)
    mounting the original root to /mnt
    using „mount -t proc none /mnt/proc“
    and „mount -o bind /dev /mnt/dev“
    then „chroot /mnt“.
    Now you can perform „mkinitrd“ and reboot.

  3. hideaki1f says:

    When it already happened, it suffices to boot with the additional parameter „rootfstype=ext4“ in case you forgot mkinitrd.

Kommentar verfassen

Trage deine Daten unten ein oder klicke ein Icon um dich einzuloggen:

Du kommentierst mit Deinem Abmelden /  Ändern )

Google Foto

Du kommentierst mit Deinem Google-Konto. Abmelden /  Ändern )


Du kommentierst mit Deinem Twitter-Konto. Abmelden /  Ändern )


Du kommentierst mit Deinem Facebook-Konto. Abmelden /  Ändern )

Verbinde mit %s

%d Bloggern gefällt das: