Props to the mirrors

After having “debootstrap”-ed my home firewall three times in the last week due to harddrive failure, all I can really say is:

1.) Reliable disk space is worth every cent
2.) Knowing how to recover from a hdd going click-click-click is a boon.
3.) Andrew Alston and the TENET team deserve props to the 1+E06 for maintaining debian.mirror.ac.za

If it wasn’t for my ability to bootstrap a system quickly via HTTP, I’d have really been up the proverbial shit creek.

CDROM media is *so* 90’s.

In case anyone really cares, the simplest way to recover from a major HDD crash on a debian system is to get the debian-live rescue CD, and bootstrap a new system like so:

mount /dev/sda1 /mnt (new partition already formatted with your choice of filesystem evil)
debootstrap --arch amd64 squeeze /mnt http://debian.mirror.ac.za/debian
mount -o bind /dev /mnt/dev
LANG=C chroot /mnt /bin/bash
echo foo >/etc/hostname
mount -t proc proc /proc
apt-get install linux-image-2.6-amd64
apt-get install grub
grub-install /dev/sda
update-grub
passwd root
apt-get install ssh
reboot

Et voila. A basic debian system. This can also be neatly used to usurp an existing (e.g. Redhat) system if you can get hold of all the debootstrap perl code and dependancies.

Having a broadband connection available is obviously extremely useful.

I managed to do all of this via my Windows machine after having installed a tiny http proxy. Thus I could simply use

http_proxy=http://192.168.0.8:3128/ apt-get install or
http_proxy=http://192.168.0.8:3128/ debootstrap squeeze /mnt http://debian.mirror.ac.za/

I’ve used this technique before as well with SSH tunnels to a target system that didn’t have internet access, whereas my local desktop did.

Cheers TENET.

Author: roelf on September 13, 2010
Category: Uncategorized

Leave a Reply

*

Last articles