Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Kernel Panic - Unable to mount root.
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
LeonidR
n00b
n00b


Joined: 01 Jun 2016
Posts: 11

PostPosted: Wed Jun 01, 2016 6:14 pm    Post subject: Kernel Panic - Unable to mount root. Reply with quote

Hi

I'am new in Linux.
I got the old project which was running on Gentoo on VIA embedded board. Now this board is out of production. It's need to replace this board with new one (VIA EPIA-M920).
Gentoo was loading from Compact Flash card connected to board thru IDE on old system. The new system doesn't have IDE. Now Compact Flash card should be connected to board via USB (Card reader).

There are a lot of scripts for build the Gentoo, install additional applications, format flash card, copy built Gentoo and application.
After building and coping I have flash card with two identical partition with same content (steel don't understand why).

When I trying to boot from compact flash I get a few errors:

Code:
via_rng: Cannot enable VIA C3 RNG, aborting
via_rng: RNG registering failed (-19)

I understood that it means problem with random number generator driver.
Code:
Kernel panic - not syncing: VFS: unable to mount root fs on unknown-block(0,0)


fstab on first partition
Code:

/dev/sda1      /          ext3   defaults,noauto,noatime   0 1
/dev/sda2      /twin      ext3   defaults,noatime                   0 3


fstab on second partition
Code:

/dev/sda2      /      ext3   defaults,noatime                   0 1
/dev/sda1      /twin      ext3   defaults,noauto,noatime   0 3


grub.conf
Code:

#default 1
default saved
timeout 0
fallback 1
#splashimage=(hd0,0)/boot/grub/splash.xpm.gz

title=Linux 2.6.x (/dev/sda1)
root (hd0,0)
kernel /boot/vmlinuz init=/sbin/init root=/dev/sda1 quiet acpi=force video=viafb:mode=1280x1024,bpp=16,active_dev=CRT,accel=1
savedefault 1

title=Linux 2.6.x (/dev/sda2)
root (hd0,1)
kernel /boot/vmlinuz init=/sbin/init root=/dev/sda2 quiet acpi=force video=viafb:mode=1280x1024,bpp=16,active_dev=CRT,accel=1
savedefault 0

I enabled all drivers for supporting USB in kernel configuration.
I tried to play with disk label. Without any success. The same errors.
What am I doing wrong? In which direction I should investigate to solve the problem.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 43198
Location: 56N 3W

PostPosted: Wed Jun 01, 2016 7:12 pm    Post subject: Reply with quote

LeonidR,

Welcome to Gentoo and the deep end :)

In the normal course of events, the kernel mounts root before it starts USB.
That's a problem when root is on USB.

Your
Code:
 unknown-block(0,0)
tells that the kernel cannot see the hard drive at all. The numbers here are important.

You must tell the kernel to wait for the root filesystem to appear before it tries to mount root. Add
Code:
rootwait
to the kernel command line in grub.conf.

The via_rng errors can be fixed later.

Are you really using greb-legacy and a 2.6 kernel or have you done a new handbook install.
That you get errors from the kernel, shows that grub does its thing and loads the kernel and the kernel starts.
There are plenty of opportunities to go wrong before you get even that far.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
LeonidR
n00b
n00b


Joined: 01 Jun 2016
Posts: 11

PostPosted: Wed Jun 01, 2016 8:07 pm    Post subject: Reply with quote

Thank you very much NeddySeagoon.

Kernel panic error disappeared. But Gentoo steel freezing on booting after errors:

Code:
PCI: BIOS Bug: MCFG area at e0000000 in not E820-reserved
PCI: Not using MMCONFIG.
via_rng: Cannot enable VIA C3 RNG, aborting
via_rng: RNG registering failed (-19)


And yes it's a 2.6 kernel. It is legacy product and it's need to support without development. I wanted only make it work without upgrading components.
But I'm thinking may be updating the kernel will fix some of this errors.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 43198
Location: 56N 3W

PostPosted: Wed Jun 01, 2016 9:15 pm    Post subject: Reply with quote

LeonidR,

Post the output of lsusb and lspci, so we can see your hardware.
This need not be done with Gentoo. Any distro will work.
Put your kernel .config file onto a pastebin site and post a link.

If its possible to ssh into the device after the freeze, dmesg may be useful too.

Be careful about upgrading any software. Newer kernel will (eventually) want a newer gcc which will want a newer glibc ....
Before you know it, you will be doing a full rebuild.

Code:
PCI: BIOS Bug: MCFG area at e0000000 in not E820-reserved
PCI: Not using MMCONFIG.
via_rng: Cannot enable VIA C3 RNG, aborting
via_rng: RNG registering failed (-19)
are not errors. You cannot use the via_rng, but if you didn't want to, that's OK.
The other messages are advisories.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
LeonidR
n00b
n00b


Joined: 01 Jun 2016
Posts: 11

PostPosted: Thu Jun 02, 2016 3:52 pm    Post subject: Reply with quote

I booted using Gentoo Live CD. But it doesn't have lsusb.

lspci
https://bpaste.net/show/0538c51af6c3
config
https://bpaste.net/show/ae376af78c4e

If lsusb steel be helpful I'll try to boot another distro.

Gentoo freezes after messages and a can't write in console.
I verified folder /var/log/. It's empty.

I'll update kernel in case if I won't have other variants.
Now I wanna try to fix this without updating.
Back to top
View user's profile Send private message
LeonidR
n00b
n00b


Joined: 01 Jun 2016
Posts: 11

PostPosted: Fri Jun 03, 2016 3:03 pm    Post subject: Reply with quote

lsusb
https://bpaste.net/show/d85cb537155d
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 43198
Location: 56N 3W

PostPosted: Fri Jun 03, 2016 6:21 pm    Post subject: Reply with quote

LeonidR,

To boot, the kernel needs to be able to mount the root filesystem. To to that it must be able to read and understand the HDD.

First the partition table.
Code:
# CONFIG_PARTITION_ADVANCED is not set
CONFIG_MSDOS_PARTITION=y
Thats OK as long as you never use disks with GPT disk lables.
GPT disk lables are rare on USB sticks but must be used on drives bigger than 2Tb.
GPT may not even be an option in
Code:
# Linux kernel version: 2.6.24.7


Now your HDD stuff.
Code:
# CONFIG_IDE is not set
Good, that makes my life easier. I turned this option off for good at kernel 2.6.26.
Code:
CONFIG_BLK_DEV_SD=y
That's anything that behaves as a HDD.
Code:
# CONFIG_BLK_DEV_SR is not set
No optical drive support.


Code:
# CONFIG_SCSI_MULTI_LUN is not set
This is needed for card readers that support more than one card type,
What about
Code:
Bus 001 Device 004: ID 0cf2:6230 ENE Technology, Inc. SD Card Reader (UB623X)

Only the first slot will work with this option off.
Code:
CONFIG_ATA=y
CONFIG_SATA_AHCI=y
covers your
Code:
00:0f.0 SATA controller: VIA Technologies, Inc. Standard AHCI 1.0 SATA Controller (rev 01)

Code:
CONFIG_SATA_VIA=y
CONFIG_PATA_VIA=y
are not needed but are harmless.

Code:
CONFIG_EXT2_FS=y
CONFIG_EXT2_FS_XATTR=y
CONFIG_EXT3_FS=y
CONFIG_EXT3_FS_XATTR=y
Good, you can use both ext2 and ext3 filesystems.

Code:
CONFIG_FAT_FS=y
CONFIG_MSDOS_FS=y
CONFIG_VFAT_FS=y
CONFIG_FAT_DEFAULT_CODEPAGE=437
CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
and the FAT filesystems.
Code:

# Pseudo filesystems
#
CONFIG_PROC_FS=y
CONFIG_PROC_KCORE=y
CONFIG_PROC_SYSCTL=y
CONFIG_SYSFS=y
CONFIG_TMPFS=y
Thats all good stuff too.

2.6 kernel was a long time ago
Code:
CONFIG_SYSFS_DEPRECATED=y
prevents booting but I don't remember exactly when that started.
Its worth trying a kernel with this off.

Code:
CONFIG_USB_EHCI_HCD=y
CONFIG_USB_UHCI_HCD=y
covers your USB 1 and USB 2 hardware.
Your kernel is too old to have XHCI suppor, so the USB3 won't work.

Other things ...
You have
Code:
CONFIG_VIA_RHINE=y
for your network cards, you need
Code:
CONFIG_VIA_VELOCITY=y

This page says that its in your kernel.

Code:
00:14.0 Audio device: VIA Technologies, Inc. VT8237A/VT8251 HDA Controller (rev 30)
00:01.1 Audio device: VIA Technologies, Inc. HDMI Audio Device
both need Intel High Definition Audio suppot. You have
Code:
# Sound
#
# CONFIG_SOUND is not set


Likewise for Xorg you need options in
Code:
# CONFIG_DRM is not set
if the Via Chrome diriver is in your kernel
00:01.0 VGA compatible controller: VIA Technologies, Inc. VX11 Graphics [Chrome 645/640]
I recall there being issues with this.

You have the old text console selected
Code:
# Console display driver support
#
CONFIG_VGA_CONSOLE=y
CONFIG_VGACON_SOFT_SCROLLBACK=y
CONFIG_VGACON_SOFT_SCROLLBACK_SIZE=64
CONFIG_VIDEO_SELECT=y
CONFIG_DUMMY_CONSOLE=y
CONFIG_FRAMEBUFFER_CONSOLE=y
and you have asked the kernel to switch to a framebuffer driver for the console if one is available.
None are selected.
Code:
# CONFIG_FB_VESA is not set
would me a good choice to get you going.

As
Code:
# CONFIG_USB_STORAGE is not set
UBS block devices won't work.
That's your
Code:
Bus 001 Device 002: ID 8564:1000 Transcend Information, Inc. JetFlash
Bus 001 Device 004: ID 0cf2:6230 ENE Technology, Inc. SD Card Reader (UB623X)
devices.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
LeonidR
n00b
n00b


Joined: 01 Jun 2016
Posts: 11

PostPosted: Fri Jun 03, 2016 7:36 pm    Post subject: Reply with quote

NeddySeagoon,

Thank you so much. Now it's more clear about what it's going on.

I'll try to reconfigure the kernel.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 43198
Location: 56N 3W

PostPosted: Fri Jun 03, 2016 8:27 pm    Post subject: Reply with quote

LeonidR,

Use make menuconfig
It has a search function - press /

Some options may be hidden until the things they depend on are set correctly. They won't appear in the search either.
Press z to see and be able to search all options.
z is a toggle. All options really means all options ... and there are a lot.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
LeonidR
n00b
n00b


Joined: 01 Jun 2016
Posts: 11

PostPosted: Mon Jun 06, 2016 4:39 pm    Post subject: Reply with quote

NeddySeagoon,

Thanks for explaining how to find fields in menuconfig. It's relay helpful feature.

I changed few fields in .config.

Code:
CONFIG_USB_STORAGE=y
CONFIG_SCSI_MULTI_LUN=y
CONFIG_USB_DEVICEFS=y


After this I get new messages:

Code:
sd 2:0:0:0: [sda] Assuming drive cache: write through
sd 2:0:0:0: [sda] Assuming drive cache: write through


After this messages Gentoo steel freezes.

When I unplug bootble USB I get the message:
Code:
EXT3-fs error (device sda2): ext3_find_entry: reading directory #2 offset 0


In this system I haven't seen Via Chrome. It has only VIA FB driver.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 43198
Location: 56N 3W

PostPosted: Mon Jun 06, 2016 9:51 pm    Post subject: Reply with quote

LeonidR,

Can you post an image of the frozen screen?

You will need to put it on an image site and put a link here.

The message
Code:
 EXT3-fs error (device sda2): ext3_find_entry: reading directory #2 offset 0
suggests that the boot was progressing, but slowly,
The filesystem was mounted and being read.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
LeonidR
n00b
n00b


Joined: 01 Jun 2016
Posts: 11

PostPosted: Tue Jun 07, 2016 2:20 pm    Post subject: Reply with quote

The link to screen image.
http://s32.postimg.org/i3r0yhfxx/20160607_094846.jpg

I guess I have problems with drivers.
I need to add proper drivers for my configurations.
May be chipset and video drivers will help.

