Benutzer:Peter Littmann/Debian Wheezy rescue system bei Kimsufi

Aus Wikibooks
Zur Navigation springen Zur Suche springen

Diese Anleitung basiert auf einem Forumpost von heise.

# Set the language environment
export LANGUAGE=C;export LC_ALL=C;export LANG=C
mkfs.ext4 /dev/sdb2
mkdir /mnt/sdb2;mount /dev/sdb2 /mnt/sdb2
mkdir /mnt/sdb2/nfs
rsync -avHAXS /nfs/ /mnt/sdb2/nfs
rsync -avHAXS --exclude=/mnt --exclude=/nfs --exclude=/proc --exclude=/dev --exclude=/sys --exclude=/run / /mnt/sdb2
mkdir /mnt/sdb2/proc;mkdir /mnt/sdb2/sys;mkdir /mnt/sdb2/dev;mkdir /mnt/sdb2/mnt;mkdir /mnt/sdb2/run
mv /mnt/sdb2/power /mnt/sdb2/power.bak
mv /mnt/sdb2/etc/ovh /mnt/sdb2/etc/ovh.bak
mv /mnt/sdb2/etc/ovhrc /mnt/sdb2/etc/ovhrc.bak
mv /mnt/sdb2/etc/init.d/ovh.sh /mnt/sdb2/etc/init.d/ovh.sh.bak
touch /mnt/sdb2/debian.rescue
unlink /mnt/sdb2/boot;mkdir /mnt/sdb2/boot
rsync -avHAXS /boot/ /mnt/sdb2/boot
mount -R /proc /mnt/sdb2/proc
mount -R /sys /mnt/sdb2/sys 
mount -R /dev /mnt/sdb2/dev

# going chroot
chroot /mnt/sdb2
apt-get update
apt-get upgrade
apt-get -t wheezy-backports install qemu
# optional packages: libasound2-plugins libglide3 pulseaudio qemu-user-static samba vde2 sgabios
apt-get install grub2
dpkg-reconfigure grub2
cat /etc/mtab >>/etc/fstab
blkid
nano /etc/fstab         # remove the nfs mounts and add Canonical / device
mkdir -p /run/lock /run/shm
mdadm --examine --scan >> /etc/mdadm.conf
grub-install /dev/sdb
mount -a
apt-get install linux-image-3.2.0-4-amd64
apt-get -t wheezy-backports install linux-image-amd64
nano /etc/network/interfaces   # enable auto lo and auto eth0
apt-get install --reinstall isc-dhcp-client
apt-get install --reinstall dhcp-probe
echo furlab-recovery >hostname

# switch to hard disk boot in your control panel
exit
shutdown -r 1