skip to main |
skip to sidebar
Solaris Tips and Tricks
Solaris Tips and Tricks
Another technique for poor man's disk mirroring that allows the 2nd disk to be usable (read hands off as in no messing with vfstab).
Solaris 10 has a new feature boot -m verbose which allows you to customize boot console output.
In case you ever wanted to know what the heck is going on during the boot process. (CC)
If you haven't sat down and figured out what all those scripts do, here is an analysis of Solaris 8 Startup Files.
How can I allow/prevent users from giving files away to someone else?
Want to do something to multiple machines at once? Use the Sun Cluster Console Tool. NOTE: you also need the scripts.jar.
Need help with disk contention problems in a "shared" storage configuration?
Peter Baer Galvin has some Cool Commands to help you get your job done faster and easier.
wgrep is a windowing grep that is useful for grabbing X number of lines before and after a match.
Can't remember what field is what? Just add this header to your crontab.
Scripts
If you are having some problems like cannot determine current directory even if the perms look ok...there is a fix.
NOTE: Flash requires at least Solaris 8 4/01 and does not work well with DiskSuite/softpartitions.
NcFTP and ProFTPD are some handy, secure, configurable FTP servers. Article on configuring NcFTP.
suntype is a script to help determine what model of Sun box you have.
prtdiag is helpful in checking out what state your system is in. (CC)
Solaris 10 has a new Reduced Networking Software Group that you can build up to have exactly what you want in it.
UberJS is designed to help with jumpstarting w/o RARP'ing over the network.
The MR System for Rapid Recovery Toolkit helps you create a mini-root (via JumpStart) that will allow you to access VxVM, Networker, NetBackup, etc.
Libraries (or the lack of them)
coolcommands.com has a searchable database of commands or one-line scripts which provide a function in a UNIX environment.
Celeste Stokely has information and links to just about anything and everything UNIX related.
memconf will tell you what kind of memory is in your Sun box without opening it.
Stale NFS file handle error message?
Having problems unmounting a busy FS in Solaris 7 or 8?
Network
If you need to figure out which switch port you are plugged into, the switch name and IOS version, you are in luck!
Trying to decide what to call your servers?
Ethernet FAQ
How to setup more than 255 virtual ethernets on Solaris 8 (Sparc)
nddconfig sets network driver parameters to prevent some network attacks.
If I have multiple NIC's, how can I do outbound load spreading for Solaris 8 or have redundant network connections? Sun Answerbook SysAdmin article Sun BluePrints article (PDF)
Where can I find a FREE firewall program for Sol 8? SunScreen is included in Solaris 9.
How can I log or limit/deny certain hosts from telnet/ftp/etc. to my box? Download tcp-wrappers from Sunfreeware.com.
How do I manually change the hostname or IP or change the hostname via a script?
How do I set the NIC speed/duplex?
How can I display what my current NIC speed/duplex settings are?
What are the limitations when using multiple NIC's?
Ok, what about setting up trunking on a QFE card?
When multiple interfaces are installed and it complains they are not plugged in, you can stop those error messages with setenv tpe_link test false at the ok prompt.
How can I determine if an interface is in promiscuous mode?
How can I prevent being detected while snooping?
How do I interpret the output of netstat -k?
How do I turn off replies to broadcast pings?
Where can I find information about tuning my TCP/IP stack?
I have heard that Solaris web servers are slow to serve MS clients? How can I speed up their access?
What if I don't want to use the /etc/defaultrouter file?
So what do those lights on the back of my FDDI card mean?
How do interface groups differ from trunking?
Why should I use interface groups?
I want to know more about interface groups?
NIS
Some info on protecting your NIS maps.
Here is a nice method to secure NIS.
/dev/null
How can I recreate /dev/null?
OBP
How can I reset the default boot-file (or anything else)? set-default boot-file
Change/create the boot-device alias while the server is running using the "eeprom" command. (CC)
How to view OBP aliases from a booted system (CC) or have a script cut out the relevant OBP aliases section for you.
Sun OBP Quick Reference Guide (PDF)
Available OpenBoot Prom diagnostic commands (CC)
OS
The Solaris 2 FAQ has been recently updated.
The Top 10 reasons you should upgrade at least to Solaris 8.
Reasons you should consider upgrade to Solaris 9.
How can I tell if I am running in 32 bit or 64 bit mode?
Where can I find out more info about booting the 32 or 64-Bit Kernel?
Which OS release am I running? cat /var/sadm/softinfo/INST_RELEASE OR cat /etc/release
What is the latest version of Solaris that is available?
Where can I find the Solaris Family Comparison Chart of features for each OS version?
Packages
Info on how you can make your own Solaris packages.
How can you determine which package a file belongs to?
Passwords
Solaris 10 has a new password history feature.
Patches
How can you determine if this is a clean install or an upgraded Solaris system?
What are the various patch exit codes?
Performance Tips
Performance and Tuning on Solaris 2.6, 7 and 8
PERL
If you are tired of using the switcheroo method of editing files with sed to a temp file, then moving them back, take a look at using the inplace editing function of PERL (perl -i -p -e). However, don't edit files that are really softlinks such as /etc/hosts. It breaks the softlink and makes it a real file.
Power/CPR
Why do I get some error message about /etc/power.conf?
Priority Paging
Why shouldn't I be using priority paging on Solaris 8 and 9?
What is priority paging and why do I need it if I am running pre Solaris 8?
Priority Paging FAQ
Ports
How can you determine which process is using that port? Otherwise, you must use LSOF.
Printing
Tech article on the basics of printing.
Processes
Solaris 10 allows you to limit the display of other user's processes.
pargs -e will display a process' environment variables
RAID
The Sun Fire v440 has onboard hardware RAID 1. raidctl Solaris 8 man page
Here's how to detect a failed v440 hardware RAID 1 disk and the process to replace it.
Why can't I create a 2nd mirrorset using the v440's onboard RAID card?
Why is RAID 1+0 better than RAID 0+1?
Description and summary chart of the different RAID levels.
AC&NC describes the different RAID levels in an easy to understand format.
RAID benchmarking tools
Raid Manager / RM6 / A1000
How to reset the A1000/A3x00 configuration if you have been swapping disks with other A1000's or have the orange light on w/o any hardware errors.
Here is another/quicker method to reset the A1000 configuration.
How can you wipe the DACstore from an A1000 drive?
How can I create A1000 & A3x00 luns with Raid Manager 6.22 and not have to reboot?
Here are the CLI equivalents to saving a raid module profile in RM6.
Here are some instructions on how to setup an A1000 on Solaris 8
Is it possible to swap the A1000 cache battery without powering the array off?
Known bug with RM 6.22 results in the following error messages: "Auto configure failed" or "Wrong number of drives entered for the RAID level given".
Think you have a failing power supply on your A1000/A3000? (CC)
Some info on the different RM6 Controller States. (CC)
You need to read this Infodoc if you are trying to run RM on Solaris 8. (CC)
Having long boot times (90mins) with >8 LUN support on A1000 and A3x00 configurations? (CC)
Registration
You can disable prompting for user or system registration reminder after installing Solaris.
Rosetta Stones
SysAdmin quick comparison of Solaris 8, HP-UX, FreeBSD, Linux, AIX
Compares: AIX, FreeBSD, HP-UX, Redhat, Solaris, Tru64 (PDF)
Compares: Everything and the kitchen sink (PDF)
SCSI disks
Here is how to determine which root disk you are booted from.
Quick how-to on setting up Sun eeprom aliases for alternative boot disks.
The script scsiinfo will displays information about SCSI devices attached to a given system (like probe-scsi, but from the OS).
iostat -En will also provide you with SCSI device information.
WD converts sd instance numbers to logical device names and vice versa.
dmap is a utility from SarCheck that also provides instance numbers/logical device names.
Getspace is a handy little script to grab the used and free space via df -k.
Need to add SCSI disks "hot" or make it see your cdrom (Solaris 7 and earlier)? In Solaris 8, use devfsadm -c disk.
Security
The Solaris 8 Build Document has lots of handy security checks, scripts, etc. (PDF) [locally]
Solaris Security Toolkit FixModes
Armoring Solaris Armoring Solaris: II
The Solaris Security FAQ
Here are some suggestions for securing Solaris.
Sed
Handy sed one-liners.
Sendmail
How can I easily look up where this e-mail address will go?
Need to know which version of sendmail I'm running.
How can I allow Sendmail to run w/o accepting mail from other servers? (also check ou the Oct. 2003 issue for more info)
How can I change the sendmail banner?
Service Management Facility (SMF)
SMF has a new function svcs -x to help figure out what is wrong with my system.
SMF has changed the way the system starts up and shuts down. The /etc/rc?.d/ directories are all LEGACY facilities.
Solaris 10 has some new features with svcadm.
SMF quickstart guide
Solaris 10 allows enabling and disabling of services using the svc* commands.
Here's the SMF developer introduction.
SE Toolkit
Where can I find the SE Toolkit?
Please be careful when running virtual_adrian as it will make changes to the kernel following Adrian's rules.
Shell
How can you determine if you have an interacive login?
Lots of good info (memory refreshers) on KSH.
KSH FAQ
KSH examples
How can I compile a shell script so people can't change it or strings/view the password? Francisco's home page
Solstice DiskSuite/Solaris Volume Manager (SDS/SVM)
Booting off of a single disk from a mirrored root pair in Solaris 10 may fail with a panic unless you have 120254-02 or later.
If you are running SVM and have slow disk transfer rates, make sure to apply 113073 to speed things up by a factor of 3.
Please note the NEW procedure to replace SVM disks that have gone bad. The old method for SDS no longer works with those device ID's.
Here is a nice soft partitioning doc for DiskSuite/SVM The only other docs are the man pages.
Undocumented setting to ignore the quorum rule in DiskSuite 4.2.1.
What to do when one of your DiskSuite mirrors went bad and you didn't use the above tip.
Where can I get the newest version of Solstice DiskSuite that supports soft partitions? The Solaris 8 patch is actually 108693. It is built into Solaris 9 as Solaris Volume Manager. (CC)
If you are running Solaris 2.6/7 and want to use soft partions, you must upgrade to Solaris 8/9. The patch revision (106628-18) has a serious, silent 4 GB bug, so they have withdrawn it.
BluePrints article on SVM Performance Best Practices.
Can I convince DiskSuite do RAID 1+0 (which is better than 0+1, and why)? (CC)
It is hard to keep all these different names Sun assigns to everything straight. Where can I find a list of all the product aliases for SDS/SVM/etc? (CC)
Great way to have DiskSuite/SVM coexist with Veritas and let each do what it does best.
Nice doc on how to replace a mirror gone bad. PDF
Quick method for mirroring your root disk with DiskSuite (Solaris Volume Manager) and an example of how the SVM root disk could be laid out.
How do I increase the number of metadevices? Check the DiskSuite FAQ
How do I remove the boot disk from DiskSuite control? Check the DiskSuite FAQ
Sort
Sort can be used to generate a list sorted by the first field, with only the highest valued second field for each first field value.
SSH
ClusterSSH allows you to control a number of xterm windows via a single console.
How do I get trusted-host authentication working?
How can I get hostbased authentication to work with SSH2?
Starfire / E10k
A short article on Starfire Administration
Stop-A, L1-A, break key sequence
How can we prevent the Stop-A key from being used if we don't have a keyswitch?
How can we create an alternate keyboard sequence for the BREAK signal on a dumb terminal?
How do I prevent a spurious BREAK (includes terminal server reboot) signal from halting my Sun server? Cisco method (Workaround section) or the Stokely method
How the different terminal servers stack up on this issue.
How do I send the break sequence (aka STOP-A or L1-A) using my terminal program?
Here is the explanation of the resistor between the pins fix and where it came from.
Storage Arrays
Storage Array helpful tips
Syslog
How to prevent syslog from accepting remote messages.
Su
Need to log when someone uses su? Use this dummy su program instead.
Sys-unconfig
If sys-uconfig wipes out your LDAP config files during Flash installs in Solaris 9, you need Patch-ID# 112941. (CC)
Is your sys-unconfig broken in Solaris 8?
Tar
Show me the easiest way to move files between directories using tar.
Oops, I accidentally created a tar file with an absolute path.
How can I use wildcards when extracting only certain files from a tarfile?
Trying to use tar with include/exclude lists? Use /dev/null as the destination.
Telnet
How can I create an account that only allows telnet/login access (no FTP)?
How can I change the default telnet banner?
Terminals
How come my server won't boot until I connect my terminal to it?
Timezone
How do I change the timezone my Sun server is in?
Top
Top is very handy at getting a snapshot of your server.
Uadmin
What are all the options to uadmin?
UFS
The performance of UFS logging improves or exceeds the level of performance of nonlogging file systems in Solaris 08/2003.
How can I enable UFS logging on Solaris 7 and later?
Why aren't you logging?
Veritas File System
VxFS quick reference guide
Veritas Volume Manager
Basic VxVM commands quick reference sheet (PDF)
Advanced VxVM quick reference sheet (PDF)
Sun doc on how to replace a disk in a 280r when you are using Veritas to mirror the disks. (CC)
Here is the best way to mirror your root disk with Veritas.
How to create a RAID 1+0 (striped-pro) volume. (CC)
How to convert an existing RAID 0+1 volume to RAID 1+0. (CC)
How to disable and re-enable VERITAS Volume Manager (VxVM) at boot time when the boot disk is encapsulated.
How do you replace an E3500 internal FCAL disk?
How can I replace a failing/failed primary rootdisk?
Top 10 FAQ's about Volume Manager. (CC)
How do I add a disk "hot" to Veritas?
Veritas Volume Replicator
VVR quick reference guide
VI
VI Cheatsheet PDF
VI lovers home page
How can I reverse a text file with vi?
Can I delete blank lines in a file using vi?
If I wanted to make the same change several times in file, use vi.
Video
How can I print a list of all possible resolution/refresh rates for your screen?
Would you like to set your display to 24 bit color?
Where can I find the cable adapters that will let me use my PC's monitor on a Sun box?
Sun's official answer on using Sun monitors on a PC.
How to connect a SUN monitor to a PC.
Vold (Volume Management)
Want to automatically play audio cd's or mount your Jaz drive?
X or Xdm
I need to add a login warning message when logging into CDE.
How can I keep my Sun server from announcing that it will serve as an X server?
Xaudio
Getting a bunch of error messages in syslog related to Xaserver?
ZFS in Solaris 10
ZFS homepage
ZFS cheat sheet
The Best File System in the World? Part I
The Best File System in the World? Part II
Solaris Zones
Solaris 10 (02/2004) now has zones available.
Zlogin manpage
No comments:
Post a Comment