Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
systemd-boot root=/dev/ram0
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
g-w
n00b
n00b


Joined: 06 Apr 2022
Posts: 8

PostPosted: Wed Apr 06, 2022 3:22 am    Post subject: systemd-boot root=/dev/ram0 Reply with quote

Today I installed Gentoo with OpenRC and systemd-boot. It created the following entry:
Code:

title      Gentoo/Linux
version    5.15.32-gentoo-dist
machine-id Default
options    root=/dev/ram0
linux      /Default/5.15.32-gentoo-dist/linux
initrd     /Default/5.15.32-gentoo-dist/initrd


My actual root is /dev/sda3. Now, the entry created fails to boot, landing in a Dracut emergency shell. When corrected to /dev/sda3, it boots. But what is /dev/ram0 and why did systemd-boot set it as my root drive? It does not exist.
Back to top
View user's profile Send private message
jpsollie
Apprentice
Apprentice


Joined: 17 Aug 2013
Posts: 291

PostPosted: Sat Apr 16, 2022 4:08 am    Post subject: Reply with quote

/dev/ram0 is the device name of your ramdisk.
When your kernel loads from an initial ramdisk, it creates a virtual device /dev/ram0 to boot from. the bootloader puts the ramdisk up there in memory, so your kernel can boot.
When you boot it, it will find things like kernel modules, basic settings etc in the ramdisk to instruct how to proceed.
The fact that it doesn't work sounds like:
-you didn't generate ramdisk correctly. Check the gentoo handbook / wiki for that, you may have missed something
-your fstab in the ramdisk has an incorrect device set for the root filesystem (/)
_________________
The power of Gentoo optimization (not overclocked): [img]https://www.passmark.com/baselines/V10/images/503714802842.png[/img]
Back to top
View user's profile Send private message
Phoenix591
Guru
Guru


Joined: 17 Sep 2007
Posts: 487

PostPosted: Sat Apr 16, 2022 7:33 am    Post subject: Reply with quote

when trying to come up with the commandline to use for automatically generated entries, systemd-boot first looks at /etc/kernel/cmdline, and if it doesn't exist, looks at /usr/lib/kernel/cmdline, and if that also does not exist, falls back to /proc/cmdline ( the current commandline used for the kernel). This last option is what it did: it used the livecd's root=/dev/ram0 for your actual install.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Sat Apr 16, 2022 9:48 am    Post subject: Reply with quote

g-w,

/dev/ram0 is your first ram disk.

Once upon a time, the initrd was loaded into /dev/ram0 and the kernel was told to look for it there.
That's not been the case for a long time now. Your kernel may not even have ramdisk support enabled. Its been replaced with tmpfs.

There is much tighter integration between the kernel and initramfs these days. The kernel will use it if its there so root=/dev/ram0 is no longer required to mouth the temporary root filesystem.
_________________
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 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