[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: installing debian 10 without a cd and without usb but could use ethernet



On Thu 21 Jan 2021 at 11:08:56 (-0800), Dan Hitt wrote:
> On Thu, Jan 21, 2021 at 10:02 AM Dan Ritter wrote:
> > Dan Hitt wrote:
> > > On Thu, Jan 21, 2021 at 3:33 AM Brian wrote:
> > > >
> > > >    menuentry 'Debian 10' {
> > > >    linux /boot/vmlinuz
> > > >    initrd /boot/initrd.gz
> > > >    }
> > >
> > > And that is: how can grub2 or any other software know what partition
> > > '/boot' refers to?
> > >
> > > So i presume that in this very very short stanza you provide, there will
> > > also have to be a search line like David has (search --no-floppy ......)
> > > to identify just where '/boot' is (???).

Yes, my PCs all have two root filesystems (normally stable and
oldstable), hence the search line. And with a BIOS Boot partition and
an EFI one too, neither of the roots is going to be as early as the
first partition.

The stanza is embedded into grub.cfg at 40_custom, so there are loads
of modules already set up.

> > https://en.wikipedia.org/wiki/GNU_GRUB#Startup_on_systems_using_BIOS_firmware
> >
> > stage 2: core.img loads /boot/grub/i386-pc/normal.mod from the
> > partition configured by grub-install. If the partition index has
                            ↑↑↑↑↑↑↑↑↑↑↑↑
> > changed, GRUB will be unable to find the normal.mod, and
> > presents the user with the GRUB Rescue prompt.
> >
> > So the answer to your question is, it's been configured at
> > install time, not discovered at runtime.
> 
> Thanks Dan for your mail, and for the reference to the wikipedia article.
> 
> When you say 'configured at install time', does that refer to the time at
> which i run 'sudo update-grub' (on my mint host)?
> 
> (I presume that it is impossible that this refers to the time when grub
> itself was last installed on the box, several years ago.)

As dsr wrote, it's when grub-install is run that you decide where most
of the Grub stuff is loaded from, including the grub.cfg file. So this
could indeed be years ago if grub itself hasn't needed upgrading.
Commands like update-grub (and grub-mkconfig) merely play around with
the /boot/grub/grub.cfg that belongs to the system you're running.

So, for example, I boot using the (newest) Grub on buster. When I
(occasionally) upgrade stretch on that PC, I update-grub so that the
stretch grub.cfg information is correct, but I don't grub-install
on stretch (ie I don't touch the MBR or UEFI).
Then I boot buster and run its update-grub so that the new information
in stretch's "BEGIN /etc/grub.d/10_linux" section gets incorporated
into buster's "BEGIN /etc/grub.d/30_os-prober" section. (That's the
only way in which stretch's grub.cfg is ever used.)

> Anyhow, i added an entry to /etc/grub.d just to see what would happen if i
> took the simple menu entry quite literally:
>     menuentry "simple-test" {
>         linux /boot/vmlinuz
>         initrd /boot/initrd.gz
>     }
> 
> I ran 'sudo update-grub', and the entry was copied into /boot/grub/grub.cfg
> without modification.  And then i tried booting into it, just to see what
> grub would do.  And, it did what i think was the only thing it possibly
> could: it reported:
>     error: file `/boot/vmlinuz' not found.
>     error: you need to load the kernel first.
> 
>     Press any key to continue...
> 
> Now, Brian said that "the installer's initrd does not contain a loop
> module", so that would indicate that if i want to use
> debian-10.7.0-amd64-xfce-CD-1.iso, i'll need to get it on the disk
> (presumably by just unpacking it somewhere --- prior to booting, i can loop
> mount it and copy it to a 'real' directory), and then modifying
> /boot/vmlinuz and /boot/initrd.gz to be paths that grub understands.  Or,
> maybe the debootstrap method Bastien suggests would be good.

My own priority is just to circumvent the BIOS limitation of my oldest
PC, but otherwise get the most similar installation to my usual
net-install. Because of that PC's architecture, bullseye may well turn
out to be its final installation after 20 years.

Cheers,
David.


Reply to: