Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[gelöst2] Wie kann man denn GRUB2 konfigurieren?(DualBoot)
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Deutsches Forum (German)
View previous topic :: View next topic  
Author Message
LuxJux
Guru
Guru


Joined: 01 Mar 2016
Posts: 497
Location: Germany/Berlin

PostPosted: Wed Sep 27, 2017 6:59 pm    Post subject: [gelöst2] Wie kann man denn GRUB2 konfigurieren?(DualBoot) Reply with quote

Dummerweise möchte Win ja sda1/mbr für die Installation.
Calculate läuft wunderbar auf sda5
Beide Systeme booten auch fehlerfrei in den GAST (ohne PW)

In der grub.cfg steht jedoch ganz oben
Don't edit this file manually

Was ich gerne hätte: GRUB sollte doch bitte als erstes in den WIN-GAST starten
Am besten so, daß GRUB noch nicht mal als Startmenü erscheint.
Und ich würde dann noch eine Tastenkombi benötigen, um Linux zu starten


P.S.: Ich hab die grub.cfg doch manuell von SET BOOTTIME=2 zu 20sec geändert

edit: Wenns nicht native geht, vielleicht mit chroot ? (von LiveCD) ?


Last edited by LuxJux on Thu May 17, 2018 4:18 pm; edited 4 times in total
Back to top
View user's profile Send private message
mike155
Advocate
Advocate


Joined: 17 Sep 2010
Posts: 4438
Location: Frankfurt, Germany

PostPosted: Wed Sep 27, 2017 8:42 pm    Post subject: Reply with quote

Hallo LuxJux,
Quote:
In der grub.cfg steht jedoch ganz oben
Don't edit this file manually

Bei GRUB 0.97 gab es eine Konfigurationsdatei "/boot/grub/grub.conf", die man editieren konnte / musste.

