{"id":393,"date":"2020-10-24T13:43:47","date_gmt":"2020-10-24T11:43:47","guid":{"rendered":"https:\/\/pcmacb.de\/?page_id=393"},"modified":"2026-01-19T15:56:11","modified_gmt":"2026-01-19T14:56:11","slug":"repair-grub-in-efi","status":"publish","type":"page","link":"https:\/\/pcmacb.de\/?page_id=393","title":{"rendered":"Repair Grub in EFI"},"content":{"rendered":"\n<p>Mit <a rel=\"noreferrer noopener\" href=\"https:\/\/www.supergrubdisk.org\/\" target=\"_blank\">Supergrub<\/a> ins installierte Linux System booten. Bei OpenSUSE mit Yast -&gt; bootloader reparieren. In Debian Systemen in der Konsole als root:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">mkdir \/boot\/efi<br>mount \/dev\/sda2 \/boot\/efi<\/pre>\n\n\n\n<p><strong>sda2<\/strong> ist die Windows EFI Partition<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">apt install --reinstall grub-efi\ngrub-install\nupdate-grub<\/pre>\n\n\n\n<p>check:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">file \/boot\/efi\/EFI\/debian\/grubx64.efi<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Mit LUKS verschl\u00fcsselte Festplatten:<\/h2>\n\n\n\n<p>Das Fogebeispiel bezieht sich auf OpenSUSE ab Version 15.3 und die Knoppix Version ist die &#8222;Kleine&#8220;, wenn die DVD-Version genutzt wird, ist wahrscheinlich nichts nach zu installieren wie &#8222;efibootmgr&#8220;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">## in knoppix nachtr\u00e4glich installieren\napt install efibootmgr\nmodprobe efivars\nmodprobe -v dm-multipath\n######################################################\n## partition erstellen\nfdisk \/dev\/sdb\nmit \"n\" neue partition erstellen - erkl\u00e4rt sich selbst...\nmit \"w\" auf Platte schreiben und beenden.\n\ncryptsetup luksFormat \/dev\/sdX5\n## Dateisystem auf verschl\u00fcsselter Partition erstellen \n\ncryptsetup luksOpen \/dev\/sdX5 cryptwhatever\nmkfs.ext4 \/dev\/mapper\/cryptwhatever\n\n######################################################\n## Partition entschl\u00fcsseln und einbinden\ncryptsetup luksOpen \/dev\/nvme0n1p4 cr_root\nmount \/dev\/mapper\/cr_root \/home\/knoppix\/mntoo\/\n\ncryptsetup luksUUID \/dev\/mapper\/cr_root\n\nmount \/dev\/nvme0n1p1 \/home\/knoppix\/mntoo\/boot\/efi\/\nmount -o bind \/proc \/home\/knoppix\/mntoo\/proc\nmount -o bind \/dev \/home\/knoppix\/mntoo\/dev\nmount -o bind \/sys \/home\/knoppix\/mntoo\/sys\nchroot \/home\/knoppix\/mntoo\/ \/bin\/bash\n\nlsinitrd \/boot\/initrd -f \/etc\/crypttab\nvi \/etc\/crypttab\nmkinitrd\n\ngrub2-mkconfig -o \/boot\/grub2\/grub.cfg\ngrub2-install \/dev\/nvme0n1\n<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">fsck bei jedem booten erzwingen<\/h2>\n\n\n\n<p>ich habe bei einem bestimmten virtuellen Server im Dauerbetrieb das Problem, dass die virtuellen Festplatten &#8211; aus welchen Gr\u00fcnden auch immer &#8211; Fehler im Dateisystem erzeugen und ich nur vor Ort mit <a href=\"https:\/\/www.knopper.net\/\">knoppix<\/a> gebootet das Dateisystem reparieren kann. Durch folgende Eintr\u00e4ge in Grub wird bei jedem Start das \u00dcberpr\u00fcfen und reparieren des Dateisystems erzwungen:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>nano \/etc\/default\/rcS<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"># be more verbose during the boot process\n#VERBOSE=no\nVERBOSE=yes\n# automatically repair filesystems with inconsistencies during boot\n#FSCKFIX=no\nFSCKFIX=yes<\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\">nano \/etc\/default\/grub<\/pre>\n\n\n\n<p>hier wird auch noch ipv6 serverweit abgeschaltet und die Nachrichten beim Bootvorgang vermehrt:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">#GRUB_CMDLINE_LINUX_DEFAULT=\"quiet\"<br>GRUB_CMDLINE_LINUX_DEFAULT=\"nosplash fsck.mode=force fsck.repair=yes\"<br>GRUB_CMDLINE_LINUX=\"ipv6.disable=1\"<\/pre>\n\n\n\n<p>Wichtig! Nach den \u00c4nderungen:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">update-grub<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">OpenSUSE: Zweite Passworteingabe nach GRUB verhindern<\/h2>\n\n\n\n<p>Hierzu muss ein Key erstellt, der verschl\u00fcsselten Partition zugeordnet und an Grub \u00fcbergeben werden. <\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">touch \/.root.key\nchmod 600 \/.root.key\ndd if=\/dev\/urandom of=\/.root.key bs=1024 count=1\n\n## check what's on\nmount | grep \" \/ \"\ncryptsetup status cr_root\n\ncryptsetup luksAddKey \/dev\/nvme0n1p4 \/.root.key\n\n# nano \/etc\/crypttab\ncr_root  UUID=XYZ-XYZ-XYZ-XYZ-XYZ- none  x-initrd.attach \/root.key\n\n# nano \/etc\/dracut.conf.d\/99-root-key.conf\ninstall_items+=\" \/.root.key \" # die Leerzeichen sind wichtig!!\n\n# nano \/etc\/permissions.local\n\/boot\/ root:root 700\n\nchkstat --system --set\n\nmkinitrd<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Mit Supergrub ins installierte Linux System booten. Bei OpenSUSE mit Yast -&gt; bootloader reparieren. In Debian Systemen in der Konsole als root: mkdir \/boot\/efimount \/dev\/sda2 \/boot\/efi sda2 ist die Windows EFI Partition apt install &#8211;reinstall grub-efi grub-install update-grub check: file <a class=\"more-link\" href=\"https:\/\/pcmacb.de\/?page_id=393\">weiterlesen&#8230;<\/a><\/p>\n","protected":false},"author":3,"featured_media":0,"parent":79,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_lmt_disableupdate":"","_lmt_disable":"","footnotes":""},"class_list":["post-393","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/pcmacb.de\/index.php?rest_route=\/wp\/v2\/pages\/393","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pcmacb.de\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/pcmacb.de\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/pcmacb.de\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/pcmacb.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=393"}],"version-history":[{"count":11,"href":"https:\/\/pcmacb.de\/index.php?rest_route=\/wp\/v2\/pages\/393\/revisions"}],"predecessor-version":[{"id":1505,"href":"https:\/\/pcmacb.de\/index.php?rest_route=\/wp\/v2\/pages\/393\/revisions\/1505"}],"up":[{"embeddable":true,"href":"https:\/\/pcmacb.de\/index.php?rest_route=\/wp\/v2\/pages\/79"}],"wp:attachment":[{"href":"https:\/\/pcmacb.de\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=393"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}