Results 1 to 6 of 6
I am new to linux, and have only been using it for a month now. Today I issued the following command: mv /* /var/www because I was trying to move ...
- 12-04-2009 #1Just Joined!
- Join Date
- Dec 2009
- Posts
- 3
HELP!!!! I moved my entire root directory somewhere else!!!!
I am new to linux, and have only been using it for a month now. Today I issued the following command: mv /* /var/www because I was trying to move all the files in the folder to the web root. I know now that I was supposed to add a period before /* to make it ./*.
UGH! Is there any way to revert this? I can't even use simple commands like ls because it gives me the following error: bash: /bin/ls: No such file or directory
I'm hoping I can at least recover my files! I absolutely HATE myself at this very moment. Any help would be greatly appreciated!!!
- 12-04-2009 #2
you could try the following:
1) boot a live CD such as Knoppix
2) mount / and /var/www (the later only, if it is separate partition)
3) cd to <MOUNTDIRECTORY_OF_YOUR_CHOICE>/var/ww
4) mv everything, that is not supposed to be there to <MOUNTDIRECTORY_OF_YOUR_CHOICE>/
5) unmount the two dirs again
6) reboot from harddisc
This should work.
If not, save all important files. (aka config, homedirs, data like /var/www and possible the logs), then re-install.
- 12-04-2009 #3Just Joined!
- Join Date
- Dec 2009
- Posts
- 3
Hi Irithori,
Thanks for the suggestions. It makes sense to me. However, do you have any pointers on how to do step 2? how do I mount the internal hard drive? Also, when I boot from a live CD will I have access to a working mv command? Right now it deosn't seem to work on my system.
- 12-04-2009 #4
knoppix will offer you a fully working linux.
including mv
2a) sudo su -
2b) fdisk -l
2c) identify your root partition. you need the device name (like /dev/sda1)
2d) mkdir /mnt/root
2e) mount /dev/<YOURDEVICE> /mnt/root
After you are finished with moving files around, unmount the partition
unmount /mnt/root
- 12-04-2009 #5Just Joined!
- Join Date
- Dec 2009
- Posts
- 3
You are the best man! I followed your directions exactly and I'm back to normal. The only discrepancy was I had to use umount instead of unmount :P.
Thanks again!
- 12-04-2009 #6


Reply With Quote
