Top: Index Previous: Protecting Up: Index Next: Windowing

CSC8306 -- Systems Administration

Introduction

Systems have a tendency to crash. Sometimes for accidental reasons, sometime for malicious reasons, sometimes hardware and sometimes because of breathtaking displays of incompetence.

Linux systems are generally relatively secure and controlled. They are most susceptible, therefore, to displays of incompetence from the systems administrator. Being able to recover a system which you have just broken is, therefore, a very useful skill.

Warning

In this practical, we are going to perform actions which have a reasonable likelihood of breaking your system irrevocably. If this happens, you will have to re-install. Re-installation happens to us all at times, and you should not feel embarrassed if this happens. However, you SHOULD feel very bad if you have not backed up all of your user files first!

Do this now, if you have not done so.

A hardware failure

One of the most useful files on linux is /var/log/messages. It is where most of the information about the system goes.

act
  1. Open /var/log/messages in an editor, and familiarise yourself with the format.
  2. Now, hard reboot your system (VM->Power->Power off and ignore any warning messages). This simulates a system failing totally.
log
  1. Locate /var/log/messages the point at which the machine was turned off.
  2. What information is there about the cause of the system failure?

A more realistic failure

Next, we are going to take most of the memory out of the system, and see what effect this has on it.

logact Go to VM—>Settings—>Memory

Reduce the memory to the minimum (which should be 4Mb). Now hard reboot.

Record the error message that you get. Now increase the memory by 4Mb (to 8Mb), again record the error message. Increase the memory by 4Mb, until the system fully boots, recording the error messages you see.

Answer the following question:

  1. What is a kernel panic?

I think Fluffy is dead, Jimmy

The last problem was relatively minor. Now, we need to work on something more serious.

Download problem_creator and run it as root. Now reboot as normally.

log
  1. What error messages do you get during the reboot?
  2. In this case, you have damage to your kernel. What is the system kernel? For your operating system, what is the kernel called?

Kernel damage is hard to repair because your system is so broken, that you can't get it to work to repair in the first place. Again, we are going to re-install the broken sections of your system. It's harder this time.

Follow these instructions as closely as you can.

act
  1. Make sure you have the iso image from earlier (or download it!). Make sure that the virtual CD-ROM is still connected (or reconnect it!)
  2. Restart the system. As soon as the virtual system powers up, you need to hit F2 to get into the boot selection. There's a knack to this (and a cheat should the knack fail). If you have problems, ask me. Or better google.
  3. Select the boot menu, CD-Rom and hit "+". CD-Rom should now be in front of Hard Disk. F10 to save and reboot.
  4. The system should now boot from the CD-ROM. When it gives you the option try "Try Ubuntu without changing your computer".
    • You may have problems getting this to work. Make sure that your virtual CD-ROM is actually connected.
  5. Eventually you will get a desktop; this is not "your desktop" it's the CD-ROMs version.
  6. You need to find a linux-image package for your system1. There are a number of places you can get this from. Try and work out where.
  7. Now do the following
mount /dev/sda1 /mnt
cp  ~/Desktop/linux-imagexxx.deb /mnt/tmp
chroot /mnt
dpkg -i /tmp/linux-imageXXX.deb
exit
umount /mnt
reboot
  1. With a bit of luck, your system should be working again.
  2. If you lack luck then, well, you know how to install a system from scratch.

This section is pretty hard — try it a few times, but you may fail. There are a number of lessons from this; one is never, ever, download a perl script from the web and run it as root, even if someone very nice tells you to.

log Try and explain what you have just done, with reference to what the various commands mean. Try and explain why each of them are necessary.

1. There are likely to be several versions available. If you do not know which kernel version you have, you should be able to work it from the information that you have.


Top: Index Previous: Protecting Up: Index Next: Windowing