Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.os.linux.misc > #26836 > unrolled thread

restore grub?

Started byT <T@invalid.invalid>
First post2019-04-22 00:38 -0700
Last post2019-04-22 15:21 +0200
Articles 10 — 4 participants

Back to article view | Back to comp.os.linux.misc


Contents

  restore grub? T <T@invalid.invalid> - 2019-04-22 00:38 -0700
    Re: restore grub? The Natural Philosopher <tnp@invalid.invalid> - 2019-04-22 08:47 +0100
    Re: restore grub? "Carlos E. R." <robin_listas@es.invalid> - 2019-04-22 10:46 +0200
      Re: restore grub? "David W. Hodgins" <dwhodgins@nomail.afraid.org> - 2019-04-22 05:16 -0400
        Re: restore grub? "Carlos E. R." <robin_listas@es.invalid> - 2019-04-22 11:49 +0200
          Re: restore grub? "David W. Hodgins" <dwhodgins@nomail.afraid.org> - 2019-04-22 07:55 -0400
            Re: restore grub? "Carlos E. R." <robin_listas@es.invalid> - 2019-04-22 15:16 +0200
      Re: restore grub? T <T@invalid.invalid> - 2019-04-22 03:49 -0700
        Re: restore grub? The Natural Philosopher <tnp@invalid.invalid> - 2019-04-22 12:19 +0100
        Re: restore grub? "Carlos E. R." <robin_listas@es.invalid> - 2019-04-22 15:21 +0200

#26836 — restore grub?

FromT <T@invalid.invalid>
Date2019-04-22 00:38 -0700
Subjectrestore grub?
Message-ID<q9jr1i$3up$1@dont-email.me>
Hi All,

When grub.cfg is mess up and your can't boot from a legacy BIOS,
how do you use a live USB to restore your Grub boot?

Many thanks,
-T

[toc] | [next] | [standalone]


#26837

FromThe Natural Philosopher <tnp@invalid.invalid>
Date2019-04-22 08:47 +0100
Message-ID<q9jrhm$702$3@dont-email.me>
In reply to#26836
On 22/04/2019 08:38, T wrote:
> Hi All,
> 
> When grub.cfg is mess up and your can't boot from a legacy BIOS,
> how do you use a live USB to restore your Grub boot?

vi?

:-)



-- 
The New Left are the people they warned you about.

[toc] | [prev] | [next] | [standalone]


#26839

From"Carlos E. R." <robin_listas@es.invalid>
Date2019-04-22 10:46 +0200
Message-ID<gi5daqF2agtU1@mid.individual.net>
In reply to#26836
On 22/04/2019 09.38, T wrote:
> Hi All,
> 
> When grub.cfg is mess up and your can't boot from a legacy BIOS,
> how do you use a live USB to restore your Grub boot?

Roughly:

Boot live
mount main in /mnt
mount bind /proc, /dev and /sys
chroot /mnt
edit grub.cfg   correctly
run grub2-mkconfig -o /path/grub.cfg

-- 
Cheers,
       Carlos E.R.

[toc] | [prev] | [next] | [standalone]


#26840

From"David W. Hodgins" <dwhodgins@nomail.afraid.org>
Date2019-04-22 05:16 -0400
Message-ID<op.z0m5egcca3w0dxdave@hodgins.homeip.net>
In reply to#26839
On Mon, 22 Apr 2019 04:46:17 -0400, Carlos E. R. <robin_listas@es.invalid> wrote:

> On 22/04/2019 09.38, T wrote:
>> Hi All,
>>
>> When grub.cfg is mess up and your can't boot from a legacy BIOS,
>> how do you use a live USB to restore your Grub boot?
>
> Roughly:
>
> Boot live
> mount main in /mnt
> mount bind /proc, /dev and /sys
> chroot /mnt
> edit grub.cfg   correctly
> run grub2-mkconfig -o /path/grub.cfg

If it's a systemd install in the live system, replace the mount bind and
the chroot with ...
systemd-nspawn -D /mnt

Regards, Dave Hodgins

-- 
Change dwhodgins@nomail.afraid.org to davidwhodgins@teksavvy.com for
email replies.

[toc] | [prev] | [next] | [standalone]


#26843

From"Carlos E. R." <robin_listas@es.invalid>
Date2019-04-22 11:49 +0200
Message-ID<gi5h21F31u3U2@mid.individual.net>
In reply to#26840
On 22/04/2019 11.16, David W. Hodgins wrote:
> On Mon, 22 Apr 2019 04:46:17 -0400, Carlos E. R.
> <robin_listas@es.invalid> wrote:
> 
>> On 22/04/2019 09.38, T wrote:
>>> Hi All,
>>>
>>> When grub.cfg is mess up and your can't boot from a legacy BIOS,
>>> how do you use a live USB to restore your Grub boot?
>>
>> Roughly:
>>
>> Boot live
>> mount main in /mnt
>> mount bind /proc, /dev and /sys
>> chroot /mnt
>> edit grub.cfg   correctly
>> run grub2-mkconfig -o /path/grub.cfg
> 
> If it's a systemd install in the live system, replace the mount bind and
> the chroot with ...
> systemd-nspawn -D /mnt

Why?

cer@Elesar:~> man systemd-nspawn
No manual entry for systemd-nspawn
cer@Elesar:~> apropos systemd-nspawn
systemd-nspawn: nothing appropriate.
cer@Elesar:~>


-- 
Cheers,
       Carlos E.R.

[toc] | [prev] | [next] | [standalone]


#26847

From"David W. Hodgins" <dwhodgins@nomail.afraid.org>
Date2019-04-22 07:55 -0400
Message-ID<op.z0ncp6c3a3w0dxdave@hodgins.homeip.net>
In reply to#26843
On Mon, 22 Apr 2019 05:49:53 -0400, Carlos E. R. <robin_listas@es.invalid> wrote:

> On 22/04/2019 11.16, David W. Hodgins wrote:
>> If it's a systemd install in the live system, replace the mount bind and
>> the chroot with ...
>> systemd-nspawn -D /mnt

> Why?
> cer@Elesar:~> man systemd-nspawn
> No manual entry for systemd-nspawn
> cer@Elesar:~> apropos systemd-nspawn
> systemd-nspawn: nothing appropriate.
> cer@Elesar:~>

http://man7.org/linux/man-pages/man1/systemd-nspawn.1.html

Regards, Dave Hodgins

-- 
Change dwhodgins@nomail.afraid.org to davidwhodgins@teksavvy.com for
email replies.

[toc] | [prev] | [next] | [standalone]


#26850

From"Carlos E. R." <robin_listas@es.invalid>
Date2019-04-22 15:16 +0200
Message-ID<gi5t5tF5jrtU1@mid.individual.net>
In reply to#26847
On 22/04/2019 13.55, David W. Hodgins wrote:
> On Mon, 22 Apr 2019 05:49:53 -0400, Carlos E. R.
> <robin_listas@es.invalid> wrote:
> 
>> On 22/04/2019 11.16, David W. Hodgins wrote:
>>> If it's a systemd install in the live system, replace the mount bind and
>>> the chroot with ...
>>> systemd-nspawn -D /mnt
> 
>> Why?
>> cer@Elesar:~> man systemd-nspawn
>> No manual entry for systemd-nspawn
>> cer@Elesar:~> apropos systemd-nspawn
>> systemd-nspawn: nothing appropriate.
>> cer@Elesar:~>
> 
> http://man7.org/linux/man-pages/man1/systemd-nspawn.1.html

Yeah, well, but in any case, I can not use it for repairs as it is not
there.

-- 
Cheers,
       Carlos E.R.

[toc] | [prev] | [next] | [standalone]


#26844

FromT <T@invalid.invalid>
Date2019-04-22 03:49 -0700
Message-ID<q9k67s$s0l$1@dont-email.me>
In reply to#26839
On 4/22/19 1:46 AM, Carlos E. R. wrote:

> edit grub.cfg   correctly

Thank you!

"Correctly?"  Please elucidate.

I drive has a working grub.cfg that works with EUFI.
Should I reuse that one?

The Live USB works with both Legacy and EUFI.  Can I
steal one of those?

-T

[toc] | [prev] | [next] | [standalone]


#26845

FromThe Natural Philosopher <tnp@invalid.invalid>
Date2019-04-22 12:19 +0100
Message-ID<q9k805$5k2$1@dont-email.me>
In reply to#26844
On 22/04/2019 11:49, T wrote:
> On 4/22/19 1:46 AM, Carlos E. R. wrote:
> 
>> edit grub.cfg   correctly
> 

Actually dont.
Because it will get overwritten anyway

You can edit it to temprarily boot a system, but you need to then edit 
/etc/default/grub and run update-grub

> Thank you!
> 
> "Correctly?"  Please elucidate.
> 
> I drive has a working grub.cfg that works with EUFI.
> Should I reuse that one?

May need tweaking. But not a bad starting point.


TBH I would reinstall the OS as it might be quicker then learning the 
arcane and recondite corners of GRUB



> 
> The Live USB works with both Legacy and EUFI.  Can I
> steal one of those?
> 


Could try.

remember grub.cfg may not be your problem: it may be upsteram in 
/etc/default/grub...


/etc/default/grub:


# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
#   info -f grub -n 'Simple configuration'

GRUB_DEFAULT=0
#GRUB_HIDDEN_TIMEOUT=0
GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=10
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="splash quiet"
GRUB_CMDLINE_LINUX=" splash vga=795"

# Uncomment to enable BadRAM filtering, modify to suit your needs
# This works with Linux (no patch required) and with any kernel that obtains
# the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
#GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"
GRUB_BACKGROUND=/usr/local/share/pixmaps/backgrounds/swan.png
# Uncomment to disable graphical terminal (grub-pc only)
#GRUB_TERMINAL=console

# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
GRUB_GFXMODE=1024x768

# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to 
Linux
GRUB_DISABLE_LINUX_UUID=true

# Uncomment to disable generation of recovery mode menu entries
#GRUB_DISABLE_RECOVERY="true"

# Uncomment to get a beep at grub start
#GRUB_INIT_TUNE="480 440 1"

I had issuees cloning a hard drive to an SSD in that the default grub 
that worked for the HD didnt work for the SSD if I recall correctly.

I manually edited grub.cfg and got a sort of boot and then ran 
update-grub to autodetect what was needful and went from there



> 


-- 
Canada is all right really, though not for the whole weekend.

"Saki"

[toc] | [prev] | [next] | [standalone]


#26851

From"Carlos E. R." <robin_listas@es.invalid>
Date2019-04-22 15:21 +0200
Message-ID<gi5te5F5jrtU2@mid.individual.net>
In reply to#26844
On 22/04/2019 12.49, T wrote:
> On 4/22/19 1:46 AM, Carlos E. R. wrote:
> 
>> edit grub.cfg   correctly
> 
> Thank you!
> 
> "Correctly?"  Please elucidate.

I can't.  The file has a complex setup and I only understand bits of it.
I thought you might have done some edit and you wanted to repair the
slight damage. Not do something like UEFI<->BIOS changes.

Also, as TNP says, you edit the default instead.

-- 
Cheers,
       Carlos E.R.

[toc] | [prev] | [standalone]


Back to top | Article view | comp.os.linux.misc


csiph-web