2010-02-01 05:43:14

by Thomas Kupper

[permalink] [raw]
Subject: mount ext2/3 as ext4 - no changes to ext2/3 fs structures?

Hello,

I guess it's a very simple question which I could not find a clear answer on the net: The ext4 wiki states that since 2.6.29 one can mount ext2/3 as ext4 without any changes.

Consider the following scenario: Assume I have a partition formated with ext2 on a computer with some 2.4.x kernel. Now I mount this ext2 partition on another computer as ext4 using a 2.6.29+ kernel. After that I take the disk back to the older computer and mount the ext2 on the 2.4.x kernel with the ext2 driver.

Does that work? Or is the ext4 driver updating some internal structures in a way that an old ext2 driver can't handle that partition anymore? Assume I don't enable any ext4 specific features like extents, etc.


Thanks for any clarification or pointing to a doc that does,
Thomas


2010-02-01 05:54:50

by Michael Rubin

[permalink] [raw]
Subject: Re: mount ext2/3 as ext4 - no changes to ext2/3 fs structures?

On Sun, Jan 31, 2010 at 2:31 PM, Thomas Kupper <[email protected]> wrote:
> Consider the following scenario: Assume I have a partition formated with ext2 on a computer with some 2.4.x kernel. Now I mount this ext2 partition on another computer as ext4 using a 2.6.29+ kernel. After that I take the disk back to the older computer and mount the ext2 on the 2.4.x kernel with the ext2 driver.

I have seen this work as long as you don't add the "extents" or other
ext4 specific mount options. Our kernels are not quite as up to date
as 2.6.29 and we have not done extensive testing with that kernel. Not
sure anyone has tested this case thoroughly.


mrubin

2010-02-03 15:18:28

by Thomas Kupper

[permalink] [raw]
Subject: Re: mount ext2/3 as ext4 - no changes to ext2/3 fs structures?

On 1 Feb 2010, at 06:54, Michael Rubin wrote:

> On Sun, Jan 31, 2010 at 2:31 PM, Thomas Kupper <[email protected]> wrote:
>> Consider the following scenario: Assume I have a partition formated with ext2 on a computer with some 2.4.x kernel. Now I mount this ext2 partition on another computer as ext4 using a 2.6.29+ kernel. After that I take the disk back to the older computer and mount the ext2 on the 2.4.x kernel with the ext2 driver.
>
> I have seen this work as long as you don't add the "extents" or other
> ext4 specific mount options. Our kernels are not quite as up to date
> as 2.6.29 and we have not done extensive testing with that kernel. Not
> sure anyone has tested this case thoroughly.

Thanks alot for your answer, that'll do for me to start with. Nothing on computers is guaranteed to work perfect :)

> mrubin

Cheers,
Thomas

2010-02-03 21:08:41

by Theodore Ts'o

[permalink] [raw]
Subject: Re: mount ext2/3 as ext4 - no changes to ext2/3 fs structures?

On Sun, Jan 31, 2010 at 09:54:27PM -0800, Michael Rubin wrote:
> On Sun, Jan 31, 2010 at 2:31 PM, Thomas Kupper <[email protected]> wrote:
> > Consider the following scenario: Assume I have a partition
> > formated with ext2 on a computer with some 2.4.x kernel. Now I
> > mount this ext2 partition on another computer as ext4 using a
> > 2.6.29+ kernel. After that I take the disk back to the older
> > computer and mount the ext2 on the 2.4.x kernel with the ext2
> > driver.
>
> I have seen this work as long as you don't add the "extents" or other
> ext4 specific mount options. Our kernels are not quite as up to date
> as 2.6.29 and we have not done extensive testing with that kernel. Not
> sure anyone has tested this case thoroughly.

Yep, it's a supported feature that mounting a file system previously
intended for ext2 or ext3 on ext4 shouldn't cause it to become
unmountable elsewhere.

Note however that the "extents" ext4 mount options has gone away; if
you want to enable extents on kernels, the supported way to do this
is:

tune2fs -O extents /dev/sda1

Once you do this (and you can do this on a live-mounted ext4
filesystem and it will take effect immediately), any new inodes that
are created will be extent-mapped.

We currently don't have a way of converting extent-mapped inodes back
to the legacy indirect block mapping scheme (a patch to do an off-line
conversion wouldn't be _that_ hard; patches gratefully accepted), so
this is currently a one-way conversion.

- Ted