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


Groups > linux.debian.user > #176663 > unrolled thread

How to seperate grub devices?

Started byHans <hans.ullrich@loop.de>
First post2017-01-14 11:00 +0100
Last post2017-01-16 21:50 +0100
Articles 12 — 6 participants

Back to article view | Back to linux.debian.user


Contents

  How to seperate grub devices? Hans <hans.ullrich@loop.de> - 2017-01-14 11:00 +0100
    Re: How to seperate grub devices? Pascal Hambourg <pascal@plouf.fr.eu.org> - 2017-01-14 11:20 +0100
      Re: How to seperate grub devices? Hans <hans.ullrich@loop.de> - 2017-01-14 11:40 +0100
        Re: How to seperate grub devices? Pascal Hambourg <pascal@plouf.fr.eu.org> - 2017-01-14 12:00 +0100
    Re: How to seperate grub devices? Darac Marjal <mailinglist@darac.org.uk> - 2017-01-16 12:00 +0100
      Re: How to seperate grub devices? Hans <hans.ullrich@loop.de> - 2017-01-16 12:10 +0100
        Re: How to seperate grub devices? Darac Marjal <mailinglist@darac.org.uk> - 2017-01-16 12:30 +0100
          Re: How to seperate grub devices? Hans <hans.ullrich@loop.de> - 2017-01-16 12:50 +0100
            Re: How to seperate grub devices? <tomas@tuxteam.de> - 2017-01-16 13:00 +0100
            Re: How to seperate grub devices? Mark Fletcher <mark27q1@gmail.com> - 2017-01-16 13:10 +0100
              Re: How to seperate grub devices? "Thomas Schmitt" <scdbackup@gmx.net> - 2017-01-16 13:50 +0100
      Re: How to seperate grub devices? Pascal Hambourg <pascal@plouf.fr.eu.org> - 2017-01-16 21:50 +0100

#176663 — How to seperate grub devices?

FromHans <hans.ullrich@loop.de>
Date2017-01-14 11:00 +0100
SubjectHow to seperate grub devices?
Message-ID<sZthU-4mT-7@gated-at.bofh.it>
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.

Best

Hans

[toc] | [next] | [standalone]


#176667

FromPascal Hambourg <pascal@plouf.fr.eu.org>
Date2017-01-14 11:20 +0100
Message-ID<sZtBg-4Iu-15@gated-at.bofh.it>
In reply to#176663
Le 14/01/2017 à 10:50, Hans a écrit :
>
> 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?

What do you mean exactly ?
update-grub does not "edit any hard drive", it just regenerates the file 
/boot/grub/grub.cfg.

> 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.

It doesn't, unless you share the two systems share the same /boot/grub.

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


#176671

FromHans <hans.ullrich@loop.de>
Date2017-01-14 11:40 +0100
Message-ID<sZtUB-4P6-19@gated-at.bofh.it>
In reply to#176667
Am Samstag, 14. Januar 2017, 11:17:57 CET schrieb Pascal Hambourg:

> What do you mean exactly ?
> update-grub does not "edit any hard drive", it just regenerates the file
> /boot/grub/grub.cfg.

Yes, and it does it on BOTH physical harrdrives. 
> 
> > 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.
> 
> It doesn't, unless you share the two systems share the same /boot/grub.

Ii does! Booting from the second drive and updating grub, also changes the 
first harddrive (both are sata drives).

If I do not want this behaviour, I have to disconnect the drive from the 
mainboard.

Hans

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


#176677

FromPascal Hambourg <pascal@plouf.fr.eu.org>
Date2017-01-14 12:00 +0100
Message-ID<sZudY-4VP-19@gated-at.bofh.it>
In reply to#176671
Le 14/01/2017 à 11:31, Hans a écrit :
> Am Samstag, 14. Januar 2017, 11:17:57 CET schrieb Pascal Hambourg:
>
>> What do you mean exactly ?
>> update-grub does not "edit any hard drive", it just regenerates the file
>> /boot/grub/grub.cfg.
>
> Yes, and it does it on BOTH physical harrdrives.
>>
>>> 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.
>>
>> It doesn't, unless you share the two systems share the same /boot/grub.
>
> Ii does! Booting from the second drive and updating grub, also changes the
> first harddrive (both are sata drives).

