[DNG] reinstalling GRUB2

2019-07-21 Thread Haines Brown
In the process of installing Ascii on a new HD in my box, I somehow 
managed to break GRUB2 un the principal hard disk in the box, whhich 
is /dev/sdb.  When I boot /dev/sdb, I do not get its GRUB menu, but a 
simple blinking cursor at the upper left. This usually indicates video 
problems, but I have no problem with video when I use another means to 
boot /dev/sdb.

To boot /dev/sdb I have to use reconnect SATA cables to all three 
disks and use the BIOS boot menu to boot /dev/sda 
or /dev/sdck. Then I use the boot menu on the disk to boot 
/dev/sdb. /dev/sdb proceeds to boot without any problem.

To fix this, it went to reinstall GRUB2 on /dev/sdb. That effort 
failed:

1. I insert an Ascii netinst key and select Advanced Options, Then I 
select CLI rescue mode. I go though the installation steps to the 
point I'm presented with a list of partitions. These are:

  /dev/sdb1 This is /root
  /dev/sdv2 This is broken out /boot
  ... [other partitions on sdb]
  /dev/sdc1  [root on a HD with its SATA cable pulled] 
  /dev/sdc2  [ascii system]

/dev/sda also has its SATA cable pulled for the moment, but it 
does not show up in the list of partitions. No idea why /dev/sdc shows 
up.  

2. The directions say to pick the root partition, and so I pick 
/dev/sdb1. 

3. Rescue mode next tells me that it sees I have /boot broken out, 
and that to reinstall GRUB@ I need to mount it. So I say, Yes, mount it.

4. I am returned to the Rescue options menu. The choices are to pick a 
differnet root file system, execute a shell, or to reboot. The only 
other root file system is /dev/sdc1, but that's not where I want to 
reinstall GRUB. I see no use for a shell. I don't see any option to 
reinstall GRUB2.

In syslog, when I successfully  boot /dev/sdb1 is the line:
  Kernel command line: BOOT_IMAGE=/vmlinuz-4.9.0-9-amd64 
  root=UUID=fbc8d367-795c-48f2-a9c3-08029e1710e2 ro quiet

In /dev/sdb1/ are the symlinks:
initrd.img -> boot/initrd.img-4.9.0-9-amd64
initrd.img.old -> boot/initrd.img-4.9.0-8-amd64
vmlinuz -> boot/vmlinuz-4.9.0-9-amd64
vmlinuz.old -> boot/vmlinuz-4.9.0-8-amd64

vmlinuz-4.9.0-9-amd64 and initrd.img-4.9.0-9-amd64
are found in /dev/sdb2. 

The file /boot/grub/grubenv is empty

In /etc/default/grub are:

  GRUB_DEFAULT=0
  GRUB_TIMEOUT=5
  GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
  GRUB_CMDLINE_LINUX_DEFAULT="quiet"
  GRUB_CMDLINE_LINUX=""


Haines Brown

  
___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] reinstalling GRUB2

2019-07-21 Thread Simon Hobson
I see two other ways to make this easy, both of which have worked for me in the 
past  :

1) use grub rescue cd (which you can put on a USB stick). Then fairly easy to 
sort out by picking the right menu options.

2) use these incantations, lifted from a post elsewhere :

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)
___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] reinstalling GRUB2

2019-07-21 Thread Steve Litt
On Sun, 21 Jul 2019 20:25:42 +0100
Simon Hobson  wrote:

> I see two other ways to make this easy, both of which have worked for
> me in the past  :

This is great information. I have some questions...

> 
> 1) use grub rescue cd (which you can put on a USB stick). Then fairly
> easy to sort out by picking the right menu options.

Do you mean:

* Super Grub2 Disk (https://sourceforge.net/projects/supergrub2/)
* boot-repair-disk (https://sourceforge.net/p/boot-repair-cd/home/Home/)
* System Rescue CD (http://www.system-rescue-cd.org/)
* GrubEFIReinstall (https://wiki.debian.org/GrubEFIReinstall)
* Ultimate Boot CD (http://www.ultimatebootcd.com/)



> 
> 2) use these incantations, lifted from a post elsewhere :
> 
> 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) 

*Exactly* what do you mean by "your-grub-boot-device"? Does it vary
depending on MBR vs UEFI?

So now you've installed Grub(2), but then how do you configure grub?

Do your instructions vary depending on MBR vs UEFI?

Thanks,

SteveT


Steve Litt 
July 2019 featured book: Troubleshooting Techniques
 of the Successful Technologist
http://www.troubleshooters.com/techniques
___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng