Showing posts with label recovery. Show all posts
Showing posts with label recovery. Show all posts

Friday, April 3, 2009

Don't panic if something breaks!

In Ubuntu, you could screw up things if some of the startup files are mangled. I accidently wrote something wrong in the /etc/environment file. (Unlike other Linux implementations, Ubuntu keeps the enviroment settings in the /etc/environment file) This can be a bit of a bother for some utilities that require some settings that are normally kept in the .bash_profile file of the user (That is what I've come to know so far but I guess I need to investigate this further)

Anyway, to cut a long story short; I ended up fouling /etc/enviroment. When I restarted the computer, it gave a scary warning "Your session hardly lasted 10 seconds" and someting more about possibly running out of hard-disk space (which obviously was wrong because it was practically a squeaky clean computer)

After hyperventilating for a while, I managed to calm myself down. Fortunately, I have developed this habit from quite some years... of remembering the last few things exactly. So that just in case something like this happens, you know how to retrace. I know many others who go about doing things in a daze and then cannot undo what they have done. Basically you need to keep a log of activities. Whether you do that in your head or otherwise is your choice.

So I realized that it must be to do with the stuff I wrote in the /etc/enviroment file. It struck me that the Ubuntu 8.1 is actually a live disk. I placed it in the drive and booted from it as if nothing had happened. I could get into the system. I opened up a terminal window. Then I gave a "sudo" command to give myself editing rights (which does not have a password ... because you loaded from the Live CD ... but you have to give the command nevertheless.) Now the hard-disk location had conceptually moved it was now under /media/disk1 or something like that ( In other other computers I can imagine it to be different). So I loaded /media/disk1/etc/environment into the nano editor and removed the offending lines that I had written earlier, and I saved the file.

Now when I rebooted everything was in order