Summary: Urgent!

From: Zhiyi Huang (
Date: Thu May 30 1996 - 10:55:15 CDT

Thanks a lot to all of you who give me very good suggestions.

I've solved my problem by:

1) Using 'tar' command to copy "mount" and "" to a floppy;

2) Boot the system from a CDROM, install miniroot to my system disk's
swap space (partition "b");

3) Using 'tar' command to copy "mount" to my just-installed miniroot's
"/bin" directory from that floppy;

4) Using "mount" to mount my /usr's partition to /mnt;

5) Using "tar" to copy "" to /mnt/lib/ from that floppy;

6) reboot.

My original question was:
>I removed /usr/lib/ by mistake. I cannot type in any command now.
>Please help!
>Thanks a lot!

Here are some good suggestions:
1) From: Kris Briscoe <>
Subject: Re: Urgent!!! /usr/lib/

boot cdrom, create mini-root, and recover from backup tape.

2) From: Anders Hammarquist <>
He, that's not fun I bet. If you can NFS-export /usr/lib/
from somewhere you should be able to get your system up using the
following procedure...

If you are NOT running sh, start /sbin/sh (statcially linked version
of sh - doesn't need If your system is down, boot it
single-user. That will hopefully drop you into an sh shell...


shcat() {
        while test $# -ge 1
                while read i
                        echo "$i"
                done < $1
then mount the filesystem with on an existing directory (mkdir
is not statically linked :( ) using

/sbin/mount box:/path /local_path

(/tmp is probably a good place if you rebooted the machine)

and then comes the fun part - copying

shcat /path/to/ > /usr/lib/

Now, if you rebooted you may need to fsck /usr before you can write to
it. Do

/etc/fsck /usr (or possibly special)

and then

/sbin/mount -o remount /usr

if none of this works, or if you can't find to NFS from
somewhere you need to boot from tape/cd/net and reinstall from
there. (If you can boot net, you can probably find an to NFS on
the boot server)

Good luck!


3) From: Venkata Ramakrishna R <>
you have to physically attach this disk to the other system and copy I think this is the only option you have.


4) From: Herbert Wengatz <>
To: Zhiyi Huang <>
Subject: Re: Urgent!!! /usr/lib/

Reboot the system via CDROM or tape, install a mini-Solaris into your
old swap-space, then try to install networking support and try to get an
equivalent from another machine. (Mount you old "/usr" first!)

Lost of work, not easy to explain all that. - Else: reinstall your whole
(Hope you do backups regularly...)

Good luck!


5) From: Matt Hill <>
Subject: Re: Urgent!!! /usr/lib/

if you only moved it, not removed it, then you can use sln
(statically linked ln) to link it from the correct place, to get back
up and running again. you should still be able to use all the shell
built in commands, such as cd and echo. remember you can use echo *
as an acceptable ls.

if you actually removed it from your system, then no dynamically
linked programs can run until you get it back. since cp is
dynamically linked, you can't just copy it back. you will need to
halt your system (crash it if you have to) then find your original
SunOS install cd and bring the system up with a miniroot. then mount
the necessary filesystems from your hard drive onto the miniroot and
copy the file back from the cd.

                        Judy Z. Huang Tel:(908)699-3551 Beeper:(908)633-3181
Bellcore, 6 Corporate Place, Piscatway, NJ 08854-4199

This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:11:00 CDT