On Sat, Jan 14, 2017 at 10:50:47AM +0100, Hans wrote:
Hi list,
this is the situation:
I have debian installed on my first harddrive and kali-linux on my
second
harddrive. When a new kernel version is installed, update-grub is always
editing both harddrives. Is there a way, to avoid this?
So, I do not want, that an upgrade of the kali-kernel touches the grub
installation of the first harddrive with debian and vice versa.
If this is not possible, I would also be happy to know.
As noted by Pascal, update-grub only recreates grub's config, but let's
clarify some of the workings of grub to see where your problem lies.
BIOS will typically only boot from one drive (That said, both BIOS and
UEFI often have mechanisms to choose what that drive is). When grub is
installed to a drive, it will use the grub.cfg from that drive (I'm not
sure if that's built in, or if it's an assumption that grub makes, but
let's take it as read). That grub.cfg can then be used to start
operating systems on any drive.
So, I think what you're wanting is A) Debian's grub pointing to Debian's
grub.cfg, booting Debian and Kali AND B) Kali's grub pointing to Kali's
grub.cfg, booting Kali and Debian.
For that, run "dpkg-reconfigure -plow grub-pc" (or whichever build of
grub you're using: grub-efi-*, grub-coreboot etc. Note that you're
reconfiguring the application package itself, NOT an auxiliary package
such as 'grub2' or 'grub' or 'grub-common'). This *should* ask you to
which drives you want grub installed. This will update the grub image
embedded at the start of the drive(s) that you select. In theory, then,
deselecting the Kali drive should mean that all data on the Kali drive
is untouched (by grub).
If, additionally, you want Debian's grub to ONLY boot Debian and Kali's
grub to ONLY boot Kali, then you should uninstall the "os-prober"
package and re-run update-grub. Basically, the normal assumption is that
ONE operating system is in charge of the bootloader, but you still want
to be able to boot other operating systems, so update-grub calls
os-prober which scans your system for other operating systems and adds
them into the list. If you remove os-prober, grub will only know about
itself.
Hope that helps.
Best
Hans
--
For more information, please reread.