Discussion Locked

etc files deleted

0 helpful
7 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

pls can anyone help with this,
i wrote a script that mistakenly deleted my etc folder . now i cant log on, is there anything i can do apart from reinstalling.

7 replies

by cpfeiffe

If /etc is gone you can't get on the network so you won't be able to just restore from backup so easily. What you can do is 'boot cdrom -s' from the installation cd and 'mount /dev/dsk/c#t#d#s# /mnt' to mount the system root slice to the CD. Once that is done you can copy the files from /etc/ on the CD to /mnt/etc (the disk /etc). Then you can edit the hosts, hostname.? and netmasks files in /mnt/etc to hopefully get on the network. A lot of config files won't match up, but at least this may get you on the network. You can also edit your /mnt/etc/passwd and /mnt/etc/shadow files to set the password to nothing and then change it after you log on. Losing /etc may be unrecoverable, depending on your system's configuration up to this point, but this gives you the best chance. Once you are back on the network you should do a full restore of /etc. Good luck.

by hungry cat

The only way in most cases is to mount your HD to some file system (emergecy floppy/cd, other working fs) before doing smth. At least it is recommended for you to specify OS 'cause here is some OS-specifed tricks, for example, on FreeBSD you can use/etc backups done on last system cvsup automaticly, some system automaticly backup /etc and more. At least use /etc from emergecy repair media or other fs. Don't forget to correct /etc/fstab - like files.

This discussion is closed to new replies.