Command mistake

RenDprogrammeur

New member
Joined
Sep 21, 2005
Messages
53
Location
Netherlands
Hello,

By an command mistake i removed the /bin folder now i can make an bin folder again in ftp or in putty.

Does some one know how to fix this ?

Can i wget a folder or some ?
 
Hé, een Nederlander :).


Uhhm, you removed your /bin on a server?
Basically that kinda means you're scr*wed...

You might be able to get 'someone elses' /bin, but you're gonna have a lot of problems restoring this.

Example, Bash resides in /bin, mount resides in /bin, su resides in /bin, mv resides in /bin, same with tar and gunzip.

Best case scenario, you can get it to work again, although you should reinstall.
Worst case scenario, you have already logged out of the shell session, you can't get a shell, and the system dies...
 
Easiest way, if only the /bin directory was deleted ...

is to build another system with the same OS.

Then remove the broken drive from the broken server and make it a second drive in that new system.

Mount the / partition; call it baddrive or similar; mount it as /mnt/baddrive.

Copy over the entire /bin directory this way:
Code:
cp -p /bin /mnt/baddrive/
Note that unless you know what you're doing, this can break everything.

Jeff
 
I am not sure about other Linux distros, but RedHat/Centos CDs can be booted in "rescue" mode where you actually boot off CD with a minimal OS install and your current system mounted somewhere in /mnt.

Just copy over /bin from there, you should be fine :)
 
That's a good point, Webcart. But did you check to make sure that both installs have the same contents? I generally don't post untested results, and there was no indication of what OS distribution was being used, so frankly, I didn't even think of it.

I'm glad you did, but I'd love to know if anyone's checked to be sure the contents are the same.

If you know it works, then for those of us using releases with a rescue function (and for which the /bin contents are the same) it could be a timesaver.

Jeff
 
jlasman said:
That's a good point, Webcart. But did you check to make sure that both installs have the same contents? I generally don't post untested results, and there was no indication of what OS distribution was being used, so frankly, I didn't even think of it.

I'm glad you did, but I'd love to know if anyone's checked to be sure the contents are the same.

If you know it works, then for those of us using releases with a rescue function (and for which the /bin contents are the same) it could be a timesaver.

Jeff

Jeff, I am not entirely sure as to what you mean by "the same content". Are you talking about the same set of tools? Or you want to make sure both /bin directories have identical binaries?
Either way, the rescue disk has all the tools necessary to boot the system and perform basic maintenance tasks - that's a fact.
May be something is missing, but it's surely enough to have the ball rolling.

Your solution should work too, though, I don't think it's a "tested result" either ;) However, it's not as practical, especially for folks who have to manage boxes remotely :)
 
Yes, my error. I meant that both /bin directories would have the same content.

It's certainly worth a try.

Jeff
 
Back
Top