Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED]Kernel panic - Unable mount root at boot block (0,0)
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
YTW
n00b
n00b


Joined: 30 Aug 2016
Posts: 65
Location: Taiwan

PostPosted: Fri Sep 16, 2016 2:19 am    Post subject: [SOLVED]Kernel panic - Unable mount root at boot block (0,0) Reply with quote

Last time I used
Code:
grub-mkconfig -o /boot/grub/grub.cfg
, then it shows
Code:
/boot/grub/grub.cfg.new no such dir or file

So I emerge grub:2 and redo grub-install /dev/sda again. Then it works.
But when I reboot, 'kernel panic - unable mount root at block (0,0)', What should I check after liveCD mount?


Last edited by YTW on Mon Sep 19, 2016 7:46 am; edited 1 time in total
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


Joined: 09 Dec 2006
Posts: 7552
Location: Goose Creek SC

PostPosted: Fri Sep 16, 2016 4:20 am    Post subject: Reply with quote

You have done a new install?
Is your computer UEFI capable? If so are you attempting a UEFI system or legacy BIOS?
Boot the liveCD and run
Code:
wgetpaste --tee -c 'parted -l'
wgetpaste --tee -c 'lspci -k'
Mount the gentoo partitions and run
Code:
wgetpaste /mnt/gentoo/usr/src/linux/.config
wgetpaste /mnt/gentoo/etc/fstab
wgetpaste /mnt/gentoo/boot/grub/grub.cfg
wgetpaste -tee -c mount
wgetpaste -tee -c blkid
Post the url's returned by wgetpaste
_________________
Defund the FCC.
Back to top
View user's profile Send private message
YTW
n00b
n00b


Joined: 30 Aug 2016
Posts: 65
Location: Taiwan

PostPosted: Fri Sep 16, 2016 4:39 am    Post subject: Reply with quote

I am using BIOS. I think my computer is not UEFI capable sorry.
Back to top
View user's profile Send private message
YTW
n00b
n00b


Joined: 30 Aug 2016
Posts: 65
Location: Taiwan

PostPosted: Fri Sep 16, 2016 8:54 am    Post subject: Reply with quote

Does anyone know something happened at boot?

1)Are these steps correct? Kernel boot -> initramfs -> init tool
So when is root mount? And when the loadable kernel modules are loaded?

2) I used genkernel all that auto generated initramfs when installation, but I modifying kernel configuration manually, then redo grub configuration without genkernal --install initramfs.
Is forgotting to update initramfs after modifying kernel configuration a wrong concept?
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Fri Sep 16, 2016 10:55 am    Post subject: Reply with quote

YTW,

Code:
unable mount root at block (0,0)
is a message produced by the kernel.
That means that whatever grub did, it at least loaded a kernel and possibly the initrd too.

The (0,0) normally means that something needed for the kernel to reach your HDD is missing.
In addition to what DONAHUE has requested, pastebin the output of lspci too. - it need not be from inside the chroot.

I suspect that when you modified the kernel manually, you took something out that you need.
_________________
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
DONAHUE
Watchman
Watchman


Joined: 09 Dec 2006
Posts: 7552
Location: Goose Creek SC

PostPosted: Fri Sep 16, 2016 1:46 pm    Post subject: Reply with quote

Quote:
Are these steps correct? Kernel boot -> initramfs -> init tool
Not correct. genkernel configures drivers needed for your drives as modules. The initramfs must run to load these modules in the kernel.
My unskilled reading of /etc/grub.d/10_linux tells me that grub determines the version of the genkernel kernels it finds and searches for an initramfs of matching version to pair with them when writing grub.cfg. So you should, while running genkernel to make your kernels, run
Code:
genkernel all
grub-mkconfig -o /boot/grub/grub.cfg
to update the kernel, the initramfs, and the grub.cfg all together to matching values. Read the grub.cfg after creating a new one.
_________________
Defund the FCC.
Back to top
View user's profile Send private message
Buffoon
Veteran
Veteran


Joined: 17 Jun 2015
Posts: 1074
Location: EU or US

PostPosted: Fri Sep 16, 2016 1:50 pm    Post subject: Reply with quote

FWIW, manual Grub configuration is not condemned by Grub developers, in Gentoo you really do not need that horrible automated conf creation.
Back to top
View user's profile Send private message
YTW
n00b
n00b


Joined: 30 Aug 2016
Posts: 65
Location: Taiwan

PostPosted: Sun Sep 18, 2016 10:25 am    Post subject: Reply with quote

http://bpaste.net/show/a99fa0519c96 parted -l
http://bpaste.net/show/8ca01e87415e lspci -k
http://bpaste.net/show/3f9e4d6d3fb5 Linux/x86 4.4.6-gentoo Kernel Configuration
http://bpaste.net/show/25aedf2846a9 /etc/fstab
http://bpaste.net/show/bce8dd602149 grub.cfg
http://bpaste.net/show/897a90e1ba56 mount
http://bpaste.net/show/76e4089e8877 blkid

Names added by NeddySeagoon to make it easier to find things.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Sun Sep 18, 2016 10:50 am    Post subject: Reply with quote

YTW,

Lets look at your book sequence from the start. All your grub.cfg entries look like.
Code:
   echo   'Loading Linux 4.4.6-gentoo ...'
   linux   /boot/vmlinuz-4.4.6-gentoo root=/dev/sda4 ro 

There in no initrd line there, so no initrd will be loaded. That's OK providing your kernel does not need to load any modules to mount root.

lspci -k shows
Code:
00:1f.2 SATA controller: Intel Corporation 5 Series/3400 Series Chipset 4 port SATA AHCI Controller (rev 05)
   Subsystem: Acer Incorporated [ALI] 5 Series/3400 Series Chipset 4 port SATA AHCI Controller
   Kernel driver in use: ahci
   Kernel modules: ahci
so you need the HDD code down to ahci built into the kernel.

Lets look at the kernel
Code:
CONFIG_BLK_DEV_SD=m
CONFIG_BLK_DEV_SR=m
CONFIG_ATA=y
CONFIG_SATA_AHCI=m

CONFIG_EXT4_FS=m

All those items need to be built into the kernel (maybe more) to be able to boot with no initrd.
The problem is that those modules ale located on the root filesystem, which cannot be read to load the modules until the root filesystem is mounted. Its a circular dependency. There are lots of those in the boot process.

Rebuild your kernel, using menuconfig to set those options to <*>
Menuconfig has a search function. Press /

Actually, CONFIG_BLK_DEV_SR is for your optical drives and is not needed to boot.
_________________
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
YTW
n00b
n00b


Joined: 30 Aug 2016
Posts: 65
Location: Taiwan

PostPosted: Sun Sep 18, 2016 12:18 pm    Post subject: Reply with quote

It works!!
Is that initrd and initramfs the same stuff?
(It seems that they both works for loading modules for kernel before root mount)
So if a guy choose genkernel when install, after modifying some drivers in menuconfig next time in need, he/she should use genkernel again and can not use manual way of 'make and make modules_install'; otherwise, initrd will be missing that cause some important stuff still <M> in .config before root mount without inird or initramfs to load them first?

How Neddy check number of block(0,0) to derive where problem probably is? Is there wiki or something teach this?
Back to top
View user's profile Send private message
Roman_Gruber
Advocate
Advocate


Joined: 03 Oct 2006
Posts: 3806
Location: Austro Bavaria

PostPosted: Sun Sep 18, 2016 2:20 pm    Post subject: Reply with quote

In my case, for two different boxes. I only created once the initramfs with genkernel and use my own build kernel, which also includes my own build modules in /lib/modules/kernel-version directory

Just an example of a boot entry I created a few hours ago. As you can see, I use microcode "initramfs" from intel and the initramfs created with gentoo-sources 4.2.3 with gentoo-sources 4.7.3. That initramfs is ~1 Year old, as this notebook is now ~1 Year old. And the installation is still the same as I started with gentoo, just moved from notebook a => b => c ...

Boot entry from my grub from sysrescue-cd 4.6.0
Code:
menuentry ' 4.7.3-gentoo-14-09-2016  /boot/   SanDisk SSD  ' {
        load_video
        insmod gzio
        insmod part_gpt
        insmod fat
        insmod ext2
        set root='hd0,gpt2'
        echo    ' boot entry for SanDisk SSD'

    linux /4.7.3-gentoo-16-09-2016  ** snip - removed **
    initrd /microcode.cpio /initramfs-genkernel-x86_64-4.2.3-gentoo

}


There is no requirement for always rebuild the intiramfs when you know what you are doing.

--

You can use any kernel basically with genkernel initramfs as long as they work together. A good starting point is to start with the genkernel-kernel and slim down the .config later.

Gentoo is about choice. As long as you know what you are doing, you have the freedom to choose whichever bootloader, bootmanager, kernel, initramfs, init-system, shell, desctop environment to use as long as they work together.

---

The only requirement is to rebuild those modules when you create a kernel, which is done anyway with => make && make modules_install => just always change the local-version of the kernel when you build a new kernel (or use a different kernel version, so there is a difference in /lib/modules/kernel-version directory)

--

Quote:
Is that initrd and initramfs the same stuff?

[url]
http://stackoverflow.com/questions/10603104/the-difference-between-initrd-and-initramfs[/url]


Last edited by Roman_Gruber on Sun Sep 18, 2016 2:29 pm; edited 2 times in total
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Sun Sep 18, 2016 2:26 pm    Post subject: Reply with quote

YTW,

A long time ago the initrd was a compressed ext2 filesystem in a file.
Today, the initramfs is a compressed CPIO archive of CPIO archives.
They both do the same job. Only the internal structure is different.

When the initrd (ext2 in a file) was in widespread use, everyone had ext2 in their kernels anyway.
It was the root filesystem.

The terms initrd and initramfs tend to be used interchangeably today. Its sloppy but it only matters if you need to know the internal data structures.
Most users don't.

You can tell genkernel to use your own .config file if you wish. Then it will do the build and install steps.
The option all, tells genkernel to use its own default configuration.
I don't know how to use genkernel because I've never needed to find out.

You don't need to use genkernel to make an initrd/initramfs. There are several ways. You can even do it yourself.
My system has root inside LVM on raid5. I need an initrd to assemble the raid (mdadm) so that lvm can find the logical volumes before root is even visible. Both mdadm and lvm are user space programs so they must go in the initrd.
However, my hand made initrd does not contain any kernel modules, so it never needs to be updated. Its like firmware. It was made when the system was new in 2009 and I don't expect to change it.

The numbers in block(0,0) are the kernel major,minor device numbers. They are listed in /usr/src/linux/Documentation/devices.txt
The numbers may be assigned twice. Once to a block device and once to a character device. Its usually clear which is which.

Code:
0,0 is therefore    0             Unnamed devices (e.g. non-device mounts)
                  0 = reserved as null device number


Your HDD will be correctly listed under
Code:
  8 block       SCSI disk devices (0-15)
                  0 = /dev/sda          First SCSI disk whole disk
                 16 = /dev/sdb          Second SCSI disk whole disk
...


block(8,3) in the error message usually says that the kernel can find /dev/sda3 but not read the partition. e.g. The root filesystem is missing from the kernel, or its not available for some reason.
_________________
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 Kernel & Hardware 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