Re: [gentoo-user] Re: Using UUID for root disk in grub requires initramfs?
On Sat, Jul 20, 2019 at 2:37 AM Ian Zimmerman wrote: > On 2019-07-19 20:58, Adam Carter wrote: > > > I experimented found the following worked in /etc/default/grub; > > > > GRUB_DEVICE="PARTUUID=d3554d49-02" > > > > Which writes grub.cfg as; > > linux /vmlinuz-5.2.0-gentoo root=PARTUUID=d3554d49-02 ro > > init=/usr/lib/systemd/systemd iommu=pt raid=noautodetect > > > > PARTUUID looked up with blkid. No initramfs required :) > > I don't get this. blkid is userspace. The _kernel_ needs to know what > the root fs device is, before it even starts pid 1. > Sorry I was misleading by not using chronological order. The steps are; 1. Use blkid to look up the PARTUUID of the root partition 2. Add this to /etc/default/grub as GRUB_DEVICE="PARTUUID=d3554d49-02" 3. run grub-mkconfig 4. Reboot
Re: [gentoo-user] Re: Using UUID for root disk in grub requires initramfs?
On Fri, Jul 19, 2019 at 12:37 PM Ian Zimmerman wrote: > > On 2019-07-19 20:58, Adam Carter wrote: > > > I experimented found the following worked in /etc/default/grub; > > > > GRUB_DEVICE="PARTUUID=d3554d49-02" > > > > Which writes grub.cfg as; > > linux /vmlinuz-5.2.0-gentoo root=PARTUUID=d3554d49-02 ro > > init=/usr/lib/systemd/systemd iommu=pt raid=noautodetect > > > > PARTUUID looked up with blkid. No initramfs required :) > > I don't get this. blkid is userspace. The _kernel_ needs to know what > the root fs device is, before it even starts pid 1. The kernel init code is able to find a device given its PARTUUID. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/init/do_mounts.c?h=v4.19.59#n172
[gentoo-user] Re: Using UUID for root disk in grub requires initramfs?
On 2019-07-19 20:58, Adam Carter wrote: > I experimented found the following worked in /etc/default/grub; > > GRUB_DEVICE="PARTUUID=d3554d49-02" > > Which writes grub.cfg as; > linux /vmlinuz-5.2.0-gentoo root=PARTUUID=d3554d49-02 ro > init=/usr/lib/systemd/systemd iommu=pt raid=noautodetect > > PARTUUID looked up with blkid. No initramfs required :) I don't get this. blkid is userspace. The _kernel_ needs to know what the root fs device is, before it even starts pid 1. With initramfs, this egg/chicken problem is hidden: the initramfs itself is the initial root fs, and during the pivot to the real root fs userspace programs [1] are already available. [1] Well, usually just 1 of them: busybox. -- Please don't Cc: me privately on mailing lists and Usenet, if you also post the followup to the list or newsgroup. To reply privately _only_ on Usenet and on broken lists which rewrite From, fetch the TXT record for no-use.mooo.com.