# (Solved) kernel panic - not syncing: vfs: unable to mount

## FrankRizz0

Good afternoon all!

So the complete error was 

```
kernel panic - not syncing: vfs: unable to mount root fs on unknown-block(8,4)
```

Starting from the beginning, I bought a used server that I wanted for a NAS.  Turns out that Open Media Vault / FreeNAS doesn't suit my needs (nor do I like them much) so I decided to change it into a Gentoo box, and turn it into an HTPC.  I have no idea what the error means (8,4) so I am not sure where to begin.  My fstab is here:

https://paste.pound-python.org/show/zhMT46SMRHb0lmfhwW7S/

My lspci -k located here:

https://paste.pound-python.org/show/s2ekNk0mJA1ZDy0VngeW/

And my kernel config is here:

https://paste.pound-python.org/show/ntWMUViLVcjHkSSt3Qbb/Last edited by FrankRizz0 on Mon Jul 30, 2018 11:32 am; edited 1 time in total

----------

## axl

My guess is: you didn't include the proper disk support in the kernel. With "old server" is hard to guess what that would be. Could be anything from pata/sata/scsi or any of the raids. My suggestion is boot again the live cd and analyze dmesg/lspci from there, not from your kernel which doesn't include the obvious support you need.

----------

## NeddySeagoon

FrankRizz0,

unknown-block(8,4) tells the kernel major and minor device numbers that the kernel is trying to mount as root.

That's /dev/sda4.

That you get (8,4) tells that the kernel can see something there but not understand what it finds.

Maybe the root filesystem driver is missing from the kernel?

Unless you have an initrd, <M> won't work.

Perhaps the live kernel and install media don't agree on what /dev/sda4 is?

As the box is/was a NAS, it will have several drives.

Grub lets you edit the in memory copy of the boot stanza ... press 'e' and do same trial and error.

Maybe you used a USB stick as install media and its still plugged in?

On some systems USB storage devices are enumerated before HDD?

----------

## FrankRizz0

Thanks for the reply Neddy.  I removed the drives from the box besides one additional drive.  I did the install using the LiveDVD on a USB stick, and also made sure to change it back to boot from the hard drive.  Not exactly sure what you mean by <M>.  Also, I'm unsure regarding pressing 'e', are you referring during the boot process to press e?

----------

## axl

 *FrankRizz0 wrote:*   

> Thanks for the reply Neddy.  I removed the drives from the box besides one additional drive.  I did the install using the LiveDVD on a USB stick, and also made sure to change it back to boot from the hard drive.  Not exactly sure what you mean by <M>.  Also, I'm unsure regarding pressing 'e', are you referring during the boot process to press e?

 

the <m> means that you could have had the kernel compiled for some hardware disk controllers as Modules (m stands for module) and in case you do have that, you would need an additional initrd image. you didn't have any M in disk stuff, i checked. but U do have very basic disc support in kernel. and servers usually have specialized disk controllers that include something other then just piix. 

again, you are missing stuff from the kernel in either sata/scsi department. compare output from livedvd or whatever media you installed from that is seeing the controller, with dmesg from your own kernel that is lacking support.

----------

## axl

a total of 20 =m in the config. no way in hell it is the initrd file. Take a look at sata. Only has piix.

He said it's an old server. Has xeon. Certainly has a server type disk controller instead of piix.

----------

## FrankRizz0

Thanks for your help axl.  Below is the output of dmesg:

https://paste.pound-python.org/show/uB4L5XRXa8HzxPsJ5RpL/

and I found some strange inconsistencies:

```
[   15.889250] EXT4-fs (sda2): couldn't mount as ext3 due to feature incompatibilities

[   15.889378] EXT4-fs (sda2): mounting ext2 file system using the ext4 subsystem

[   15.910827] EXT4-fs (sda2): mounted filesystem without journal. Opts: (null)

[   15.953557] EXT4-fs (sda4): couldn't mount as ext3 due to feature incompatibilities

[   15.953683] EXT4-fs (sda4): couldn't mount as ext2 due to feature incompatibilities

[   16.020556] EXT4-fs (sda4): mounted filesystem with ordered data mode. Opts: (null)

[   16.063104] EXT4-fs (sdb1): couldn't mount as ext3 due to feature incompatibilities

[   16.063265] EXT4-fs (sdb1): couldn't mount as ext2 due to feature incompatibilities

[   16.122477] EXT4-fs (sdb1): mounted filesystem with ordered data mode. Opts: (null)
```

