1752277 Members
4623 Online
108786 Solutions
New Discussion юеВ

Re: moved /usr/lib

 
SOLVED
Go to solution
Rachel Smith_1
Occasional Advisor

moved /usr/lib

OS : HPUX 11.00

I accidentally moved /usr/lib to /usr/lib2!! Now I get the message when I run most commands :
# ln
crt0: ERROR couldn't open /usr/lib/dld.sl errno:000000002

I have tried to set the SHLIB_PATH, which works, but chatr doesn't - so it doesn't help to add /usr/lib2 to the search path.

I have been trying to use the recovery cd to move the lib2 directory back to lib, but I need some instruction on how to do this.

So far, I can boot to my recovery cd where I can choose to load cp, mv, mount and other tools. After that I chroot_lvmdisk to get to my root directory but there isn't a /usr/lib2 available. How can I get this and once I copy it over how can I force these changes to take affect when I reboot???

Thanks!
7 REPLIES 7
Helen French
Honored Contributor

Re: moved /usr/lib

Check if /usr file system is mounted? If not, mount it first and then check for lib2 directory. If you just moved lib to lib2, you can just move it back the same way:

# mv /usr/lib2 /usr/lib
Life is a promise, fulfill it!
A. Clay Stephenson
Acclaimed Contributor

Re: moved /usr/lib

This isn't so hard to fix. Shutdown and boot in single-user mode by interrupting the boot process. Then enter hpux -is and Interact with IPL? N. You will then come up as root with oonly / mounted. All the utilities in /sbin are statically linked so that /usr/lib is not needed. You can then mount /usr -- an fsck will probably be required first. Then you can use /sbin/mv to mv /usr/lib2 to /usr/lib. Umount /usr, shutdown, and then boot normally and you should be good to go.
If it ain't broke, I can fix that.
John Dvorchak
Honored Contributor

Re: moved /usr/lib

/usr is usually a mounted filesystem and is probably not mounted when you run the recovery CD. Try mounting /usr if you know the lvol name, and look for /usr/lib2. Then it is just as simple as it was to move it in the first place just:

mv /usr/lib2 /usr/lib

Good luck,
John
If it has wheels or a skirt, you can't afford it.
Rachel Smith_1
Occasional Advisor

Re: moved /usr/lib

Okay, so log on in single-user mode and I try to mount /usr. I get this error :

#mount /usr
mount - Cannot open device /dev/vg00/lvol17: no such device or address

So I went to /dev/vg00 and lvol17 is there. I run fsck and and I get this :

#fsck
Can't open /dev/vg00/r1vol1, errono=6
can't open device /dev/vg00/lvol3
file system check failure, aborting ...
.
.
.
can't open device /dev/vg00/lvol9
file system check failure, aborting ...

Again everything appears to be there in the /dev/vg00 directory. I have tried changing permisions thinking maybe that would be the problem, but that doesn't change anything.

What would cause this?
John Dvorchak
Honored Contributor
Solution

Re: moved /usr/lib

When in single user mode you have to activate the volume group first then you can check it:

vgchange -a y /dev/vg00

Then you can check them:

fsck -F vxfs /dev/vg00/usr (or whatever it's called)

Then mount it:

mount /usr

That should help.
If it has wheels or a skirt, you can't afford it.
Rachel Smith_1
Occasional Advisor

Re: moved /usr/lib

Activating the volume group fixed the problem. Thanks everyone - I have my /usr/lib back now!

Rachel
A. Clay Stephenson
Acclaimed Contributor

Re: moved /usr/lib

I would first do a /sbin/cat /etc/fstab to determine /usr's fstype and lvol.

Next, /sbin/fsck -F vxfs /dev/vg00/rlvol7 -- or whatever is appropriate for your filesystem/lvol.

Now, mount /usr
/sbin/mount -F vxfs /dev/vg00/lvol7 /usr

If it ain't broke, I can fix that.