# ext2 mounted as ext4 ?

## truc

hello  :Smile: 

EDIT:  you can ignore the following, and directly go to this post explaining the 'problem'

I'd been using ext2 as the FS for the partitions /tmp, /usr/src, /usr/portage, distfiles... for performance reasons, and because I didn't mind losing some data on these places.

Then, I realised, I can just make some regular backups of the whole system, and just put everything (except /home) on ext2. And in case something goes wrong (FS corruptions and the like), I can just extract my last recent backup, and continue doing my stuffs.

I succesfully did a fresh install within a existing linux distro, everything had just gone well until I rebooted on the new system (with / on ext2):

* Some strange errors in the boot process (I'll report exactly what tomorow), just one console (ctrl-alt-Fn don't seem to do anything)

* some weird messages about / beeing ext4 without a journal

the mount command shows me the root  (/) is an ext4 mounted partiton, weird eh?

I sure did know ext2 doesn't have a journal, but didn't know ext2 looks just like ext4 without a journal (well, from what I've read ext4 is a kind of enhanced ext3 which is itself some kind of a patched ext2)and the like

So, question is:

Have some of you already tried this ( / on ext2) with success?

Can all these errors be related to this? (let's say for example, init scripts don't handle too well unjournalized FS, which just screw the boot process up?)

What do you guys think?

Thanks in advance  :Smile: 

----------

## Inodoro_Pereyra

EXT2 is disabled by default in the newest kernel versions. I guess you probably have EXT2 disabled but EXT4 enabled and in some weird way, the kernel is getting it wrong instead of not mounting it at all... Check that in your kernel config and post the results.

And yes, you can have your root partition in EXT2...

Cheers!

----------

## truc

Hello again, thanks Inodoro_Pereyra for your help.

I had ext{2,3,4] directly compiled into the kernel. I've change it to have only ext2 and ext3 that way, and ext4 as a module. now, I don't see ext4 mentionned anywhere in the logs, but still got some issues :S : 

```
CONFIG_EXT2_FS=y

# CONFIG_EXT2_FS_XATTR is not set

# CONFIG_EXT2_FS_XIP is not set

CONFIG_EXT3_FS=y

CONFIG_EXT3_FS_XATTR=y

CONFIG_EXT3_FS_POSIX_ACL=y

CONFIG_EXT3_FS_SECURITY=y

CONFIG_EXT4_FS=m

# CONFIG_EXT4DEV_COMPAT is not set

# CONFIG_EXT4_FS_XATTR is not set

```

now the output of 'mount' on the new system:

```
rootfs on / type rootfs (rw)

/dev/root on / type ext2 (rw,noatime,errors=continue)

/proc on /proc type proc (rw,nosuid,nodev,noexec)

rc-svcdir on /lib/rc/init.d type tmpfs (rw,nosuid,nodev,noexec,size=1024k,mode=755)

udev on /dev type tmpfs (rw,nosuid,size=10240k,mode=755)

usbfs on /proc/bus/usb type usbfs (rw,noexec,nosuid,devmode=0664,devgid=85)

binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,noexec,nosuid,nodev)

```

/dev/root, is supposed to be dev/sda5

Actually, I now think I have a problem which is probably not related to the FS choice, since I have weird other errors:

```
cannot mount or create /dev/shm, and /dev/pts
```

```
swapon: cannot stat /dev/sda2: No such file or directory
```

```
for /dev/sda5: 

 the superblock doesn't describe a correct ext2 filesystem...
```

Ok, so the problem is somewhere else, but I haven't find where yet.

If you got any idea?  :Smile: 

I know I've played with initramfs a while ago, the makefile field in make menuconfig, is empty, but, may be this isn't enough. I"m going to try without initramfs support, and will report back

EDIT: nope, completely disabling initramfs is of no help  :Sad: 

Tell me if you need more info, I'd be glad to help you helping me  :Smile: 

----------

## cruzki123

put udev in the boot init level

# eselect rc add udev boot

I have the same problem yesterday. I think openrc and / or udev change its behavior in the lasts weeks.

----------

## truc

Thanks cruzki123   :Exclamation:  That solved most of my problems:)

I still have a problem, but different from this one, so new thread, int IG: Could not create /dev/pts, and /dev/shm

Thanks again fro your help:)

----------

## truc

Well, actually the problem remains, I'm not sure now if I'm on the right section to post this (may be Kernel&hardware?).

If ext4 is compiled as a module, then my ext2 formated root (/) device is mounted as an ext2 filesystem

but

if ext4 is compiled directly into the kernel, then my ext2 formated root device is mounted as an ext4 filesystem  :Exclamation: 

This is kinda weird! I can live with that(ext4 as a module), but I'm just wondering why?

----------

## mv

You can use the kernel option 

```
rootfstype=ext2
```

However, usually this is used the other way around (i.e. with rootfstype=ext4): If you have an ext4 filesystem and for some reason your kernel mounts it with ext2 which won't work because of the additional features.

In fact, I cannot understand why there might arise a problem if you mount some ext2 filesystem as ext4: Since ext4 is a superset of the ext2 features (and won't activate features which change the format automatically), there should be no problems (except for some warnings during mounting that not all features can be used). Are you sure that your problems come from mounting ext2 as ext4?

----------

## truc

Actually the only problems, I noticed, are some warnings, and the 'reparation of the volume'  which seems to happen on every boot (it says there are some errors on the FS). This doesn't happen when my / is mounted as ext2

I'll try the rootfstype=ext2 at the kernel command line, thank you:)

----------

## mv

You are right, I tried now myself: It is not possible to mount ext2 with ext4 - it will complain that there is no journal and refuse to mount. This surprises me, because it was announced that ext4 has the ability to work without journal. So it seems this announcement was just false. Strange that it is from the developers themselves.

----------

## desultory

 *mv wrote:*   

> You are right, I tried now myself: It is not possible to mount ext2 with ext4 - it will complain that there is no journal and refuse to mount. This surprises me, because it was announced that ext4 has the ability to work without journal. So it seems this announcement was just false. Strange that it is from the developers themselves.

 You checked that your kernel is from a branch which would have included the feature, that your kernel lacks that feature while being recent enough to have that feature, that your partition was formatted and mounted properly and otherwise entirely ruled out any errors on your part or faults in your system. Most impressive.

----------

## mv

 *desultory wrote:*   

> You checked that your kernel is from a branch which would have included the feature

 

According to the announcement page it should be included in all 2.6.28 kernels, so I did not recheck this, since I use 2.6.28. Of course, looking at the date of your link, it might be this is the problem (cannot check currently). As I said: It seems the announcement is just false.

 *Quote:*   

> that your kernel lacks that feature while being recent enough to have that feature

  Why should this happen if there is no such configure option concerning ext4?  *Quote:*   

> that your partition was formatted and mounted properly and otherwise entirely ruled out any errors on your part or faults in your system. Most impressive.

  No reason to get sarcastic: If I mount the same partition only with ext2 than ext4, there are no problems. Of course, Heisenberg's uncertain principle might have influenced my machine everytime I change 2 into 4.   :Wink: 

----------

## desultory

 *mv wrote:*   

> According to the announcement page it should be included in all 2.6.28 kernels, so I did not recheck this, since I use 2.6.28.

 That page indicates that the file system is present in that version, not the feature which allows using it without a journal.

 *mv wrote:*   

> Of course, looking at the date of your link, it might be this is the problem (cannot check currently).

 You almost certainly can.

 *mv wrote:*   

> As I said: It seems the announcement is just false.

 As I indicated, that assessment is faulty. Having just checked the logs, the feature is present in 2.6.29-rc1 and later. 

 *mv wrote:*   

> No reason to get sarcastic: If I mount the same partition only with ext2 than ext4, there are no problems.

 Sarcasm was just a gentle way to point out certain flaws in your logic, not to mention the unlikelihood that your claim that the feature was announced as implemented in the kernel without actually having been there was true.

 *mv wrote:*   

> Of course, Heisenberg's uncertain principle might have influenced my machine everytime I change 2 into 4.  

 You probably just need to be more careful with emacs.

 *truc wrote:*   

> Well, actually the problem remains, I'm not sure now if I'm on the right section to post this (may be Kernel&hardware?).

 Good point.

Moved from Unsupported Software to Kernel & Hardware.

----------

## mv

 *desultory wrote:*   

> That page indicates that the file system is present in that version, not the feature which allows using it without a journal.

  The page says the filesystem is present in 2.6.28, lists all its features and indicates that one of the features (online defragmentation) is not yet available. To read from this that also other features might not be available in 2.6.28 needs a really good will of interpretation, to say the least   :Wink: 

----------

## s4e8

Since kernel 2.6.29, mount ext2 filesystem as fstype=ext4 is supported, you will gain delay alloc & mballoc from fstype=ext4.

----------

## mv

 *s4e8 wrote:*   

> Since kernel 2.6.29, mount ext2 filesystem as fstype=ext4 is supported, you will gain delay alloc & mballoc from fstype=ext4.

 

That's really good news. There is just one thing which I do not understand: Why is ext2 and ext3 still in kernel if ext4 can just replace both of them without any drawbacks? Am I missing something, or are there perhaps plans to remove ext2 and ext3?

----------

## platojones

 *mv wrote:*   

>  *s4e8 wrote:*   Since kernel 2.6.29, mount ext2 filesystem as fstype=ext4 is supported, you will gain delay alloc & mballoc from fstype=ext4. 
> 
> That's really good news. There is just one thing which I do not understand: Why is ext2 and ext3 still in kernel if ext4 can just replace both of them without any drawbacks? Am I missing something, or are there perhaps plans to remove ext2 and ext3?

 

Well, 2 reasons...1)  Of the ext filesystems, Grub still only understands ext2 and 2)  ext2 is still the most 'stable'.  The other 2 are just ext2 +new features.

----------

## mv

 *platojones wrote:*   

> Well, 2 reasons...1)  Of the ext filesystems, Grub still only understands ext2 and 2)  ext2 is still the most 'stable'.  The other 2 are just ext2 +new features.

 

I do not understand reason 1): If ext2 and ext3 would be removed from the kernel, nothing would change: An existing ext2/ext3 partition would just "formally" be mounted as ext4, but since ext4 uses only those features on them which do not change the disk format, the partition remains ext2/ext3. So grub/live-cds/whatever would have absolutely no problem with them.

I understand reason 2), but also only for some transition period until ext4 is considered rock stable. From what I understood this should be the case since kernel 2.6.28.

----------

## platojones

 *Quote:*   

> I do not understand reason 1): If ext2 and ext3 would be removed from the kernel...nothing would change: An existing ext2/ext3 partition would just "formally" be mounted as ext4

 

Not true...you can't mount an ext2 filesystem as ext3 or ext4...it only goes the other way.  You can mount an ext3 fs as ext4 though. 

[EDIT]Sorry, I came late to this thread and didn't read the whole thing...I didn't catch that with 2.6.29, you can supposedly do that...well, then my first point is not so critical[/EDIT]

----------

## mv

 *platojones wrote:*   

>  *Quote:*   I do not understand reason 1): If ext2 and ext3 would be removed from the kernel...nothing would change: An existing ext2/ext3 partition would just "formally" be mounted as ext4 
> 
> Not true...you can't mount an ext2 filesystem as ext 3 or ext4.

 

You can mount it as ext4, that's the crucial point: There was never a problem to mount ext3 as ext4, and concerning ext2 it requires only the non-journal patch (which I mistakenly thought is already included since 2.6.28 but which now turned out to be only included in more current kernel versions). Please recall:

 *s4e8 wrote:*   

> Since kernel 2.6.29, mount ext2 filesystem as fstype=ext4 is supported, you will gain delay alloc & mballoc from fstype=ext4.

 

----------

## 165177

 *mv wrote:*   

>  *platojones wrote:*   Well, 2 reasons...1)  Of the ext filesystems, Grub still only understands ext2 and 2)  ext2 is still the most 'stable'.  The other 2 are just ext2 +new features. 
> 
> I do not understand reason 1): If ext2 and ext3 would be removed from the kernel, nothing would change: An existing ext2/ext3 partition would just "formally" be mounted as ext4, but since ext4 uses only those features on them which do not change the disk format, the partition remains ext2/ext3.

 

They're different filesystems, so give them different names. Anything else would just be confusing ...

----------

## platojones

 *Quote:*   

> Please recall: 

 

Yeah, I was editing my post while you were replying...I got it now.  I'm still back in pre-2.6.29 world.

 *Quote:*   

> They're different filesystems, so give them different names. Anything else would just be confusing ...

 

They do have different names...the fact that the naming convention is version-ed accurately reflects the reality that the follow on filesystems are feature supersets of ext2.

----------

## desultory

 *mv wrote:*   

> The page says the filesystem is present in 2.6.28, lists all its features and indicates that one of the features (online defragmentation) is not yet available. To read from this that also other features might not be available in 2.6.28 needs a really good will of interpretation, to say the least  

 All it requires is to recognize that it is documentation and those who write documentation are fallible. Combine that with the feature not being listed in the change logs for any 2.6.28 series kernel and the oversight becomes obvious. Just bear in mind that documentation bugs are far more likely than developers claiming to have included features which are not present and temper your claims accordingly.

----------

## mv

 *desultory wrote:*   

> All it requires is to recognize that it is documentation and those who write documentation are fallible [...] and temper your claims accordingly.

  I did not mean to attack anybody, I just said that this announcement is false (and in fact, I was misleaded by it). From your reaction it appears that this sounds to a native English speaker more agressive than it appears to me. Sorry if I have chosen the wrong words: in my mother language German saying that some (technical) statement is false is not an agressive sentence...

----------

