# Converting ext4 to ext3 file system

## Joseph_sys

I've installed Gentoo with ext4 file system but I would like to convert it to ext3.

Do I have to re-install it?

```
/dev/sda1      /boot      ext2      noauto,noatime   1 2

/dev/sda3      /      ext4      noatime      0 1

/dev/sda2      none      swap      sw      0 0

/dev/sda4      /home      ext4      noatime      0 1

/dev/sda5               /home2          ext4            noatime         0 1
```

or change in fstab from ext4 to ext3

enable ext3 in kernel 

boot-strap from CD and run:

```
mkfs.ext3 /dev/sda3

mkfs.ext3 /dev/sda4

mkfs.ext3 /dev/sda5
```

Will it work?

----------

## Aquous

You can't convert from ext4 to ext3, you'll need to reinstall.

But why would you want to use ext3 over ext4?

----------

## ycUygB1

ext4 is awesome.  So fast.

----------

## depontius

Why do you want to move from ext4 to ext3?

----------

## albright

some of the comments here:

http://lwn.net/Articles/469805/

suggest ext4 is too easily corruptible ... (I've had no

trouble myself and need/like the trim function in ext4)

----------

## depontius

 *albright wrote:*   

> some of the comments here:
> 
> http://lwn.net/Articles/469805/
> 
> suggest ext4 is too easily corruptible ... (I've had no
> ...

 

I presume you're talking about the metadata checksumming?  It's relevant to mention that the article talks about this in the context of bad hardware.

But it's more relevant to ask, "Is ext3 any better in this respect?"  I suspect not at all - this particular question hasn't even been asked about ext3, has it?  If ext3 were better in this respect, I would have expected that feature to have been carried forward into ext4 already.

EDIT... I've just been reading the comments as well as the original article.  Other than one user's experience, which may have been quirky hardware, it just looks like a "my favorite filesystem" fest.

----------

## Joseph_sys

 *Aquous wrote:*   

> You can't convert from ext4 to ext3, you'll need to reinstall.
> 
> But why would you want to use ext3 over ext4?

 

I was reading somewhere that ext4 might have a problem with some applications and I'm having one:

https://forums.gentoo.org/viewtopic-t-905512.html

So I want to make sure it is not ext4

----------

## ycUygB1

I read that thread.  I doubt that is a result of the filesystem you are using.

Filesystem problems can be of the type that data becomes corrupted for instance

when power is cut, or sometimes the filesystem is slow for your application.

I once had problems with ext3 combined with lvm2.  The data got corrupted

when the power was cut.  I swore off ext3 and became a rabid XFS fan.

XFS is uber-stable, but it was slow.  Now the benchmarks show that XFS is fast,

I think as of 2.6.39.

My advice is that if you are not running lvm and not doing disorderly shutdowns,

then you should use ext4, which is the default filesystem for most distros.

If you are totally rabid about not losing data and don't care about performance,

then use XFS.

----------

## Joseph_sys

 *hnaparst wrote:*   

> I read that thread.  I doubt that is a result of the filesystem you are using.
> 
> Filesystem problems can be of the type that data becomes corrupted for instance
> 
> when power is cut, or sometimes the filesystem is slow for your application.
> ...

 

The box is connected to UPS so I don't think I'm paranoid about data loss besides the data is backup daily to another box.

But I can not solve this issue I don't know what else to try  :Sad: 

----------

## wcg

I did not find mention of any tool that will grind through an ext4

filesystem like e2fsck and convert all of the extent-using ext4

files to indirect-block using ext3 files, then alter the flags in

the overall filesystem metadata to be consistent with an ext3

filesystem.

So, it looks like doing it the hard way is the only way. Mount option

and one-file-at-a-time script, run a restore program from a system

rescue cd or live cd after running mke2fs on your partitions, copy

everything to an external hd and hope the controller and drive

firmware does not prove to be consumer junk hardware when

you need to copy it back, etc.

----------

## wrc1944

Instead of re-installing, couldn't one just backup, tar, or clone the Gentoo partitions (/, home. whatever, etc.), and then reformat the original partition(s) to ext4, and then copy them back?

You'd need to first build a kernel with ext4 support, and after the copy and copy back procedure use a live cd to reinstall grub, but I see no reason this wouldn't work fine.  Plus, you'd get a good defrag in the process.   :Smile: 

Has booting from an ext4 partition been solved yet?  IIRC,last time I checked (about a year ago) that was a problem.

OOPS   :Embarassed:   Just realized my "ext4" typo, above.  What I meant was reformatting an ext4 partition to ext3, using the procedure I outlined. 

One other thing:  IIRC, you can do a simple move to ext4 from ext3 on the same partition without reformatting (by mounting it as ext4), but unless you do an actual reformat  of the partitioin to ext4 you will be missing the extents feature of ext4, which as I understood it was the main point of running ext4.  (Not really up on this- haven't looked into it in at least a year)

----------

## darklegion

 *hnaparst wrote:*   

> 
> 
> If you are totally rabid about not losing data and don't care about performance,
> 
> then use XFS.

 

Really? Last time I used XFS (admittedly a few years ago) it didn't handle unsafe shutdowns well at all.

----------

## ycUygB1

Just create an ext3 partition and copy the files to the new partition. 

You wont need all the directories to boot off the new system. Then change fstab and add a new line to grub

and youll be able to boot off ext3.

You can do the whole thing while running in your existing system if you already have an ext3 partition.

If not use gparted to create the space.

But this isnt the cause of the problems you are having

----------

