-   Linux - Newbie (
-   -   Getting info on kernel on another disk, kernel panic error 6 ext3 (

chrismurphy 02-13-2011 07:03 PM

Getting info on kernel on another disk, kernel panic error 6 ext3
Dell laptop booting from a USB stick with a CentOS 5.5 minimum installation.

Uncompressing Linux...OK, booting the kernel.
Red Hat nash version starting
sda: assuming drive cache: write through
sda: assuming drive cache: write through
mount: error 6 mounting ext3
mount: error 2 mounting none
switchroot: mount failed: 22
umount /initrd-dev failed: 2
Kernel panic - no syncing: Attempted to kill init!

1. Does minimum installation not drop on a kernel or initrd with ext3 support? I can't imagine that's true, but have to ask.

2. The USB stick is single partition ext3. Maybe there is some limitation specifically related to USB stick booting that requires boot to be FAT16 or FAT32? Except the CentOS 5.5 installer refuses to let me install on either FAT.

3. How can I do the equivalent of lsmod on a linux installation that will not boot? i.e. I have CentOS x86_64 running in VirtualBox, I can plug the USB stick in there, so how do I get information on the USB stick's kernel and initrd if I can't boot from it?

4. Is it possible to rebuild the i386 based initrd on this USB stick, when the computer is not booted from that stick, with a system that's x86_64 based?

System Info:
Dell Latitude i686 Laptop which has run CentOS 5.5 and Fedora 12,13,14 in the past, and boots from Fedora 14 Live CD transferred to a USB stick. So I know USB booting is possible on this machine, and this stick.

The process of creating the stick:

CentOS 5.5 i386 on a USB stick. Old Dell i686 laptop which has previously run CentOS 5.5 installed from DVD, and has successfully booted from this same USB stick holding transferred Fedora 12,13,14 Live CDs. CentOS 5.5 was installed onto the USB drive directly by the CentOS 5.5 DVD installer (running virtualized in VirtualBox 4.02 on Mac OS X 10.6.5.). No errors or complaints during installation.

For whatever reason, the installer did not do some things correctly. First Grub wasn't working correctly, I got that sorted out and have the Grub+CentOS splash screen, it finds vmlinuz and the initrd, and then I get a kernel panic.

Google search turns up suggestions that ext3 was built into the kernel and that's why I'm getting this message. I do not know how the installer would have dropped a kernel or initrd during instalation that that don't contain such a basic thing that obviously comes in linux kernel 2.6.18-89 EL. Hence my first two questions.


chrismurphy 02-13-2011 07:21 PM

OK unless someone else tells me differently, I'd like to try the following in order:

1. Just mkinitrd on the existing kernel config. But I'm not sure if/how to do this from an x86_64 Linux, to a disk with an i386 Linux. Is this possible?

2. Maybe the USB support is not built into the kernel, but is a module loaded later? If so I imagine BIOS+Grub have initial USB support, get the kernel and initrd into memory, hand off occurs to kernel which promptly has no idea what USB is and bang, kernel panic. If this is plausible, can I use the preload option with mkinitrd to load USB support? Or do I have to bake a new kernel with it built-in? And if so, again, can I do this from an x86_64 Linux, to a disk with an i386 Linux?

chrismurphy 02-13-2011 09:15 PM

OK so I think I know what's going on. I built this USB disk on a VM, and that installer made all of its assumptions about what kernel modules were needed based on that VM hardware. I move the key to another machine, and it's a different set of hardware. The usb_module is almost certainly not loaded in the initrd so the boot fails. So I tried booting with the install DVD with "linux expert rescue" so that the USB drivers are loaded and I end up in rescue boot mode. chroot the usb stick after mounting it, and mkinitrd preloading various kernel modules all to no avail. So there is problem some oddball driver that I can't just guess at, to support this laptop.

So now I'm beginning to understand how it's tough to make a universal USB stick that will boot just anything. But since the kernel on this USB disk is the same as the one on the boot DVD, I'm thinking I might be able to just copy the initrd off that DVD and point grub to it instead.

chrismurphy 02-14-2011 12:12 PM

OK so the obvious occurred to me which is why not format both / and /boot on the USB stick as ext2 instead of ext3? Sure enough, that works. So with either CentOS-4.8-i386-bin1of4.iso or CentOS-4.8-i386-binDVD.iso, you can do a minimum install directly onto the USB stick, just make sure to format it as ext2. Kudzu even launches and removes/adds hardware as you move the stick between computers. Very cool.

Basic technique:
At the first CentOS screen, type "linux expert" and make sure your USB stick is plugged in. You have to do both to get USB drivers to load. When you get to partition/formatting, don't choose automatic, choose Disk Druid. And then make a 15MB /boot ext2, and the rest as / ext2. At the bottom of the packages list is an option for minimal install, click that and everything else will be unchecked. Install.

You have networking, sshd so you can plug in this USB stick and remotely access the computer. parted and mdadm are on the stick as well so you can even set up a RAID. Remotely.

All times are GMT -5. The time now is 07:26 PM.