Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Booting with a separate boot partition and no initramfs
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
vladimir1986
n00b
n00b


Joined: 09 Dec 2010
Posts: 37

PostPosted: Thu Jul 23, 2015 1:05 pm    Post subject: Booting with a separate boot partition and no initramfs Reply with quote

Hello there!

I have been wondering now for a while If I could save me the "nuissance" of having to load the initram image and storing it on the boot partition for a while. I understand as far as I know that it stores the mountpoints of the OS amongs other things....

In thoery compiling all the needed drivers for my HHDD and filesystems would allow me to boot, but I can't stop thinking:

If the kernel self-loads in /dev/sda1 (boot partition), how is going to read /etc/fstab in (/dev/sda2)? and know where to mount everything? Will it work?

I know that it is as easy as trying it up and if everything fails just fire it up something like the install cdrom and build an initramfs and the sort out the boot manager, but I would love if possible an explanation of this being feasible or not first.

Thank you in advance!
Back to top
View user's profile Send private message
Tony0945
Advocate
Advocate


Joined: 25 Jul 2006
Posts: 2951
Location: Illinois, USA

PostPosted: Thu Jul 23, 2015 1:24 pm    Post subject: Reply with quote

What is the nuisance? I've been looking at initramfs and apparently you can even embed it in the kernel like firmware and only have one boot file. The kernel will self extract the initramfs that mounts everything and jumps to the real root init. It also looks like you only have to build it once. You can even use genkernel to only build the initramfs.
Back to top
View user's profile Send private message
ct85711
Veteran
Veteran


Joined: 27 Sep 2005
Posts: 1694

PostPosted: Thu Jul 23, 2015 1:44 pm    Post subject: Reply with quote

Well, I can say that it is fully possible to not use a initramfs and boot up perfectly fine (I've been doing this for over 15 years).

The way that works, is the when grub first boots up it will load the root partition in readonly to get the kernel started. Once the kernel is started up some, it will go mount the rest of the mount points afterwards, and remount the root partition to read write to continue on.

Note, you do need all the necessary drivers built in (not as modules) for your HD and filesystems for this to work. Also if you want to use encryption, mdarray, etc you do have to use a initramfs to get access to the actual root partition. The other big thing is that you can not have /usr seperated to a different partition without an initramfs.

I have no clue about embedding a initramfs inside the kernel, to know more on that. I just know that isn't necessary for a basic partition setup (I actually have initramfs support disabled in my kernels.)
Back to top
View user's profile Send private message
Tony0945
Advocate
Advocate


Joined: 25 Jul 2006
Posts: 2951
Location: Illinois, USA

PostPosted: Thu Jul 23, 2015 4:16 pm    Post subject: Reply with quote

ct85711 wrote:


I have no clue about embedding a initramfs inside the kernel, to know more on that.


From https://wiki.gentoo.org/wiki/Custom_Initramfs

Quote:

Embedding into the Kernel

If you want the initramfs to be embedded into the kernel image, set Initramfs source file(s) to the root of your initramfs, (e.g. /usr/src/initramfs):
KERNEL CONFIG_INITRAMFS_SOURCE="/usr/src/initramfs"

General setup --->
(/usr/src/initramfs) Initramfs source file(s)

Now when you compile your kernel it will automatically put the files into a cpio archive and embed it into the kernel image. You will need to rebuild your kernel any time you make any changes to your initramfs.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Thu Jul 23, 2015 4:38 pm    Post subject: Reply with quote

vladimir1986,

You have an incomplete understanding of the boot process.

This post explains a little.
_________________
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
vladimir1986
n00b
n00b


Joined: 09 Dec 2010
Posts: 37

PostPosted: Tue Jul 28, 2015 11:40 am    Post subject: Reply with quote

Thank you! It was really helpful. I am going to proceed to compile the last kernel and see what I end doing. I still might mess up things, but now I know what could it be and how to fix it next time!
Back to top
View user's profile Send private message
steveL
Watchman
Watchman


Joined: 13 Sep 2006
Posts: 5153
Location: The Peanut Gallery

PostPosted: Tue Jul 28, 2015 2:00 pm    Post subject: Reply with quote

NeddySeagoon wrote:
..understanding of the boot process.

This post explains a little.

Cheers Neddy linked as first tip on the tips page under: "Understanding the boot process" (with a post link, as edited above.)

Nice one :-)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware 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