# [Solved] Can't boot properly if I set / as ext4

## Etal

I was feeling a bit adventurous and I decided to boot one of my machines with ext4 on root.

I've tried it with other partitions - if I change ext3 to ext4 in fstab and add noextents, it mounts the partition fine. So, I decided to do that with /.

What happens is that once it boots, it for some reason mounts as ext3. After that it can't remount to rw and ends up in ro mode.

Does anyone know why that happens? Why would it boot as ext3? Without extents, ext4 is supposed to be backwards-compatible, so I shouldn't have to modify the fs to use ext3 as ext4, right?

Thanks in advance!   :Smile: 

Edit: added [solved] tag

----------

## poly_poly-man

as long as you haven't mounted an ext3 partition as ext4 (read-write, at least), you can go back. If you've mounted it ext4 and played with it, it's ext4 now. Data loss ensues if you mount it ext3.

As for why it's not booting, check to make sure ext4 is not a module, and is built-in. Also, if you have a kernel <2.6.28, call it ext4dev, not ext4.

Running ext4 just fine over here.

----------

## platojones

To get the kernel to recognize it as ext4 instead of ext3, you have to add a kernel boot argument to your grub.conf.  Try adding rootfstype=ext4.  That tells the kernel to that even though it looks like an ext3, go ahead and mount it as ext4.  Unless you tell the kernel explicitly, it will read the FS signature on the root partition, which tells the kernel that it is an ext3 file system.

----------

## Etal

 *platojones wrote:*   

> To get the kernel to recognize it as ext4 instead of ext3, you have to add a kernel boot argument to your grub.conf.  Try adding rootfstype=ext4.  That tells the kernel to that even though it looks like an ext3, go ahead and mount it as ext4.  Unless you tell the kernel explicitly, it will read the FS signature on the root partition, which tells the kernel that it is an ext3 file system.

 

Thanks, I'll try that.

 *poly_poly-man wrote:*   

> as long as you haven't mounted an ext3 partition as ext4 (read-write, at least), you can go back. If you've mounted it ext4 and played with it, it's ext4 now. Data loss ensues if you mount it ext3.

 

I don't think that's right... According to the their page page:

 *Ext4 Wiki wrote:*   

> You can mount any ext3 filesystem as ext4 without any changes. If the filesystem is mounted as ext4 using the "extents" mount option (the default), this will enable the INCOMPAT_EXTENTS feature, and prevent the filesystem from being mounted as ext3 again. If you mount with the "-o noextents" option this will not happen.

 

so if I have a line:

```
/dev/sda5   /         ext4   noatime,noextents   0 1
```

it should be fine, right?

 *poly_poly-man wrote:*   

> 
> 
> As for why it's not booting, check to make sure ext4 is not a module, and is built-in. Also, if you have a kernel <2.6.28, call it ext4dev, not ext4.
> 
> 

 

It's a very monolithic 2.6.28 kernel   :Wink: 

 *poly_poly-man wrote:*   

> 
> 
> Running ext4 just fine over here.

 

Glad to know.  :Smile: 

----------

## poly_poly-man

 *platojones wrote:*   

> To get the kernel to recognize it as ext4 instead of ext3, you have to add a kernel boot argument to your grub.conf.  Try adding rootfstype=ext4.  That tells the kernel to that even though it looks like an ext3, go ahead and mount it as ext4.  Unless you tell the kernel explicitly, it will read the FS signature on the root partition, which tells the kernel that it is an ext3 file system.

 hmm... works as ext4 here without that....

----------

## Etal

 *poly_poly-man wrote:*   

>  *platojones wrote:*   To get the kernel to recognize it as ext4 instead of ext3, you have to add a kernel boot argument to your grub.conf.  Try adding rootfstype=ext4.  That tells the kernel to that even though it looks like an ext3, go ahead and mount it as ext4.  Unless you tell the kernel explicitly, it will read the FS signature on the root partition, which tells the kernel that it is an ext3 file system. hmm... works as ext4 here without that....

 

I guess maybe you converted it? (See my comment above, I edited it)

----------

## poly_poly-man

 *AM088 wrote:*   

>  *poly_poly-man wrote:*    *platojones wrote:*   To get the kernel to recognize it as ext4 instead of ext3, you have to add a kernel boot argument to your grub.conf.  Try adding rootfstype=ext4.  That tells the kernel to that even though it looks like an ext3, go ahead and mount it as ext4.  Unless you tell the kernel explicitly, it will read the FS signature on the root partition, which tells the kernel that it is an ext3 file system. hmm... works as ext4 here without that.... 
> 
> I guess maybe you converted it? (See my comment above, I edited it)

 dunno exactly what you meaen by "converted" - more like used tunefs to biggen my inodes on sysresccd (and also changed fstab).

----------

## Etal

Woohoo, it booted! Thanks platojones

```
EXT4-fs warning (device sda5): ext4_fill_super: extents feature not enabled on this filesystem, use tune2fs.

EXT4-fs: barriers enabled

kjournald2 starting.  Commit interval 5 seconds

EXT4-fs: delayed allocation enabled

EXT4-fs: mballoc enabled

EXT4-fs: mounted filesystem with ordered data mode.

VFS: Mounted root (ext4 filesystem) readonly.
```

 *poly_poly-man wrote:*   

> dunno exactly what you meaen by "converted" - more like used tunefs to biggen my inodes on sysresccd (and also changed fstab).

 

I meant this:

```
# tune2fs -O extents,uninit_bg,dir_index /dev/DEV

# fsck -pf /dev/DEV
```

----------

## poly_poly-man

 *AM088 wrote:*   

> Woohoo, it booted! Thanks platojones
> 
> ```
> EXT4-fs warning (device sda5): ext4_fill_super: extents feature not enabled on this filesystem, use tune2fs.
> 
> ...

 sure, I did that.. though that doesn't actually mess with the fs itself.

I think barriers are non-backwards-compatible, true?

anyway, I think you should enable extents, and then shake all your files. Great speed improvement, especially deleting files.

----------

## Etal

 *poly_poly-man wrote:*   

>  *AM088 wrote:*    *poly_poly-man wrote:*   dunno exactly what you meaen by "converted" - more like used tunefs to biggen my inodes on sysresccd (and also changed fstab). 
> 
> I meant this:
> 
> ```
> ...

 

Not sure about you, but when I converted my other partitions, I got quite a few "fixes" from fsck (hence the -p).

 *poly_poly-man wrote:*   

> I think barriers are non-backwards-compatible, true?
> 
> 

 

Actually, ext3 does support barriers (and from what I understand, it's just a mechanism by which data is written, but it does not actually change the format)

 *poly_poly-man wrote:*   

> anyway, I think you should enable extents, and then shake all your files. Great speed improvement, especially deleting files.

 

I'll probably wait a bit and see how well works now, while it's still backwards-compatible (I remember reiser3 giving me Oopses and Kernel Panics less than two years ago, on this machine *shudder*)

----------

## Etal

OK, I enabled extents. Now I'm all fully Ext4 except /boot with Ext2. Yay

----------