Bei GRUB 2 gibt es eine Konfigurationsdatei "/boot/grub/grub.cfg". Es gibt zwei Methoden, um diese Datei anzupassen:
  1. Man editiert diese Datei von Hand und ignoriert die Meldung "Don't edit this file manually"
  2. Man editiert die Dateien:
    Code:
    /etc/default/grub
    /etc/grub.d/*

    Nach jeder Änderung ruft man folgende Anweisung auf:
    Code:
    grub-mkconfig -o /boot/grub/grub.cfg

    Dadurch erzeugt grub-mkconfig eine neue Datei "/boot/grub/grub.cfg". Die meisten Distributionen wählen den zweiten Weg - und führen grub-mkconfig auch automatisch bei Kernel-Updates aus - wodurch manuelle Änderungen in "/boot/grub/grub.cfg" verloren gehen - deshalb die Warnung.
Mehr dazu gibt's hier:
Back to top
View user's profile Send private message
LuxJux
Guru
Guru


Joined: 01 Mar 2016
Posts: 497
Location: Germany/Berlin

PostPosted: Wed Sep 27, 2017 9:26 pm    Post subject: Reply with quote

[code]Setting configuration parameters

The following variables in /etc/default/grub are the most common ones to set to control how GRUB2 will function:
Variable Explanation Default value
GRUB_DEFAULT Defines the default menu entry selected on boot. May be a numeric index, a menu title, or "saved". Defaults to first detected entry.
GRUB_TIMEOUT Delay (in seconds) before booting default menu entry. Set to 0 to boot immediately or -1 to wait indefinitely. The default is 5 seconds.
GRUB_CMDLINE_LINUX Parameters to be passed on the kernel command line for all Linux menu entries. For instance, to support hibernation, users will need to add GRUB_CMDLINE_LINUX="resume=/dev/sdXY" with /dev/sdXY being the swap partition.
GRUB_CMDLINE_LINUX_DEFAULT Parameters to be passed on the kernel command line for non-recovery Linux menu entries.
GRUB_DEVICE The initial root device (i.e. the kernel's root= parameter). Set this to override the grub-mkconfig command's root device auto-detection. For example, GRUB_DEVICE=/dev/ram0 will force root=/dev/ram0 to be used in the kernel command line. [/kode]

Sieht gut aus.
Also muß ich doch die grub2.cfg von Hand bearbeiten, um WIN als erstes zu starten.

Moin
Back to top
View user's profile Send private message
LuxJux
Guru
Guru


Joined: 01 Mar 2016
Posts: 497
Location: Germany/Berlin

PostPosted: Fri Oct 06, 2017 7:41 pm    Post subject: Reply with quote

Das funktioniert ganz einwandfrei.
Doch wie haben die das gemacht bei Calculate, daß der grub "versteckt" ist ?
Änder ich die boottime von 2 nach 5....ist grub wieder sichtbar.
Wie haben die das gemacht ?

Find ich gut, falls die Kids mal wieder an den Compi wollen.
Könnt ihr mir da helfen ?

Achso, Linux ist 20161229 Calculate
Und grub ist erst nach dem 814Packete-Update versteckt.
Back to top
View user's profile Send private message
LuxJux
Guru
Guru


Joined: 01 Mar 2016
Posts: 497
Location: Germany/Berlin

PostPosted: Fri Oct 06, 2017 9:00 pm    Post subject: Reply with quote

Lustig. Mit Win bekomme ich diese ANtwort von Marlo:
Quote:
Grub2 bootet immer, wenn nicht von Hand dazwischen gegangen wird, immer in das zuletzt gestartete System. Selbst dann, wenn es in der Reihenfolge ganz unten steht. Aber wenn es dir um die Reihenfolge geht:

Code:
mv /etc/grub.d/30_os-prober /etc/grub.d/01_os-prober


danach wie gewohnt:
Code:
grub2-mkconfig -o /boot/grub/grub.cfg


ma


Mit linux hab/kann/ist die nicht vorhanden.

Code:
grub2-mkconfig -o /boot/grub/grub.cfg

Kommando nicht vorhanden.

Aber ansonsten gehts mir gut
Back to top
View user's profile Send private message
Marlo
Veteran
Veteran


Joined: 26 Jul 2003
Posts: 1591

PostPosted: Sat Oct 07, 2017 3:04 pm    Post subject: Reply with quote

Ah, da ist ja mein Beitrag,

hab mir zwischendurch mal calculate in einer VM installiert.
Da wird nicht grub2 sondern grub verwendet. Dann wäre also :
Code:
grub-mkconfig -o /boot/grub/grub.cfg

auszuführen.

Aber das wird nach einem update natürlich wieder alles überschrieben.
Übrigens, die grub.cfg wird über die /etc/default/grub geändert.
Dort kann man SET BOOTTIME=2 setzen. Und natürlich danach die grub.cfg neu schreiben nicht vergessen.
_________________
------------------------------------------------------------------
http://radio.garden/
Back to top
View user's profile Send private message
LuxJux
Guru
Guru


Joined: 01 Mar 2016
Posts: 497
Location: Germany/Berlin

PostPosted: Sat Oct 07, 2017 4:53 pm    Post subject: Reply with quote

Vielen Dank für eure Hilfe.
Jetzt startet grub so, wie gewünscht.
Hab das Thema auf gelöst gesetzt.

P.S.: Das mit dem "versteckten grub" ging dann auch ziemlich einfach.
Auf Konsole ändern und die Schriftfarbe für nichtgewählte Einträge auf black/black einstellen
Back to top
View user's profile Send private message
LuxJux
Guru
Guru


Joined: 01 Mar 2016
Posts: 497
Location: Germany/Berlin

PostPosted: Thu May 17, 2018 1:29 am    Post subject: Reply with quote

-
-
-
-
Muß das nochmal aufwärmen.
Hatte nun hidden-grub mit gentoo als 1. bootoption eingestellt. (Startet in eine Konsole. Sehr schön)
Nach einem win8 oder gentoo-update bleibt grub (hidden) auch weiterhin unverändert (4.9.72 stable)
Nach einem calculate-update ist die Reihenfolge jedoch verändert. Calc ist nun die 1.bootoption

Wie kann ich denn Calculate beim nächsten update darum bitten, die bootreihenfolge nicht zu verändern ?

bzw.

Wie kann unter calculate (grub)
gentoo als 1. bootoption dauerhaft eingesetllt werden/bleiben ?
Back to top
View user's profile Send private message
Yamakuzure
Advocate
Advocate


Joined: 21 Jun 2006
Posts: 2283
Location: Adendorf, Germany

PostPosted: Thu May 17, 2018 7:54 am    Post subject: Re: [ungelöst2] Wie kann man denn GRUB2 konfigurieren?(DualB Reply with quote

LuxJux wrote:
Was ich gerne hätte: GRUB sollte doch bitte als erstes in den WIN-GAST starten
Am besten so, daß GRUB noch nicht mal als Startmenü erscheint.
Und ich würde dann noch eine Tastenkombi benötigen, um Linux zu starten
Ich weiß, dass das jetzt ein wenig her ist.

Es ist auch nur eine Idee, weil das bei mir so schön funktioniert: Wie wäre es mit UEFI?

Ich habe bei mir ein UEFI Bootmenu, das standardmäßig Grub2 startet (für die Kernelauswahl). Drücke ich F12 beim starten, kommt das Bootmenu, und ich kann nebst Linux auch Win10Pro oder SysRescCD auswählen.

Grub bleibt so weiter nutzbar (wie gesagt, Kernel-Auswahl und -Manipulation), und Windoof ist in höchstem Maße zufrieden.
_________________
Important German:
  1. "Aha" - German reaction to pretend that you are really interested while giving no f*ck.
  2. "Tja" - German reaction to the apocalypse, nuclear war, an alien invasion or no bread in the house.
Back to top
View user's profile Send private message
Tyrus
Guru
Guru


Joined: 03 Feb 2018
Posts: 300

PostPosted: Thu May 17, 2018 8:17 am    Post subject: Reply with quote

@LuxJux:
Kennst du die Option "saved" für GRUB_DEFAULT?

Also das ist aus /etc/defaut/grub. Damit startet Grub immer das Betriebssystem, welches zuletzt gestartet wurde. Egal welche Position das im Menu hatte. Wenn du Calculate zuletzt benutzt hast bleibt auch der Autostart bei Calculate. Wenn du Windows genutzt hast genauso - wird Windows automatisch gestartet. Wenn du willst das Gentoo automatisch bootet nachdem du Calculate genutzt hast, musst du es nur einmal manuell starten. Danach ist Gentoo in der Automatik.

Und dabei ist es egal an welcher Stelle das im Bootmenu von Grub auftaucht. Du müsstest nur /etc/default/grub unter Gentoo und auch unter Calculate anpassen. Dann kannst du in beiden grub-mkconfig nutzen.

Ist aber auch nur ein Vorschlag.
Back to top
View user's profile Send private message
LuxJux
Guru
Guru


Joined: 01 Mar 2016
Posts: 497
Location: Germany/Berlin

PostPosted: Thu May 17, 2018 9:08 pm    Post subject: Reply with quote

:)
Back to top
View user's profile Send private message
LuxJux
Guru
Guru


Joined: 01 Mar 2016
Posts: 497
Location: Germany/Berlin

PostPosted: Fri Jun 29, 2018 7:10 pm    Post subject: Reply with quote

Code:

plasma ~ # grub-mkconfig -o /dev/sdc/boot/grub/grub.cfg
/usr/sbin/grub-mkconfig: Zeile 243: /dev/sdc/boot/grub/grub.cfg.new: Ist kein Verzeichnis
plasma ~ #

Dann ebend nicht.
Back to top
View user's profile Send private message
Tyrus
Guru
Guru


Joined: 03 Feb 2018
Posts: 300

PostPosted: Fri Jun 29, 2018 7:27 pm    Post subject: Reply with quote

LuxJux wrote:
Code:

plasma ~ # grub-mkconfig -o /dev/sdc/boot/grub/grub.cfg
/usr/sbin/grub-mkconfig: Zeile 243: /dev/sdc/boot/grub/grub.cfg.new: Ist kein Verzeichnis
plasma ~ #

Dann ebend nicht.


Ähm das ist ja auch kein Verzeichnis.
Lass dir mal
Code:

ls -l /dev/sdc

anzeigen.

Dann findest du sowas wie
Code:

brw-rw---- 1 root disk 8, 0 29. Jun 2018  /dev/sdc


Es handelt sich um ein block device das mit der Ausgabe von grub-mkconfig nichts anfangen kann.

Was du vermutlich wohl ausführen wolltest, ist wohl eher das hier:
Code:

grub-mkconfig -o /boot/grub/grub.cfg
Back to top
View user's profile Send private message
LuxJux
Guru
Guru


Joined: 01 Mar 2016
Posts: 497
Location: Germany/Berlin

PostPosted: Fri Jun 29, 2018 7:43 pm    Post subject: Reply with quote

Das sollte jedoch schon sdc sein und nicht sda
Also der grub-install

Edit: Von LiveVD
Back to top
View user's profile Send private message
Tyrus
Guru
Guru


Joined: 03 Feb 2018
Posts: 300

PostPosted: Fri Jun 29, 2018 8:14 pm    Post subject: Reply with quote

Kann dir nicht mehr folgen. Reden wir jetzt über grub-install oder grub-mkconfig. Das sind zwei verschiedene Kommandos.
Back to top
View user's profile Send private message
ChrisJumper
Advocate
Advocate


Joined: 12 Mar 2005
Posts: 2390
Location: Germany

PostPosted: Sat Jun 30, 2018 6:24 pm    Post subject: Reply with quote

LuxJux wrote:
Das sollte jedoch schon sdc sein und nicht sda
Also der grub-install

Edit: Von LiveVD


Es ist nicht ganz egal ob es sdc oder sda ist, aber was Tyrus meint ist das es kein Verzeichnis ist.

Du benutzt das mount Kommando um Datenträger Einzuhängen. Beispielsweise

Code:
# mount /dev/sda1 /boot


Dann kannst du über /boot auf die Festplatte /dev/sda zugreifen, genauer gesagt auf die erste Partition (in meinem Beispiel).

Klar, grub-install braucht so eine Festplatten-Device Angabe. Aber grub-mkconfig braucht halt nur ein Verzeichnis (wie eben /boot/grub/grub.cfg).

In deinem vorherigen Post hast du aber lediglich ein Verzeichnis erstellt das /dev/sdc/boot/grub/grub.cfg hieß.

Vielleicht hast du dich da auch nur verschrieben oder bei der Live-CD Nutzung vertan.

So kleine Fehler passieren schon mal wenn es so warm ist. Das schlimme dabei man liest das auch selber nicht genau.. weil man etwas anders erwartet. Musst den Blick dafür schärfen wenn du Fehlermeldungen bekommst.

Aber das sage ich mir auch immer selber. Meistens, fällt es mir auf wenn ich gerade einen Thread erstellen will und versuche das Problem für andere in Worte zu fassen. In dem Moment stoße ich dann von allein auf die Lösung.
Back to top
View user's profile Send private message
Tyrus
Guru
Guru


Joined: 03 Feb 2018
Posts: 300

PostPosted: Sun Jul 01, 2018 1:38 am    Post subject: Reply with quote

@ChrisJumper: Danke :)

@LuxJux:
Wenn du mit ner LiveDVD arbeitest, wäre meine Frage, ob du dich für die Installation von grub in einer ChangeRoot-Umgebung befindest? Also das passiert ja auch z.B. bei der Installation von Gentoo wenn, du dem Handbuch folgst.
Falls das nicht der Fall, ist und du die Festplatte zum Beispiel unter /mnt eingemountet hast, ist der Aufruf bei grub-install etwas anders.

Code:

grub-install /dev/sda


führt in Wirklichkeit

Code:

grub-install --boot-directory=/boot/ /dev/sda


aus. Das ist für die ChangeRoot-Umgebung ok. Der Schalter "--boot-directory=/boot/" ist ein Defaultwert. Denn kann man weglassen, wenn das genau so gewollt ist.

Sonst musst du
Code:

grub-install --boot-directory=/mnt/boot /dev/sda

verwenden.

Warum das wichtig ist. Es wird bei der Installation ein Image von grub installiert. Und das landet im Verzeichnis welches man über den Schalter angibt ergänzt durch /grub. Also zum Beispiel dann unter /mn/boot/grub.

Welches Device das Richtige ist, musst du selber rausfinden. Also ob /dev/sda oder /dev/sdc stimmt, weiss ich nicht. Aber es sollte eine ganze Festplatte sein und nicht eine Partition. Also kein /dev/sda5 als Beispiel.

Mit grub-mkconfig erstellst du danach die Konfiguration. Die Ausgabe landet auf Standardausgabe wenn du sonst nix angibst.
Der Schalter "-o /boot/grub/grub.cfg" schreibt die Ausgabe in ein File.
Code:

grub-mkconfig -o /boot/grub/grub.cfg


Und es ist kein Verzeichnis das man da angeben muss, sondern ein Filename
Da hab ich ChrisJumper wahrscheinlich verwirrt bei seiner Hilfe, sorry.
Die Fehlerausgabe war: "/usr/sbin/grub-mkconfig: Zeile 243: /dev/sdc/boot/grub/grub.cfg.new: Ist kein Verzeichnis ".
Ich denke, das liegt daran das "/dev/sdc" und danach das "/"-Zeichen von der Shell als Verzeichnis gedeutet werden. Die sieht das Blockdevice und beschwert sich dann.
Back to top
View user's profile Send private message
LuxJux
Guru
Guru


Joined: 01 Mar 2016
Posts: 497
Location: Germany/Berlin

PostPosted: Sun Jul 01, 2018 6:30 pm    Post subject: Reply with quote

:idea: :!:

Da war mein Denkfehler.
grub-install benötigt die Festplatte (z.B. /dev/sdc)
mkconfig benötigt jedoch grub.cfg

Code:
 mkdir /mnt/ssdboot
mount /dev/sdc2 /mnt/ssdboot
grub-mkconfig -o /mnt/ssdboot/grub/grub.cfg


Das ergibt Sinn. Und hat dann auch funktioniert.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Deutsches Forum (German) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum