Systemrettung: Unterschied zwischen den Versionen

Aus Info-Theke
Zur Navigation springen Zur Suche springen
 
Zeile 17: Zeile 17:
done
done
chroot /trg
chroot /trg
echo "we have entered the forign system (chroot)!"
echo "we have entered the foreign system (chroot)!"


cd /boot
cd /boot
Zeile 28: Zeile 28:
grub-install $BOOT_DISK
grub-install $BOOT_DISK


echo "use 'exit' to leave the forign system"
echo "use 'exit' to leave the foreign system"
</pre>
</pre>



Aktuelle Version vom 11. Januar 2023, 05:43 Uhr


Grub restaurieren[Bearbeiten]

  • Rettungssystem starten
BOOT_DISK=/dev/sdX
ROOT_PART=/dev/sdX5

setxkbmap de

test -d /trg || mkdir /trg
mount -o subvol=@ $ROOT_PART /trg
ls -ld /trg/bin

for dir in sys dev proc ; do
   mount -o bind /$dir /trg/$dir
done
chroot /trg
echo "we have entered the foreign system (chroot)!"

cd /boot
dpkg-reconfigure initramfs-tools
oder
dpkg-reconfigure linux-image-4.4.5-towo.1-siduction-amd64
oder
initramdfs -v -u

grub-install $BOOT_DISK

echo "use 'exit' to leave the foreign system"

Restaurierung Root-FS von tar-Archiv[Bearbeiten]

BASE=
cp -a $BASE/bin $BASE/xbin ; mkdir /old 
FN=$BASE/M
cat <<EOS >$FN
#! $BASE/xbin/sh
MV=$BASE/xbin/mv
dir=\$1
if [ ! -d "/\$dir" ] ; then
        echo "+++ missing dir: $dir"
else
        \$MV $BASE/\$dir old
        \$MV $BASE/new/\$dir /
        ls -ld $BASE/\$dir $BASE/old/\$dir
fi 
EOS
chmod +x $FN
FN=/A
cat <<EOS >/$FN
#! $BASE/xbin/sh
$BASE/M usr
$BASE/M etc
$BASE/M sbin
$BASE/M var
$BASE/M home
$BASE/M media
$BASE/M opt
$BASE/M root
$BASE/M lib
$BASE/M lib64

echo "get $BASE/old/lib/modules/<kernel>"
echo "do manually: $BASE/M bin"
EOS
chmod +x $FN