Help needed! Command ruined server..

PeterB

Verified User
Joined
Mar 2, 2005
Messages
30
Hi everyone,

Something realy stupid happend at my server just some minutes ago, I was moving some files, but Putty failed to send a dot;

mv -f ./*../

But the server recieved it without the dot. Now everything has stopped working, the only things that actually are working are PHPMyAdmin, webmail and IRC, FTP and E-mail are working too, but the passwords seem to be wrong, and HTTP does not deliver any webpages. SSH is out too.

My guess is that all the files are in the /home/admin/public_html/ dir, the '../' location, but how can I get them back to /..

What can I do to restore this? It's a busy webserver, and I realy need to fix it soon...

Thank you in advance,
Peter

PS: DirectAdmin isn't working too..
 
Last edited:
I think you need to go to the datacenter and logon directly into the server and repair the damage. This is the only way you can solve this i guess.
 
This is going to be a bit of a problem, I guess...

Usually I'd say this isn't a real problem, as you're moving the / to ../ which is also the /.

When I try it here (on 1 file), it gives back:
mv: `/prg2.jar' and `../prg2.jar' are the same file.
However, I did this from the root.

So if you can still login at the datacenter (DO NOT REBOOT), go to the right location, and it should be something like:
mv -fv ./* /
Or something.

However, you are very lucky if you can still login, as the bash binary has also moved.
You can't start it up, as your /boot has also been moved.

If you can't login, your best try is to reinstall from backup, I guess. Or do it from an OTHER linux environment, where you mounted the HD in question. However, make sure you use the correct commands then...
 
I'll try to get to the datacenter, since I'm not 18 years yet, transportation is a bit of a problem, but this seems as the only solution. I've got a knoppix live-CD which I'll try, and if it doesn't work, a format will indeed be needed. I've got a full system-backup from last thursday, let's just hope I might restore most of the important files...

I'll let you know if it worked..
 
With a working Knoppix CD, you can easily do it without resorting to backups.

All you have to do is use it as live cd, create a dir where you can mount the server drive, mv everything back to right place and try to boot it. However, i don't know if mv'ing destroy's symlinks or anything, so prepare to resort to backups, but just be happy if that's not needed.

Just know, restoring a DA backup is a bigger bitch than working an hour to mv and repair everything correctly... (No offence John, but system wide restore just plain sucks)

If you read this on time: good luck :).
 
Here's the bad news...

First of all, Icheb... moving / to ../ only means the same thing if you're already in the / directory when you run the command. Peter has already told us that he was in a subdomain of /home/admin/public_html/ when he issued the command. :(

The other problem of course is that he'll have to look at all the files now in /home/admin/public_html and figure out where they belong.

It's doable, depending on one's experience with linux, one's access to another server with the same configuration to look at, and a lot of patience.

Otherwise it's a full restore of OS and DA, and then a backup restore.

:(

And Peter, I'd say it's highly unlikely that ssh could drop the dot.

Good luck.

Jeff
 
Back
Top