crle is a powerful command on Solaris. It can change where the OS looks for its libraries and in what order.
If someone has run this command with the -l flag and changed the path to something which has bricked your server, don’t fear it IS recoverable.
You’ll know it when you see it, trying to do anything with the server will spit out library errors.
Firstly, determine whether you have a separate /var partition. This is untested with an rpool, but works well with SVM/SDS and UFS root. If your /var mounts in single user inside an rpool, you should be able to follow similar steps to the ufsroot with /var on the root partition.
If you have a separate /var, recovery is:
Log into the systems SP and issue a break. Don’t even bother trying to get to the console, if crle has bricked your server you wont even have the libraries to get a login prompt.
At the ok prompt:
ok setenv auto-boot? false
… system will reset back to ok prompt …
ok boot -as
When you get prompted for an /etc/system file, use /dev/null. This forces a disk boot, rather than an SDS boot.
Once you’re in, mount /var, this should mount your SDS mirror. If it doesn’t you’ll need to mount each side of /var individually.
# mount /var
Then move the bad config file.
# mv /var/ld/ld.config /var/ld/ld.config.bak
This will result in the defaults being used (/lib:/usr/lib:/usr/local/lib) if it can’t find the custom library path file.
If you do have a custom path you use, run the following after you’ve moved the file:
# crle -c /var/ld/ld.config -l “custom path”
# crle -c /var/ld/ld.config -l “/lib:/usr/lib:/usr/local/lib”
Then reboot the server and everything should come up fine.
If you don’t have a separate /var (you really should though!):
You can use the same procedure as above, except you’ll need to boot from cd or net boot. Unfortunately as soon as /var mounts, the system will use the ld.config file, and you won’t even be able to get a login prompt.
Boot off cd/net and then mount the root partition:
ok boot cdrom -s
# mount <device> /mnt
Move dodgy ld.config file:
# mv /mnt/var/ld/ld.config /mnt/var/ld/ld.config.old
You should then be able to reboot the server using the default library path. The above should work for both zfs/ufs root.