% master: re_install_grub_with_live_cd.tex
% Re-install Grub with Live CD v0.4
% 2022-05-09 (Rx)

\section{Re-install Grub with Live CD}
%-------------------------------------

\subsection{Chroot}
%------------------
\index{chroot}\index{env-update}\index{source}\index{export}
\begin{verbatim}
sudo fdisk -l                                   Patition für das chroot festellen
sudo mount /dev/sdb3 /mnt/gentoo                chroot z.B. /dev/sdb3 auf z.B. /mnt/gentoo mounten
sudo mount -t proc none /mnt/gentoo/proc        Mounten der /proc und /dev Dateisysteme
sudo mount --rbind /dev /mnt/gentoo/dev
sudo chroot /mnt/gentoo /bin/bash               Betreten der neuen Umgebung
env-update                                      Umgebungsvariablen aktualisieren
source /etc/profile                             Profil laden
export PS1="(chroot) $PS1"                      Promt anpassen
\end{verbatim}

\subsection{Grub}
%----------------
\index{grub}
\begin{verbatim}
sudo grub
grub> find /boot/grub/stage1
grub> root (hd0,1)
grub> setup (hd0)
grub> quit
reboot
\end{verbatim}