Systemrettung: Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
(4 dazwischenliegende Versionen von 2 Benutzern werden nicht angezeigt) | |||
Zeile 6: | Zeile 6: | ||
BOOT_DISK=/dev/sdX | BOOT_DISK=/dev/sdX | ||
ROOT_PART=/dev/sdX5 | ROOT_PART=/dev/sdX5 | ||
setxkbmap de | |||
test -d /trg || mkdir /trg | test -d /trg || mkdir /trg | ||
mount $ROOT_PART /trg | mount -o subvol=@ $ROOT_PART /trg | ||
ls -ld /trg/bin | |||
for dir in | for dir in sys dev proc ; do | ||
mount -o bind $dir /trg/$dir | mount -o bind /$dir /trg/$dir | ||
done | done | ||
chroot /trg | chroot /trg | ||
echo "we have entered the | echo "we have entered the foreign system (chroot)!" | ||
cd /boot | cd /boot | ||
dpkg-reconfigure initramfs-tools | |||
oder | |||
dpkg-reconfigure linux-image-4.4.5-towo.1-siduction-amd64 | dpkg-reconfigure linux-image-4.4.5-towo.1-siduction-amd64 | ||
oder | oder | ||
Zeile 23: | Zeile 28: | ||
grub-install $BOOT_DISK | grub-install $BOOT_DISK | ||
echo "use 'exit' to leave the | echo "use 'exit' to leave the foreign system" | ||
</pre> | |||
== Restaurierung Root-FS von tar-Archiv == | |||
<pre>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 | |||
</pre> | |||
<pre>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 | |||
</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