First and formost, you are entirely responsible for your own actions. This is an experiment in progress, and if you don't understand what you're doing then you shouldn't be tagging along. This document is here to save those who could work all this out for themselves a few hours of head scratching & frustration.
At this point our restore image has no boot sector. We are about to knowingly render our EEE-PC system unbootable.
This is why we made a rescue feature in our restore key… (
) …didn't we.
This part of the tutorial will involve wiping the WHOLE hard disk of the EEE-PC with a mix of data and zeros. The boot sector will be wiped with zeros! That's bad.
If you don't understand what that means, stop now. You are about to deliberately bork your system and then unbork it.
Do you feel lucky?
If all has gone well, the system will pause for 15 seconds while the USB subsystem 'settles', then find the EEE-PC hard disk, at /dev/sda, then find that there is no longer a disk at /dev/sdb… …then find the USB restore key at /dev/sdc. (Of course all this (
) assumes you're smart enough to unplug all other USB hard disks…)
It will then ask if you wish to proceed with erasing and re-imaging your system.
NOTE: The answer to this question is entirely in your hands.
If you choose to say “yes”, the screen will clear and a message will appear telling you how many blocks we expect to write. It will then tell you that the install will take 10-15 minutes. Mine takes almost exactly 13mins.
NOTE: The screen will blank after 10mins of inactivity. Don't panic. You can hit any regular key to re-activate the screen.
After the image has finished copying, PLEASE ignore the instruction to remove your USB key until later. It will wait for you to hit [enter]. Upon hitting enter, the system will reboot from our USB restore key. At the USB restore key's grub menu, hit the down arrow a couple of times to prevent auto-booting to the rescue image. The system will now pause at the grub menu.
We will now use the restore key's grub install to unbork our EEE-PC's boot sector. We are paused at the grub boot menu. hit [c] to enter the grub command line and perform the following commands.
grub> root (hd1,0)
grub> setup (hd1)
grub> reboot
and NOW we unplug our USB key, and the EEE-PC reboots from it's internal hard drive,
It will ask you to perform the initial device setup, (real name, password, timezone, etc…)
At this point you will either be very happy, or not very happy at all. I have a well configured debian-ish system with Xandros' rather slick 'user' friendly interface that's tightly integrated with the hardware on a consumer laptop. What do we need to finish it off? SIMPLE BACKUP & RESTORE!
Before we customise like mad idiots, let's fold our known good system back into the system restore image… (>_<) …Patience!
PLEASE NOTE It seems to be worth noting for the less perceptive out there, that our system restore key quite deliberately finds the hard disk containing the restore image on partition 1, by looking for an unusual filesystem type with a particular size on partition two of the same disk… …this enables substantial flexibility with the size and content of the partition holding the restore image (or images…). The only real constraint from the script provided is that the image partition contain an ext3 filesystem. If you've succeded in making it this far, you'd no doubt find it trivial to remove or adapt even this constraint. In fact, you could probably do it from within the rescue image in about ten seconds… (
) …including the time taken to set the REEESTORE variable to something…
With that said, let's continue.
This will take you to a busybox shell with proc and sys mounted, and with relevant kernel modules loaded:
mount -o ro /dev/sda2 /mnt
chroot /mnt /bin/bash
su
Assuming the rescue key is at /dev/sdb (it may end up at /dev/sdc, depending on how you booted)
mount /dev/sdb1 /mnt
the next command is 'optional'. again, it depends on how close to the wind you like to sail.
mv /mnt/loop-eee.gz /mnt/loop-eee.bak
Copy the EEE-PC's root filesystem over the restore image on the USB key
dd if=/dev/sda | gzip -c -9 > /mnt/loop-eee.gz
make coffee. When it's done, unmount the USB key
umount /mnt
Hit [CTRL]-[d] to exit 'su' and again to exit the changeroot jail, (you really shouldn't hit it a third time. Let's be nice.) then unmount the EEE-PC's root filesystem
umount /mnt
reboot the system
reboot
and pat yourself heartily on the back for a job well done.
Obviously if you want to update the restore image at any stage in the future, you just repeat the steps in this last section again… rio b and you sfr