Debian's GRUB does not do this by default.
/etc/kernel/postinst.d/zz-update-grub just runs update-grub.
update-grub is just a script which runs grub-mkconfig and writes its 
output to /boot/grub/grub.cfg.

I don't know about Kali's GRUB.

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


#176743

FromDarac Marjal <mailinglist@darac.org.uk>
Date2017-01-16 12:00 +0100
Message-ID<t0db5-7HX-29@gated-at.bofh.it>
In reply to#176663
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.

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


#176746

FromHans <hans.ullrich@loop.de>
Date2017-01-16 12:10 +0100
Message-ID<t0dkK-817-19@gated-at.bofh.it>
In reply to#176743
You all did not understand me, maybe caused by my bad English.

update-grub is ALWAYS changing grub.cfg on BOTH drives, same from which system 
it is started. And I want it only have changed on THAT DRIVE, I am running AT 
THE MOMENT. The other drive shall be then stayed untouched!

Hope this makes it more clear.

Hans

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


#176747

FromDarac Marjal <mailinglist@darac.org.uk>
Date2017-01-16 12:30 +0100
Message-ID<t0dE5-88J-1@gated-at.bofh.it>
In reply to#176746
On Mon, Jan 16, 2017 at 12:05:06PM +0100, Hans wrote:
>You all did not understand me, maybe caused by my bad English.
>
>update-grub is ALWAYS changing grub.cfg on BOTH drives, same from which system
>it is started. And I want it only have changed on THAT DRIVE, I am running AT
>THE MOMENT. The other drive shall be then stayed untouched!

Then something is wrong with your system.

update-grub is a shell script which calls "grub-mkconfig -o 
/boot/grub/grub.cfg". (Evidence: 
https://sources.debian.net/src/grub2/2.02~beta2-22%2Bdeb8u1/debian/update-grub/)

grub-mkconfig generates a new configuration and outputs it either to 
stdout or to the file specified in the -o option. (Evidence: 
https://sources.debian.net/src/grub2/2.02~beta2-22%2Bdeb8u1/util/grub-mkconfig.in/)

There is no facility in either of these to output to TWO config files.

So, either you're using something like unionfs, or RAID mirroring or 
automatic file copying or something similar which is mirroring changes 
on one drive to another drive OR ELSE you actually only have one boot 
partition which both grubs point to.

>
>Hope this makes it more clear.
>
>Hans
>

-- 
For more information, please reread.

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


#176749

FromHans <hans.ullrich@loop.de>
Date2017-01-16 12:50 +0100
Message-ID<t0dXr-8gC-9@gated-at.bofh.it>
In reply to#176747
It makes a grub.cfg on PHYSICAL harddrive ONE and
a second one on PHYSICAL harddrive TWO and both are identical.

But as both shall be different, according to the drive I want start from.

If you do not understand me yet, take this discussion as closed.

Thanks for the try.

Best 

Hans
 

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


#176750

From<tomas@tuxteam.de>
Date2017-01-16 13:00 +0100
Message-ID<t0e78-8ky-19@gated-at.bofh.it>
In reply to#176749
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Mon, Jan 16, 2017 at 12:45:51PM +0100, Hans wrote:
> It makes a grub.cfg on PHYSICAL harddrive ONE and
> a second one on PHYSICAL harddrive TWO and both are identical.
> 
> But as both shall be different, according to the drive I want start from.
> 
> If you do not understand me yet, take this discussion as closed.

I was about to jump in, but if you get that grumpy at people who try
to help you, I better stay out. My days are exhausting as they are,
I don't need to take more abuse.

all the best, nevertheless
- -- t
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iEYEARECAAYFAlh8tM0ACgkQBcgs9XrR2kY+EwCZARd/tGETTfdXUD6DgnkwZyNX
dKQAoIHN83KfwQGzENWWqukcnrkCGGAX
=Ry0P
-----END PGP SIGNATURE-----

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


#176751

FromMark Fletcher <mark27q1@gmail.com>
Date2017-01-16 13:10 +0100
Message-ID<t0egP-bR-37@gated-at.bofh.it>
In reply to#176749
On Mon, Jan 16, 2017 at 12:45:51PM +0100, Hans wrote:
> It makes a grub.cfg on PHYSICAL harddrive ONE and
> a second one on PHYSICAL harddrive TWO and both are identical.
> 
> But as both shall be different, according to the drive I want start from.
> 
> If you do not understand me yet, take this discussion as closed.
> 
> 

No, mate, we UNDERSTOOD you from the beginning, the problem is that 
_what you are describing is impossible_.

So there is something you are not telling us, or something is going on 
on your machine that you either did not think relevant or did not know.

For example, could your setup when running Kali and when running Debian 
in FACT, contrary to what you think is going on, be sharing a /boot 
mount? That would be unusual, it would be strange, but it WOULD WORK, 
assuming both kernels were there -- and it is one way to explain the 
behaviour you are seeing.

Type "df" command in Kali and in Debian and post the output here, that 
will eliminate that question. Also the content of /etc/fstab

Mark

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


#176752

From"Thomas Schmitt" <scdbackup@gmx.net>
Date2017-01-16 13:50 +0100
Message-ID<t0eTv-rg-7@gated-at.bofh.it>
In reply to#176751
Hi,

Hans wrote:
> > If you do not understand me yet, take this discussion as closed.

Mark Fletcher wrote:
> No, mate, we UNDERSTOOD you from the beginning, the problem is that 
> _what you are describing is impossible_.

To be exacting: It obviously goes beyond the imagination of the people
here, who have experience with running update-grub.

Hans, if you are sure that this happens and prepared to present the
experimental facts which make you sure, then consider to ask at
  help-grub@gnu.org
  https://lists.gnu.org/mailman/listinfo/help-grub
how this could be possible.

As one can see on
  http://lists.gnu.org/archive/html/help-grub/2017-01/threads.html
the main supporter is quite busy. So be friendly and concise when
you present your case.


Why your problem should be on topic there:

man 8 update-grup says its a "stub for grub-mkconfig". On my Debian 8
i see in file /usr/sbin/update-grub :
  #!/bin/sh
  set -e
  exec grub-mkconfig -o /boot/grub/grub.cfg "$@"
(Did you check what your "update-grub" command actually does ?
 In mine i see no indication that it would write two grub.cfg files.)

man 8 grub-mkconfig says you should report bugs to bug-grub@gnu.org.
This is the neighbor list of help-grub. Since your problem is not
yet identified as a bug in GRUB, i would start by asking at help-grub.

I'd skip "update-grub" and ask directly about

  grub-mkconfig -o /boot/grub/grub.cfg ...your.other.arguments.if.any...

(After having tested that it indeed shows the problematic behavior,
 of course.)


Have a nice day :)

Thomas

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


#176759

FromPascal Hambourg <pascal@plouf.fr.eu.org>
Date2017-01-16 21:50 +0100
Message-ID<t0mo1-5OK-9@gated-at.bofh.it>
In reply to#176743
Le 16/01/2017 à 11:56, Darac Marjal a écrit :
>
> BIOS will typically only boot from one drive (That said, both BIOS and
> UEFI often have mechanisms to choose what that drive is).

UEFI behaves differently. It mostly uses boot entries pointing at EFI 
executable files which can be located on any drive instead of boot drives.

> 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

GRUB comes in several parts (depending on the target/architecture), 
which can be installed on different drives.

GRUB BIOS comes in three parts :
- the boot image, installed in the MBR of a drive or the PBR of a partition
- the core image, which can be installed in different places but must be 
on the same drive as the boot image
- the other files (modules, config file...) installed in /boot/grub.

GRUB EFI only has a core image installed in the EFI system partition 
mounted on /boot/efi, and other files in /boot/grub.

The core image can contain an embedded configuration, but of course it 
is not updated by update-grub.

> 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.

Only GRUB BIOS (grub-pc) asks for a boot device. GRUB EFI won't ask for 
a boot device, because it does not need to : it does not install a boot 
image, and it installs the core image in /boot/efi by default.

> 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.

Alternatively you could just add GRUB_DISABLE_OS_PROBER=true in 
/etc/default/grub instead of uninstalling os-prober.

[toc] | [prev] | [standalone]


Back to top | Article view | linux.debian.user


csiph-web