:: Re: [DNG] reinstalling GRUB2
Top Pagina
Delete this message
Reply to this message
Auteur: Haines Brown
Datum:  
Aan: dng
Onderwerp: Re: [DNG] reinstalling GRUB2
On Wed, Jul 24, 2019 at 03:35:08PM -0400, fsmithred via Dng wrote:

> > I've no idea what's going on. I was told to use the grub2-install
> > command, but on my system (Ascii) there is only
> > /usr/sbin/grub-install.
>
> grub-install is all I've ever used or seen mentioned in debian.


I suspect my source of info made a typo.

> Please describe what happens when user runs grub-install. And what do you
> get when you run
> echo $PATH
> as user and as root?
>
> but not by root because root has no path to /usr/sbin.


It seems user has no path to /usr/sbin:

    $ echo $PATH
    /usr/local/texlive/2018/bin/x86_64-linux:/home/haines/scripts: \ 
          /usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games


I was unaware of "su -". Interesting.

When I become root with "su", I get the following:

# grub-install
bash: grub-install: command not found

# /usr/sbin/grub-install
bash: /usr/sbin/grub-install: No such file or directory

> How are you becoming root? In ascii, either 'su' or 'su -' will give you
> */sbin in your path.


When I am root by means of su - I get the following:

$ su -
# grub-install
Installing for i386-pc platform.
grub-install: error: install device isn't specified.

# /usr/sbin/grub-install
Installing for i386-pc platform.
/usr/sbin/grub-install: error: install device isn't specified.

# update-grub \dev\sdb
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-4.9.0-9-amd64
Found initrd image: /boot/initrd.img-4.9.0-9-amd64
Found linux image: /boot/vmlinuz-4.9.0-8-amd64
Found initrd image: /boot/initrd.img-4.9.0-8-amd64
Found linux image: /boot/vmlinuz-4.9.0-6-amd64
Found initrd image: /boot/initrd.img-4.9.0-6-amd64
Found Debian GNU/Linux (9) on /dev/sda1
Found Debian GNU/Linux (9) on /dev/sdc1
done

I have not rebooted to test this grub installation on /dev/sdb, for
what worries me is that my tarbet MBA, /dev/sdb, is not reported as
having Debian on it. Disk /dev/sda is partitioned the same as /dev/sdb
(root is sdb1 and /boot is broken out as sdb2). Should # update-grub
have retuirned the line:

Found Debian GNU/Linux (9) on /dev/sdb1

> (OT) Does anyone know why they changed the behavior of su? Is there a reason
> why root should have /usr/share/games in the path?


> > Probably not relevant is that every morning I get this cron error:
> > /etc/cron.daily/apt-compat:
> > Cache has broken packages, exiting
>
> What happens if you empty the cache with 'apt-get clean' or the equivalent?


I believe I already tried that, but I now do it again with su -. Won't
know if any effect until tomorrow morning.

Haines Brown