Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Installing Gentoo with systemd, btrfs and systemd-boot
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
januschp
n00b
n00b


Joined: 11 Oct 2017
Posts: 3

PostPosted: Wed Oct 11, 2017 4:50 pm    Post subject: Installing Gentoo with systemd, btrfs and systemd-boot Reply with quote

Hi,

I am trying to replicate my ArchLinux setup with systemd, systemd-boot and btrfs with gentoo. So far, everthing is setuped. However, when I am trying to boot into the system, it halts and spits out the following errors:

The filesystem /dev/sda2, mounted at /newroot does not contain a valid init=/sbin/init
Could not find the root block device in /dev/sda2

I do have the base-system on /dev/sda2 and the boot efi partition is on /dev/sda1. When I install the efi boot loader with bootctl --path=/boot install and check it afterwards with bootctl status, it shows in the loader section:
Product: n/a
Partition: n/a
File: n/a
Nevertheless it seems to find the Boot Loader Binaries and has generated the correct Boot loader entries.

I have compiled app-sys/systemd with the systemd and gnuefi USE flags, because systemd-boot could not be merged after the installation of apps-sys/systemd. I tried to soft link /usr/lib/systemd/systemd /sbin/init but it did not help. I have no idea what to try next. Following the systemd section in the gentoo wiki could not provide a solution to my problem.
Does anybody have an idea how to proceed?

Cheers,
Janusch


Last edited by januschp on Thu Oct 12, 2017 8:34 am; edited 1 time in total
Back to top
View user's profile Send private message
xaviermiller
Administrator
Administrator


Joined: 23 Jul 2004
Posts: 7972
Location: ~Brussels - Belgique

PostPosted: Wed Oct 11, 2017 6:38 pm    Post subject: Reply with quote

Hi,

Please give us the bootloader parameters you gave, it seems you forgot to tell the kernel to switch to systemd with the init= parameter
See https://wiki.gentoo.org/wiki/Systemd
_________________
Kind regards,
Xavier Miller
Back to top
View user's profile Send private message
januschp
n00b
n00b


Joined: 11 Oct 2017
Posts: 3

PostPosted: Thu Oct 12, 2017 8:43 am    Post subject: Reply with quote

Hi,

my booloader parameters are:
title Gentoo Linux
linux /vmlinuz-linux #I have renamed the kernel
initrd /initramfs-linux.img #I have renamed the ramdisk
options root=LABEL=ROOT rootflags=subvol=@ rw #/dev/sda2 is labeled ROOT

Thats what I put into the /boot/loader/entries/gentoo.conf.


Cheers
Janusch
Back to top
View user's profile Send private message
januschp
n00b
n00b


Joined: 11 Oct 2017
Posts: 3

PostPosted: Thu Oct 12, 2017 9:49 pm    Post subject: Reply with quote

Hi,
know the error turned into "could not find the root block device in ." during boot after reinstalling gentoo with the same specs as before.
Does anyone have an idea?

Cheers
Janusch
Back to top
View user's profile Send private message
WvR
Apprentice
Apprentice


Joined: 03 Mar 2011
Posts: 181
Location: Tsuruga, Japan

PostPosted: Fri Dec 29, 2017 9:35 am    Post subject: Reply with quote

Perhaps you already solved the problem, but allow me to help.

I recently experienced very similar problems.

When you get the message "does not contain a valid ...", it means that the disk was succesfully mounted and the start-up scripts are looking for a certain file (/sbin/init in your case). Either this file does not exist or it is "invalid".

Possible solution: boot the machine from USB (I use System Rescue CD but you can use any "liveUSB" or "liveDVD"). Then mount the disk, for example:

Code:
 mount /dev/sda2 /mnt/gentoo


then check and make sure that you have an entry
Code:
 /mnt/gentoo/sbin/init


If you do not have such a file, find the location of
Code:
init
and modify the setup scripts. If the file
Code:
/mnt/gentoo/sbin/init
is present, it is either damaged or something else is wrong. The only solution in such a case would be to redo the entire Gentoo installation, starting with a complete reformat of the hard disk.
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