LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Virtualization and Cloud
User Name
Password
Linux - Virtualization and Cloud This forum is for the discussion of all topics relating to Linux Virtualization and Linux Cloud platforms. Xen, KVM, OpenVZ, VirtualBox, VMware, Linux-VServer and all other Linux Virtualization platforms are welcome. OpenStack, CloudStack, ownCloud, Cloud Foundry, Eucalyptus, Nimbus, OpenNebula and all other Linux Cloud platforms are welcome. Note that questions relating solely to non-Linux OS's should be asked in the General forum.

Notices


Reply
  Search this Thread
Old 12-26-2017, 06:49 AM   #1
linuxbawks
Member
 
Registered: Apr 2013
Distribution: Snuckware
Posts: 240

Rep: Reputation: 17
How necessary is the initrd?


I installed slack with elilo in EFI mode.
The elilo.conf is simple and it loads vmlinuz without an initrd. It's straightforward.

In the case of loading a Xen-dom0 kernel I understand you have to use mobootpack to create a composite image for the elilo loader. But is an initrd still required in this case?
 
Old 12-26-2017, 09:06 AM   #2
fatmac
LQ Guru
 
Registered: Sep 2011
Location: Upper Hale, Surrey/Hants Border, UK
Distribution: Mainly Devuan, antiX, & Void, with Tiny Core, Fatdog, & BSD thrown in.
Posts: 5,473

Rep: Reputation: Disabled
From memory, an initrd is only needed if the kernel doesn't have all necessary drivers compiled into it.
 
Old 12-26-2017, 10:20 AM   #3
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,241

Rep: Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321
If the kernel was compiled using an initrd, you probably need it. If you compile your own, you can choose your options and do without it. I do. In booting, the following things happen
  1. Bios starts reading the hard disk, and thus runs the boot loader
  2. Boot loader loads kernel and initrd if specified.
  3. Kernel takes over. It has to be equipped to handle every task it attempts with compiled in modules.
  4. Kernel mounts root and the module tree becomes accessible.

So, obviously in the initrd or kernel, you need support for your hard disk filesystem, and motherboard chipset. In special cases you need access to decryption, or network or other exotic things. If /boot and / don't have the same filesystem, you need support for both. You don't need modules for networking, bluetooth and usb unless they're needed by the kernel in the boot process.
 
1 members found this post helpful.
Old 12-28-2017, 02:32 PM   #4
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,965

Rep: Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622
https://en.wikipedia.org/wiki/Initial_ramdisk

I had to look it up.
 
Old 12-28-2017, 05:06 PM   #5
linuxbawks
Member
 
Registered: Apr 2013
Distribution: Snuckware
Posts: 240

Original Poster
Rep: Reputation: 17
Reason I asked was in the particular case of loading Xen.
If I understand correctly, Xen loads first then it chains vmlinuz. So the order in which modules load is:

- Xen
- initrd
- vmlinuz.
 
Old 12-28-2017, 07:27 PM   #6
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,965

Rep: Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622
Do you mean you want to edit grub such as this?
"
Edit Debian's configuration file for grub-mkconfig.
# vi /etc/default/grub

Change the line:

GRUB_DEFAULT=0

to

GRUB_DEFAULT='Debian GNU/Linux, with Xen hypervisor'
"

I am now lost as to your question exactly? Do you mean when you start a dom?
 
1 members found this post helpful.
Old 12-28-2017, 07:31 PM   #7
linuxbawks
Member
 
Registered: Apr 2013
Distribution: Snuckware
Posts: 240

Original Poster
Rep: Reputation: 17
I was asking when starting dom0.

Nevermind, I think the question has been answered.
 
Old 12-28-2017, 07:35 PM   #8
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,965

Rep: Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622
OK, sorry I didn't get the question.
Thanks for the update.

More info here just in case.

https://wiki.xenproject.org/wiki/Xen...eginners_Guide
 
Old 12-29-2017, 04:18 AM   #9
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 4,137
Blog Entries: 1

Rep: Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874
The initrd copes with parts of the kernel that were compiled as "modules", but are REQUIRED to read the data necessary to boot. The initrd is optional if those parts of the kernel are NOT modules. Things like drivers for the hardware that contains the kernel (SATA / USB), and the filesystem(s) needed to read the kernel are required to NOT be modules if you do not have an initrd. All the other modules can be loaded after the fact via /etc/modules or /etc/modprobe.d/*.conf preferences.

Pros and cons of course, like not being able to unload modules and free resources if they are not modules. Like if /boot/ is it's own partition with a unique filesystem, which you don't need after booting. The module to read it will always be active if it's not a module (less RAM, fewer CPU cycles). One thing that annoys me about embedded systems like raspbian is that the nfs modules are NOT modules. I don't use that part of the kernel, but they take space and add entries to the output of ps (nfsiod+rpciod), which annoys me as I cannot remove them without recompiling the kernel and rebooting. And on older boards with only 256MB of RAM, that can be a significant cost to performance and functionality.
 
Old 01-06-2018, 05:58 AM   #10
voleg
Member
 
Registered: Oct 2013
Distribution: RedHat CentOS Fedora SuSE
Posts: 354

Rep: Reputation: 51
You do not need initrd if you have all modules, required to access root filesystem, built-in the kernel.
It is mean, that it is only for your own compiled kernel.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
WHen I rebooted my laptop it is stuck at "initrd /boot/initrd.img Shadowmeph Linux - Newbie 2 03-07-2014 03:03 PM
How to create new initrd.gz (or initrd.img) file? kkpal Programming 2 12-10-2007 08:38 AM
Failed to symbolic-link boot/initrd.img-2.6.18-4-486 to initrd.img Scotteh Linux - Software 8 06-01-2007 11:24 PM
initrd ashlesha Linux - Software 1 12-01-2006 04:57 PM
what is initrd? PinRojas Linux - Newbie 2 06-16-2005 11:18 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Virtualization and Cloud

All times are GMT -5. The time now is 12:09 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration