Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[Solved] VFS: Unable to mount root fs on unknown-block(0,0)
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
piotr5
Tux's lil' helper
Tux's lil' helper


Joined: 14 Dec 2012
Posts: 117

PostPosted: Thu Apr 13, 2017 10:45 am    Post subject: [Solved] VFS: Unable to mount root fs on unknown-block(0,0) Reply with quote

I'm on linux-4.4.6 since linux-4.9.16 fails to boot with above kernel panic. I tested the new kernel with the old initramfs and it boots correctly (although not to the end since kernel-modules are missing.) then I tested the old kernel with the new initramfs and I get a kernel panic of unknown type. did I do something wrong in creating initramfs? are there any constraints except for cpio of newc type compressed by xz?

Last edited by piotr5 on Sun Apr 23, 2017 6:59 am; edited 1 time in total
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Thu Apr 13, 2017 12:03 pm    Post subject: Reply with quote

piotr5,

Code:
VFS: Unable to mount root fs on unknown-block(0,0)
tells that the kernel cannot reach the hard drive at all.
If your initrd contains kernel modules, its tied to the matching kernel, since the kernel will not modprobe modules intended for a different kernel.

Tell us how you configured, compiled and installed both your kernel and initrd.
If you used genkernel, tell the commands that you used.
_________________
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
piotr5
Tux's lil' helper
Tux's lil' helper


Joined: 14 Dec 2012
Posts: 117

PostPosted: Thu Apr 13, 2017 10:59 pm    Post subject: Reply with quote

there isn't much to tell: I started "genkernel all --kernel-config=/etc/kernels/kernel-config-x86_64-4.4.6-gentoo", then extracted the resulting initrd, altered it and added some files, and packaged it up again with
Code:
find . -print |cpio --quiet -o -H newc |xz
streaming the result directly into the file I loaded by grub2. and you are wrong that this error is caused by wrong kernel version. above error comes only if I use the correct kernel version with the right initrd I created. with older kernel and this initrd I get a kernel panic also at root-mounting but since messages run by too fast I can't tell the exact error-message. I suspect the file-system the kernel failed to mount is the very initrd. hence my question if there are some special requirements. I've done a similar procedure for many years, this is the first time it failed...

to emphasize: since the new kernel is capable of mounting and running the old initrd, it definitely is no driver missed out during compilation!
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Fri Apr 14, 2017 8:20 am    Post subject: Reply with quote

piotr5,

Any kernel version should work. I didn't intend to suggest otherwise.
You cannot mix one kernel with the initrd intended for another as one kernel will not load a different kernels modules.
The
Code:
vermagic:       4.10.1-gentoo SMP preempt mod_unload modversions
needs to match.

Code:
genkernel all
should make a kernel and initrd that at least mounts root, or fails with different numbers in unknown-block(0,0).
I can think of one hardware setup where that fails - root on nvme, where genkernel does not load the nvme module from the initrd.
If raid/lvm/luks are needed, you need to pass the corresponding options to genkernel.

Make a simple, as you can,
Code:
genkernel all
kernel and check that it mounts root.
It may fail later but that's OK. This is not intended to be a fix. Its a test to shrink the problem domain.

Root on nvme needs manual intervention during the kernel configure stage.
_________________
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
piotr5
Tux's lil' helper
Tux's lil' helper


Joined: 14 Dec 2012
Posts: 117

PostPosted: Sat Apr 22, 2017 9:21 am    Post subject: Reply with quote

I don't need to create any new initramfs, the one genkernel created works -- except that as it is unchanged I cannot mount root from there. the culprit is my creating a new initramfs. the altered one just boots till input-setup and then before entering any init scripts just complains it cannot mount unknown-block(0,0), i.e. it cannot mount initramfs or whatever virtual filesystem it's supposed to mount first. I know that for sure since my real linux-partition is far from any kind of (0,0) partition.

as for lvm and luks, I am using both, but they are in my config-file for genkernel, not on command-line. so "genkernel all" is by far not as simple as I can...

so, I did extract both, the original initramfs as created by genkernel and the altered version. and diff -r only shows the expected differences: one startup-file which didn't even get executed before crashing, and a few files it would have required. well, diff also complained about "dev/console", "dev/null", "dev/tty0", "dev/tty1", "dev/ttyS0" and "dev/zero" being character-devices. but that too is to be expected. so the only mistake I could have made is in the commandline for cpio or xz. so, what's wrong with
Code:
find . -print |cpio --quiet -o -H newc |xz
and how should the correct command pipe look like? when I replace the "." for a "*" I get the same result to booting from the older kernel with the new initramfs: kernal panic right inside mount_block_root (or printk, can't tell if that's part of panic or panic-reporting). below and above the stack-dump am able to read the related error-message. strange thing though is, with this new kernel it failed inside mount_block_root+0x293/0x2ab (notice the 2 different values), while with old kernel the broken initramfs caused a crash in mount_block_root+0x287/0x287 (i.e. values before and after "/" are the same). does that mean it's a different failure? how do I check which source-code line corresponds to these numbers? how comes some stack-frames have 2 differing offsets printed?
Back to top
View user's profile Send private message
szatox
Advocate
Advocate


Joined: 27 Aug 2013
Posts: 3137

PostPosted: Sat Apr 22, 2017 10:20 am    Post subject: Reply with quote

Maybe it's about your boot params rather than initramfs.
Try going with root=/dev/ram0 real_root=<your root device>.
Also, adding "debug" will drop you to shell once or twice during early boot, so you can have a look around.

And talking about building your custom initramfs: kernel's builtin decompressor for xz supports only a subset of xz compression options. It is not able to understand the output from xz's defaults. I don't know what the supported subset or what options you need to pass to xz. The easy mode is to go with gzip or bzip2 instead. I think gzip is even enabled by default, so you don't have to recompile kernel.
Back to top
View user's profile Send private message
piotr5
Tux's lil' helper
Tux's lil' helper


Joined: 14 Dec 2012
Posts: 117

PostPosted: Sun Apr 23, 2017 6:50 am    Post subject: Reply with quote

many thanks! that's the answer I were looking for! I made the mistake of believing the subset of xz supported by kernel would mean lower compression-rate. now it seems having checksums is a problem.
Code:
xz -e --check=none -z -f -9
is what genkernel uses, and it also worked for me! i.e. the correct pipe seems to be:
Code:
find . -print |cpio --quiet -o -H newc |xz -e --check=none -z -f -9
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming 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