# /sbin corrupted



## drpaudel (Jul 26, 2010)

My server is not functioning due to unknown reason. It doesnot boot normally and throws 
	
	



```
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.


----------



## fbsd1 (Jul 26, 2010)

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.


----------



## SirDice (Jul 26, 2010)

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.


----------



## kpa (Jul 26, 2010)

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.


----------



## vivek (Jul 26, 2010)

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?


----------



## SirDice (Jul 26, 2010)

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.


----------



## drpaudel (Jul 27, 2010)

After replacing /sbin from fresh installed system following errors are seen.

```
Attempt to query device size fail: Not Ready. media Not Present
Mounting root from ufs:/dev/da0s1a
```
and 

```
/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..


----------



## da1 (Jul 27, 2010)

hmm .. maybe rebuild world ?


----------



## SirDice (Jul 27, 2010)

You have some serious filesystem issues!

Backup everything you still have in /etc/. This should restore /etc/ to a reasonable state:

```
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.


----------



## drpaudel (Jul 28, 2010)

*Solved*

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


----------

