{"id":839,"date":"2023-09-03T18:14:45","date_gmt":"2023-09-03T16:14:45","guid":{"rendered":"https:\/\/linux-bibel.at\/?p=839"},"modified":"2023-09-03T18:14:46","modified_gmt":"2023-09-03T16:14:46","slug":"arbeiten-in-der-grub-shell-unter-linux","status":"publish","type":"post","link":"https:\/\/linux-bibel.at\/index.php\/2023\/09\/03\/arbeiten-in-der-grub-shell-unter-linux\/","title":{"rendered":"Arbeiten in der GRUB-Shell unter Linux"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">GRUB ist der h\u00e4ufigste unter Linux eingesetzte Bootloader (<em>eine Alternative w\u00e4re LILO &#8211; Linux Loader &#8211; dieser wird meines Wissens jedoch nur unter Slackware eingesetzt<\/em>). Bastelt man an der Konfiguration ohne genug Wissen herum k\u00f6nnte es schon vorkommen das GRUB nicht mehr damit zurechtkommt, Linux (oder andere Systeme wie etwa auch Windows) nicht mehr ohne Hilfe starten kann. Auch ein Fehler beim Update &#8211; etwa wenn dieses aus welchem Grund auch immer unterbrochen wird, kann es zu solchen Fehlern kommen (<em>in der Regel sollte so etwas jedoch nicht passieren<\/em>).<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In solchen F\u00e4llen hilft die GRUB-Shell. Bei dieser handelt es sich um eine Art minimalisiertes\u00a0Terminal. In dieses Terminal gelangt man automatisch, wenn GRUB erkennt, dass etwas nicht funktioniert &#8211; alternativ gelangt man auf diese, indem man im GRUB-Men\u00fc:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"576\" src=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/grub-shell-1024x576.jpg\" alt=\"\" class=\"wp-image-840\" srcset=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/grub-shell-1024x576.jpg 1024w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/grub-shell-300x169.jpg 300w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/grub-shell-768x432.jpg 768w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/grub-shell-1536x864.jpg 1536w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/grub-shell.jpg 1920w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">die Taste &#8222;<kbd>c<\/kbd>&#8220; dr\u00fcckt:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"576\" src=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/grub-shell-1-1024x576.jpg\" alt=\"\" class=\"wp-image-841\" srcset=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/grub-shell-1-1024x576.jpg 1024w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/grub-shell-1-300x169.jpg 300w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/grub-shell-1-768x432.jpg 768w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/grub-shell-1-1536x864.jpg 1536w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/grub-shell-1.jpg 1920w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">In der GRUB-Shell arbeitet man eigentlich wie am normalen Terminal &#8211; es gibt jedoch auch kleine Unterschiede, so sind nur wenige Befehle verf\u00fcgbar und Sie k\u00f6nnen nur das Englische Tastaturlayout nutzen:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"381\" src=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/grub-shell-2-1024x381.jpg\" alt=\"\" class=\"wp-image-842\" srcset=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/grub-shell-2-1024x381.jpg 1024w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/grub-shell-2-300x112.jpg 300w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/grub-shell-2-768x286.jpg 768w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/grub-shell-2.jpg 1280w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Gleich einmal zu Beginn &#8211; die GRUB-Shell kann nichts reparieren, Sie k\u00f6nnen damit jedoch das System starten und darin den Bootloader wieder passend konfigurieren.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Die GRUB-Shell nutzen<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Einer der wichtigsten Befehle in der GRUB-Shell ist:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ls<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Wie auf dem Standard-Terminal zeigt er den Inhalt &#8211; in diesem Fall die Partitionen:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"576\" src=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/grub-shell-3-1024x576.jpg\" alt=\"\" class=\"wp-image-843\" srcset=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/grub-shell-3-1024x576.jpg 1024w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/grub-shell-3-300x169.jpg 300w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/grub-shell-3-768x432.jpg 768w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/grub-shell-3-1536x864.jpg 1536w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/grub-shell-3.jpg 1920w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Auch die Vervollst\u00e4ndigung der Befehle mit der\u00a0<strong><kbd>Tabulator<\/kbd><\/strong>-Taste funktioniert hier. Nun k\u00f6nnen Sie sich n\u00e4here Informationen zu den einzelnen Partitionen anzeigen lassen &#8211; etwa:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ls (hd0,msdos2)<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"576\" src=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/grub-shell-4-1024x576.jpg\" alt=\"\" class=\"wp-image-844\" srcset=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/grub-shell-4-1024x576.jpg 1024w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/grub-shell-4-300x169.jpg 300w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/grub-shell-4-768x432.jpg 768w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/grub-shell-4-1536x864.jpg 1536w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/grub-shell-4.jpg 1920w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Um direkt die Verzeichnis-Hierarchie der Partition anzuzeigen, geben Sie das jeweilige Verzeichnis an &#8211; am einfachsten nat\u00fcrlich das Wurzel-Verzeichnis:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ls (hd0,msdos2)\/<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"576\" src=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/grub-shell-5-1024x576.jpg\" alt=\"\" class=\"wp-image-845\" srcset=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/grub-shell-5-1024x576.jpg 1024w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/grub-shell-5-300x169.jpg 300w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/grub-shell-5-768x432.jpg 768w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/grub-shell-5-1536x864.jpg 1536w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/grub-shell-5.jpg 1920w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Sehen wir die Verzeichnis-Hierarchie (<em>wie im Bild oben<\/em>) des Systems, wissen wir wo unser Bootloader liegt &#8211; in diesem Fall handelt es sich um die Partition &#8222;<strong>(hd0,msdos2)<\/strong>&#8222;. Mit folgenden beiden Befehlen zeigen wir GRUB nun den Speicherort des Bootloaders und der Wurzel-Partition (<em>nach obigem Beispiel<\/em>):<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>set prefix=(hd0,msdos2)\/boot\/grub\/\nset root=(hd0,msdos2)<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Mittels:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>set<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">l\u00e4sst sich nun die Konfiguration \u00fcberpr\u00fcfen:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"576\" src=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/grub-shell-6-1024x576.jpg\" alt=\"\" class=\"wp-image-846\" srcset=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/grub-shell-6-1024x576.jpg 1024w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/grub-shell-6-300x169.jpg 300w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/grub-shell-6-768x432.jpg 768w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/grub-shell-6-1536x864.jpg 1536w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/09\/grub-shell-6.jpg 1920w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Haben Sie den Standort des Bootloaders und die Wurzel-Partition angegeben, k\u00f6nnen Sie mit dem Befehl:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>insmod normal<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">pr\u00fcfen, ob die Konfiguration funktioniert &#8211; erhalten Sie keine Ausgabe, sollte ein Start funktionieren, bei Fehlermeldungen haben Sie etwas falsch angegeben. Im positiven Fall &#8211; also wenn Sie keine Meldung erhalten haben, k\u00f6nnen Sie das System mit:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>boot<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">direkt starten oder mit:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>normal<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">zur\u00fcck in den grafischen Bootloader wechseln, um von dort das System zu starten. Im laufenden System gilt es anschlie\u00dfend den Bootloader wieder passend zu konfigurieren.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>GRUB ist der h\u00e4ufigste unter Linux eingesetzte Bootloader (eine Alternative w\u00e4re LILO &#8211; Linux Loader &#8211; dieser wird meines Wissens jedoch nur unter Slackware eingesetzt). Bastelt man an der Konfiguration ohne genug Wissen herum k\u00f6nnte es schon vorkommen das GRUB nicht mehr damit zurechtkommt, Linux (oder andere Systeme wie etwa auch Windows) nicht mehr ohne [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":845,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[17,4],"tags":[12,7,15,6],"class_list":["post-839","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-system","category-terminal","tag-kommandozeile","tag-shell","tag-system","tag-terminal"],"_links":{"self":[{"href":"https:\/\/linux-bibel.at\/index.php\/wp-json\/wp\/v2\/posts\/839","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/linux-bibel.at\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linux-bibel.at\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linux-bibel.at\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/linux-bibel.at\/index.php\/wp-json\/wp\/v2\/comments?post=839"}],"version-history":[{"count":1,"href":"https:\/\/linux-bibel.at\/index.php\/wp-json\/wp\/v2\/posts\/839\/revisions"}],"predecessor-version":[{"id":847,"href":"https:\/\/linux-bibel.at\/index.php\/wp-json\/wp\/v2\/posts\/839\/revisions\/847"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/linux-bibel.at\/index.php\/wp-json\/wp\/v2\/media\/845"}],"wp:attachment":[{"href":"https:\/\/linux-bibel.at\/index.php\/wp-json\/wp\/v2\/media?parent=839"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linux-bibel.at\/index.php\/wp-json\/wp\/v2\/categories?post=839"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linux-bibel.at\/index.php\/wp-json\/wp\/v2\/tags?post=839"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}