Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[Sol.] mounting /dev/sda4 on /newroot failed: No such device
View unanswered posts
View posts from last 24 hours

Goto page 1, 2, 3  Next  
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
Sumun
n00b
n00b


Joined: 02 Sep 2019
Posts: 25

PostPosted: Mon Sep 02, 2019 4:47 pm    Post subject: [Sol.] mounting /dev/sda4 on /newroot failed: No such device Reply with quote

Hello,

I am new to Gentoo and tried to install it on my SSD today. I did follow the installation handbook for the most part with one notable exception:
I used f2fs for my root partition instead of ext4.
Since genkernel doesn't compile f2fs by default, I was using the the --menuconfig option to enable (built-in) f2fs kernel support.
I did install the sys-fs/f2fs-tools after kernel compilation.

Everything seems fine, but when rebooting into the installed system I get the following error:
Code:
Using mount -t f2fs -o ro /dev/sda4 /newroot
mount: mounting /dev/sda4 on /newroot failed: No such device
Could not find the root block device in .
Please specify another value or:
- press Enter for the same
- type "shell" for a shell
- type "q" to skp
root block device() ::

If I enter "shell" and then "blkid", it does list all /dev/sda* devices.


My /etc/fstab:
Code:
/dev/sda1        /boot        ext2     noautime,noatime   1 2
/dev/sda3        none         swap     sw                 0 0
/dev/sda4        /            f2fs     noatime            0 1
/dev/cdrom       /mnt/cdrom   auto     noauto,ro          0 0


My /boot/grub/grub.cfg is the same as the config one gets when running "grub-mkconfig -o /boot/grub/grub.cfg", except that I added "rootfstype=f2fs" to the boot parameters.

Being close to 100% sure that I have correctly enabled f2fs kernel support, I am clueless about what could be causing this problem.
Thank you in advance for any help!


Last edited by Sumun on Thu Sep 05, 2019 6:08 pm; edited 1 time in total
Back to top
View user's profile Send private message
Jaglover
Watchman
Watchman


Joined: 29 May 2005
Posts: 7653
Location: Saint Amant, Acadiana

PostPosted: Mon Sep 02, 2019 5:00 pm    Post subject: Reply with quote

Welcome to Gentoo!

Code:
Could not find the root block device in .


This hints your block device is not accessible by your kernel. What kind of device is it? From installation media lsmod and dmesg will contain useful information.
_________________
Please learn how to denote units correctly!
Back to top
View user's profile Send private message
Sumun
n00b
n00b


Joined: 02 Sep 2019
Posts: 25

PostPosted: Mon Sep 02, 2019 5:27 pm    Post subject: Reply with quote

Thank you for your fast response.

Since I don't know how to find out what kind of device my block device is using those two commands, I post their outputs here.

lsmod:
http://dpaste.com/1JPY4P3

dmesg:
http://dpaste.com/285X8GE

I'd be very glad if you could glimpse at these outputs or at least give me a hint on what I should look for.
Back to top
View user's profile Send private message
axl
Veteran
Veteran


Joined: 11 Oct 2002
Posts: 1027
Location: Romania

PostPosted: Mon Sep 02, 2019 5:45 pm    Post subject: Reply with quote

Well, this is just guesswork but I assume the initrd file is at fault, or better yet, the busybox inside the initrd file, which I _think_ may try to call mount.f2fs which is not present in busybox/initrd.

See, if you don't use initrd file, then the kernel does the mounting of rootfs. If you DO use initrd file, then it should have f2fs inside it (again, I _think_).

A simple way to check if I'm right, just remove the initrd file and try again. Of course, make sure the f2fs is compiled as builtin not as a module (Y not m). (NVM, from dmesg it's obvious that it's built in).
Back to top
View user's profile Send private message
Sumun
n00b
n00b


Joined: 02 Sep 2019
Posts: 25

PostPosted: Mon Sep 02, 2019 6:17 pm    Post subject: Reply with quote

Am I correctly assuming that you mean the initramfs?

I tried commenting out the initramfs in my grub.cfg file and get some messages that end with a kernel panic.

https://pasteboard.co/IvzWGKj.jpg
https://pasteboard.co/IvzWVcX.jpg

I think the most relevant error messages are:

Code:
VFS: Cannot open root device "sda4" or unkown-block(0,0): error -19
Please append a correct "root=" boot option [...]

and
Code:
Kernel panic - not syncing: VFS: unable to mount root fs on unkown-block(0,0)

So I doubt that not using the initramfs file solves the problem. Or do you think I should try completely removing the initramfs file instead of just commenting it out from the grub.cfg?
Back to top
View user's profile Send private message
axl
Veteran
Veteran


Joined: 11 Oct 2002
Posts: 1027
Location: Romania

PostPosted: Mon Sep 02, 2019 6:29 pm    Post subject: Reply with quote

I was wrong anyway about busybox. I tried myself and it knows how to mount f2fs. sorry. I'll keep thinking... sorry for wasting your time.
Back to top
View user's profile Send private message
axl
Veteran
Veteran


Joined: 11 Oct 2002
Posts: 1027
Location: Romania

PostPosted: Mon Sep 02, 2019 6:33 pm    Post subject: Reply with quote

Could you please post your genkernel.conf and kernel config please?
Back to top
View user's profile Send private message
Jaglover
Watchman
Watchman


Joined: 29 May 2005
Posts: 7653
Location: Saint Amant, Acadiana

PostPosted: Mon Sep 02, 2019 6:36 pm    Post subject: Reply with quote

You have 2 block devices, I suspect your kernel is enumerating them differently and is trying to mount root filesystem from wrong device. I suggest to use PARTUUID to tell kernel which partition contains root filesystem. You could edit the kernel command line and let it use sdb4 to test my theory.
_________________
Please learn how to denote units correctly!
Back to top
View user's profile Send private message
Sumun
n00b
n00b


Joined: 02 Sep 2019
Posts: 25

PostPosted: Mon Sep 02, 2019 6:59 pm    Post subject: Reply with quote

I am going to post the kernel config files in a few moments. I didn't change anything except for F2FS though, so I don't think it is going to help.

It could indeed be the case that my kernel is enumerating my block devices differently.
What do you mean by "edit the kernel commmand line"? How do I do that?
I am going to change my /etc/fstab file to use PARTUUID.
Back to top
View user's profile Send private message
axl
Veteran
Veteran


Joined: 11 Oct 2002
Posts: 1027
Location: Romania

PostPosted: Mon Sep 02, 2019 7:04 pm    Post subject: Reply with quote

Sumun wrote:
I am going to post the kernel config files in a few moments. I didn't change anything except for F2FS though, so I don't think it is going to help.

It could indeed be the case that my kernel is enumerating my block devices differently.
What do you mean by "edit the kernel commmand line"? How do I do that?
I am going to change my /etc/fstab file to use PARTUUID.


he meant to modify grub.conf. that's where the kernel command line is. kernel file root=/dev/sda4 ... he suggested to change with root=PARTUUID=code. you can get the code by doing blkid | grep sda4 and look for PARTUUID.

Please make sure to post /etc/genkernel.conf as well please. Or just make sure you enabled BUSYBOX="yes" and DISKLABEL="yes" there. if you had to enable either one, run again genkernel --config=/etc/genkernel.conf initramfs to regenerate the file with support for those 2 things and try again.
Back to top
View user's profile Send private message
Jaglover
Watchman
Watchman


Joined: 29 May 2005
Posts: 7653
Location: Saint Amant, Acadiana

PostPosted: Mon Sep 02, 2019 7:08 pm    Post subject: Reply with quote

I'm not a Grub user, but I seem to remember you can edit the command line after hitting 'e' at Grub screen.
_________________
Please learn how to denote units correctly!
Back to top
View user's profile Send private message
axl
Veteran
Veteran


Joined: 11 Oct 2002
Posts: 1027
Location: Romania

PostPosted: Mon Sep 02, 2019 7:08 pm    Post subject: Reply with quote

Assuming in the future you will use grub-mkconfig again, there's also this toggle option in /etc/default/grub to switch between /dev/sda4 or partuuid like jaglover suggested.

GRUB_DISABLE_LINUX_UUID=true
Back to top
View user's profile Send private message
Sumun
n00b
n00b


Joined: 02 Sep 2019
Posts: 25

PostPosted: Mon Sep 02, 2019 7:41 pm    Post subject: Reply with quote

Here is my genkernel config:
http://dpaste.com/1G0J6JN

Where do I find the kernel config?


Quote:
you can edit the command line after hitting 'e' at Grub screen.

Ok, I didn't know that.
I am going to try and edit the grub.conf
Back to top
View user's profile Send private message
axl
Veteran
Veteran


Joined: 11 Oct 2002
Posts: 1027
Location: Romania

PostPosted: Mon Sep 02, 2019 7:49 pm    Post subject: Reply with quote

Sumun wrote:
Here is my genkernel config:
http://dpaste.com/1G0J6JN


:)

what you posted was the kernel .config. Thanks.

But genkernel config is actually /etc/genkernel.conf. Am I to understand you have the stock config? If you didn't edit it, do that now. I checked, the stock file has a comment sign in front of both busybox and disklabel.

Again, NOT SURE, but it should be easy to try and check if this helps.

Edit the file /etc/genkernel.conf

Look for line #BUSYBOX="yes". Remove the "#" sign. Look for line #DISKLABEL="yes". Remove the comment "#" sign. Then save.

run: sudo genkernel initramfs

then try booting again. unless i'm missing something again.


Last edited by axl on Mon Sep 02, 2019 8:03 pm; edited 1 time in total
Back to top
View user's profile Send private message
Sumun
n00b
n00b


Joined: 02 Sep 2019
Posts: 25

PostPosted: Mon Sep 02, 2019 7:52 pm    Post subject: Reply with quote

Jaglover wrote:
You have 2 block devices, I suspect your kernel is enumerating them differently and is trying to mount root filesystem from wrong device. I suggest to use PARTUUID to tell kernel which partition contains root filesystem. You could edit the kernel command line and let it use sdb4 to test my theory.


I tested it now with both /dev/sdb4 and PARTUUID. Both gave the exact same error as with /dev/sda4.
Back to top
View user's profile Send private message
Jaglover
Watchman
Watchman


Joined: 29 May 2005
Posts: 7653
Location: Saint Amant, Acadiana

PostPosted: Mon Sep 02, 2019 8:02 pm    Post subject: Reply with quote

Well, another fruit of my guesswork would be for some reason your M.2 device is not recognized by your genkernel at all, although it should, it seems to use AHCI standard. Perhaps initramfs does not load? I do not use initramfs myself, never used it, nor have I used genkernel. Perhaps someone familiar with these will chime in.
_________________
Please learn how to denote units correctly!
Back to top
View user's profile Send private message
Sumun
n00b
n00b


Joined: 02 Sep 2019
Posts: 25

PostPosted: Mon Sep 02, 2019 8:04 pm    Post subject: Reply with quote

axl wrote:
Sumun wrote:
Here is my genkernel config:
http://dpaste.com/1G0J6JN


:)

what you posted was the kernel .config. Thanks.

But genkernel config is actually /etc/genkernel.conf. Am I to understand you have the stock config? If you didn't edit it, do that now. I checked, the stock file has a comment sign in front of both busybox and disklabel.

Again, NOT SURE, but it should be easy to try and check if this helps.

Edit the file /etc/genkernel.conf.

Look for line #BUSYBOX="yes". Remove the "#" sign. Look for line #DISKLABEL="yes". Remove the comment "#" sign. Then save.

run: sudo genkernel initramfs

then try booting again. unless i'm missing something again.

I just tried this. Interestingly, #DISKLABEL="yes" was already uncommented, but #BUSYBOX wasn't. However, it still gave me the same error.
Back to top
View user's profile Send private message
axl
Veteran
Veteran


Joined: 11 Oct 2002
Posts: 1027
Location: Romania

PostPosted: Mon Sep 02, 2019 8:05 pm    Post subject: Reply with quote

The same error being this one?

Code:
Using mount -t f2fs -o ro /dev/sda4 /newroot
mount: mounting /dev/sda4 on /newroot failed: No such device
Could not find the root block device in .
Please specify another value or:
- press Enter for the same
- type "shell" for a shell
- type "q" to skp
root block device() ::


EDIT: IF yes, then please use shell to post a dmesg from that point. That would help to get new ideas.
Back to top
View user's profile Send private message
axl
Veteran
Veteran


Joined: 11 Oct 2002
Posts: 1027
Location: Romania

PostPosted: Mon Sep 02, 2019 8:08 pm    Post subject: Reply with quote

Sumun wrote:
I just tried this. Interestingly, #DISKLABEL="yes" was already uncommented, but #BUSYBOX wasn't. However, it still gave me the same error.


Did you happen to check the date on the initramfs file? Maybe you skipped the step where you had to redo the initramfs file. maybe you skipped that. could post a log of that, I would like to see for myself genkernel saying: including busybox and blkid.
Back to top
View user's profile Send private message
axl
Veteran
Veteran


Joined: 11 Oct 2002
Posts: 1027
Location: Romania

PostPosted: Mon Sep 02, 2019 8:11 pm    Post subject: Reply with quote

Also if anyone else wants to chime in... be my guest. I just like a good riddle.
Back to top
View user's profile Send private message
Sumun
n00b
n00b


