Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Do you use an initramfs?
View unanswered posts
View posts from last 24 hours

Goto page Previous  1, 2, 3  
Reply to topic    Gentoo Forums Forum Index Gentoo Chat
View previous topic :: View next topic  

Do you use an initramfs?
Yes, most distros do so I guess it's the right move
2%
 2%  [ 2 ]
Yes, I use genkernel so it's a no-brainer
7%
 7%  [ 7 ]
Yes, I've got a system setup that requires one
26%
 26%  [ 24 ]
Yes (Other - please explain)
5%
 5%  [ 5 ]
No, I do my own kernel so it's just more work
39%
 39%  [ 36 ]
No, it's just something else to go wrong
10%
 10%  [ 10 ]
No (Other - please explain)
8%
 8%  [ 8 ]
What's an initramfs?
0%
 0%  [ 0 ]
Total Votes : 92

Author Message
steveL
Advocate
Advocate


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

PostPosted: Mon Nov 11, 2013 12:23 pm    Post subject: Reply with quote

greyspoke wrote:
As a matter of interest, why is that (the last bit about being in sync)? I have raid and lvm in my initramfs on a simple system, and haven't been punctilious about updating the versions in the initramfs, yet haven't seen any problems. I can see that if I create new raid devices or volumes with a new version of the software then I ought to update that in the initramfs in case there isn't forward compatibility.

Exactly what you just said, I guess. But the point here is to have general advice and scripts that keep your system running no matter what. If we can't guarantee things are kept running, then they're not kept running. I for one do not want to have to enumerate the situations wherein an lvm upgrade in rootfs will remain compatible with whatever version is still in initramfs: I just want the one version on rootfs in use, and that's why I set my machine up as it is.
tw04l124 wrote:
For lvm and luks you need an initramfs.

If rootfs is on lvm or luks, then yes. If rootfs is a standard partition on your hard-disk, then no, you don't.
Again, this is exactly the same as the traditional cut-off point to require an initrd.

Which is kinda my point: nothing's really changed. The early-boot bring-up is exactly the same whether you do it via udev in an initramfs, or udev starting after localmount. The requirement for the former is the same as it always was: you need modules or devices loaded to access rootfs, have /usr on a network drive, or you have a modular kernel along the lines of a binary distro.

The network drive case can be mitigated on a source-distro, where you have kernel modules built-in for your mobo, not to require an initramfs, though it's not something I've done; again, nothing's changed, AFAICT.

The only change is that we've been told that udev needs local drives (ie the equivalent of localmount) accessible before it starts. Which is an initscript ordering, given the kernel most of us setup before we even reboot into our initial Gentoo install.
Back to top
View user's profile Send private message
greyspoke
Tux's lil' helper
Tux's lil' helper


Joined: 08 Jan 2010
Posts: 105

PostPosted: Tue Nov 12, 2013 9:11 am    Post subject: Reply with quote

steveL wrote:
greyspoke wrote:
As a matter of interest, why is that (the last bit about being in sync)? I have raid and lvm in my initramfs on a simple system, and haven't been punctilious about updating the versions in the initramfs, yet haven't seen any problems. I can see that if I create new raid devices or volumes with a new version of the software then I ought to update that in the initramfs in case there isn't forward compatibility.

Exactly what you just said, I guess. But the point here is to have general advice and scripts that keep your system running no matter what. If we can't guarantee things are kept running, then they're not kept running. I for one do not want to have to enumerate the situations wherein an lvm upgrade in rootfs will remain compatible with whatever version is still in initramfs: I just want the one version on rootfs in use, and that's why I set my machine up as it is.

...

Oh I agree, but I kind of fell into having an initramfs shortly after starting with Gentoo. When I set up my machine I didn't need one, my root was on a raid partition but not lvm and the kernel autothingy coped with that. Then an mdadm upgrade meant I needed an initramfs, then the /usr and/var things happened (they were logical volumes) and so on. Fortunately I realised I should probably upgrade the versions in the initramfs before I got caught out by something.
Back to top
View user's profile Send private message
Goverp
Guru
Guru


Joined: 07 Mar 2007
Posts: 353

PostPosted: Tue Nov 12, 2013 9:58 am    Post subject: Reply with quote

greyspoke wrote:
...
As a matter of interest, why is that (the last bit about being in sync)? I have raid and lvm in my initramfs on a simple system, and haven't been punctilious about updating the versions in the initramfs, yet haven't seen any problems. I can see that if I create new raid devices or volumes with a new version of the software then I ought to update that in the initramfs in case there isn't forward compatibility.

I build my (hand-rolled) initramfs into the kernel, and so its contents are always reasonably up to date. It probably costs an extra couple of seconds on each kernel build, but means I don't have to worry about (in my case) mdadm getting out of date.
_________________
Greybeard
Back to top
View user's profile Send private message
eccerr0r
Advocate
Advocate


Joined: 01 Jul 2004
Posts: 4105
Location: USA

PostPosted: Mon Nov 18, 2013 8:18 pm    Post subject: Reply with quote

The initramfs seems very kernel dependent beyond the modules inside of it... I think initramfs is a good idea but too many dependencies and makes it hard to maintain.

I ended up rolling my own, and it does help quite a bit. The main thing I like about them is that it's pretty much needed for any self booting removable media to guarantee (or almost guarantee) it locating the right root disk...
_________________
Intel Core i7 2700K@ 4.1GHz/HD3000 graphics/8GB DDR3/180GB SSD
What am I supposed to be advocating?
Back to top
View user's profile Send private message
Randy Andy
Veteran
Veteran


Joined: 19 Jun 2007
Posts: 1063
Location: /dev/koelsch

PostPosted: Tue Nov 19, 2013 2:23 pm    Post subject: Reply with quote

eccerr0r wrote:
The main thing I like about them is that it's pretty much needed for any self booting removable media to guarantee (or almost guarantee) it locating the right root disk...


Especially for this case, I found a solution in using root=PARTUUID= for the kernel command line since kernel >= 2.6.37, compiled with CONFIG_EFI_PARTITION=y support and GPT partitioned storage devices, as I wrote into my early post of this thread, on page 1. :wink:

Regards, Andy.
_________________
If you want to see a Distro done right, compile it yourself!
Back to top
View user's profile Send private message
eccerr0r
Advocate
Advocate


Joined: 01 Jul 2004
Posts: 4105
Location: USA

PostPosted: Tue Nov 19, 2013 3:04 pm    Post subject: Reply with quote

That's neat they fixed the kernel to understand UUID at boot time. I know that it didn't like labels at boot time.
Does it work for MBR?

I've been trying to build a bootable connection-agnostic media that is FAT32/MBR formatted with a Linux compatible container, so I can use the storage on the media with Windows and digital cameras/other portable, non-linux devices as well... I think this also needs initramfs, just like my root-on-lvm-on-RAID5 setup.
_________________
Intel Core i7 2700K@ 4.1GHz/HD3000 graphics/8GB DDR3/180GB SSD
What am I supposed to be advocating?
Back to top
View user's profile Send private message
Havin_it
Veteran
Veteran


Joined: 17 Jul 2005
Posts: 1085
Location: Edinburgh, UK

PostPosted: Tue Nov 19, 2013 5:51 pm    Post subject: Reply with quote

eccerr0r wrote:
That's neat they fixed the kernel to understand UUID at boot time. I know that it didn't like labels at boot time.
Does it work for MBR?

I've been trying to build a bootable connection-agnostic media that is FAT32/MBR formatted with a Linux compatible container, so I can use the storage on the media with Windows and digital cameras/other portable, non-linux devices as well... I think this also needs initramfs, just like my root-on-lvm-on-RAID5 setup.


Depends how globally generic/portable you need it to be. Random example: I stuck a second (ext2) partition and a bootloader onto a FAT32 thumbdrive. You'd think Windows and/or typical embedded devices wouldn't be troubled by this, but it prevented a Kodak photo kiosk from reading it.

You can't bank on much sanity when it comes to the foibles of embedded device OSes. After all, no one (who matters to them or could call them out on it) ever gets to see how shitty their code is O.o
Back to top
View user's profile Send private message
eccerr0r
Advocate
Advocate


Joined: 01 Jul 2004
Posts: 4105
Location: USA

PostPosted: Tue Nov 19, 2013 8:23 pm    Post subject: Reply with quote

Well, the nice thing is that you can install grub on VFAT partition, and you have a container file that contains the ext2 partition; and the initramfs/kernel sits on the vfat partition...

This should be very compatible with any FAT device - only one partition still is visible - it should be fairly universally compatible.

Only exception is if the device hides stuff in the MBR. Then this would cause problems.
_________________
Intel Core i7 2700K@ 4.1GHz/HD3000 graphics/8GB DDR3/180GB SSD
What am I supposed to be advocating?
Back to top
View user's profile Send private message
Randy Andy
Veteran
Veteran


Joined: 19 Jun 2007
Posts: 1063
Location: /dev/koelsch

PostPosted: Wed Nov 20, 2013 12:49 pm    Post subject: Reply with quote

eccerr0r wrote:
That's neat they fixed the kernel to understand UUID at boot time. I know that it didn't like labels at boot time.
Does it work for MBR?


Hi eccerr0r.

No. They improved the kernel to read out the Partition unique GUID (/dev/disk/by-partuuid/) without the need of a initramfs, which is different to the UUID (/dev/disk/by-uuid/)
The Partition unique GUID exist/ could only used, for GPT partitioned devices.

If you use blkid to show device information, you could see a UUID and a PARTUUID simulaneously which are different.
For GPT devices you could also specify a new Label which is called PARTLABEL (/dev/disk/by-partlabel/), but this could also be used only with the help of a initramfs.

So for now, we have lots of different possibilities for naming and mounting a GPT device, which could be:
by-path
UUID
PARTUUID
LABEL
PARTLABEL


Converting MBR schemes to GPT is easy and possible without loosing the data on the devices, but for thumbdrives a bit more tricky/risky.
But using GPT thumbdrives for older Windows versions is often like playing roulette.

Best, Andy.
_________________
If you want to see a Distro done right, compile it yourself!
Back to top
View user's profile Send private message
eccerr0r
Advocate
Advocate


Joined: 01 Jul 2004
Posts: 4105
Location: USA

PostPosted: Wed Nov 20, 2013 3:01 pm    Post subject: Reply with quote

Ah there's the difference, GPT stores Partition UUID per partition versus MBR which does not have any identifier per partition. For MBR partition it depends on the underlying filesystem to expose a UUID, which still requires a user-space application to detect (maybe in the near future it won't?). Unfortunately for older devices and non-DOS devices probably don't understand GPT at all, so likely stuck with using MBR for a while...
_________________
Intel Core i7 2700K@ 4.1GHz/HD3000 graphics/8GB DDR3/180GB SSD
What am I supposed to be advocating?
Back to top
View user's profile Send private message
Gusar
Advocate
Advocate


Joined: 09 Apr 2005
Posts: 2643
Location: Slovenia

PostPosted: Wed Nov 20, 2013 3:25 pm    Post subject: Reply with quote

Actually, MBR has PARTUUID as well. It's a pseudo-uuid, comprising of the disk identifier/NT disk signature and partition number. Something like 2b38f5ec-01 (first partition on the disk with a 2b38f5ec identifier). blkid from util-linux-2.24 will show it. If your partitions don't have it, you need to add a disk identifier to your disk - run fdisk, press x to enter expert mode, then press i. Kernels starting with 3.8 (I think) can boot from MBR disks with root=PARTUUID=2b38f5ec-01
Back to top
View user's profile Send private message
eccerr0r
Advocate
Advocate


Joined: 01 Jul 2004
Posts: 4105
Location: USA

PostPosted: Wed Nov 20, 2013 4:01 pm    Post subject: Reply with quote

I guess if the disk has a user created-unique UUID that's stored in the MBR somehow, then that works. Unfortunately this is somewhat nonstandard as this was not defined in the MSDOS days... and Windows/NT disk signatures is an add-on...

There's still a lot of esoteric boot situations that initramfs is needed however! I've held out so long against using them but eventually caved in and started using it where it made sense. Root filesystem on LVM on mdraid I guess still needs this, or has someone found a solution to this too?
_________________
Intel Core i7 2700K@ 4.1GHz/HD3000 graphics/8GB DDR3/180GB SSD
What am I supposed to be advocating?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo Chat All times are GMT
Goto page Previous  1, 2, 3
Page 3 of 3

 
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