When I looked through that, I decided to check out fdisk -l, whic I posted here:

https://paste.pound-python.org/show/RAgYj8dIycNp4ObnB2N0/

What I found very strange is that I only have 2 drives, not three.  Even more curious is that someone tried to install an EFI boot on it.  The system is definitely bios and not efi, I have checked and double checked.  Anyhow, I deleted them.

----------

## NeddySeagoon

FrankRizz0,

When the grub menu appears, choose the option you want but press the 'e' key, not enter.

If you have a part of the SCSI stack missing, the error is usually unknown-block(0,0).

The <M> refers to the kernel menuconfig symbol means that something is to be made available as a loadable module. <*> indicates that the code is to be included in the kernel binary.

It matters because booting is solving the problem of loading an operating system from disk, on a computer that can read exactly one disk block. There are lots of circular dependencies to be broken.

Consider the following. There is a loadable module required to mount the root filesystem. The module is on the root filesystem, therefore it cannot be loaded until root is mounted.

There are two solutions build a kernel that can boot without needing loadable module support, or provide the modules in a temporary root filesystem, which is what an initrd is.

Tell us how you made your kernel.

Put your lspci output into a post.

Using wgetpaste, put your kernel .config file onto a pastebin site and post a link to it.

Tell us which filesystem types you have on which partitions.

----------

## axl

 *FrankRizz0 wrote:*   

> Thanks for your help axl.  Below is the output of dmesg:
> 
> https://paste.pound-python.org/show/uB4L5XRXa8HzxPsJ5RpL/
> 
> and I found some strange inconsistencies:
> ...

 

Nope, seems to be covered by ahci. Have no clue then...

----------

## axl

 *NeddySeagoon wrote:*   

> Put your lspci output into a post.
> 
> Using wgetpaste, put your kernel .config file onto a pastebin site and post a link to it.
> 
> 

 

it's in the first post neddy.

----------

## FrankRizz0

My lspci -k located here: 

https://paste.pound-python.org/show/s2ekNk0mJA1ZDy0VngeW/

And my kernel config is here: 

https://paste.pound-python.org/show/ntWMUViLVcjHkSSt3Qbb/

----------

## FrankRizz0

My fstab is located here:

https://paste.pound-python.org/show/zhMT46SMRHb0lmfhwW7S/

I did find an error with fstab, sdb is actually ext4 not 3, but this wouldn't cause my system not to boot.

----------

## FrankRizz0

Almost forgot, how I built my kernel; I researched what I could from lspci -k output and used google.

----------

## axl

I have no clue. Afaik it should have worked. For my own curiosity could you post the output (while on live dvd) of udevadm info -a -n /dev/sda pls ?

----------

## FrankRizz0

https://paste.pound-python.org/show/jrwdeNUwGm04wQAIM1F3/

----------

## axl

Thank you. Yes, as expected nothing special. SD disk is on, ext4 is on, ahci is on. Really have no clue. 

At this point, If this would happen to me, I would start to wonder if I am booting the kernel I am compiling. 

The only question mark I have left based on what you posted is what is on sda1?

----------

## axl

U mentioned at one point you tried to treat the system as uefi. 

combine that with a vfat first partition on a mbr disc that might include a previous iteration of kernel... and u have prolly your sda1. am I right?

EDIT what I am saying is that the kernel booted from sda1 is not the kernel from /boot on sda2. or kernel compiled on sda4 doesn't get on sda2. either way... that's what i would look at.

----------

## Marlo

 *FrankRizz0 wrote:*   

> My fstab is located here:
> 
> https://paste.pound-python.org/show/zhMT46SMRHb0lmfhwW7S/
> 
> I did find an error with fstab, sdb is actually ext4 not 3, but this wouldn't cause my system not to boot.

 

But did you really create a user named Media?

More specifically: Does the directory /home/Media exist?

```
[  220.552406] EXT4-fs (sda4): mounted filesystem with ordered data mode. Opts: (null)

[  236.547968] EXT4-fs (sda2): mounting ext2 file system using the ext4 subsystem

[  236.564880] EXT4-fs (sda2): mounted filesystem without journal. Opts: (null)

[  800.868602]  sdb: sdb1

[  826.413140]  sdb: sdb1
```

----------

## FrankRizz0

axl you misunderstood, I did not try and build it as a uefi, it was already on the system, so the previous owner tried to install Gentoo and was unsuccessful (I know this because I have researched this system, it is definitely NOT uefi, it is bios).  Marlo, sdb would not stop the system from booting.  Further to this, yes, I did create a file in /home called Media.

Edit: Sorry, I did not create a user called Media, that is where I mounted sdb.

----------

## axl

 *FrankRizz0 wrote:*   

> axl you misunderstood, I did not try and build it as a uefi, it was already on the system, so the previous owner tried to install Gentoo and was unsuccessful (I know this because I have researched this system, is is definitely NOT uefi, it is bios).

 

can it be possible that the system boots in a loop from sda1 with a kernel made by the previous user? it would make sense. u're doing boot in sda2.

----------

## FrankRizz0

Possibly, I did not comment sda1 in fstab, maybe that will do the trick (I don't remember ever commenting grub as sda1 in fstab).

----------

## axl

 *FrankRizz0 wrote:*   

> Possibly, I did not comment sda1 in fstab, maybe that will do the trick (I don't remember ever commenting grub as sda1 in fstab).

 

dude!!! what is on it? start with that. you seem to know what is on 2, 3, 4, but what is on 1? do you know? dont just comment or whatever. figure out what is there.

PS also your last comment made you l33t. congrats on your 600th post.  :Smile: 

----------

## FrankRizz0

OK so I think I somehow created sda2 as efi:

```
/dev/sda1     2048      6143      4096     2M BIOS boot

/dev/sda2     6144    268287    262144   128M EFI System

/dev/sda3   268288   1316863   1048576   512M Linux filesystem

/dev/sda4  1316864 488395119 487078256 232.3G Linux filesystem

```

This is from fdisk /dev/sda

----------

## axl

Like I said in a previous post, I think (bet/gamble 80% sure at this point), the kernel in efi / (slash) boot sda2 is not the kernel you compiled. sda3 is not swap. the whole thing is gpt without a point because is not larger then 2tb. and bios is not uefi. 

save everything. make a single partition in mbr or whatever disk layout you like... but certainly not this. and make sure the kernel that has the config you posted is the kernel that is booted, and i'm 80% sure it will work.

----------

## axl

i mean, for a bios/mbr setup, your partition layout is pretty weird. I would start over. save all data tar/xz. treat everything like a stage3 i want to save, instead of restore. 

repartition the disk in a mbr manner, according to your requirements. and just start over with the save as stage 3.

----------

## Marlo

 *NeddySeagoon wrote:*   

> FrankRizz0,
> 
> When the grub menu appears, choose the option you want but press the 'e' key, not enter.
> 
> 

 

Just do what NeddySeagoon said:

from

```
 BOOT_IMAGE=/isolinux/gentoo root=/dev/ram0 init=/linuxrc dokeymap aufs looptype=squashfs loop=/image.squashfs cdroot initrd=/isolinux/gentoo.xz console=tty1 
```

to

```
root=/dev/sda4 rootfstype=ext4
```

----------

## FrankRizz0

So I started all over again, from scratch and now the system won't go into the Grub screen.  Fortunately, whenever I do an install, I put on a file every step that I've made.  Maybe someone can see an error I've made during the install, which is located here:

https://paste.pound-python.org/show/H27UDwILLauMk9n6yc64/

----------

## axl

 *FrankRizz0 wrote:*   

> So I started all over again, from scratch and now the system won't go into the Grub screen.  Fortunately, whenever I do an install, I put on a file every step that I've made.  Maybe someone can see an error I've made during the install, which is located here:
> 
> https://paste.pound-python.org/show/H27UDwILLauMk9n6yc64/

 

I don't see any error in making the system but I don't see the kernel being made for starters.

EDIT: nono. sorry. it's there. line 19-20. sorry.

EDIT2: ok, so when you say the system wont go into grub screen, what does that mean? how would you describe it? and second, what was the output of grub-install /dev/sda and grub-mkconfig -o /boot/grub/grub.conf?

----------

## FrankRizz0

OK so started from the beginning AGAIN.  I found a couple errors during my install, first, for some reason I did not mount sda3 to root at the beginning of my install, so this is what made me start from the beginning.  This still did not help, so since the Grub splash screen was not posting at boot, I assumed it was my Grub install.  Discovered my error, add GRUB_PLATFORMS="pc" to make.conf, ran 

```
emerge -uavDN @world
```

 and grub updated itself.  Once completed, I ran 

```
grub-install /dev/sda
```

 and then 

```
grub-mkconfig -o /boot/grub/grub.cfg
```

 which returned:

```
Installing for i386-pc platform.

Installation finished. No error reported.

Generating grub configuration file ...

Found linux image: /boot/vmlinuz-4.14.52-gentoo

done
```

Grub splash screen still did not appear.  At first I had assumed that it was a hard drive failure, but in the past when I've tried to format a hard drive over to a Linux file system that was dead fdisk caught it immediately.  I assumed it was my bios set up so I made the hard drive first boot priority instead of the DVD, still no luck.  At this point I do not no where else to look.  Below is my install, if anyone can see an error please let me know, thanks in advance!

https://paste.pound-python.org/show/KTxEXdmywjvlBUito9H5/

----------

## Jaglover

Sorry, starting over is complete nonsense. You have no GPT support in your kernel, thus you are getting this (8,4) error. Kernel can access the drive, but gets stuck reading partition table.

----------

## axl

 *Jaglover wrote:*   

> Sorry, starting over is complete nonsense. You have no GPT support in your kernel, thus you are getting this (8,4) error. Kernel can access the drive, but gets stuck reading partition table.

 

No he doesn't. If disk were to be GPT, grub would complain about it.

----------

## axl

 *FrankRizz0 wrote:*   

> Grub splash screen still did not appear.

 

there's 2 things I can think of. given THIS installation. not the old one. 

1. maybe partition 1 (the boot partition needs a bootable flag). button A in fdisk. 

2. maybe grub was set to work in a resolution that the card cannot do in VBE or whatever grub is using. try to set grub in plain text mode without beatyfication stuff.

----------

## Jaglover

 *axl wrote:*   

>  *Jaglover wrote:*   Sorry, starting over is complete nonsense. You have no GPT support in your kernel, thus you are getting this (8,4) error. Kernel can access the drive, but gets stuck reading partition table. 
> 
> No he doesn't. If disk were to be GPT, grub would complain about it.

 

Well, I'm not there watching over his shoulder, but he said he is using GPT and it was not enabled in his config.

Reinstalling will let to repeat previous mistakes and also add new mistakes. Thus, it should be fixed, not reinstalled.

What is going on there now I don't know. My fix is for initial issue he was having.

----------

## axl

 *Jaglover wrote:*   

>  *axl wrote:*    *Jaglover wrote:*   Sorry, starting over is complete nonsense. You have no GPT support in your kernel, thus you are getting this (8,4) error. Kernel can access the drive, but gets stuck reading partition table. 
> 
> No he doesn't. If disk were to be GPT, grub would complain about it. 
> 
> Well, I'm not there watching over his shoulder, but he said he is using GPT and it was not enabled in his config.
> ...

 

I agree with you there. But I just asked him to post what happens when he tries to install grub and the man posted that everything is ok. the output he provided rules out the thing u're thinking. I thought of it too.

----------

## FrankRizz0

Jaglover no, I am not using gpt at this point.  No disrespect, but let's also try and stay away from opinions and critique (it doesn't help at this point) and I also found a couple errors by going through my install multiple times.  axl, I'm thinking you're correct, I will add the boot flag to sda1 and redo grub, I'll let you know in a few minutes.

----------

## axl

 *FrankRizz0 wrote:*   

> Jaglover no, I am not using gpt at this point.  No disrespect, but let's also try and stay away from opinions and critique (it doesn't help at this point) and I also found a couple errors by going through my install multiple times.  axl, I'm thinking you're correct, I will add the boot flag to sda1 and redo grub, I'll let you know in a few minutes.

 

Just bad manners. Comes on page 2, insults both of us, uninformed. Could have just had a cursory read. just... bleah. 

Anyway, hope it works. Good luck.

----------

## FrankRizz0

Thanks for all your help axl.

----------

## axl

 *FrankRizz0 wrote:*   

> Thanks for all your help axl.

 

It was my pleasure  :Smile:  I hope it worked and U're not just saying that because of jag lover. 

It's ok to be a jag lover. Jags are awesum. 

https://www.youtube.com/watch?v=e7gR7EYjcP8

----------

## FrankRizz0

So, turns out the disks were GPT and not MBR.  I went into gdisk, changed the partition table to MBR, went back into fdisk, changed sda1 to a linux filesystem (gdisk changed it to efi) and the box booted.  Once again thanks for all your help guys!

----------

