help-grub
[Top][All Lists]
Advanced

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

Re: Breaking out of menu on "live disk", repairing grub


From: Jordan Uggla
Subject: Re: Breaking out of menu on "live disk", repairing grub
Date: Mon, 25 Mar 2013 10:48:44 -0700

On Mon, Mar 25, 2013 at 4:37 AM, Felix Miata <address@hidden> wrote:
> On 2013-03-25 15:03 (GMT+0400) Andrey Borzenkov composed:
>
>
>> Felix Miata wrote:
>
>
>>> On 2013-03-25 12:15 (GMT+0400) Andrey Borzenkov composed:
>
>
>>>> Simon Hobson wrote:
>
>
>>>>> back in Grub 1 days, I could remember how to install grub just by
>>>>> mounting the filesystem, chrooting to it, and issuing a few grub
>>>>> commands.
>>>>> I've never managed to make this work with 1.99 (as currently installed
>>>>> with
>>>>> Debian). Is there a simple set of commands that will do what worked in
>>>>> grub
>>>>> 1 (going form memory here) :
>>>>> hd0 = /dev/sda
>>>>> root = (hd0,0)
>>>>> install (hd0)
>
>
>>>> mkdir /sysroot
>>>> mount /dev/your-root-dev /sysroot
>>>> mount /dev/your-boot-dev /sysroot/boot
>>>> mount --bind /dev /sysroot/dev
>>>> mount --bind /sys /sysroot/sys
>>>> mount --bind /proc /sysroot/proc
>>>> mount --bind /run /sysroot/run (recommended if you are using systemd)
>>>> chroot /sysroot
>>>> grub-install /dev/your-grub-boot-device (may be grub2-install on some
>>>> distro)
>
>
>>> Lots more to remember than what I do with Grub Legacy:
>
>
>> The only thing to remember is grub-install. Everything else is
>> standard "create proper chroot environment" which is not related to
>> what you are going to do in chroot.
>
>
>> What exactly is the point of your comment?
>
>
> Lots less to remember with Grub Legacy, as there is no need to chroot to set
> it up, plus there is the context of $SUBJECT.

There is no need to chroot to run grub-install in grub2 either. Also,
what $SUBJECT are you referring to? The OP's original message was
"back in Grub 1 days, I could remember how to install grub just by
mounting the filesystem, chrooting to it, and issuing a few grub
commands", so they were already chrooting when they were installing
grub legacy, according to their message. If you're referring to
"Breaking out of menu on "live disk", repairing grub", breaking out of
the menu on the vast majority of liveCD/DVD's will get you to a
syslinux prompt, from which you can neither install a boot sector for
grub legacy nor grub2. And if you did find a liveCD/DVD which used
grub legacy as its bootloader you would only be able to use it to
install a boot sector for a partition with an already existing and
properly setup /boot/grub/.

>
>
>>> # grub                          # if booted to live media,
>
>
>> Did you try to do it in chroot without mounting /dev on any modern
>> distribution?
>
>
> To what end? Are you forgetting $SUBJECT, the thread purpose?
>
>
>>> grub> root (hd0,2)              # e.g. in this case third partition on
>>> first
>
>
>> Or this without having correct device.map? Which is implied by lack of
>> "chroot" in your example.
>
>
> If the find command finds not what is expected, a device.map file can be
> configured in the live environment or the target mounted to /boot and a
> device.map configured there if an appropriate one is not there already. In

With grub2 no device.map is needed at all, and you've just lost the
advantage of "not needing to mount /boot/" that you supposedly get
with grub legacy.

> any event, there's no need for chroot when using live media containing
> executable Grub Legacy, or if as $SUBJECT breaking to a Grub prompt from a

No need for chroot with grub2 either.

> Grub menu, and no need for configuration files scattered in diverse places
> separate from the target location, or a configuration script that depends on
> them for its function.

grub-install in grub2 requires no configuration files anywhere, which
is one less file than grub legacy which required a
/boot/grub/device.map.

I think you're thinking about grub-mkconfig, which is a tool that
automatically generates a grub.cfg. Note that there has never been
such a tool in upstream grub legacy, the users' only option was to
either write their menu.lst manually (still an option today with
grub2) or use a distribution specific menu.lst generator (like
Debian's "update-grub"), all of which that I have encountered were
extremely convoluted, and all of which required that you chroot into
the system to run them. Points for grub legacy?

Many people seem to grossly misremember what grub legacy actually did,
and did-not, do.

-- 
Jordan Uggla (Jordan_U on irc.freenode.net)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]