Thanks.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 43198
Location: 56N 3W

PostPosted: Tue Jun 07, 2016 4:50 pm    Post subject: Reply with quote

LeonidR,

Your kernel command line in /boot/grub/grub.conf contains the command quiet.
This suppresses all or most of the kernel messages which would otherwise be sent to the console.

Edit the kernel lines in /boot/grub/grub.conf to remove the word quiet so we can see the suppressed messages, then post a new image.
Use the command
Code:
nano -w /boot/grub/grub.conf
so that the line is not accidentally wrapped or truncated. The kernel command line must be on one very long line.
In your image it starts kernel /boot/vmlinuz

I have a feeling that the kernel may be running rootfsck. When it does that, it reads the entire filesystem. Its a long operation that depends on the filesystem size, the HDD read speed, the CPU power etc. It could easily be 10 minutes. I have known odd cases where its several hours.

The system may not actually be hung. We need the suppressed messages.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
LeonidR
n00b
n00b


Joined: 01 Jun 2016
Posts: 11

PostPosted: Tue Jun 07, 2016 6:40 pm    Post subject: Reply with quote

NeddySeagoon,

I got more one kernel message
Code:
kernel panic - not syncing attempted to kill init

after I sent you a screen image.

I deleted "quiet" from grub.conf.
New screen image:
http://s32.postimg.org/r33fqil11/20160607_141507.jpg

Thanks.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 43198
Location: 56N 3W

PostPosted: Tue Jun 07, 2016 7:34 pm    Post subject: Reply with quote

LeonidR,

There are no errors in your image. Just normal kernel boot information messages.

Code:
kernel panic - not syncing attempted to kill init
suggests that the kernel loaded, mounted the root filesystem, found /sbin/init then failed.
Killing init is like a shutdown.

Its also possible that it mounted the wrong thing as root and failed to find /sbin/init at all.

Your kernel line in grub.conf says root=/dev/sda1 if you have any other block devices connected, the drive enumeration order may not put your root device at sda.

Go to boot normally. Make your choice but press 'e', not return, for the interactive editor.
Find the line that says
Code:
root (hd0,0)
or whatever it says on your system.
Edit the line to read
Code:
root (hd
now press the tab key.
Grub will either change the line to read
Code:
root (hd0,
if there is only a single hdd, or it will list the HDD an hd0, hd1 and so on.
Choose a dirve you like, I will use hd0 but you will try them all in turn.
Make the line read
Code:
root (hd0,
and press tab again. Grub will list all the partitions on the selected drive.
Choose one you like and complete the root (hd0,0) entry.
Make a note of the drives and partitions you discovered then put that root (hd0,0) entry back as you found it.

This playing with the
Code:
root (hd0,0)
entry is only trying to confirm the that the kernel root=/dev/sda1 is correct.
Now for the confusing bit. root (hd0,0) or whatever, tells grub where to find the files needed for booting. That's grubs root, in BIOS terminology.
Everything counts from 0.

The root=/dev/sda1 tells the kernel where the root of the filesystem tree is. Its often not the same place as grubs root.
That is, the word root in grub.conf means two different things depending on the context.

Now that you have a list of the drives and partitions on the machine you can do trial and error with the root=/dev/sda1 entry.
Using grubs edit option try all the drives and partition in turn in root=/dev/sda1
If there is only one drive, it will be /dev/sda, for two, it will be /dev/sda and /dev/sdb and so on.
For three partitions, you have /dev/sda1, /dev/sda2 and /dev/sda3

Eventually, you may get past the
Code:
kernel panic - not syncing attempted to kill init
then fail when rootfsck runs against root because the /etc/fstab entry for root does not match the actual root filesystem. That's a good sign.

You will only be editing the in memory copy of grub.conf. Grub cannot write to the hard drive.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
LeonidR
n00b
n00b


Joined: 01 Jun 2016
Posts: 11

PostPosted: Tue Jun 07, 2016 9:37 pm    Post subject: Reply with quote

NeddySeagoon,

I don't have any other block devices connected.

I tried to change 'root (hd0,0)'.
When I pressed 'tab' in case 'root (hd' I had hd0 - 3, but only hd0 had 2 partitions. I didn't see any partitions when I pressed 'tab' in case hd1, hd2, hd3.
I tried to boot from hd(0,0), hd(0,1) the same screen as I've sent you. With hd(1,0) , hd(2,0), hd(3,0) the error shows that it can't boot up.

I have two partition with almost identical content on bootable CF card.

Different are grub.conf and fstab. If something will happen with one than the unit runs from other partition.

grub.conf 1
Code:
#default 1
default saved
timeout 0
fallback 1
#splashimage=(hd0,0)/boot/grub/splash.xpm.gz

title=Linux 2.6.x (/dev/sda1)
root (hd0,0)
kernel /boot/vmlinuz rootwait init=/sbin/init root=/dev/sda1 quiet acpi=force video=viafb:mode=1280x1024,bpp=16,active_dev=CRT,accel=1
savedefault 1


grub.conf 2
Code:
#default 1
default saved
timeout 0
fallback 1
#splashimage=(hd0,0)/boot/grub/splash.xpm.gz

title=Linux 2.6.x (/dev/sda2)
root (hd0,1)
kernel /boot/vmlinuz rootwait init=/sbin/init root=/dev/sda2 quiet acpi=force video=viafb:mode=1280x1024,bpp=16,active_dev=CRT,accel=1
savedefault 0


Thanks.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 43198
Location: 56N 3W

PostPosted: Wed Jun 08, 2016 5:23 pm    Post subject: Reply with quote

LeonidR,

That all looks good and it confirms that your root should be /dev/sda1.
The other two HDD that the BIOS can see will be your card reader with empty slots. That's all good.

Another test.

Using the grub editor, boot to the menu, press 'e' and find
Code:
kernel /boot/vmlinuz rootwait init=/sbin/init root=/dev/sda1 quiet acpi=force video=viafb:mode=1280x1024,bpp=16,active_dev=CRT,accel=1


Change init=/sbin/init to read init=/bin/bash, remove the quiet and allow the boot to continue.

The system will start very quickly but it will be a very lonely place to be.
Just you, bash and the kernel. The root filesystem will be mounted read only. There will be no environment and no services.
To run commands, you will need to provide the full path name.

You may notice error messages from the kernel as the boot progresses.
What are they?
Code:
/bin/dmesg | /usr/bin/less
will let you make a note of them.
As root is mounted read only, its safe to power off.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
LeonidR
n00b
n00b


Joined: 01 Jun 2016
Posts: 11

PostPosted: Wed Jun 08, 2016 7:28 pm    Post subject: Reply with quote

NeddySeagoon,

After test with 'read init=/bin/bash' I got the same last screen.

http://s32.postimg.org/r33fqil11/20160607_141507.jpg

The system doesn't start. I can't type the commands.
Than I removed "rootwait" and the same screen.
All tests was without "quiet".
May be it's something wrong with USB?

Thanks.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 43198
Location: 56N 3W

PostPosted: Wed Jun 08, 2016 7:46 pm    Post subject: Reply with quote

LeonidR,

There is no longer any
Code:
kernel panic - not syncing attempted to kill init
message?

I suspect that the rootwait is making the kernel wait forever for a root filesystem that never appears.
Change the rootwait to rootdelay=30

What should happen now is that the boot sequence will get to the same place it halts at now, then after 30 seconds, carry on anyway.
If the root filesystem has not appeared in 30 seconds, its not going to.
This time there should be an error about not mounting the root filesystem.
Please post an image of that error.

You may well be right about the USB but it could be other things too.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
LeonidR
n00b
n00b


Joined: 01 Jun 2016
Posts: 11

PostPosted: Thu Jun 09, 2016 2:27 pm    Post subject: Reply with quote

I have a success with booting Gentoo.
Now it boots well.
What I did, I disabled in kernel i2c, Network and PATA.
I think it was problem with PATA because board doesn't have PATA at all, only SATA.
But why we haven't seen any error messages. I don't understand.

Thank so much NeddySeagoon.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 43198
Location: 56N 3W

PostPosted: Thu Jun 09, 2016 4:57 pm    Post subject: Reply with quote

LeonidR,

None of that explains what was happening.
I'm pleased its fixed though.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum