Last night I was working on my ubuntu server and suddenly it just crashed with multicoloured bars on the screen, automatically it logged me out
and I lost my database indexes
I tried to mount my harddisk on my pendrive which has DSL installed in it
I rebooted my system and grub started acting weird, so I was left with no choice but give up my GUI.
Here is where the fun began at night 3
If your system does not boot and there is no hope of restore you have to convince yourself to take back up of the data, databases, etc. and go ahead with re-installation of the entire machine.
Here is How you manage grub when it acts weird (I cannot explain 'weird' here, pardon me)
hitting 'e' is to edit.
1. Hit 'e' on your keyboard as soon as you see grub loading
2. select the kernel.
3. Hit 'e'
4. select the line starting with the word 'kernel'
5. Hit 'e'
6. type the word "Single" (without quotes) at the end of the line and hit enter.
7. Hit 'b'
You are now logged in as root in your machine, you can even retrieve your password by typing 'passwd', if you have forgotten it!
and mount your main partition.
I recommend all of you to have pendrives you, one with DSL installed in it and the other for backup. You may require them at the time of emergency.
now mount your pendrives on the local folder for easy access.
# mount /path/to/usbstick /path/to/localfolder
# path to usbstick can be "/dev/sdb" or "/dev/sdc" etc.
If you use MySql and haven't created back up, do it now by:
# mysqldump -u "username" -p"password" "database_name" > FILE.sql
Sometimes, our data is large and space is less, in that condition you want to prefer compressing your folders before transferring them to back up drive.
# tar -cvf filename.tar folder/to/compress
# tar -czvf filename.tgz folder/to/compress
tgz = tar.gz. tar - archieves the folder into one file and then gzip compresses it. simple?
use copy command to transfer your files
which will be somewhat like this:
# cp -rv /your/dirs/files/to/backup /your/mounted/local/folder
# umount /path/to/usb/stick
Don't forget to unmount your pendrive before you remove it!