Joined: 02 Sep 2019
Posts: 25

PostPosted: Mon Sep 02, 2019 8:25 pm    Post subject: Reply with quote

axl wrote:
The same error being this one?

Code:
Using mount -t f2fs -o ro /dev/sda4 /newroot
mount: mounting /dev/sda4 on /newroot failed: No such device
Could not find the root block device in .
Please specify another value or:
- press Enter for the same
- type "shell" for a shell
- type "q" to skp
root block device() ::


EDIT: IF yes, then please use shell to post a dmesg from that point. That would help to get new ideas.

Yes, with one small difference: it now says
Code:
Block device PARTUUID=.... is not a valid root device

instead of
Code:
No such device

The problem with using dmesg in that shell is that I don't know how to post it here, since this shell is very limited and I have no Internet access in there, so I can't use wgetpaste.
Do you have an idea how I can still post the output of dmesg?
Also, how do I post a log of the intramfs file redo step?

And, by the way, thank you guys for trying to help me, even if we haven't found a solution yet.
Back to top
View user's profile Send private message
Sumun
n00b
n00b


Joined: 02 Sep 2019
Posts: 25

PostPosted: Mon Sep 02, 2019 8:28 pm    Post subject: Reply with quote

Jaglover wrote:
Well, another fruit of my guesswork would be for some reason your M.2 device is not recognized by your genkernel at all, although it should, it seems to use AHCI standard. Perhaps initramfs does not load? I do not use initramfs myself, never used it, nor have I used genkernel. Perhaps someone familiar with these will chime in.

I am pretty sure that initramfs itself does load, because, as I tried earlier, if I comment it out of grub, something weird happens.
Maybe I should try a reinstall with manual kernel configuration?
Back to top
View user's profile Send private message
Jaglover
Watchman
Watchman


Joined: 29 May 2005
Posts: 7653
Location: Saint Amant, Acadiana

PostPosted: Mon Sep 02, 2019 8:49 pm    Post subject: Reply with quote

You don't need to reinstall Gentoo to try a different kernel. A custom kernel without initramfs is easier to troubleshoot, IMHO. Remember, there are three things which must be compiled in as <*>, not as module <M>.
First, the HDD controller, it is nowadays AHCI for most PC's, but there are some M.2 devices which use NVME instead. You may try and turn NVME on in your genkernel for testing.
Second, the partition table, it would be GPT or MBR.
Third, root filesystem support, it is F2FS for you.
_________________
Please learn how to denote units correctly!
Back to top
View user's profile Send private message
axl
Veteran
Veteran


Joined: 11 Oct 2002
Posts: 1027
Location: Romania

PostPosted: Mon Sep 02, 2019 8:59 pm    Post subject: Reply with quote

wait. wait. not a valid root device is another beast. wait.


now you just got an init problem. and my guess you just need to add to kernel command (that grub.conf or edit at boot)


init=/usr/lib/systemd/systemd or init=/lib/systemd/systemd depending on useflags. if you have useflag USE="systemd"

just check which file exists. if /usr/lib/systemd/systemd exists, use that as init. if the other one... well it's obvious.

now. what that error means is that it did mount the root partition but can't start init. which should be either /init or /sbin/init. if you're an openrc guy you should be covered, but if you're on systemd side, this is what you're missing. also to be added in /etc/default/grub at CMDLINE or smth. you'll know when you edit the file. there's also more fancy ways to do it, but let's just start here. and don't give up :)


Last edited by axl on Mon Sep 02, 2019 9:01 pm; edited 1 time in total
Back to top
View user's profile Send private message
Sumun
n00b
n00b


Joined: 02 Sep 2019
Posts: 25

PostPosted: Mon Sep 02, 2019 9:01 pm    Post subject: Reply with quote

Jaglover wrote:
You don't need to reinstall Gentoo to try a different kernel. A custom kernel without initramfs is easier to troubleshoot, IMHO. Remember, there are three things which must be compiled in as <*>, not as module <M>.
First, the HDD controller, it is nowadays AHCI for most PC's, but there are some M.2 devices which use NVME instead. You may try and turn NVME on in your genkernel for testing.
Second, the partition table, it would be GPT or MBR.
Third, root filesystem support, it is F2FS for you.

Tomorrow I am going to try turning on NVME in genkernel, and if that doesn't work, I will compile a custom kernel as you suggested.
I'll report back.
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
Goto page 1, 2, 3  Next
Page 1 of 3

 
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