Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Why should I use 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
GSnake
Tux's lil' helper
Tux's lil' helper


Joined: 10 Sep 2012
Posts: 100
Location: Italy

PostPosted: Wed Jan 16, 2013 11:53 pm    Post subject: Why should I use InitramFS? Reply with quote

That's my question! Why should I use it?
(Linux n00b here!)
Thanks!
Back to top
View user's profile Send private message
CrankyPenguin
Apprentice
Apprentice


Joined: 19 Jun 2003
Posts: 255

PostPosted: Thu Jan 17, 2013 12:06 am    Post subject: Reply with quote

With recent versions of udev it is required if you have a "complex" drive layout. In practical terms this means having a separate /usr partition.

The rationale is simple. The kernel and udev require certain programs to boot that are scattered across /sbin /bin /usr/sbin, and so on. Thus it needs to have a basic set of programs to boot. However with the latest udev these programs are required before all of the drives are up and running as per fstab. Thus you need an initramfs to get the code up and running so that the rest of the booting takes place.

That's the general picture. For more detailed info I suggest you search the boards for udef info. NeddySeagoon has put up some useful info.
_________________
Linux, the OS for the obsessive-compulsive speed freak in all of us.
Back to top
View user's profile Send private message
GSnake
Tux's lil' helper
Tux's lil' helper


Joined: 10 Sep 2012
Posts: 100
Location: Italy

PostPosted: Thu Jan 17, 2013 12:10 am    Post subject: Reply with quote

Ok so since I have an "all-in-one" partition won't be needed..but.. how does the initramfs know from where it should load all the binaries?
Back to top
View user's profile Send private message
CrankyPenguin
Apprentice
Apprentice


Joined: 19 Jun 2003
Posts: 255

PostPosted: Thu Jan 17, 2013 12:23 am    Post subject: Reply with quote

When the initramfs is built you give it that information as well as lists of kernel modules to include. You can do this "manually" using tools that come with the kernel distro or using a script. Personally I use genkernel which builds a nice vanilla ramfs even for non gentoo kernels.

There may be other reasons for the initramfs as well. While the current udev (171-r9) requires it just for multiple partitions I know that bigger changes will be needed for udev 18x. That is being held off till the docs are ready but you may want to look into it now since you are asking. I believe NeddySeagoon has a good howto. I was caught by surprise for the current change since it came as a standard update and had to spend more time fixing it after the fact than I cared to.
_________________
Linux, the OS for the obsessive-compulsive speed freak in all of us.
Back to top
View user's profile Send private message
The Doctor
Veteran
Veteran


Joined: 27 Jul 2010
Posts: 1513

PostPosted: Thu Jan 17, 2013 12:48 am    Post subject: Re: Why should I use InitramFS? Reply with quote

GSnake wrote:
That's my question! Why should I use it?
(Linux n00b here!)
Thanks!
I think the more general answer to your question is to do things the kernel cannot do for itself. As noted above, one of these things recently became mount /user. A more planned example would be root on lvm. You can't use the lvm until you assemble it, and you can't assemble it without the tools stored there.
An initramfs is basically just a busybox script and compressed, striped down copy of your filesystem. The script includes the instructions that can either be as simple as assembling a known configuration to probing hardware and taking the appropriated action a binary distro or live CD.

It is completely practical to manually configure a kernel so one is not required. This does, however, require some knowledge or research on your part. This website can help with that.

They do, however, offer an increase in options. Using an initramfs it is possible to encrypted the entire drive (except /boot). They also slow down the boot process, so if you can do without you may want to.
_________________
First things first, but not necessarily in that order.
Back to top
View user's profile Send private message
greyspoke
Tux's lil' helper
Tux's lil' helper


Joined: 08 Jan 2010
Posts: 103

PostPosted: Thu Jan 17, 2013 8:24 am    Post subject: Reply with quote

A few more specific uses:

An initramfs is needed if any partition needed for booting is on a software RAID array managed by mdadm, at least for more recent versions of mdadm which don't seem to work with the auto assembler built into the kernel.

Another use is that you can create an initramfs with a larger array of tools in it than is needed just for booting and use it as a built in rescue CD. I have found this useful on occasions when I have "updated" my system into an unusable state. (Unless I set my grub.conf to go straight into the default kernel configuration without a delay, which renders having a rescue option in your grub.conf pointless...)

Initramfs is also how bootsplash gets to work early on in the boot process.
Back to top
View user's profile Send private message
GSnake
Tux's lil' helper
Tux's lil' helper


Joined: 10 Sep 2012
Posts: 100
Location: Italy

PostPosted: Thu Jan 17, 2013 3:30 pm    Post subject: Reply with quote

Thank you guys!
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