/sbin corrupted

My server is not functioning due to unknown reason. It doesnot boot normally and throws
Code:
init: can't exec getty '/usr/libexec/getty' for port /dev/ttyv0: No such file of directory
Login from single user mode I found that /sbin directory is not there. I tried to copy /sbin directory installed from other PC but couldnot copy. Please suggest the best possible solution so that i can rescue it.
 
Since /sbin is missing maybe other system directories are missing also. This is just the case when you restore your latest backup. If you dont do backups them this is your wake up call to start. Your server is compromised. You have no idea what else has been done such as leaving a trojan behind to take over your box. If no backups, install 8.1 from scratch.
 
fbsd1 said:
Your server is compromised.
What ever gave you that idea?

You have no idea what else has been done such as leaving a trogan behind to take over your box.
It's called a trojan and it's very, very unlikely.
 
There's not enough information here to deduce that such security breach has happened. The first thing to check is the health of the hardware, harddisks in particular, before jumping to conclusions.
 
Boot server into a single user and run fsck (this can be done remotely too if you've access to kvm). Did you made any changes recently such as upgrading system?
 
Most likely cause is user error :e
Followed by some harddisk/filesystem screw up

If you still have your source tree around from the last update you could try to cd to /usr/src/sbin/ and do a make install there. None of the build tools live in /sbin/ so it might work.
 
After replacing /sbin from fresh installed system following errors are seen.
Code:
Attempt to query device size fail: Not Ready. media Not Present
Mounting root from ufs:/dev/da0s1a
and
Code:
/etc/rc: can't open /etc/rc:No such file on directory
Enter full path of shell or return for /rescue/sh:
I found that /etc/rc is not available and for every attempts it says read only..
 
You have some serious filesystem issues!

Backup everything you still have in /etc/. This should restore /etc/ to a reasonable state:
Code:
cd /usr/src/etc/
make install

You will have to restore your own rc.conf and perhaps a few others.

If you still are missing things, backup your data and just reinstall. It'll be much quicker then trying to figure out what to do next.
 
Solved

Dear SirDice,
Thank you very much for your suggestion. I solved the problem according to you. Now it work fine. Cheers !!
 
Back
Top