Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Restore /usr/bin from CD

Status
Not open for further replies.

sunguru99

MIS
Dec 3, 2003
13
0
0
US
I have accidentally deleted the /usr/bin directory from my system. How do I restore this file from my CD? I am running Solaris 9 with Solaris 9 CD. I have no current backups of the file, but I know that you can restore it from the CD. Could someone please tell me how to do this?
 
Is the system is up and running? If you have another system running Solaris 9 on it you can do rcp "/usr/bin" directory from that system.
#cd /usr
#rcp -r bin damaged systemname:/usr/

If not,
1. boot the system from cdrom.
OK> boot cdrom -s
2. enter system root passwd.
#ls (you may see /bin directory)
3. mount /usr on /a
#mount /dev/dsk/c#t#d#s# /a
4. Copy "bin" directory from the CD
#cp -r bin /a/ or (#tar cvf /a/bin.tar bin;#cd /a/;#tar xvf bin.tar;)
5. Make link to root directory
#ln -s /a/bin /mnt/ (you can mount root partition on /mnt or you can do this after reboot)
#init 6 or reboot

I did this for /usr direcotry two ears back because of damaged disk.

Hope this helps.

 
bsek.
It would be better if you used tar -xvfp to get the bin directory. The reason for this is the "p" option will save the owner/group information on all the files.
 
Yes, this worked. I got the /usr/bin directory from the CD. This is what I did:

boot cdrom -s
mount /dev/dsk/c#t#d#s# /mnt
cd /usr
cp -r /usr/bin /mnt/usr/bin
umount /mnt
boot

And there I have restored /usr/bin to the system.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top