LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Ubuntu (https://www.linuxquestions.org/questions/ubuntu-63/)
-   -   ext2.ko missing for 3.13 and 3.16 kernels? (https://www.linuxquestions.org/questions/ubuntu-63/ext2-ko-missing-for-3-13-and-3-16-kernels-4175533670/)

DaveQB 02-11-2015 12:40 AM

ext2.ko missing for 3.13 and 3.16 kernels?
 
Hi all,

I have a 14.04 system that was installed about 5-7 years ago and has been upgraded with each release. It's been working well.

Right now it is running kernel 3.2.0-39 but that is not the kernel for Trusty. In upgrading to a number of 3.13 or 3.16 kernels finds me unable to boot; dropped to a initramfs prompt. Looking further the initramfs for these kernels is not getting the ext2 module. Looking further and the file:

/lib/modules/<kernel>/kernel/fs/ext2/ext2.ko

is missing on the file system. I grabbed the packages and unpacked them manually and this is indeed the case.

So does 14.04 compile ext2 support into the kernel and doesn't use an initramfs perhaps? Or is there something else I am missing here?

The system is running ok on the 3.2.0-39 kernel but I'd like to get it up the Trusty kernel.

Any thoughts on this would be appreciated.

veerain 02-11-2015 12:50 AM

You can use ext3 or ext4 to access a ext2 system. But they may convert them to newer fomat which is not reversible.

syg00 02-11-2015 02:54 AM

Quote:

Originally Posted by DaveQB
So does 14.04 compile ext2 support into the kernel and doesn't use an initramfs perhaps?

Should be easy enough to check
Code:

grep -iE ext[[:digit:]] /boot/config-$(uname -r)
Change as necessary for Ubuntu naming conventions.
Quote:

Originally Posted by veerain (Post 5315324)
You can use ext3 or ext4 to access a ext2 system.

True- best to use ext4.
Quote:

But they may convert them to newer fomat which is not reversible.
Not true. Simply mounting should not introduce any on-disk format changes; e2fsprogs supports all of ext[234] in the same codebase.

veerain 02-11-2015 03:04 AM

Quote:

Not true. Simply mounting should not introduce any on-disk format changes
Yes. You are right. To convert tune2fs is used.

DaveQB 02-11-2015 04:39 AM

Quote:

Originally Posted by syg00 (Post 5315361)
Should be easy enough to check
Code:

grep -iE ext[[:digit:]] /boot/config-$(uname -r)

Good one!
So the working 3.2.0-39 kernel has ext2 as a module and ext3 & ext4 compiled in.

The 3.16.0-30 kernel has ext2 & ext3 not set and ext4 compiled in.
So with that, how is the initramfs meant to grab any extX modules?

I feel my grub configs might not have been updated and are this loading the kernel incorrectly.

I might need a 14.04 VM to work out it's boot process.

Anyone know?

Thanks for your responses guys.

veerain 02-11-2015 04:46 AM

The most easy hack if you have skill is to edit initramfs image manually and use ext4 wherever ext2 is needed.

DaveQB 02-11-2015 05:02 AM

But the issue is there is no extX module available for this kernel to manually add into it's initramfs.
I would have to compiled that module myself.
I not sure why these modules are mixing with these standard kernel packages in Ubuntu 14.04. It feels like the system is meant to boot without an initramfs....

Thanks

syg00 02-11-2015 07:08 AM

Any new kernel should ship with, or rebuild, the initramfs so it is appropriate. Make sure the initramfs matches the kernel.

Else, as suggested, manually extract the contents, and delete the references to ext2 from the initramfs. It is not needed - unless you have the root filesystem as ext2 specifically. Then rebuild the archive.
Easier maybe to use update-initramfs - although if you do that (a "-c") it will probably include ext2 again as you will have that loaded on the (older) current kernel. If it were me, I'd unload the ext2 module before running the update-initramfs.

(all guess-work on my part as I don't run Ubuntu).

DaveQB 02-11-2015 07:43 AM

Thanks for the response.
The boot fs is ext2. But you can use ext2 driver to open ext3 and I suspect ext4 you just lose the journaling.

You have some good advice there. I'm just not sure why this is necessary. I mean all other users of Ubuntu 14.04 aren't messing with their initramfs. I'm setting up 14.04 in a VM to inspect a working system. I really want to learn exactly what has happened here.

TB0ne 02-11-2015 09:29 AM

Quote:

Originally Posted by veerain (Post 5315399)
The most easy hack if you have skill is to edit initramfs image manually and use ext4 wherever ext2 is needed.

This is the second time you've given this VERY BAD and INCORRECT ADVICE. From the kernel.org page: https://www.kernel.org/doc/Documenta...-initramfs.txt
Quote:

Originally Posted by Kernel Website
The 2.6 kernel build process always creates a gzipped cpio format initramfs archive and links it into the resulting kernel binary. By default, this archive is empty

Do you mind sharing with us the 'most easy hack' you're talking about?? How to edit the initramfs image manually??? Since you say it's the "most easy hack", you must have done it before, so please share your technique about manually editing a gzipped CPIO format file.

veerain 02-11-2015 11:16 AM

initramfs can be separate compressed cpio file to be provided to bootloader. I am doing it for years. With grub it is given to initrd command. Same kernel documentation link details how to unpack and pack initramfs images.

TB0ne 02-11-2015 02:41 PM

Quote:

Originally Posted by veerain (Post 5315587)
initramfs can be separate compressed cpio file to be provided to bootloader. I am doing it for years. With grub it is given to initrd command. Same kernel documentation link details how to unpack and pack initramfs images.

Great...so as you've been asked MULTIPLE times now: GIVE US EXAMPLES. You said this is a "most easy hack"..so it should be "most easy" for you to write up the steps. If you could easily edit this file, then why do the instructions on kernel.org tell you to use a UTILITY to generate it, along with making modifications to it?? Why don't they just tell you to edit the file manually??

Again, yes, we know what the initramfs file is, and it was even mentioned that it was a gzipped cpio file, so you're not telling us anything new. Manually editing that file is an EXTRAORDINARILY BAD IDEA, is needlessly complex, and won't really solve the OP's original question. As you've been asked before, don't post bad or misleading advice.

syg00 02-11-2015 05:50 PM

Rubbish.
People have been editting initrd forever - initramfs is conceptually the same. Grab a copy, unzip it, feed the result into cpio, have a play, pack it all up again. Not that I generally advocate it, but certainly a good learning exercise.
Try searching on "unpack initramfs".

The in-kernel initramfs is rarely used in the non-embedded world I suspect - even by those of us that compile our own kernels.

DaveQB 02-11-2015 10:29 PM

I have to say I remember editing initrd files after unpacking with cpio 10 years ago. Good experience that was successful too.
Not that hard once you get into it.

So I could unpack it and add the ext2 driver. But I need the driver for these kernels AND it's not sustainable as anything that triggers DKMS with rebuild the initramfs and it will be borked.

I need to find the root cause

TB0ne 02-12-2015 08:33 AM

Quote:

Originally Posted by syg00 (Post 5315755)
Rubbish.
People have been editting initrd forever - initramfs is conceptually the same. Grab a copy, unzip it, feed the result into cpio, have a play, pack it all up again. Not that I generally advocate it, but certainly a good learning exercise. Try searching on "unpack initramfs".

The in-kernel initramfs is rarely used in the non-embedded world I suspect - even by those of us that compile our own kernels.

Yes, people HAVE been doing it by hand, and I do KNOW how to do it. However, advising the OP to do this to solve their problem isn't the best way to go...nor is it the "most easy hack".

A learning exercise? Certainly; best way to solve this problem? No, not by a long shot.


All times are GMT -5. The time now is 10:52 PM.