I have the same problem with my iBook G4 and what I found was that the main board was dropping the power for the hard drive. Try using an self powered external USB hard drive to boot from. This will have to have the OS installed.
If it boots up and does not have any problems it is probably the power to the hard drive otherwise you have a temperature problem.
My experience with Ubuntu is that it requires more than 3GB of hard drive and it also needs a swap drive. You can use the Disc Utility to partition, but this will wipe what is on the hard drive. Boot camp might be used without loss of data.
If you have a multimeter you should be able to check the output of the power supply. If the output from the power supply is good than it is probably your battery. If I remember correctly the battery had to be installed to power up the laptop even with the power supply.