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

Re: how to quickly recover buster boot loader



Thank Andrew and Brian!
i will try rescue mode.

On Wednesday, August 5, 2020, 11:14:46 PM GMT+8, Andrew Cater <amacater@gmail.com> wrote:


Boot from Debian install media. Use rescue mode. Mount Debian partition when prompted. Run os-prober and update-grub then exit. Machine should reboot into Debian.


On Wed, Aug 5, 2020 at 1:28 PM Long Wind <longwind2@yahoo.com> wrote:
Thank Greg!
but chroot dance is new to me, it doesn't seem easy
it involves many steps (commands)
a small error will lead to failure

i install centos just for fun
i can install lubuntu at sda3 and it can boot buster



On Wednesday, August 5, 2020, 8:15:14 PM GMT+8, Greg Wooledge <wooledg@eeg.ccf.org> wrote:


On Wed, Aug 05, 2020 at 12:04:48AM +0000, Long Wind wrote:

> i have win7 at sda1 and buster at sda2i install centos 6 at sda3, it can boot win7, can't see busteri mean i can't boot buster now
> is there some rescue image that can be written to bootable usb disk?
> or do you know how to config centos 6 boot loader?is buster's boot code installed at sda2 by default?


I'm going to assume you're using Legacy/MBR booting, because I don't know
enough about UEFI to answer this question in that universe.

If you're trying to multi-boot several different Linuxes from one
hard drive, the first thing you have to do is make a decision.  You
must choose which Linux will be in control of the boot loader.

Let's say you choose Debian.  (If you choose something else, stop
reading now, and go ask the other OS's mailing list for help.)

First step, then, will be to boot into Debian successfully.  For this,
you'll probably need to boot into whatever Linux you *can* boot, whether
that's the CentOS on the hard drive, or a rescue CD, or whatever.

Once you're booted into *a* Linux, then you can do the chroot dance
to mount the Debian file system(s) underneath that.

According to the IRC bot factoid, that dance goes something like
this:

  Mount your root filesystem with "mount -t ext2 /dev/whatever /target"
  and make /dev, /proc and /sys usable with "mount --rbind --make-rslave
  /dev /target/dev ; mount -t proc none /target/proc ; mount -t sysfs none
  /target/sys". You can then chroot into the system with "chroot /target".

There may be other dances that will also work.

Once you're chrooted into Debian running under some sort of Linux
kernel, first make sure the os-prober package is installed.  Then you can
write Debian's GRUB into the master boot recor, by running grub-install.

After doing grub-install, you should have GRUB in the hard drive's
master boot record and it should be configured to read the menu in
Debian's version of the /boot directory.

In order to make the Debian GRUB menu point to all of the operating
systems on your hard drive, make sure os-prober is installed (yes, I
know, I already said it; I'm saying it again).  Then run update-grub.

Exit out of the chroot, unmount it, and reboot.  You should get Debian's
GRUB menu, and you should be able to boot into Debian, at the very
least.

If the Debian GRUB menu doesn't contain all of the operating systems
that you think it should contain, then you'll have to poke around in
the update-grub and os-prober internals and figure out what's wrong.

Once you get everything working, you'll need to remember that you have
chosen to make Debian the controller of the boot loader.  Every time
you make a kernel change to any of the *other* Linuxes on your hard
drive, you'll need to boot into Debian, and run update-grub, to pick
up the changes in the other Linuxes.



Reply to: