Monday, November 27, 2006

Solaris Tips and Tricks

Solaris Tips and Tricks

Accounts

 

Solaris 10 allows you to lockout accounts after a certain number of failed logins.

Solaris 10 has new features to manage non-login accounts and locked accounts which is no longer dainbread.

Backups

 

How can I correct the device paths when replacing a FCAL boot disk after ufsrestoring? (CC)

How can I use fssnap to take file-system snapshots of active UFS file-systems? There was also a Sys Admin article on the subject.

One technique for poor man's disk mirroring using ufsdump/ufsrestore.

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).

Boot

 

Solaris 10 has a new feature boot -m verbose which allows you to customize boot console output.

Common boot errors and their workarounds. (CC)

In case you ever wanted to know what the heck is going on during the boot process. (CC)

The basics of the boot command.

If you haven't sat down and figured out what all those scripts do, here is an analysis of Solaris 8 Startup Files.

Ever wonder what the box is doing before the banner and OBP prompt is displayed?

CD / CD-R

 

Internal DVD-ROM/CD-ROM SD-C2732 May Return Incorrect Data (CC)

What is the CD-ROM called on this box?

How can I create a bootable CD-ROM for Solaris? Another method.

How to burn things to a CD-R with Solaris 8.

Sun CD-ROM FAQ

Chown

 

How can I allow/prevent users from giving files away to someone else?

Cluster

 

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?

Cool Commands

 

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.

CoolThreads servers (T1000/T2000)

 

Here are some great resources for the Sun Fire CoolThreads servers such as kernel params, FAQ, app tuning settings, etc.

Sun Fire T2000 Disk Volume Management Guide shows you how to setup and maintain your hardware RAID 0 and RAID 1 configurations.

Here are the required kernel params for the T2000 server.

T2000 IPGE Ethernet tuning parameters

Richard McDougall has LOTS of links to more CoolThreads info

The CoolThreads Selection Tool allows you to see if your software will be a good candidate for the T1000/T2000.

If you are planning on using the T1000/T2000 to consolidate several other servers, the Consolidation Tool will help simplify Solaris Zone creation, Resource Pools and Psets.

Sun has written several Blueprints articles on the T1000/T2000

The CoolThreads servers come bundled with a FREE cryptographic accelerator.

The CoolThreads FAQ has lots of good info.

You can try a CoolThreads server (T1000/T2000) at no risk for 60days so you can play around with it to see how well it will handle your workloads.

Compiler

 

GCC has been optimized for Sparc servers

You can now download Sun Studio 11 for FREE!

Lost your uninstall file and need to uninstall your old version of Sun Workshop?

Cron

 

Can't remember what field is what? Just add this header to your crontab.

Want to see if your cronjob is running without errors?

Date

 

How can I get the current date/time for yesterday?

Debug

 

Solaris Modular Debugger (mdb) cheatsheet (PDF)

DHCP

 

Why doesn't my hostname get set when using DHCP?

Docs

 

Solaris OE Guide for New System Administrators

Sun's Best Practices Guide (PDF)

Sun documentation by product

Solaris Admininstror's Quick Reference (PDF)

DTrace

 

Scripts

Solaris Internals DTrace scripts

OpenSolaris.org DTrace scripts

iotop.d - prstat-like tool for showing the most I/O hungry processes

Top 10 DTrace scripts

Lots of DTrace tools/scripts

Articles

DTrace home

Solaris DTrace Guide (PDF)

Introduction to DTrace (PDF)

Using DTrace to Observe I/O Behavior

Security Forensics Using DTrace

DTrace -- Most Exposing Solaris Tool Ever

DTrace aggregation functions

DVD

 

Internal DVD-ROM/CD-ROM SD-C2732 May Return Incorrect Data (CC)

Having problems booting from your DVD drive in Solaris?

E-mail

 

How can I prevent my mail server from being used as a third-party relay?

Why doesn't my .forward file work?

Emacs

 

Emacs cheatsheat

Files

 

How can I remove a file with a wierd character in the name?

Filesystems

 

If you are having some problems like cannot determine current directory even if the perms look ok...there is a fix.

How many inodes are being used in a particular filesystem?

Is there a way to quickly determine which filesystems are over 90% full?

Flash

 

NOTE: Flash requires at least Solaris 8 4/01 and does not work well with DiskSuite/softpartitions.

How to exclude multiple directories and filesystems without using the "-x" option for Web Start Flash Archives.

Example of installing Web Start Flash Archives with the Solaris 8 interactive installation program. (CC)

How to install Web Start Flash Archives on a Boot Environment using Live Upgrade (Command-Line) (CC)

Infodoc on how to run Jumpstart with a "separate" boot and install server and utilizing a Flash Archive. (CC)

Solaris 8 software Jumpstart with a Boot Server only utilizing Flash Archive (CC)

How to install a Flash Archive from a CD-ROM. (CC)

FTP

 

Autogenerate your /etc/ftpusers file so you don't have to remember to modify it.

NcFTP and ProFTPD are some handy, secure, configurable FTP servers. Article on configuring NcFTP.

How do I setup an anonymous FTP server the long way or the Sun script way?

How can I create an account that only allows FTP access?

How can I change the ftp daemon's banner?

Why can't I ftp to the box if I can telnet to it?

Hardware

 

Sun now has a utility to store your Chassis Serial Number in EEPROM with a utility called Sneep. Ok, so it isn't perfect...but is a step in the right direction.

Sun System Handbook Systems List Components List

Article on Solaris device mappings.

suntype is a script to help determine what model of Sun box you have.

Some info about Sun Hardware Diagnostics. (CC)

prtdiag is helpful in checking out what state your system is in. (CC)

Sun System Handbook

SunBlade 100 FAQ's and pictures.

Sun System LED Descriptions

Hostid

 

How can you replace your nvram chip or change your hostid?

Inetd

 

How can I log all telnet/ftp connections?

Jumpstart

 

Solaris 10 has a new Reduced Networking Software Group that you can build up to have exactly what you want in it.

Article on how to boot off CD-ROM to do Jumpstart installations. (PDF)

Great Blueprints article on Customizing JumpStart Framework for Installation and Recovery (PDF)

UberJS is designed to help with jumpstarting w/o RARP'ing over the network.

Method for having a self-contained jumpstart/flash DVD.

The JumpStart Enterprise Toolkit helps simplify the JumpStart process.

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.

There are several very good Sun BluePrints for setting up Jumpstart and customizing it for a recovery mini-root.

I need help automating package installs.

Here is a SysAdmin article to get you started with JumpStart.

Tips for automating a Solaris 8 jumpstart.

How would I add a kernel patch to a jumpstart image?

Kernel

 

If you are still running Solaris 2.6, don't apply 105181-33.

What are the different tunable kernel paramters for Solaris 2.3 - 2.6, Solaris 8, Solaris 9, Solaris 10? (PDF)

Keyboard

 

How can I disable the power/suspend key?

How can you remove the keyboard from a running machine?

Libraries (or the lack of them)

CRLE will allow you to configure your runtime linking environment from the system level.

Accidentally removed/renamed a critical library file and can't get it back?

Links

 

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.

Sun's One-Stop Location for SA's web site.

Sundot has real life UNIX observations and tips.

Sunhelp - the name speaks for itself

If you are needing used Sun equipment, Acclinet gives you a 48 month warranty on anything they sell!

Solaris Infrequently Asked and Obscure Questions

Memory

 

Sun Memory Module Compatibility Chart

memconf will tell you what kind of memory is in your Sun box without opening it.

Why do I have more free memory after I upgrade to Solaris 8?

Modems

 

How can I setup my external modem to... Go directly to Celeste's serial port resources pages.

NFS

 

You can now log NFS file operations.

How can I fix the

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: