my server (Ubuntu) doesn't went right and I think it's because I entered that command:
mv directory/* /*
Yeah, that could really mess things up, if you did it as root. If you think about how the shell would've expanded that, you probably moved everything from /
into whatever the last directory in /
was...maybe /var
?
Do an ls -Al /
and paste in the results here. If you only see one directory, do an ls -Al
of that directory and paste in the results here.
One way to try to fix it is to figure out which files and directories got erroneously moved, find there they are, and move them back into /
. You might do something like this:
ls -Al /
there, to see what files and folders are usually there. echo /*
and make a note of the last directory mentioned in the output of the echo command. I've been guessing that it'll be /var
but that's based on my experience with other Unices and distros, not Ubuntu. ls -Al
of whatever that last directory was, and see if all those files and directories that were supposed to be in /
are now in that other directory. mv
command to move them back to /
. Make sure not to leave the normal contents of that subdirectory alone. You don't wan't to move everything out of /var
and into /
, you just want to move the stuff that was supposed to be in /
.Note that you'll need to issue that mv
command as root, (e.g. by using sudo
).
The real question, of course, is how to fix it. :)
Boot into your Ubuntu LiveCD, mount the filesystem, and move the other contents of your root directory out of /var
(or wherever they ended up).
Would a reboot fix the problem?
Not a chance .. You will have to move the root directories back to the root. Look, this is what happened:
$ mv -v source/* target/*
`source/1' -> `target/3/1'
`source/2' -> `target/3/2'
`source/3' -> `target/3/3'
`target/1' -> `target/3/1'
`target/2' -> `target/3/2'
Look at the last two lines there. That means e.g. '/bin' will have been moved to '/var/bin' on your machine.