LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (http://www.linuxquestions.org/questions/linux-general-1/)
-   -   How to restore my Kubuntu in recovery mode? (http://www.linuxquestions.org/questions/linux-general-1/how-to-restore-my-kubuntu-in-recovery-mode-668379/)

Gens 09-08-2008 09:29 AM

How to restore my Kubuntu in recovery mode?
 
Hello everybody!

Here is my big problem.
My configuration is Ubuntu (KDE) in dual boot with Xp pro.

I made as root by mistake a mv /* /usr/lib/thunderbird

Actually i wanted to type mv ~/thunderbird/* /usr/lib/thunderbird

I guess you can imagine the result.
I can't anymore boot on my Kubuntu and I don't really know what to do in recovery mode to restore my partition.
Is it possible to do something and if yes, can you help me?

NB: I can boot on my Xp OS so i guess my /boot is still alive!
In recovery mode i find my root / in /root/usr/lib/thunderbird that is to say in /root/usr/lib/thunderbird i have:
etc mnt media bin sbin var cdrom ....

Thanks for your help!!!!!

tredegar 09-08-2008 09:46 AM

Welcome to LQ!
You have learnt the danger of working as root :(
You could try (as root) the reverse of the mv command you issued:

Code:

mv /usr/lib/thunderbird/*  /
Then reboot.
Your system may still be broken though (How did you stop the original mv command?)

If still broken, rescue your personal home files, and reinstall.

amani 09-08-2008 10:31 AM

Alternatively use a live cd like parted magic to undo the move. You can do it in GUI mode after mounting the kubuntu partition...with the mouse

Gens 09-08-2008 12:18 PM

Hey,
thank you for your answer.

Tredegar,
i can't do the reverse of the mv command because it seems that he doesn't like it:
Cannot move files, Read only files system.

I am in recovery mode but do you know if the recovery mode loads a kernel in memory or my own kernel in the Hard Drive???

Amani,
the fact is that i can't load my GUI mode. My system is corrupt and even if i start the normal mode, it loads the recovery mode!
So how can i mount my kubuntu partition?

Thank you
Gens

tredegar 09-08-2008 12:34 PM

Quote:

Cannot move files, Read only files system.
Hmmm. Well, we could make it a read/write, but I am not at all sure what you mean by "Recovery mode", and do not wish to offer bad advice.

It may be best to boot from a live-CD. You already have one - the CD / DVD you used to install kubuntu (you were using KDE, Yes?).

Then you can (rather slowly, as you are running from the CD, not your HDD) mount your broken root filesystem, move the files back, and try rebooting (it still may not be fixed).

This is all best done from the command-line, NOT the GUI. I'll talk you through it if you need help. So ....

Can you boot from your original install CD?
Do NOT click on the "Install" icon! Just check that you can boot to a live distro, give us the output of
Code:

sudo fdisk -l
(that's "ell" not "one") in a terminal then shut it all down and come back here.

Further Qs:
Do you have any important personal data in /home/gens that you need to recover / preserve?
If so, do you have a USB external HDD or memory stick large enough to backup your personal data ?

You didn't answer "How did you stop the original mv command?"

Gens 09-09-2008 06:39 AM

Hello Tredegar,

By recovery mode i mean when i boot i have 2 options, start ubuntu in normal mode or in recovery mode (the same thing exists with Windows by pressing F8 at the boot menu).

I don't think i have the live-cd i used to install my ubuntu but i may download it again. Yes i use KDE.

Ok i think taht this is the best idea. I'm gonna download the Live-CD and repair my files by mounting my broken files system, like you said, if it works.

As soon as i boot on the live Cd, i will give you the result of the output
Code:

sudo fdisk -l
In my home directory, i have nothing very important but i'am going to check out.

For the original mv command, she stopped by itself a few seconds later.

Thanks for your advice.
Gens

Gens 09-13-2008 11:50 AM

Hello everybody,

That's it, i have solved the problem!

The solution was the Live CD (ubuntu or others Linux distribution):

Boot from the live cd and then:
Code:

cd /media && sudo mkdir kubuntu (for example)
and
sudo mount /dev/XXXX /media/kubuntu

where XXXX represents the partition where is installed your linux distribution (actually the root /). It can be hda1, sda1, sda2, sdb1...

This, to mount my linux partition in media of the LiveCd.

Then, just doing the inverse command of my mistake
Code:

sudo mv /media/kubuntu/usr/lib/thunderbird/* /media/kubuntu
and THAT'S IT.

If that can help someone, it is cool!
Thanks and see ya.

amani 09-13-2008 11:56 AM

After mounting it as you did, you can just cut and paste in the Live CD GUI. That is what I said.


All times are GMT -5. The time now is 03:08 PM.