0% found this document useful (0 votes)
1K views453 pages

Solaris Real Stuff

This document discusses how the reported "size" of processes in the top output relates to actual memory usage. While top may report individual httpd processes as using a large size like 1GB each, that size is actually virtual memory usage, not physical RAM usage, since portions of code and libraries can be shared between processes. Tools like pmap and sar provide more detailed views of actual system memory and performance.

Uploaded by

Krishna Foru
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1K views453 pages

Solaris Real Stuff

This document discusses how the reported "size" of processes in the top output relates to actual memory usage. While top may report individual httpd processes as using a large size like 1GB each, that size is actually virtual memory usage, not physical RAM usage, since portions of code and libraries can be shared between processes. Tools like pmap and sar provide more detailed views of actual system memory and performance.

Uploaded by

Krishna Foru
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 453

Solaris, Sun Stuff

Work Related Sun / Solaris Stuff that I pick up from newsgroups and web sites

Friday, November 18, 2005


Backups Under Solaris
Backups Under Solaris Other Backup Utilities In addition the basic Unix backup utilities, Solaris offers ufsdump and ufsrestore !hese two commands function as a pair ufsrestore can onl" restore from tapes created b" ufsdump Both are called from the command line and follow the s"ntax# ufsdump options arguments filenames ufsrestore options argument filenames ufsdump onl" copies data from a raw disk slice It does not cop" free blocks If a director" contains a s"mbolic link that points to a file on another disk slice, the link itself is copied When ufsdump is used with the u option, the /etc/dumpdates file is updated !his file keeps a record of when files"stems were last backed up, including the le$el of the last backup, da", date and time ufsdump can be used to back up indi$idual files and directories as well as entire files"stems If ufsdump is run without options or arguments the following defaults are assumed# ufsdump %uf /de$/rmt/& filenames !his means that ufsdump will create a le$el % incremental of the specified file, update /etc/dumpdates, and dump the files to /de$/rmt/& ufsdump also supports an S option to estimate the amount of space, in b"tes, that the backup will re'uire before actuall" creating it !his number can then be di$ided b" the capacit" of the tape to determine how man" tapes the backup will need ( series of tape characteristics and options can also be specified

) c*cartridge ) d*densit" ) s*si+e ) t*number of tracks !hese options can be gi$en in an" order as long as the arguments that follow are in the same order, i e ufsdump cdst ,&&& -./ % !his specifies a cartridge tape with a densit" of ,&&&, -./0B, and nine tracks In terms of tape options the s"ntax is as follows# ufsdump %uf /de$/rmt1(bn filenames Where ) 1*the number of the dri$e beginning with & ) (*optional densit" o l*low o m*medium o h*high o u*ultra o c*compressed ) b*specifies Berkele" SunOS - 1 compatibilit" ) n*no rewind option, which allows other files to be appended to the tape ufsrestore has an interacti$e mode which can be used to select indi$idual files and directories for restoration It also supports an option to read the table of contents from the archi$e file instead of the backup media 2imits of ufsdump# ) It does not automaticall" calculate the number of tapes needed to backup a files"stem ) It does not ha$e a built in error checking mechanism ) It does not enable the backing up of files that are remotel" mounted from a ser$er Solaris also supplies $olcop", a utilit" to make an image or literal cop" of a file s"stem !ips and 3uirks !he Solaris $ersion of tar includes extra options !he 4I option allows a list of files and directories that are backed up to be put

into a text file !he 41 option allows an exclusion file to be specified that lists the names of files and directories that should be skipped !he Solaris $ersion of mt supports an asf subcommand which mo$es the tape to the nth file n being the number of the file posted by Brahma at 4:11 PM & comments

Friday, November 0 , 2005


!"# $ !"%
325 6 32( 7i all Sorr" for m" english I ha$e 8-9&& ser$er, !: arra" and S(; 0" ser$er ha$e . <5 adapters One for !:, other for S(; =7> 8?(/&&&, 32(.:&&@ (fter reboot I see# 'lc dri$er tr"ing attach to both <5 adapters, but cannot attach to 32(.:&& I installed dri$er 'la.:&& from 7> com, but not initiali+ed (lwa"s 'lc dri$er tr"ing to attach to <5( .:&& What do I need to do A Re# 325 6 32( 0a"be "ou must look and configure the 'la conf !he best is, "ou look here for answers# http#//www 'logic com/knowledgecenter/ Re# 325 6 32( !he 'lc dri$er can not attach to the 32(.:&& card because the 32(.:&& card does not with with the 325 dri$er !his is normal 7owe$er, "ou should be able to install the 'la dri$er and run both dri$ers at the same time Re# 325 6 32( !he first thing to check is whoBs 7B( each is b" looking at the >5I identifiers 2ook at the output of the Cprtconf 4$pDC command

8ach 7B( will ha$e two lines that are important !he first to appear is Ccompatible#C and the second is Cname#C compatible# Bpci,&EE,. ,&EE . /B 6 Bpci,&EE,. ,&EE .B 6 Bpci,&EE ,.B 6 Bpci,&EE,..&& /B 6 Bpci,&EE,..&&B 6 Bpciclass,,&&&&B 6 Bpciclass,&&&&B FFFS;I>FFF name# B32G5,'laB ;ow the OS will then look for a CnameC listed in the /etc/dri$erHaliases to match a dri$er to the 7B( If a CnameC is not found the OS starts using each of the compatible entries and will match dri$ers to those entries What "ou could do is run the following commands and post their output here and IBll tell "ou whatBs wrong# prtconf 4$pD I grep ,&EE grep 'l /etc/dri$erHaliases 5hesapeake Re# 325 6 32( Did "ou e$er get a resolution for thisA I ha$e almost the exact same situation and ha$e been unable to get the 32( dri$er to attach to the .:&& Re# 325 6 32( -&.@ rootJcohuxfs.E#/etc/cfg/fpK prtconf 4$pD I grep ,&EE compatible# Bpci,&EE,.:&& ,&EE ,&L ,B 6 Bpci,&EE,.:&& ,&EE ,&LB 6 Bpci,&EE,,&LB 6 Bpci,&EE,.:&& ,B 6 Bpci,&EE,.:&&B 6 Bpciclass,&c&-&&B 6 Bpciclass,&c&-B subs"stem4$endor4id# &&&&,&EE $endor4id# &&&&,&EE compatible# Bpci,&EE,..&& ,&EE -&9. /B 6 Bpci,&EE,..&& ,&EE -&9.B 6 Bpci,&EE,-&9.B 6 Bpci,&EE,..&& /B 6 Bpci,&EE,..&&B 6 Bpciclass,&,&&&&B 6 Bpciclass,&,&&B subs"stem4$endor4id# &&&&,&EE $endor4id# &&&&,&EE compatible# Bpci,&EE,..&& ,&EE -&9. /B 6 Bpci,&EE,..&& ,&EE -&9.B 6 Bpci,&EE,-&9.B 6 Bpci,&EE,..&& /B 6 Bpci,&EE,..&&B 6 Bpciclass,&,&&&&B 6 Bpciclass,&,&&B subs"stem4$endor4id# &&&&,&EE $endor4id# &&&&,&EE compatible# Bpci,&EE,..&& /B 6 Bpci,&EE,..&&B 6 Bpciclass,&,&&&&B 6 Bpciclass,&,&&B

$endor4id# &&&&,&EE =-&:@ rootJcohuxfs.E#/etc/cfg/fpK grep 'l /etc/dri$erHaliases 'lc Cpci,&EE,..&&C 'lc Cpci,&EE,.:&&C 'lc Cpci,&EE,.:,.C 'la.:&& Cpci,&EE,%C 'la.:&& Cpci,&EE,,&&C 'la.:&& Cpci,&EE,,&,C 'la.:&& Cpci,&EE,,&.C 'la.:&& Cpci,&EE,,&:C 'la.:&& Cpci,&EE,,&-C 'la.:&& Cpci,&EE,,&/C 'la.:&& Cpci,&EE,,&%C 'la.:&& Cpci,&EE,,,LC 'la.:&& Cpci,&EE,,,/C Re# 325 6 32( I extracted the file adapter properties from the 32ogic S52I utilit" It has an index of the identities of the 32ogic cards !hat first one of ,&EE,,&L is a Sun (mber4. 1LELE, not an 7> card as "ou thought !he two ,&EE,-&9. cards are Sun (mber 7B( ports 2astl" the ,&EE,..&&,/ is probabl" either a generic 'logic card or a fibre down if this is a SB,&&/.9&R posted by Brahma at 4:58 PM & comments

&o' many file descriptors does t&e (ne't process &ave open)
K When this happens, how man" file descriptors does the 1newt K process ha$e openA =Bls 4l /proc/MpidK/fdB or something K similar @ K With ls 4l /proc/MpidK/fd I wc 4l ..E for a fresh G;O08 session and one gnome4terminal window open ... for a fresh 1<58- session and one xterminal window open =different >IDs for each of these checks@ ( gi$en process is#

root ,&&%, %&E- . ,.#&% A &&#&&#&& /usr/1,,RL/bin/1newt #.L 4auth /$ar/lib/wdm/authdir/authfiles/(#.L4(N.-7r 4dpms !his is interesting, because here is some of the Bls 4l /proc/,&&%,/fdB output lrwx444444 , root root L- 0ar ,L ,.#,, ,& 4K /$ar/lib/wdm/authdir/authfiles/(#,.4d9mx+1 =deleted@ lrwx444444 , root root L- 0ar ,L ,.#,, ,&& 4K /$ar/lib/wdm/authdir/authfiles/(#,,437kbcU =deleted@ lrwx444444 , root root L- 0ar ,L ,.#,, ,&, 4K /$ar/lib/wdm/authdir/authfiles/(#,,4bb?c7' =deleted@ lrwx444444 , root root L- 0ar ,L ,.#,, ,&. 4K /$ar/lib/wdm/authdir/authfiles/(#.E4<?il:$ =deleted@ lrwx444444 , root root L- 0ar ,L ,.#,, ,&: 4K /$ar/lib/wdm/authdir/authfiles/(#%4,i't>3 =deleted@ lrwx444444 , root root L- 0ar ,L ,.#,, ,&- 4K /$ar/lib/wdm/authdir/authfiles/(#.94OcO:O> =deleted@ lrwx444444 , root root L- 0ar ,L ,.#,, ,&/ 4K /$ar/lib/wdm/authdir/authfiles/(#,,4L/7O3D =deleted@ lrwx444444 , root root L- 0ar ,L ,.#,, ,&L 4K /$ar/lib/wdm/authdir/authfiles/(#,L4PEpN"u =deleted@ lrwx444444 , root root L- 0ar ,L ,.#,, ,&E 4K /$ar/lib/wdm/authdir/authfiles/(#,,4RNPl'P =deleted@ posted by Brahma at 4:56 PM & comments

Friday, *ctober 28, 2005


&ttpd processes eac& 'it& a si+e of 1 8,--- is t&e top .si+e. display directly related to memory
K When I run top on this box, I can see L httpd processes each with a K si+e of ,-90 is the top Csi+eC displa" directl" related to memor"A Nes, itBs the amount of $irtual memor" used b" this process Nou should see a similar number =with much greater detail@ b" doing pmap 4x on the process K If it is, how can I possibl" be running Lx,-90 processes Qust on apache K aloneA 8$er" page used b" the process is not necessaril" pri$ate to that process Read4onl" portions of the (pache binar" ma" be shared among all L, and s"stem libraries =like lib5@ ma" be shared b" man" programs

!he Bpmap 4x MpidKB output shows that more explicitl" !hen "ou might also want to know that there are e$en a lot more that offer detailed information regarding s"stem state and performance# eg sar, $mstat, iostat, trapstat, cpustat, mpstat, cputrack, busstat, kstat Darren alread" ga$e a good answer, but I wanted to elaborate a little =Or, after looking back on this after IB$e written the whole post, apparentl" more than a little @ On a simple computer, there is Qust a certain amount of R(0 a$ailable and e$er" address that a program uses =in a pointer, in an address register, or whate$er@ simpl" corresponds to part of that R(0 (nd e$er" program executes in the same address space, which means a gi$en address refers to the same thing whether itBs in the context of one process or another But on Solaris, there is $irtual memor", and e$er" process has its own address space Using the 00U hardware, the s"stem maps se$eral different ranges of the processBs address space to different things Some of the address ranges are pri$ate areas that onl" the process itself has access to (n" memor" "ou allocate with malloc=@ will be in a pri$ate address range Some address ranges correspond to regions of files on disk =In Solaris, executables are loaded b" setting up address ranges in the processBs address space that correspond to parts of the executable file (nd the same thing is done when an executable runs against a shared librar" @ Some address ranges correspond to other things =sometimes e$en things like address ranges that are used to communicate with hardware other than R(0@ ;ow to make things e$en a bit more complicated, Qust the existence of an address range within a processBs address space does not impl" that an" R(0 is used for that range <or example, if an address range corresponds to a region of a file and if "ouB$e ne$er either read from or written to an" addresses in that range, Solaris doesnBt need to waste time or memor" putting that data into R(0 (nd to make things "et more complicated, e$en if Solaris does need to use R(0 for =part of@ an address range, if two processes are using the same region of the same file, Solaris can use the same R(0 for both processes, e$en if the addresses that would be used within the processes to access that data arenBt the same addresses (nd to make things e$en "et more complicated, if a process has an address range that contains pri$ate data and that process does a fork=@, then the twin processes that result can both use the same R(0 =or swap space@ for that data until the time when one of them

tries to change the data =at which point a cop" must be made so the" ha$e their own separate copies@ So, when "ou run top, and "ou see the CSIO8C of the process, what "ouBre seeing is the si+e of all the address ranges that ha$e been created for that process 0ost =but not all@ of these address ranges could correspond to data in R(0, but e$en if the" do, it might be data that is shared with another process So when "ou see ,-90 for an (pache process, that Qust means that there are ,-90 worth of addresses that the (pache process could theoreticall" access if it wanted to !he CR8SC column of topBs output is a lot closer to the R(0 usage of a process, but itBs still not exactl" the same thing !he CR8SC column Qust tells "ou, of all the addresses that a process could potentiall" access, how man" of them are currentl" connected to a particular spot in ph"sical R(0 !hat is, how man" of those pages are resident in ph"sical memor" It doesnBt sa" how man" of those are shared with other processes ItBs tempting to sa" that the CR8SC column tells "ou how much memor" the process is using, but thatBs not entirel" accurate ItBs totall" possible for a process to be totall" dormant and not running ha$e its resident si+e increase !his could happen if the dormant processBs address space refers to some region of a file that some )other) process Qust accessed and thus forced into memor" (nd in fact, this t"pe of thing partl" accounts for wh" "ou see such high numbers, e$en in the CR8SC column Nou could ha$e a process which onl" accesses a tin" portion of some file thatBs mapped into its address space, but if a bunch of other processes also access tin" portions of the same file, that will make increase the resident si+e of all the processes that map the =whole@ file bigger !hat ma" seem a little unlikel", but actuall" it is 'uite common because things like libc so =the 5 shared librar"@ are used b" a bunch of processes, and e$en though each process might onl" use a few functions, still when "ou count the total number of functions that are acti$el" used from that librar", a significant portion of the librar" ends up being resident, and that means that it inflates the resident si+e numbers of all processes that use it K So I learned "esterda" that the nati$e stat tool for Solaris is K prstat So IBm guessing from "our posting 2ogan that in prstat, the K SIO8 column is the total amount of memor" that each process can use and K the RSS is the actual amout thats used

Ccan useC and CthatBs usedC as a description of memor" seem incorrect to me !he difference is between ?irtual 0emor" >ages that are actuall" resident in R(0 =RSS@ and those that are allocated =whether currentl" in R(0 or not =SIO8@ I donBt think that Cin useC and Cin R(0C are 'uite the same thing K CIn a $irtual memor"=,@ s"stem, a processB resident set is that part of K a processB address space which is currentl" in main memor" If this K does not include all of the processB working set, the s"stem ma" K thrash C K !hat makes sense to me except for one thing If the SIO8 is the total K amount, how come it fluctuatesA >rocesses allocate memor" while the" run 0ost programs will grow, but not shrink, but both are possible K Whoah I Qust looked at pmap thats insane

DonBt tr" to interpret e$er"thing 0ost bits are Qust mappings from other shared obQects In an a$erage program, the most common place for it to consume memor" directl" is in the RheapS 7owe$er the breakdown of shared/pri$ate/R(0/total can be useful If I canBt map SIO8 and RSS to whats a$ailable and whats in use, how K can I tell when the memor" needs to be upgradedA I was making the distinction between Cin useC =which is a little fu++" for me when talking about pages@ and Cin R(0C =which is well4defined@ Nou can map SIO8 and RSS to what pages are in R(0 at an" one time, which will probabl" be all "ou need What Cin useC means, and whether or not that has an"thing to do with R(0 residenc" is a different 'uestion 44 !he top part of the displa" of top shows memor" usage !he Bswap 4sB command shows how much swap is in use I think both of these include swap as backed up b" the executables and shared images on disk as well as the swap backed up b" the swap file !he Bswap 4lB command will show how much of the actual swap space is in use ( rule of thumb is that when the amount of swap in use starts to be as big as "our memor", "ou need to add memor"

If "ou ha$e a lot of mostl" inacti$e programs in use, "ou can allow more swap to be used without hurting performance One wa" is to look at the pi and po =page in and page out@ columns in the $mstat output (ssuming "ouBre not starting lts of new programs, high $alues here could indicate low memor" Nou should check out (drian 5ockcroftBs book, Solaris >erformance !uning =aka the >orche book@ <re'uent complaints form users about poor performance can also be an idicator of too much paging #4@ posted by Brahma at 2:14 PM & comments

Sub/ect0 1210 B23041000F5(


7i, When connecting a ser$er to a Gig interface "ou need to enable autoneg on the ser$er It will pick up the correct speed automaticall" It becomes a problem when tr"ing to force it especiall" if using 5isco switches ;ormall" I run the following script ndd 4set /de$/bge& ad$HautonegHcap , ndd 4set /de$/bge& ad$H,&&&fdxHcap , ndd 4set /de$/bge& ad$H,&&&hdxHcap & ndd 4set /de$/bge& ad$H,&&fdxHcap & ndd 4set /de$/bge& ad$H,&&hdxHcap & ndd 4set /de$/bge& ad$H,&fdxHcap & ndd 4set /de$/bge& ad$H,&hdxHcap & 7ope that it resol$es "our problem Regards 0usa posted by Brahma at 2:12 PM & comments

Friday, *ctober 21, 2005


SU,,%670 8rackin9 do'n system calls on Solaris :
SubQect# SU00(RN# !racking down s"stem calls on Solaris %

7i all, 0an" thanks to e$er"one who responded 4 (leksander >a$ic, francisco, and Darren Dunham 0" original email is attached below, along with the replies I got 4 but to summarise # I was seeing a $er" high s"sload on a Solaris % web ser$er, and $mstat confirmed that a large number of s"stem calls were being generated I wanted to track these down and find out what was being called, but couldnBt use Dtrace Net another argument for mo$ing to Solaris ,& #@ (s Darren said in his response# C!he limitations on existing tools like BtrussB are part of what dro$e dtrace, so I donBt know that thereBs an" magic out there C 7e then went on to suggest I anal"se all the (pache processes with truss, send the output to a file and then anal"se that !his was also the path suggested b" (leksander, who 'uite correctl" pointed out that truss can be made to follow an" child processes generated $ia forking, so I could therefore truss the main (pache process and follow all itBs children 7e also suggested I send the output to a file, and post4process it with awk or perl <rancisco also suggested the useful lsof tool to see what files are open, as m" original h"pothesis was that there were a large number of file handles being opened and closed In the end, I trussed e$er" ChttpdC process, and generated a summar" using Ctruss 4cC I let this run for .& seconds, and saw that there were a $er" large number of resol$epath=@ and open=@ calls being generated, roughl" half of these calls returned with an error I then narrowed m" search down, and examined what was actuall" being passed as arguments to these calls !his is easil" done with Ctruss 4t open,resol$epathC It turns out that a huge number of the resol$epath=@Bs and open=@Bs were being generated b" >7> scripts running under (pache !he" were using an inefficient includeHpath, and so when most files were being included, >7> generated man" resol$epath=@ and open=@ calls which returned in error before finall" finding the correct location of the file We fixed the >7> includeHpath and also modified some of the scripts to use an absolute path in include=@ or re'uire=@ functions, and as expected, the number of s"scalls being generated hal$ed itself !here were a number of other code4related problems on that ser$er as well, but these were unrelated to m" original re'uest for help Once again, man" thanks to those that responded >roblem resol$ed T

40ark posted by Brahma at 2:21 PM & comments

#onfi9urin9 !lo9ic ;B% card


SubQect# SU00(RN 5onfiguring 3logic 7B( card I found the solution !hanks to those who repliedT (t OB># okK show4de$s M32G5 entr"K okK select M32G5 entr"K okK show4children M2ists info about card such as WW;, 2oopId 2unK okK show4connection4mode 5urrent 7B( connection mode# . 4 2oop preferred, otherwise point4to4point =>ossible connection mode choices# & 4 2oop Onl" , 4 >oint4to4point onl" . 4 2oop preferred, otherwise point4to4point@ okK set4connection4mode =&, ,, or .@ okK show4data4rate 5urrent 7B( data rate# One Gigabit rate >ossible data rate choices# & 4 One Gigabit rate , 4 !wo Gigabit rate . 4 (uto4negotiated rate okK set4date4rate =&, ,, or .@ !o set the data rate 0ore info can be found at http#//download 'logic com/bootHcode/.:&.&/Readme txt Pohn Original 3uestion#

I ha$e a 32ogic .:&& card in a S< ?--& I am tr"ing to install Secure>ath but the card is not seen b" Solaris 9 =It is seen at OB> le$el@ (t m" last Qob I had a similar problem which I fixed b" setting the speed at the OB> le$el )!he card is set to autoneg but I need to force it to , gig@ Unfortunatel" I could not keep m" notes from that Qob and cannot for the life of me remember how to set the speed 7as an"one got notes on how to do it I ha$e spent . hours scouring google with no luck !hanks, Pohn posted by Brahma at 2:20 PM & comments

;o' do < install Sun 3=plorer


- 7ow do I install Sun 8xplorerA (fter downloading the Sun8xplorer tar O file from sunsol$e sun com# cp Sun8xplorer tar O /$ar/tmp cd to /$ar/tmp uncompress Sun8xplorer tar O tar x$f Sun8xplorer tar or, if "ou ha$e g+ip installed, +cat Sun8xplorer tar O I tar x$f 4 !his will extract the contents of the archi$e into two directories, SU;Wexplo and SU;Wexplu, located in the current director" (s superuser, t"pe the following command# F pkgadd 4d SU;Wexplo SU;Wexplu posted by Brahma at 2:19 PM & comments

3t&ernet card 'oes


SubQect# SU00(RN# 8thernet card woes

!hanks to e$er"one to repliedT It turns out that /etc/inet/ipnodes had the old I> address set 4 thanks to Dale 7irchert for pointing that out (lso if I ran s"s4unconfig it would ha$e caught it aswell 4 thanks Dominic 5lark So for future reference either change the following files # /etc/inet/hosts /etc/inet/netmask /etc/inet/ipnodes or run s"s4unconfig !hanks againT Will posted by Brahma at 2:19 PM & comments

read> 'rite performance on t&e volumes7i Greg, I canBt offer an" suggestions , but I am interested in knowing how "ou are measuring the read/ write performance on the $olumes 7DS toolA or something more common !hanks, ? K 7ello, K Pust a 'uick info gathering I am at a customer site installing a new K 7DS %%%& !he high le$el config o$er$iew# K 7DS %%%& =Open ? -&GB 2U;S@ K 7DS %.&& =2egac" (rra"@ K Sun <ire $99& K Brocade -,&&Bs =. <abrics@ K 32ogic .GB 5ards =:E/4:,&.@ to new S(; K P;I <58.4L-,. cards to old 7DS %.&& (rra" K 0>1IO enabled and configured for Round Robin K ?x?0 - , K Oracle %i K During this phased implementation, we are in the date migration stage K We are mirroring the old storage, which is from a 7DS %.&& to the new

K 2U;S on the !S =%%%&@ K Once the mirroring is complete, we will break of the plexes from the K old arra" and be full" migrated to the new 7itachi K !he customer decided not to break the mirrors "et We ha$e noticed a K decrease in write and read performance on all the $olumes on the host K I would expect a slight decrease in write performance, howe$er, we are K seeing upto a ,// milli4second increase in read time as well on each of K the $olumes 0" assumption is that because of the double writes to two K different =t"pes@ of 2U;S, that is impacting our reads K SuggestionsA Repl" 7i I am using $xstat 4g BdiskgroupB 4i , =the 4i is the inter$al I am polling, in this case e$er" one second@ !his output is gi$ing me a format like this# O>8R(!IO;S B2O5US (?G !I08=ms@ !N> ;(08 R8(D WRI!8 R8(D WRI!8 R8(D WRI!8 $ol ora&& :%:L- :99 -%:,9/L L.&9 , 9 & , $ol ora&& :%/9/ :9% -%/&E&- L..- , % & & $ol ora&& :%/E, :%, -%/-%L& L./L , 9 & , (s for Solaris 2U; metrics, I generall" use iostat 4xnp+ ,, which is gi$ing me the disk V tape I/O data and excluding an" +eroBs ItBs a lot of information, so what I do is grep out what I am looking for, for example, iostat 4xnp+ , I grep c/t&d& !hanks, Greg posted by Brahma at 2:17 PM & comments

cannot create >etc>foo0 *peration not applicable


SubQect# SU00(RN# cannot create /etc/foo# Operation not applicable Original 'uestion#

K On a Solaris 9 s"stem running fine for two months, I suddenl" get this# K K F touch /etc/foo K touch# cannot create /etc/foo# Operation not applicable K K !russ sa"s# K creat=C/etc/fooC, &LLL@ 8rrF9% 8;OSNS K K I also noted truncated files in /etc K K !here is nothing interesting in the s"stem log S"stem is a ?.,& running K Solaris 9 with recommended patches from feb .9 .&&/ Root files"stem is K mirrored using S?0 !he responses I recei$ed include# 4 (re "ou out of disk space 4 (re "ou out of inodes 4 Do "ou ha$e the same problem on other partitions like /$ar or /opt 4 (re "ou running the automounter 4 (re the permissions wrong on /etc 4 Is the CtouchC command malfunctioning 4 Is the root files"stem mounted read4onl" 4 (re "ou also unable to modif" files in /etc 4 Does "our metastat output show weird things 4 Do "ou alread" ha$e a file name CfooC in /etc !he answer is CnoC to all these points So I re'uested downtime with the customer to bring the s"stem into single4user mode to do a files"stem check (s expected, man" errors showed up, but it was able to repair the root files"stem and the s"stem is running fine now I also logged a case with Sun Support about this issue !he" sent me two documents from SunSol$e that describe common reasons for files"stem corruption Since the call is closed now I cannot retrie$e the document IDBs, sorr" for that !he onl" two reasons that remain after reading these documents are# 4 (pplications use the unlink=.@ s"stem call without checking if the director" is empt" !his is a classical U;I1 problem 4 Bugs in the O S I ha$e no idea how to check if some of the running processes are misusing unlink=.@ 0a"be dtrace can do this, but this is a Solaris 9 s"stem (s for bugs in the OS, I ha$enBt found applicable ones on SunSol$e

!hanks to all who replied 44 Uoef posted by Brahma at 2:14 PM & comments

!uestion about Sun patc&0 ;o' to find out '&at patc&es <?ve /ust installed
SubQect# SU00(RN# 3uestion about Sun patch# 7ow to find out what patches IB$e Qust installed 0an" thanks to e$er"bod" who replied Nou know who "ou are #4@ Original 'uesiton# I need to install a bunch of Sun patches into a Solaris 9 s"stem 7ow do I find out the list of Sun patches I Qust installed =using patchadd patchF@ (nswers# , Fls 4ltr /$ar/sadm/patchItail 4xx where xx is the F of patches IB$e Qust installed =ie if I installed .& patches, then the xx number will be .&W for example@ . Fshowre$ 4pIegrep Bpatch F,Ipatch F.Ipatch F:B etc where patch F,,.,: are the : patches IB$e Qust installed Cshowre$ 4pC alone wonBt cut it =but otherwise is technicall" correct@ because the output includes too man" pre$ious patches It will be kind of hard to $erif" which one posted by Brahma at 2:14 PM & comments

lo9ical volume problem


logical $olume problem 7i all, I am using $eritas ?0 : / When I want to create a raid / $olume b" the following command,

bash4. &/F $xassist 4g diskgroup make $ol4, ,&m la"out*raid/ $x$m#$xassist# 8RROR# !oo few disks for stripingW at least - disks are needed bash4. &/F $xdisk 4g diskgroup list D8?I58 !N>8 DISU GROU> S!(!US c.t,d&s. sliced diskgro&. diskgroup online c.t.d&s. sliced diskgro&: diskgroup online c.t:d&s. sliced diskgro&, diskgroup online I get the error C8RROR# !oo few disks for stripingW at least - disksC Raid / onl" need : disk Wh"A Repl" Because there are some interesting failure modes where a crash can occur in the middle of a write, lea$ing "ou not knowing if parit" is right or wrong 5ombined with a disk error, "ou can ha$e problems !o get around that failure mode, the default for a raid/ construction with $xassist is to create an additional log de$ice which is not on an" disk shared with the raid/ data ItBs small, but must be on a separate disk !here might be a wa" of using the same disk but replicating it If "ou donBt want the log disk, "ou can specif" BnologB or Bnoraid/logB, then it will onl" need : columns $xassist 4g diskgroup make $ol4, ,&m la"out*raid/,nolog log, nolog 5reates =or does not create@ dirt" region logs =for mirrored $olumes@ or log plexes =for R(ID4/ $olumes@ when creating a new $olume !his attri4 bute can be specified independentl" for mirrored and R(ID4/ $olumes with the raid/log and regionlog la"out specifications !he current implementation does not support the creation of D50 logs in the la"out specification raid/log, noraid/log 5reates =default@ or does not create log plexes for R(ID4/ $olumes posted by Brahma at 2:13 PM & comments

restored filesystem @ comparison to ori9inal

restored files"stem 4 comparison to original 7a$ing de$ised and operated a backup scheme and schedule since the start of the month, IBd 'uite like to perform a restoration in order to test it I will restore the file s"stem to a separate disk than the original, But whatBs the CbestC wa" to compare the two so I can be sure the scheme I ha$e de$ised is capable of backing up properl", but also m" proposed restore mechanism, restores properl" !he fs in 'uestion is onl" ,GB at present So an" suggested comparison can be time consuming in nature IBd ob$iousl" like to check for missing files/directories and errors with ownerships, permissions, (52s, and timestamps 7ow do I go about thisA 5heers K Rob running tripwire on the orignal and the cop" comes to mind then compare the output tripwire databases K with ownerships, permissions, (52s, and timestamps Nou could tr" the files"nc tool with the C4nC option, which will make it Qust find the differences and not attempt to make changes If "ou back up /foo and restore it into /restore/foo, then the files"nc command would be something like this# files"nc 4n 4ame 4fsrc 4s / 4d /restore foo !he C4nC means not to make an" changes, the C4aemC means to check (52s and modification times and flag e$er"thing found =e$en if it canBt be changed, the C4fsrcC means to consider the source director" to be the authoritati$e one, C4sC specifies the director" that 5O;!(I;S the source thing" to be s"nchroni+ed, C4dC specifies the director" that contains the destination thing to be s"nced, and CfooC is the thing to be s"nced If "ou wanted to compare all of C/C against something contained in C/C =such as C/restoreC@, "ou could t"pe this in ksh or bash#

cd / files"nc 4n 4ame 4fsrc 4s / 4d /restore / !hen when the cursor is at the end of the line, do 8S5 then C)C in $i mode or 0eta4C)C in emacs mode, and it will expand the list of files, at which point "ou can delete CrestoreC from the list =If "ou donBt delete CrestoreC from the list, it will think e$er"thing in CrestoreC should be in Crestore/restoreC, which make will cause the output to be filled with extraneous stuff @ 4 2ogan KI will restore the file s"stem to a separate disk than the original, !he best wa" is to use CstarC to compare both files"stems as it is the onl" known program that is able to compare HallH file properties and meta4data =except for 8xtended attribute files@ (s I currentl" know nobod" who uses 8xtended attribute files, I am sure that this will fit "our needs 5all# star 4c 4diff 4$$ 4dump 4acl 4sparse diffopts*Tatime,ctime,lmtime 45 fromdir todir B!W# !his is also the fastest known method and if "ou like to cop" a files"stem, a similar method will cop" the fs $er" fast (lso ha$e a look at star when doing incremental dumps It might be more interesting for "ou than ufsdump/ufsrstore ftp#//ftp berlios de/pub/star/alpha/ posted by Brahma at 2:12 PM & comments

;o' to free virtual memory


Re# 7ow to free $irtual memor" 2ooks like some process is leaking memor" continousl" !he process needs to fix it, use some open source tool like $algrind to find out which process is leaking memor"

Regards, 5hinmo" <or free software books $isit http#//geocities com/freesoftwarebooks we deplo"ed a Seebe"ond proQect in Unix 0achine in that i ha$e problem of excceding the $irtual memor",the $irtual memor" is keep on incresing ,at some point it is strucking up the unix ser$er, is there an" wa" to free the $irtual memomr" faster, and can we stop the incresing of $irtual memor" i need some urgentl" Regards Rambabu N posted by Brahma at 2:11 PM & comments

8unin9 t&e <>* Subsystem


!uning the I/O Subs"stem I/O is probabl" one of the most common problems facing Oracle users In man" cases, the performance of the s"stem is entirel" limited b" disk I/O In some cases, the s"stem actuall" becomes idle waiting for disk re'uests to complete We sa" that these s"stems are I/O bound or disk bound (s "ou see in 5hapter ,-, C(d$anced Disk I/O 5oncepts,C disks ha$e certain inherent limitations that cannot be o$ercome !herefore, the wa" to deal with disk I/O issues is to understand the limitations of the disks and design "our s"stem with these limitations in mind Unowing the performance characteristics of "our disks can help "ou in the design stage Optimi+ing "our s"stem for I/O should happen during the design stage (s "ou see in >art III, C5onfiguring the S"stem,C different t"pes of s"stems ha$e different I/O patterns and re'uire different I/O designs Once the s"stem is built, "ou should first tune for memor" and then tune for disk I/O !he reason "ou tune in this order is to make sure that "ou are not dealing with excessi$e cache misses, which cause additional I/Os !he strateg" for tuning disk I/O is to keep all dri$es within their ph"sical limits Doing so reduces 'ueuing timeXand thus increases performance In "our s"stem, "ou ma" find that some disks process man"

more I/Os per second than other disks !hese disks are called Chot spots C !r" to reduce hot spots whene$er possible 7ot spots occur whene$er there is a lot of contention on a single disk or set of disks Understanding Disk 5ontention Disk contention occurs whene$er the ph"sical limitations of a disk dri$e are reached and other processes ha$e to wait Disk dri$es are mechanical and ha$e a ph"sical limitation on both disk seeks per second and throughput If "ou exceed these limitations, "ou ha$e no choice but to wait Nou can find out if "ou are exceeding these limits both through OracleBs file I/O statistics and through operating s"stem statistics !his chapter looks at the Oracle statisticsW 5hapter ,., COperating S"stem4Specific !uning,C looks at the operating s"stem statistics for some popular s"stems (lthough the Oracle statistics gi$e "ou an accurate picture of how man" I/Os ha$e taken place for a particular data file, the" ma" not accuratel" represent the entire disk because other acti$it" outside of Oracle ma" be incurring disk I/Os Remember that "ou must correlate the Oracle data file to the ph"sical disk on which it resides posted by Brahma at 2:10 PM & comments

debu99in9 6# scripts- solaris:


debugging R5 scripts solaris% I can remember how to debug the startup scripts 5an someone help me out here I Qust want Solaris to report what startup script it is currentl" executing I thought it was as simple as adding a C6C to the /etc/rc) script but that didnt work !hereBs no reall" simple wa" to do this Nou ma" be thinking of adding set 4x to /etc/rcA, but that gets o$erl" $erbose for me Often IB$e made a small edit to /etc/rcA !hereBs a startup loop in there where it runs /bin/sh Yf start or so for each of the scripts Pust add a Cecho starting YfC and a Cecho done starting YC inside the CifC and outside the CcaseC statements =and make a backupT@ !hen "ou can tell what itBs tr"ing to do and where it hangs Once there, "ou can make that one script more $erbose

If "ou were running Solaris ,&, "ou could use Bboot 4m $erboseB 4 posted by Brahma at 2:10 PM & comments

statvfs > df bu9)


stat$fs / df bugA 7i all, I am tr"ing to get the files"stem information using stat$fs/df I ha$e an automounted partition mounted on /mntauto I am running SunOS / 9 If I sa" Bdf 4k /mntautoB, I get the following output# 44444444 bash4. &:F df 4k /mntauto <iles"stem kb"tes used a$ail capacit" 0ounted on cpsupsun,#/mntauto -9.-// ,& -:-.&& ,Z /mntauto 44444444 I ha$e written two different programs using Bstat$fsB to print the files"stem information <ollowing is the putput fron these two different programs# >rogram ,# main=@ [ struct stat$fs infoW access=C/mntautoC,<HOU@W if =4, ** stat$fs=C/C, Vinfo@@ perror=Cstat$fs=@ errorC@W else [ puts=Cstat$fs=@ returned the following informationC@W puts=Cabout the =B/mntautoB@ file s"stem#C@W printf=C fHbsi+e # Zu\nC, info fHbsi+e@W printf=C fHblocks # Zu\nC, info fHblocks@W printf=C fHbfree # Zu\nC, info fHbfree @W printf=C fHba$ail # Zu\nC, info fHba$ail@W printf=C fHfiles # Zu\nC, info fHfiles@W printf=C fHffree # Zu\nC, info fHffree@W printf=C fHfsid # Zu\nC, info fHfsid@W printf=C fHflag # Z1\nC, info fHflag@W printf=C fHnamemax # Zu\nC, info fHnamemax@W

printf=C fHbaset"pe # Zs\nC, info fHbaset"pe@W printf=C fHfstr # Zs\nC, info fHfstr@W ] ] Output# stat$fs=@ returned the following information about the =B/mntautoB@ file s"stem# fHbsi+e # 9,%. fHblocks # -,.%.%& fHbfree # :&.LEL& fHba$ail # .%9/-L9 fHfiles # /,./,. fHffree # /&E,&: fHfsid # 9:99L&9 fHflag # fHnamemax # .// fHbaset"pe # ufs fHfstr # >rogram .# main=@ [ struct stat$fs infoW struct stat sbW if =stat=C/mntauto/logC, Vsb@ M &@ printf=Cstat failed\nC@W if =SHISDIR=sb stHmode@@ printf=CDir\nC@W else printf=C;ot a dir\nC@W if =4, ** stat$fs=C/mntautoC, Vinfo@@ perror=Cstat$fs=@ errorC@W else [ puts=Cstat$fs=@ returned the following informationC@W puts=Cabout the =B/mntautoB@ file s"stem#C@W printf=C fHbsi+e # Zu\nC, info fHbsi+e@W printf=C fHblocks # Zu\nC, info fHblocks@W printf=C fHbfree # Zu\nC, info fHbfree @W printf=C fHbfree # Zu\nC, info fHba$ail@W printf=C fHfiles # Zu\nC, info fHfiles@W

printf=C fHffree # Zu\nC, info fHffree@W printf=C fHfsid # Zu\nC, info fHfsid@W printf=C fHflag # Z1\nC, info fHflag@W printf=C fHnamemax # Zu\nC, info fHnamemax@W printf=C fHbaset"pe # Zs\nC, info fHbaset"pe@W printf=C fHfstr # Zs\nC, info fHfstr@W ] ] Output# Dir stat$fs=@ returned the following information about the =B/mntautoB@ file s"stem# fHbsi+e # 9,%. fHblocks # %L-%,& fHbfree # %L-9%& fHbfree # 9L9-&& fHfiles # .-E.%L fHffree # .-E.%& fHfsid # 9&E-&:LfHflag # & fHnamemax # -.%-%LE.%/ fHbaset"pe # nfs fHfstr # 5ould an"one please explain me the differences between the abo$e outputsA I assume all of the abo$e should print the same answer Is this a know bug of stat$fsA !hanks in ad$ance, !ushar Repl" 0" apologies I got the errorT It was a t"po I would sa" e$er"thing is working oka" >rogram , does a stat$fs of C/C and program . calls stat$fs for C/mntautoC posted by Brahma at 2:09 PM & comments

use telnet command in a s&ell script

Re# use telnet command in a shell script I would use ssh instead of telnet setup a connection with ke"s so that the connection does not re'uire a password =man ssh to find out how@ then call it as follows ssh hostname 4l username CcommandC I tee 4a output txt posted by Brahma at 2:07 PM & comments

fsck
K Our s"stem is backed up to tape each night Unfortunatel" our S"s 8ng K is on holida"s and I do not know how to reco$er from tape K 5ould "ou walk me through it please !here are lots of wa"s to do it Without knowing which "our s"stem admin chose, itBs reall" hard to gi$e "ou an" useful information !he most likel" thing is that "ou need to use something like Cmt 4f /de$/rmt/&n asf .C to mo$e to file F. on the tape =the number . is Qust a random number pickedW "ouBll ha$e to determine where the backup of the files"stem "ou need is located on the tape and use that number instead@ !hen "ouBd change to some director" =like /tmp or some place with lots of space@ and do a Cufsrestore i$f /de$/rmt/&nC !hen use CcdC, ClsC, and CpwdC to na$igate, CaddC and CdeleteC to select which files to extract, and CextractC =whose prompt "ou should answer with C,C@ to extract them from the tape Oh, and then Cmt 4f /de$/rmt/&n offlineC to rewind and eQect the tape Of course, this assumes that the administrator chose to use ufsdump to back up the files, which is definitel" not a gi$en (lso, it is 'uite possible that the administrator chose to do incremental backups, so if that is the case, "ou ma" need to restore from a full backup tape )and) an incremental backup tapem, which makes things e$en more complicated ItBs reall" hard to know what the right thing to do is without knowing what backup scheme the administrator chose for that s"stem posted by Brahma at 2:07 PM & comments

if < do a metadb @a >dev>dsk>c0t0d0s

i e if I do a metadb 4a /de$/dsk/c&t&d&s- will it Qust add another K database replica into the sliceA ;o NouBll ha$e to delete all the replicas in one slice, then create all the replicas at one time metadb 4d /de$/dsk/c&t&d&smetadb 4a 4c . /de$/dsk/c&t&d&sposted by Brahma at 2:06 PM & comments

8ape #ontrol @t&e mt #ommand0


!ape 5ontrol 4the mt 5ommand# !his assume that the de$ice is at the & address Shows whether de$ice is $alid, whether tape is loaded, and status of tape mt 4f /de$/rmt/& status# Rewinds tape to start mt 4f /de$/rmt/& rewind# Shows table of contents of archi$e If tar t$f produces an error, then there are no more records on the tape tar t$f /de$/rmt/&# (d$anced to the next archi$e on the tape mt 4f /de$/rmt/& fsf# 0o$es the tape to the end of the last archi$e that it can detect mt 4f /de$/rmt/& eom# 8rases the tape Use with care mt 4f /de$/rmt/& erase# 8Qects the tape, if the de$ice supports that option mt 4f /de$/rmt/& offline#

!o extract length" archi$es e$en if "ou plan to log out, use the nohup command as follows# nohup tar x$f /de$/rmt/& V Identif" the tape de$ice dmesg I grep st 5heck the status of the tape dri$e mt 4f /de$/rmt/& status !arring files to a tape tar c$f /de$/rmt/& ) 5pioing files to a tape find 4print I cpio 4o$cB K /de$/rmt/& ?iewing cpio files on a tape cpio 4i$tB M /de$/rmt/& Restoring a cpio cpio 4i$cB M /de$/rmt/& !o compress a file compress 4$ some file !o uncompress a file uncompress some file O !o encode a file uuencode some file O some file O !o unencode a file uudecode some file O some file O !o dump a disk slice using ufsdump

ufsdump &c$f /de$/rmt/& /de$/rdsk/c&t&d&s& or ufsdump &c$f /de$/rmt/& /export/home !o restore a dump with ufsrestore ufsrestore r$f /de$/rmt/& !o duplicate a disk slice directl" ufsdump &f 4 /de$/rdsk/c&t&d&sE I=cd /homeWufsrestore xf 4@ posted by Brahma at 2:05 PM , comments

,irror 6emoval
7ow !o# 0irror Remo$al !o remo$e a mirror from a $olume =i e , to remo$e one of the plexes that belongs to the $olume@, run the following command# $xplex 4o rm dis (n" associated subdisks will then become a$ailable for other uses !o remo$e the disk from ?olume 0anager control entirel", run the following command# $xdisk rm <or example, C$xdisk rm c,t,d&s.C 7ow !o# 0irror Backup !he following techni'ues can be used to backup mirrored $olumes b" temporaril" taking one of the mirrors offline and then reattaching the mirror to the $olume once the backup has been run , Disassociate one of the mirrors from the $olume to be backed up# $xplex dis . 5reate a new, temporar" $olume using the disassociated plex# $xmake 4g 4U gen $ol temp$ol plex* : Start the new $olume#

$x$ol start temp$ol - 5lean the new $olume before mounting# fsck 4" /de$/$x/rdsk//temp$ol / 0ount the new $olume and perform the backup L Unmount the new $olume E Stop the new $olume# $x$ol stop temp$ol 9 Disassociate the plex from the new $olume# $xplex dis % Reattach the plex to the original $olume# $xplex att ,& Delete the temporar" $olume# $xedit rm temp$ol !o displa" the current ?eritas configuration, use the following command# $xprint !o monitor the progress of tasks, use the following command# $xtask 4l list !o displa" information related to plexes, run the following command# $xprint 4lp posted by Brahma at 2:04 PM & comments

Fi=in9 #orrupted Files and 'tmp= 3rrors


<ixing 5orrupted <iles and wtmpx 8rrors Unfortunatel", s"stem accounting is not foolproof Occasionall", a file becomes corrupted or lost Some of the files can simpl" be

ignored or restored from backup 7owe$er, certain files must be fixed to maintain the integrit" of s"stem accounting !he wtmpx files seem to cause the most problems in the dail" operation of the s"stem accounting When the date is changed manuall" and the s"stem is in multiuser mode, a set of date change records is written into the /$ar/adm/wtmpx file !he wtmpfix utilit" is designed to adQust the time stamps in the wtmp records when a date change is encountered 7owe$er, some combinations of date changes and reboots slip through the wtmpfix utilit" and cause the acctcon program to fail 7ow to <ix a 5orrupted wtmpx <ile , Become superuser . 5hange to the /$ar/adm director" : 5on$ert the wtmpx file from binar" to (S5II format F /usr/lib/acct/fwtmp M wtmpx K wtmpx ascii 8dit wtmpx ascii to delete the corrupted records / 5on$ert the wtmpx ascii file back to a binar" file F /usr/lib/acct/fwtmp 4ic M wtmpx ascii K wtmpx See fwtmp=,0@ for more information posted by Brahma at 2:04 PM & comments

<s t&ere a 'ay to determine t&e A<5 associated 'it& a socket )


lsof or K Is there a wa" to determine the >ID associated with a socket A

Or using nati$e commands without using lsof is to use pfiles cd /proc pfiles ) K /tmp/pfiles out search through pfiles out for the process that has the socket open "ou are interested in i e there will be entries such as# :EE,# /export/home/archi$er/bin/m"process 5urrent rlimit# ./L file descriptors &# SHI<57R mode#&LLL de$#9/,& ino#,%,:.& uid#& gid#: rde$#,:,. OHRDO;2NIOH2(RG8<I28 ,# SHI<57R mode#&LLL de$#9/,& ino#,%,:%E uid#& gid#& rde$#.-,. OHRDWRIOH2(RG8<I28 .# SHI<R8G mode#&L-- de$#9/,/ ino#,E uid#,&- gid#, si+e#,:%-:L OHWRO;2NIOH2(RG8<I28 :# SHI<DOOR mode#&--- de$#.%:,& ino#/9 uid#& gid#& si+e#& OHRDO;2NIOH2(RG8<I28 <DH52O8185 door to nscdR.&&S -# SHI<SO5U mode#&LLL de$#.9E,& ino#,%/E- uid#& gid#& si+e#& OHRDWR sockname# (<HI;8! ,& , , , port# %&&, peername# (<HI;8! ,& , , . port# %&&, pid :EE, has port %&&, open locall" posted by Brahma at 2:04 PM , comments

snaps&ot error0 File system could not be 'rite locked


!homas wrote# K Is there an"wa" to fssnap the root file s"stemA I would like to use a K snapshot for backup, but when I tr" to do that I get the error# K snapshot error# <ile s"stem could not be write locked (re "ou running ntp/xntpA B" default that program runs in the realtime processing class, and has a current director" in the root files"stem Nou canBt write lock the files"stem while thatBs true KK Nes, we are running ntp I will tr" killing that and see what happens KK I am thinking that it might be better to repartition the disk rather than KK to take ntp down and up for e$er" backup K Wh"A Simpl" create a script that stops xntpd, creates a snapshot, starts K xntpd and perform backup ;o need to repartition But thatBs not kind to ntp, which wants to keep running to remain stable

!he onl" problem here is that itBs working director" is in root I see two possible workarounds F, 7a$e it run in a non4R! class Nou can use priocntl for that I donBt think itBll ha$e a dramatic effect on the timekeeping, but "ou might not want to do this if "ou need $er" accurate time on this machine Y pgrep ntp :&. Y /usr/bin/ps 4o class,pid 4p :&. 52S >ID R! :&. Y priocntl 4s 4c !S :&. Y /usr/bin/ps 4o class,pid 4p :&. 52S >ID !S :&. !hus taking it from the realtime class to the timesharing class =I suppose I should ha$e tried a fssnap at that point, but didnBt @ F. Run it with the working director" not in root I donBt see an" reason it couldnBt run in /tmp or /$ar/run, unless "ou wanted to retain an" core files that might be generated IBm not certain how best to achie$e that, but I saw a post that suggested someone had good luck using chroot posted by Brahma at 2:03 PM & comments

Friday, *ctober 1 , 2005


Aroblems 'it& port for'ardin9 usin9 SS;B6C
>ort forwarding feature using SS7 is failing Resolution# !op 5onfirm these configuration settings in /etc/ssh/sshdHconfig file# (llow!cp<orwarding "es Gatewa">orts "es !hen execute# F ssh 4g 42 9&9&#webser$er#9& webser$er

In this example, s"stems connecting to http#//webser$er#9&9& will be forwarded to the web ser$er daemon httpd listening on !5> port 9& on the host webser$er If "ou allow root access with this setting in /etc/ssh/sshdHconfig# >ermitRoot2ogin "es Nou can use pri$ileged or reser$ed ports =range ,4,&.:@ with the abo$e command !emporar" Workaround# !op (dditional Information# !op posted by Brahma at 3:56 PM & comments

SS; FreDuently %sked !uestions Eeys


, , General troubleshooting hints ) In order for us to help "ou, the problem has to be repeatable ) When reporting problems, alwa"s send the output of Y ssh 4$ 4l MuserK MdestinationK ) If "ou ha$e a root account on the destination host, please run F /usr/sue/etc/sshd 4d 4p ... or =on 2inux@ F /usr/sbin/sshd 4d 4p ... as root there and connect using Y ssh 4$ 4p ... MuserK MdestinationK =the sshd ser$er will exit after each connection, and "ou ma" run into trouble with a local firewall that pre$ents "ou from connecting from a different machine Same4machine connections to

ClocalhostC should work@ ) If "ou do not ha$e root access on the ser$er, "ou can generate "our own Cser$erC ke" pair and run on an unpri$ileged port# Y ssh4ke"gen 4> CC 4f /tmp/sshtest Y pagsh 4c C/usr/sue/etc/sshd 4d 4p .... 4h /tmp/sshtestC or =on 2inux@ Y pagsh 4c C/usr/sbin/sshd 4d 4p .... 4h /tmp/sshtestC !hen connect using Y ssh 4$ 4p .... MuserK MdestinationK , / log in using RS( ke"s Do "ou reall" want to do thisA Using RS( for login means "ou will not get an (<S token, so "ou cannot access most of "our home director" on the public ser$ers !here is no wa" to CtranslateC between RS( ke" and (<S tokens If "ou want to gi$e it a tr", check the following common errors# ) the U;I1 permissions must be correct# &L&& for ^/ ssh/authori+edHke"s, &E// for ^/ ssh =and (<S read access for e$er"bod"T@, home director" not writable b" an"bod" but "ou Warning >lease make sure that "our pri$ate ke" is somewhere safe =e g in ^/pri$ate, with a s"mlink to ^ ssh@, and encr"pted using a good pass phrase ) in ^/ ssh/authori+edHke"s, there has to be one ke" per line =no linebreaks allowed@ !he debugging tips at the beginning of this chapter =running the ser$er in debug mode@ should point out the reason for failure prett" 'uickl"

, L ;ew warning messages OpenSS7 stores both the host name and the I> number together with the host ke" !his leads to some new messages# Warning# >ermanentl" added Blxplus&&,,,:E ,:9 ,L, ,.LB =RS(@ to the list of known hosts Warning# >ermanentl" added the RS( host ke" for I> address B,:E ,:9 ,L, ,.LB to the list of known hosts If these anno" "ou, use C5heck7ostI> noC in "our Y7O08/ ssh/config file 7owe$er, please be aware that "ou are turning off an intentional securit" feature of ssh Some warning that ma" appear while connecting to the >2US ser$ers under their common D;S name =e g RS>2US, 7>>2US@ is due to the fact that for load4balancing purposes, these ser$ersB D;S entr" is constantl" changing !his is detected and reported b" ssh =as it should be@ JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJ JJJJJJJJJJJJJJJJJJJJ J W(R;I;G# >OSSIB28 D;S S>OO<I;G D8!85!8DT J JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJ JJJJJJJJJJJJJJJJJJJJ !he RS( host ke" for rsplus has changed, / and the ke" for the according I> address ,:E ,:9 .-L 9. is unknown !his could either mean that D;S S>OO<I;G is happening or the I> address for the host and its host ke" ha$e changed at the same time JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJ JJJJJJJJJJJJJJJJJJJJ ,& J W(R;I;G# R80O!8 7OS! ID8;!I<I5(!IO; 7(S 57(;G8DT J JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJ JJJJJJJJJJJJJJJJJJJJ I! IS >OSSIB28 !7(! SO08O;8 IS DOI;G SO08!7I;G ;(S!NT Someone could be ea$esdropping on "ou right now =man4in4the4middle attack@T It is also possible that the RS( host ke" has Qust been changed ,/ >lease contact "our s"stem administrator (dd correct host ke" in /afs/cern ch/user/i/i$en/ ssh/knownHhosts to get rid of this message Offending ke" in /afs/cern ch/user/i/i$en/ ssh/knownHhosts#.-L >assword authentication is disabled to a$oid !roQan horses (gent forwarding is disabled to a$oid !roQan horses

!o a$oid these, use 'ualified hostnames like rsplus&,, hpplus&, etc =21>2US and SU;D8? are not prone to this problem, since a common host ke" is used on all the ser$ers in the cluster@ (n alternati$e is to =manuall"@ insert into Y7O08/ ssh/knownHhosts the >2US name after each 'ualified machine name that belongs to this >2US ser$ice# rsplus&,,rsplus ,&.- :E ,/-/E&-./E/ rsplus&.,rsplus ,&.- :E ,&E:--E%::L !o remo$e the abo$e error message, simpl" edit the file ^/ ssh/knownHhosts =or ^/ ssh/knownHhosts. for the SS74. protocol@ and remo$e the line =which should start with the hostname and/or I> address@ Be careful not to break the long lines, it has to ha$e one line per host/ke" ;ext time "ou connect, ssh should ask "ou whether "ou actuall" want to connect, etc , E Statistics options for scp OpenSS7 scp does not support a few of the command line options from ssh4, . .L Besides, the statistics output is different !he en$ironment $ariables controlling statistics output =SS7HS5>HS!(!S, SS7H;OHS5>HS!(!S, SS7H(22HS5>HS!(!S, SS7H;OH(22HS5>HS!(!S@ are not supported, either !he changed options are ssh4, . .L option meaning OpenSS7 option 4a !urn on statistics displa" for each file =on b" default@ =on b" default@ 4( !urn off statistics displa" for each file !his appears to be a no4op for ssh4, . .L =n a , use 4' to turn off all statistics@ 42 Use non pri$ileged port 4o Use>ri$iledged>ort*no =works as well on ssh4, . .L@ 43 !urn on statistics displa" =on b" default@ Sample statistics output from OpenSS7 scp =no explicit options@ Qunk ,&&Z I)))))))))))))))))))))))))))))I ..9LE &&#&& +eroes ,&&Z I)))))))))))))))))))))))))))))I /,. UB &&#&& and output from ssh4, . .L scp# Qunk I .. UB I .. : kB/s I 8!(# &&#&&#&& I ,&&Z +eroes I /,. UB I /,. & kB/s I 8!(# &&#&&#&& I ,&&Z

If "ou actuall" parse this output in scripts, "ou would ha$e to change them , 9 8rrors on exit regarding 1,, applications Since the ssh client does forwarding for the 1,, traffic from the remote host, it wonBt exit until the last 1,, application has been closed It appears that this mechanism sometimes fails, and the ssh program will report errors like below e$en if all remote 1,, applications are done# =logout@ Waiting for forwarded connections to terminate !he following connections are open# 1,, connection from xxxxx cern ch port .:/. !he session will appear to hang It can be closed b" t"ping C^ C =without the 'uotes@, and this should return "ou to "our pre$ious shell Nou could use C^VC as well to lea$e the current connection as a background process If "ou are sure that there are no 1,, windows or icons from the remote ser$er around, and if "ou can reproduce the problem, please contact ssh supportJcern ch ( current suspicion is that the regular network scanning mechanism pla"s a role in this# b" opening a connection to the remote 1,, port, but failing to connect through the forwarded channel, this could mess up the internal bookkeeping done b" ssh !o be confirmed posted by Brahma at 3:56 PM & comments

Aroblem replacin9 disk in Stor3d9e 8F


>roblem replacing disk in Stor8dge !: (t work we ha$e a !: where all disks are configured for R(ID/ One of the disks has failed, which means that accessing the data on the !: is reall" slow When I entered the replacement disk, it seemed to be taken in use automaticall" =proc list showed some progress@, but then it failed with a &D status =see $ol stat, fru stat etc below@ I noticed that the disk is not exactl" the same as the other, could this be the reasonA It is a proper replacement disk bought from Sun with the proper bracket and e$er"thing, so it should work or whatA What can I do to fix thisA

44 4 8rlend 2eganger !:&& Release , ,Eb .&&,/&//:, ,E#-E#.. 5op"right =5@ ,%%E4.&&, Sun 0icros"stems, Inc (ll Rights Reser$ed bigdadd"#/#M,K$ol stat $& u,d, u,d. u,d: u,d- u,d/ u,dL u,dE u,d9 u,d% mounted &D & & & & & & & & bigdadd"#/#M.Kfru list ID !N>8 ?8;DOR 0OD82 R8?ISIO; S8RI(2 444444 44444444444444444 44444444444 44444444444 44444444 44444444 u,ctr controller card S2R40I :E/4&&9-4&.4 &.,& &..9,: u,d, disk dri$e S8(G(!8 S!::LL&/<SU; (::9 :<>&7L:D u,d. disk dri$e S8(G(!8 S!::LE&-<SU; (-.D :5D&?<B2 u,d: disk dri$e S8(G(!8 S!::LE&-<SU; (-.D :5D&!9%W u,d- disk dri$e S8(G(!8 S!::LE&-<SU; (-.D :5D&?5Ou,d/ disk dri$e S8(G(!8 S!::LE&-<SU; (-.D :5D&?</2 u,dL disk dri$e S8(G(!8 S!::LE&-<SU; (-.D :5D&!G:: u,dE disk dri$e S8(G(!8 S!::LE&-<SU; (-.D :5D&!!9G u,d9 disk dri$e S8(G(!8 S!::LE&-<SU; (-.D :5D&?D-! u,d% disk dri$e S8(G(!8 S!::LE&-<SU; (-.D :5D&!13< u,l, loop card S2R40I :E/4&&9/4&,4 / &. <lash &::,E% u,l. loop card S2R40I :E/4&&9/4&,4 / &. <lash &:&&:9 u,pcu, power/cooling unit !85!RO245(; :&&4,-/-4&,= &&&& &.99&& u,pcu. power/cooling unit !85!RO245(; :&&4,-/-4&,= &&&& &.9E%% u,mpn mid plane S2R40I :E&4:%%&4&,4 &&&& &.,.9. bigdadd"#/#M:Kfru stat 5!2R S!(!US S!(!8 RO28 >(R!;8R !80> 444444 4444444 4444444444 4444444444 4444444 4444 u,ctr read" enabled master 4 :& / DISU S!(!US S!(!8 RO28 >OR!, >OR!. !80> ?O2U08 444444 4444444 4444444444 4444444444 444444444 444444444 4444 444444 u,d, read" disabled data disk read" read" :& $& u,d. read" enabled data disk read" read" :: $& u,d: read" enabled data disk read" read" :- $& u,d- read" enabled data disk read" read" :. $& u,d/ read" enabled data disk read" read" :: $& u,dL read" enabled data disk read" read" :: $& u,dE read" enabled data disk read" read" :L $&

u,d9 read" enabled data disk read" read" :. $& u,d% read" enabled data disk read" read" :. $& 2OO> S!(!US S!(!8 0OD8 5(B28, 5(B28. !80> 444444 4444444 4444444444 4444444 444444444 444444444 4444 u,l, read" enabled master 4 4 .E & u,l. read" enabled sla$e 4 4 .E / >OW8R S!(!US S!(!8 SOUR58 OU!>U! B(!!8RN !80> <(;, <(;. 444444 4444444 444444444 444444 444444 4444444 444444 444444 444444 u,pcu, read" enabled line normal fault normal normal normal u,pcu. read" enabled line normal fault normal normal normal bigdadd"#/#M-Kexit 5onnection closed b" foreign host Repl" K to fix thisA IBd sa", complain J Sun Searching google, I found the documentation from Seagate (mong other things, it lists this# S!::LL&/# .%,/-% c"l / - heads / E,,L9E,:E, data blocks S!::LE&-# ,-,,&& c"l / ,. heads / E,,L9E,:L% data blocks I donBt know whether these differences are a problem in this case Sun should be able to tell 0a"be the issue can be fixed with a firmware update on the new dri$e =or on all the old ones@A Nou need to take a look at the s"slog file right after the rebuild fails !here should be more information in there I ha$e had this happen before where the rebuild fails because of a read error on another disk Repl" ,@ Nour boot firmware is $er" old .@ Nour disk firmware is wa" out of date :@ Both the batteries in "our >5Us are expired !he latest boot firmware is , ,9 &- and "ouBre at , ,Eb !hatBs at least : "ears out4of4dateT

!he latest disk firmware for the S!::LL&/<SU; is (9:9 !he latest disk firmware for the S!::LE&-<SU; is (8.L If "ouBre luck" "ouBll be able to reco$er !he Bproc listB command will show if the new disk is being reconstructed to Otherwise hopefull" "ou ha$e a wa" to backup the data If so "ou can get the batteries replaced, upgrade all the firmware and reinitiali+e the $olume and restore the data Repl" K another disk !hanks for the tip I ha$e now learnt that the disk should be OU, so I will tr" this again tomorrow and watch the s"slog as "ou suggest I will be back with the result 44 4 8rlend 2eganger Repl" K all the firmware and reinitiali+e the $olume and restore the data I guess this is what happens when "ou ha$e a de$ice that works OU, "ou Qust forget about it !he batteries ha$e been replaced though, we had ordered them in I was able to cop" the data from the !: to other disk areas on the ser$er, so IBm OU with the files =I also ha$e a backup on tape made before it failed@ I ha$enBt R!<0 "et, but are there an" tips I should be aware of when upgrading boot and disk firmwareA What to do firstA Where do I get hold of the firmware updatesA K ordered them in Nou ha$e to do more than Qust replace the batteries or the !: wonBt know an"thing has changed 5ommands need to be ran to reset the dates back to +ero so the errors will go awa" !his InfoDoc should explain the procedures# http#//www sunshack org/data/sh/. ,/infoser$er central/data/s"shbk/co (lso the batteries should now last : "ears instead of . "ears per Sun In the same patch "ou would use to upgrade the boot and disk firmware#

http#//sunsol$e sun com/pub4cgi/pdownload plAtarget*,&%,,/4,EVmethod*h there is a !:extender program that will run commands to set the batter" expiration life to :L months instead of .- months K another disk Nou were ,&&Z correct !he warning light was lit on disk u,d,, so this disk was replaced and attempted rebuilt !he rebuild failed after a while, with a note of multiple disk errors in the s"slog 4 it seems as u,d- has a problem as well I was fooled b" $ol stat onl" showing error on on u,d, 4 I will check the s"slog more carefull" in the future 44 4 8rlend 2eganger K http#//sunsol$e sun com/pub4cgi/pdownload plAtarget*,&%,,/4,EVmethod*h 8xcellent, thank "ou I need to wait for m" second replacement disk, but after reading up on the patch installation method, it doesnBt seem too difficult to do K there is a !:extender program that will run commands to set the batter" K expiration life to :L months instead of .- months I had a look at the !:extender program code and I decided that using this patch is an extreme o$erkill =creating a long perl script and e$en include perl itself in the patch@ to do a small Qob# I onl" made two C id write blife MpcuK :LC commands which seems to do the trick =see below@ Of course, if "ou ha$e a room full of racks full" populated with !:s, the script would be hand" 44 4 8rlend 2eganger bigdadd"#/#M-9K bigdadd"#/#M-9Kid read u,pcu, Re$ision # &&&& 0anufacture Week # &&--.&&& Batter" Install Week # &&-,.&&/ Batter" 2ife Used # & da"s, . hours Batter" 2ife Span # E:& da"s, ,. hours Serial ;umber # &.99&& Batter" Warrant" Date# .&&/,&,&&9.,-% Batter" Internal <lag# &x&&&&&&&& ?endor ID # !85!RO245(;

0odel ID # :&&4,-/-4&,=/&@ bigdadd"#/#M-%K bigdadd"#/#M-%Kid read u,pcu. Re$ision # &&&& 0anufacture Week # &&--.&&& Batter" Install Week # &&-,.&&/ Batter" 2ife Used # & da"s, . hours Batter" 2ife Span # E:& da"s, ,. hours Serial ;umber # &.9E%% Batter" Warrant" Date# .&&/,&,&&9.,/. Batter" Internal <lag# &x&&&&&&&& ?endor ID # !85!RO245(; 0odel ID # :&&4,-/-4&,=/&@ bigdadd"#/#M/&K bigdadd"#/#M/&K bigdadd"#/#M/&K id write blife u,pcu, :L bigdadd"#/#M/,K id write blife u,pcu. :L bigdadd"#/#M/.K bigdadd"#/#M/.K bigdadd"#/#M/.Kid read u,pcu, Re$ision # &&&& 0anufacture Week # &&--.&&& Batter" Install Week # &&-,.&&/ Batter" 2ife Used # & da"s, . hours Batter" 2ife Span # ,&%/ da"s, ,9 hours Serial ;umber # &.99&& Batter" Warrant" Date# .&&/,&,&&9.,-% Batter" Internal <lag# &x&&&&&&&& ?endor ID # !85!RO245(; 0odel ID # :&&4,-/-4&,=/&@ bigdadd"#/#M/:K bigdadd"#/#M/:K bigdadd"#/#M/:Kid read u,pcu. Re$ision # &&&& 0anufacture Week # &&--.&&& Batter" Install Week # &&-,.&&/ Batter" 2ife Used # & da"s, . hours Batter" 2ife Span # ,&%/ da"s, ,9 hours Serial ;umber # &.9E%% Batter" Warrant" Date# .&&/,&,&&9.,/. Batter" Internal <lag# &x&&&&&&&& ?endor ID # !85!RO245(; 0odel ID # :&&4,-/-4&,=/&@ bigdadd"#/#M/-K bigdadd"#/#M/-K bigdadd"#/#M/-K

posted by Brahma at 3:55 PM & comments

Secure remote tasks 'it& ss& and keys


Secure remote tasks with ssh and ke"s !akeawa"# If "ou want to set up another administrator on "our ser$er or execute remote tasks securel", learn to use ssh with ke"s ?incent Danen tells "ou how in this 2inux tip Often, if "ouBre administering a ser$er, "ouBll find "ou need to execute some small task on the ser$er, or "ou want to delegate a task to another administrator, but "ou donBt want to gi$e them full access >erhaps "ou want to execute a remote backup or status test !his can all be accomplished using ssh with ke"s so that it can be unattended, but still secure !he first step is to create the ssh ke" using the ssh4ke"gen utilit" !his is extremel" straightforward If "ou plan to ha$e the task unattended, be sure to not gi$e it a password !o increase securit", make a special account to execute the taskW make sure it canBt log in, and make sure that the ssh public ke" is used onl" on a particular ser$er or set of ser$ers On the remote ser$er, cop" the userBs ssh public ke" into ^/ ssh/authori+edHke"s Nou will need to make some modifications to the line in authori+edHke"s !o begin, "ou should set a CcommandC ke"word to ensure that onl" one particular command can be executed b" that ke" !he s"ntax looks like# McodeK command*CC U8N M/codeK where command could be something as simple as C/usr/bin/rs"ncC or C/usr/local/bin/foo shC !o enhance and secure this further, add the following options to authori+edHke"s# McodeK command*C/usr/local/bin/foo shC,no4port4forwarding,no41,,4 forwarding,no4agent4forwarding,no4pt" U8N

M/codeK !his ensures that an"one connecting cannot do an" port forwarding, 1,, forwarding, agent forwarding, and ssh doesnBt allocate a pseudo4!!N which pre$ents the issuing of commands through an interacti$e session If the client s"stem is ade'uatel" secured to protect the password4less ke", and the a$ailabilit" of commands is restricted on the ser$er, using SS7 to execute remote commands is a bree+e posted by Brahma at 3:54 PM & comments

plumb and unplumb


K Basicall" it seesm its unplumbed but still existing in the running s"stem K so commands like K arp 4a K netstat 4i K should show it, ;o Unplumbed de$ices do );O!) appear in either of those two lists Unplumbed de$ices are simpl" unknown to I> and (R> K If "ou dont want to reboot, tr" plumbing and unplumbing it, might do the K trick ?er" likel" not Dri$er loading and operation is onl" indirectl" related to plumbing C>lumbC means that I> opens the dri$er =triggering it to load into memor" if necessar"@ and begins using it CUnplumbC means onl" that I> closes the dri$er stream If the dri$er itself is still in memor" =and a dri$er that manages multiple instances and has one instance still plumbed, as in the original posterBs stated configuration, is certainl" in that state@, then 44 depending on how the dri$er itself is designed 44 ma" still be fielding interrupts from the underl"ing hardware >lumbing and unplumbing I> will do nothing in that case posted by Brahma at 3:53 PM & comments

005 11001 am Sub/ect0 directio

directio n I ha$e a running process which does io# last pid# ..9:9W load a$erages# & %-, & %,, & 9. ,E#/-#.% ,&: processes# ,&& sleeping, , +ombie, . on cpu 5>U states# Z idle, Z user, Z kernel, Z iowait, Z swap 0emor"# -&%L0 real, ./L0 free, E,990 swap in use, ::%.0 swap free >ID US8R;(08 2W> >RI ;I58 SIO8 R8S S!(!8 !I08 5>U 5O00(;D E::/ root . .& & ,..:0 ,,L-0 cpu/. .- E7 -% /:Z clemser$H%H& truss 4p E::/ /,# read=,/, C&.&:&,\&\&\&\&\&\&\&\&\&C , 9,%.@ * 9,%. /,# lseek=,/, &x9<-95(&&, S88UHS8!@ * &x9<-95(&& /,# read=,/, C\&\&\&\&\&\&\&\&\&\&\&\&C , 9,%.@ * 9,%. /,# lseek=,/, &x9<-95B.&, S88UHS8!@ * &x9<-95B.& /,# read=,/, C&.&:&,\&\&\&\&\&\&\&\&\&C , 9,%.@ * 9,%. /,# lseek=,/, &x9<-95(&&, S88UHS8!@ * &x9<-95(&& /,# read=,/, C\&\&\&\&\&\&\&\&\&\&\&\&C , 9,%.@ * 9,%. /,# lseek=,/, &x9<-95B.&, S88UHS8!@ * &x9<-95B.& /,# read=,/, C&.&:&,\&\&\&\&\&\&\&\&\&C , 9,%.@ * 9,%. /,# lseek=,/, &x9<-95(&&, S88UHS8!@ * &x9<-95(&& /,# read=,/, C\&\&\&\&\&\&\&\&\&\&\&\&C , 9,%.@ * 9,%. When i monitor the s"stem , both for directIO and normal 4 cached io , i see the following patterns I will $e appreciated if someone can comment in order to eplain this# !he program reads data from the /data files"stem !his is ufs 4 on emc disk arra" = i ha$e , hba 4 fibre channel@ mount 4o remount,noforcedirectio /data F sar :& ,&&&& SunOS $erdenfs, / % GenericH,,E,E,4,. sun-u ,&/&//.&&/ ,E#/:#-. Zusr Zs"s Zwio Zidle ,E#/-#,. ,- :E & -% ,E#/-#-. ,: :9 & -9

,E#//#,. ,- :% & -E ,E#//#-. ,: :9 & -% extended de$ice statistics r/s w/s kr/s kw/s wait act$ ws$cHt as$cHt Zw Zb de$ice , - & , ,.&L , & - & & & , & , -- 9 & E c.t,LdL/ & , , . , , % / & & & & & & % . & , c,t,d& & & , & & & E 9 & & & & ,/ . :/ - & & c,t&d& extended de$ice statistics r/s w/s kr/s kw/s wait act$ ws$cHt as$cHt Zw Zb de$ice , . & , ,,9: . & - & & & , & , -9 E & L c.t,LdL/ & : , . . E % / & & & & & & E E & , c,t,d& & & . - & & ,% : & , & , .% L .L % & , c,t&d& extended de$ice statistics r/s w/s kr/s kw/s wait act$ ws$cHt as$cHt Zw Zb de$ice E . & , ,..E E & - & & & , & & ,, , & 9 c.t,LdL/ & , , . , , % / & & & & & & E - & & c,t,d& & & & - & & . : & & & & & & ,, , & & c,t&d& extended de$ice statistics r/s w/s kr/s kw/s wait act$ ws$cHt as$cHt Zw Zb de$ice , : & , ,.L- & & - & & & , & , -- % & L c.t,LdL/ & : , , . E % / & & & & & & 9 & & , c,t,d& & & & . & & , L & & & & & & ,, - & & c,t&d& $erdenfs,Jroot/tmp F$mstat 4p :& memor" page executable anon"mous files"stem swap free re mf fr de sr epi epo epf api apo apf fpi fpo fpf E-&.9&& ,E9%-,L E: 9% ,& & , , & & & , , .L.L ,, % :-E-&%L .L.9:. ,/9 & & & & & & & & & & ,.&E && :-E-,.& .L./.& ,9E .-% & & & & & & & & & ,.,L && :-E-&E. .L.:&- ,LL :: , & & & & & & & & ,,99 ,, :-E-.&9 .L.,-- ,/% & & & & & & & & & & ,.L% && mount 4o remount,forcedirectio /data F sar :& ,&&&& SunOS $erdenfs, / % GenericH,,E,E,4,. sun-u ,&/&//.&&/

Zusr Zs"s Zwio Zidle ,E#/E#,. 9 .- .: -L ,E#/E#-. . ,& :% -% extended de$ice statistics r/s w/s kr/s kw/s wait act$ ws$cHt as$cHt Zw Zb de$ice ./E 9 & & L.-:- / & & & & & 9 & & : , , EE c.t,LdL/ & , , . , , % - & & & & & & 9 : & , c,t,d& & - & - : . : . & & & & & & 9 9 & & c,t&d& extended de$ice statistics r/s w/s kr/s kw/s wait act$ ws$cHt as$cHt Zw Zb de$ice .-- - & & L---E % & & & & & 9 & & : : , E9 c.t,LdL/ & : , . . E % . & & & & & & E E & , c,t,d& & E . E - 9 ,/ L & & & , E , ,/ 9 & . c,t&d& $erdenfs,Jroot/tmp F$mstat 4p :& memor" page executable anon"mous files"stem swap free re mf fr de sr epi epo epf api apo apf fpi fpo fpf :-E-&L- .L:-/L :, ,/ & & & & & & . & & L,%.&& :-E-,%. .L:--& ./ 9 & & & & & & , & & L:%L/ && :-E-&L- .L:&99 -: 99 & & & / & & & & & L:%LL && , When i use noforcedirectio , sar reports no wio but :9 Zs"s , on the other hand iostat shows about ,0B read per second with -- % msec ser$ice time !his io utili+ed the disk onl" L or 9 percent (nd , $mstat 4p shows that the s"stem does pagins for file io onl" for ,0B . But when i force directio , i ha$e Z:% wio , io rate grows significantl" =L/0B per second@ , the disks are utili+ed at EE percent and ser$ice time is : , msec (t the same time , i see L/0B of fpi , Wh" does the low io rate in , =noforcedirectio@ create -- % msec ser$ice time while the high io rate create onl" : , msecA Isnt it logical to expect to see more io more ser$ice time . Since the option . uses forcedirectio , how can i explain the large fpi $alueA =If directio is in use , wh" does the operating s"stem cache file dataA@ : comparing the Z:9 s"s with Z:% wio , which one of them is better A

Uind Regards, tolga n I think the output is related with the IOBs t"pe of "our application If IO is through CddC command, the output is Qust what "ou think right, that is to sa",,@using CnoforcedirectioC option, IO is using more cpu power, and cached io=fpi@ ,IO thoughput is higherW.@using CforcedirectioC option, opposite to the former CddC command is using Cread/writeC s"stem calls Rn Is there an" progress about itA !o confirm whether using the filecache or not, "ou can install the tool bundle CmemtoolC to assist "ou http#//www solarisinternals com/si/tools/memtool/index php (s a command from CmemtoolC, Cmemps 4mC can tell "ou which file is in cache and how much cache the file occup" >S, another tool CdirectiostatC could be also helpful http#//www solarisinternals com/si/tools/directiostat/index php n KIs there an" progress about itA I dont understand, if cache is turned off, ph"sial disk IO increases !his is natural, and the perfomance problems are to be found elsewhere /wfr n !he applications such as oracle, which has own file IO management s"stem, will be benefit from directio =file cache disabled@Wbut the performance of the normal file s"stem IO will get an impact n !he applications such as oracle, which has own file IO management s"stem, will benefit from directio =file cache disabled@Wbut the performance of the normal file s"stem IO will get an impact posted by Brahma at 3:53 PM & comments

9rap&ics monitor and serial console on 1 0


SubQect# Re# graphics monitor and serial console on ?--& n

K We ha$e a ?--& running Solaris % !he s"stem has an 1?R4,&& graphics K card and 5R! monitor attached 5urrentl" the 5R! monitor is acting as K the console Is there an" wa" to continue to utili+e the 5R! monitor K for logging in and windowing =i e continue to see the dtgreet login K screen and login to 5D8@ while ha$ing another de$ice attached to the K serial management port act as the console for the s"stemA Nes, thatBs prett" common <orce the console to the de$ice "ou want $ia Binput4de$iceB and Boutput4de$iceB in the eeprom !hen cp /usr/dt/config/1ser$ers to /etc/dt/config =if "ou donBt ha$e one there alread"@ Read the examples at the top for the Cif no character de$ice is associatedC example and use that at the bottom instead of the existing line ItBll probabl" look something like this when "ouBre done #& 2ocal localHuidJnone root /usr/openwin/bin/1sun #& 4nobanner !he monitor should come ali$e when dtlogin launches n posted by Brahma at 3:52 PM & comments

Sun 'arns a9ainst puttin9 ra' data on s2


It should be noted though, that Sun warns against putting raw data on s., since block +ero contains the disk label, and labelling will o$erwrite the beginning of "our raw data <inall", IBll mention that I saw an interesting case man" "ears ago, where a disk with s& consisting of the entire disk got unmounted rather abruptl" to sa" the least fsck on s& complained about a bad superblock, e$en with an" of the alternate superblock locations 7owe$er, I was able to fsck s. with success, and then mount cleanl" DonBt know enough about the guts of the disk la"out to know wh" this worked, but it did On the other hand, changing the length of s. to something other than the entire disk is an explicit no4no, according to Sun posted by Brahma at 3:51 PM & comments

Understandin9 5ata "ink 3rrors

Understanding Data 2ink 8rrors 0an" performance issues with ;I5s can be related to data link errors 8xcessi$e errors usuall" indicate a problem When operating at half4duplex setting, some data link errors such as <rame 5heck Se'uence =<5S@, alignment, runts, and collisions are normal Generall", a one percent ratio of errors to total traffic is acceptable for half4duplex connections If the ratio of errors to input packets is greater than two or three percent, performance degradation ma" be noticed In half4duplex en$ironments, it is possible for both the switch and the connected de$ice to sense the wire and transmit at exactl" the same time and result in a collision 5ollisions can cause runts, <5S, and alignment errors due to the frame not being completel" copied to the wire which results in fragmented frames When operating at full4duplex, <5S, 5"clic Redundanc" 5hecks =5R5@, alignment errors, and runt counters should be minimal If the link is operating at full4duplex, the collision counter is not acti$e If the <5S, 5R5, alignment, or runt counters are incrementing, check for a duplex mismatch Duplex mismatch is a situation where the switch is operating at full4duplex and the connected de$ice is operating at half4duplex, or $ice $ersa !he result of a duplex mismatch will be extremel" slow performance, intermittent connecti$it", and loss of connection Other possible causes of data link errors at full4duplex are bad cables, fault" switch port, or ;I5 software/hardware issues 8xplanation of >ort 8rrors 5ounter Description !roubleshooting ;I5 5ompatibilit" Issues on ISUnet (lignment 8rrors (lignment errors are a count of the number of frames recei$ed that donBt end with an e$en number of octets and ha$e a bad 5R5 <5S=<rame 5heck Se'uence@ <5S error count is the number of frames that were transmitted/recei$ed with a bad

checksum =5R5 $alue@ in the 8thernet frame !hese frames are dropped and not propagated onto other ports 1mit48rr !his is an indication that the internal transmit buffer is full Rc$48rr !his is an indication that the recei$e buffer is full UnderSi+e !hese are frames which are smaller than L- b"tes =including <5S@ and ha$e a good <5S $alue Single 5ollisions Single collisions are the number of times the transmitting port had one collision before successfull" transmitting the frame to the media 0ultiple 5ollisions 0ultiple collisions are the number of times the transmitting port had more than one collision before successfull" transmitting the frame to the media 2ate 5ollisions ( late collision occurs when two de$ices transmit at the same time and neither side of the connection detects a collision !he reason for this occurrence is because the time to propagate the signal from one end of the network to another is longer than the time to put the entire packet on the network !he two de$ices that cause the late collision ne$er see that the other is sending until after it puts the entire packet on the network 2ate collisions are detected b" the transmitter after the first Cslot timeC of L- b"te times !he" are onl" detected during transmissions of packets longer than L- b"tes Its detection is exactl" the same as for a normal collisionW it Qust happens late when compared to a normal collision 8xcessi$e 8xcessi$e collision are the number of 5ollisions frames that are dropped after ,L attempts to send the packet resulting in ,L collisions 5arrier Sense 5arrier Sense occurs e$er" time an 8thernet controller wants to send data and the counter is incremented when there is an error in the process

Runts !hese are frames smaller than L- b"tes with a bad <5S $alue Giants !hese are frames that are greater than ,/,9 b"tes and ha$e a bad <5S $alue >ossible 5auses for Incrementing >ort 8rrors 5ounter >ossible 5ause (lignment 8rrors !hese are the result of collisions at half4duplex, duplex mismatch, bad hardware =;I5, cable or port@, or connected de$ice generating frames that do not end with on an octet and ha$e a bad <5S <5S =<rame 5heck Se'uence@ !hese are the result of collisions at half4duplex, duplex mismatch, bad hardware =;I5, cable, or port@, or connected de$ice generating frames with bad <5S 1mit48rr !his is an indication of excessi$e input rates of traffic !his is also an indication of transmit buffer being full !he counter should onl" increment in situations where the switch is unable to forwarded out the port at a desired rate Situations such as excessi$e collisions and ,& megabit ports will cause the transmit buffer to become full Increasing speed and mo$ing link partner to full4duplex should minimali+e this occurance Rc$48rr !his is an indication of excessi$e output rates of traffic !his is also an indication of the recei$e buffer being full !his counter should be +ero unless there is excessi$e traffic through the switch In some switches, the outlost counter has a direct correlation to the Rc$48rr UnderSi+e !his is an indication of a bad frame generated b" the connected de$ice Single 5ollisions !his is an indication of a half4duplex configuration 0ultiple 5ollisions !his is an indication of a half4duplex configuration

2ate 5ollisions !his is an indicationof fault" hardware =;I5, cable, or switch port@ or duplex mismatch 8xcessi$e 5ollisions !his is an indication of o$er4utili+ation of switch port at half4duplex or duplex mismatch 5arrier Sense !his is an indication of fault" hardware =;I5, cable, or switch port@ Runts !his is an indication of the result of collisions, duplex mismatch, dot,', or IS2 configuration issue Giants !his is an indication of fault" hardware, dot,', or IS2 configuration issue (dditional !roubleshooting for ,&&&Base1 ;I5s Gigabit (uto4;egotiation =;o 2ink to 5onnected De$ice@ Gigabit 8thernet has an auto4negotiation procedure that is more extensi$e than what is used for ,&/,&& 0bps 8thernet =Gigabit (uto4negotiation spec# I888 Std 9&. :+4,%%9@ !he Gigabit (uto4negotiation negotiates flow control, duplex mode, and remote fault information Nou must either enable or disable link negotiation on both ends of the link Both ends of the link must be set to the same $alue or the link will not connect If either de$ice does not support Gigabit auto4negotiation, disabling Gigabit auto4 negotiation will force the link up Disabling auto4negotiation ChidesC link drops and other ph"sical la"er problems Onl" disable auto4negotiation to end4de$ices such as older Gigabit ;I5s that do not support Gigabit auto4negotiation Do not disable auto4 negotiation between switches unless absolutel" re'uired as ph"sical la"er problems ma" go undetected and result in spanning4tree loops !he alternati$e to disabling auto4 negotiation is contacting the $endor for software/hardware upgrade for I888 9&. :+ Gigabit auto4negotiation support

posted by Brahma at 3:51 PM & comments

Net'ork #onfi9uration confi9ure t&e driver


;etwork 5onfiguration !his section describes how to configure the dri$er after it has been installed on "our s"stem !o 5onfigure the 7ost <iles (fter installing the Sun Gigabit8thernet adapter dri$er software, "ou must create a file for the adapterBs 8thernet interface Nou must also create both an I> address and a host name for the 8thernet interface in the /etc/hosts file , (t the command line, use the grep command to search the /etc/pathHtoHinst file for ge interfaces <or Sun Gigabit8thernet/># !he following example shows the de$ice instance from an adapter installed in slot , F grep ge /etc/pathHtoHinst C/pciJ,f,-&&&/networkJ,C & CgeC <or Sun Gigabit8thernet/S# !he following example shows the de$ice instance from an adapter installed in slot & F grep ge /etc/pathHtoHinst C/sbusJ,f,&/networkJ,C & CgeC . 5reate an /etc/hostname geMnumK file, where num is the instance number of the ge interface "ou plan to use If "ou wanted to use the adapterBs ge interface in the Step , example, "ou would need to create a /etc/hostname ge& file, where & is the number of the ge interface If the instance number were ,, the file name would be /etc/hostname ge, )

Do not create an /etc/hostname genum file for a Sun Gigabit8thernet adapter interface "ou plan to lea$e unused ) !he /etc/hostname genum file must contain the host name for the appropriate ge interface ) !he host name should ha$e an I> address and should be entered in the /etc/hosts file ) !he host name should be different from an" other host name of an" other interface# for example, /etc/hostname ge& and /etc/hostname ge, cannot share the same host name !he following example shows the /etc/hostname genum file re'uired for a s"stem called +ardo+ that has a Sun Gigabit8thernet adapter =+ardo+4,,@ F cat /etc/hostname ge& +ardo+ F cat /etc/hostname ge, +ardo+4,, : 5reate an appropriate entr" in the /etc/hosts file for each acti$e ge interface <or example# F cat /etc/hosts F F Internet host table F ,.E & & , localhost ,.% ,-- ,& /E +ardo+ loghost ,.% ,-- ,, 9: +ardo+4,, If "our s"stem does not support D"namic Reconfiguration =DR@, reboot posted by Brahma at 3:45 PM & comments

3t&ernet Gumbo Frame #onfi9uration Arocedure


8thernet Pumbo <rame 5onfiguration >rocedure ;o configuration changes are re'uired in the iS5SI dri$er or in the Solaris operating s"stem to support Qumbo frames Instead, configuration changes must be made in the ;etwork Interface 5ard =;I5@, through the use of the configuration interface and tools that are pro$ided b" the ;I5 manufacturer ;ot all ;I5s support Qumbo frames, so check with "our manufacturer to $erif" that this feature is supported (lso, the network e'uipment =8thernet switches, routers, and so forth@ between the host and the S; /-&& will ha$e to be configured to accept Qumbo frames, because most e'uipment does not support this capabilit" b" default >erformance Impro$ement !echni'ues !hese are the most likel" reasons that iS5SI network performance is lower than expected# ) <low control has not been enabled on the ;I5 card in the host ) <low control has not been enabled on one or more of the switches in the 8thernet network that is between the host and the S; /-&& !o see these problems, obser$e either the retransmit timeout or the data packets retransmitted counters in the S; /-&& Nou can also obser$e the !5> segments retransmitted counter# issue the netstat 4s command in Solaris 0an" ;I5s and switches are shipped with pause frames =flow control@ disabled If "ou enable pause frames on all Gigabit 8thernet interfaces =the host s"stem and all network switches@, then "ou will help reduce dropped packets# a source of significant performance degradation B" default, pause frames are enabled on the S; /-&& and are not user4configurable If "our ser$er uses a Sun Gigabit 8thernet adapter ;I5, then use this procedure to enable flow control =b" default, recei$e flow control is disabled for the Sun adapter@# ,

(dd this line to the /kernel/dr$/ge conf file =b" default, this file does not exist@# ad$Hpause!1*,W . Reboot the Solaris host : Issue this command to $erif" that ad$Hpause!1 is set properl"# ndd/de$/ge ad$Hpause!1 !he ;I5 should respond with a $alue of , posted by Brahma at 3:44 PM & comments

8roubles&ootin9 5ifficulties Net'ork


!roubleshooting Difficulties Disabling autonegotiation can result in ph"sical la"er problems going undetected 2ink partner, cable problems, and other Data 2ink la"er issues are hidden from the administrator and manual examination of dri$er statistics is re'uired s Unable to detect bad cables s Unable to detect link failures s Unable to check link partners capabilities s Unable to mo$e s"stems from one port to another or to another switch or router s Unable to determine performance issues on higher la"er applications s Unable to implement >ause <rames =<low 5ontrol@ s Difficulties in determining where s"stem has forced setting configured =/etc/s"stem and dri$er conf using ndd in startup script 2ink s"ncing between link partners ma" not happen and the link ma" not come up when autonegotiation is absent on ,&&B(S84! =U!>@ copper 8xample of hme interface with duplex mismatch# hme& has negotiated and failed back to 7D1 and experiencing crc babble and lateHcollisions

5onsoleK show port negotiation -/, >ort 2ink ;egotiation 44444 4444444444444444 -/, enabled F kstat 4p hme#&##B/collisionsIframingIcrcIcodeH$iolationsItxHlateHcollisions/B hme#&#hme&#codeH$iolations & hme#&#hme&#collisions ,LE.& >age ,,. 8thernet (utonegotiation Best >ractices _ Pul" .&&8xample of hme interface with duplex mismatch# hme, is forced to <D1 and experiencing framing, crc, and codeH$iolation errors 8xample of switch port with duplex mismatch# >ort ,,/.. has been forced to <D1 =<ull Duplex@ but link partner is in 7D1 =half duplex@, resulting in <5S =<rame 5heck Se'uence@ and runt errors 5heck that port negotiation is enabled on the switch# hme#&#hme&#crc & hme#&#hme&#framing & hme#&#hme&#txHlateHcollisions /E&L F kstat 4p hme#,##B/collisionsIframingIcrcIcodeH$iolationsItxHlateHcollisions/B hme#,#hme,#codeH$iolations ,-E hme#,#hme,#collisions & hme#,#hme,#crc .9: hme#,#hme,#framing 9 hme#,#hme,#txHlateHcollisions & 5onsoleK show port counters ,,/.. >ort (lign48rr <5S48rr 1mit48rr Rc$48rr UnderSi+e 44444 4444444444 4444444444 4444444444 4444444444 444444444 ,,/.. & /E.%L9 & & & >ort Single45ol 0ulti45oll 2ate45oll 8xcess45ol 5arri4Sen Runts Giants 44444 4444444444 4444444444 4444444444 4444444444 444444444 444444444 444444444 ,,/..

& & & & & %EL/:.. & 5onsoleK show port negotiation -/, >ort 2ink ;egotiation 44444 4444444444444444 -/, enabled 5onsoleK show port negotiation -/, posted by Brahma at 3:44 PM & comments

Stran9e fsck be&aviour 'it& alternated superblock


SubQect# Re# Strange fsck beha$iour with alternated superblock PBR wrote# K Wh" is it asking C<R88 B2U 5OU;!=S@ WRO;G I; SU>8RB2U S(2?(G8AC when doing K fsck with alternated superblock A K Is this normal beha$iourA Nes, this is normal !he d"namic data is onl" updated =or onl" regularl" updated@ in the main superblock I think, so the other ones get stale prett" fast Reall", the"Bre a repositor" of la"out information about the <S so "ou can find things like cgs Vc in emergenc" 44tim K IBam using Solaris % on a ?--& with a Sun Storedge ::,& K I ha$e a strange beha$iour with using fsck with a alternated supperblock# K <irst make a files"stem# K F newfs /de$/md/rdsk/d., K newfs# /de$/md/rdsk/d., last mounted as /afsE K newfs# construct a new file s"stem /de$/md/rdsk/d.,# ="/n@A " K /de$/md/rdsk/d.,# ,-:&,%.,%. sectors in L//:: c"linders of LK tracks, K :-, sectors K L%9::L &0B in ,:,&E c"l groups =/ c/g, /: .90B/g, L/.9 i/g@ K super4block backups =for fsck 4< ufs 4o b*F@ at#

K :., ,&%/&-, .,9%EL, :.9--9, -:E%.&, /-E:%., L/L9L-, ELL::L, 9E/9&9, K %9/.9&, K Initiali+ing c"linder groups# K K K K K K K K super4block backups for last ,& c"linder groups at# K ,-.%,/%,&-, ,-.%.L9/EL, ,-.%:E9&-9, ,-.%-9E/.&, ,-.%/%L%%., ,-.%E&L-L-, K ,-.%9,/%:L, ,-.%%./-&9, ,-:&&:-99&, ,-:&,--:/., K Do normal fsck# K F fsck 4< ufs /de$/md/rdsk/d., K )) /de$/md/rdsk/d., K )) 2ast 0ounted on /afsE K )) >hase , 4 5heck Blocks and Si+es K )) >hase . 4 5heck >athnames K )) >hase : 4 5heck 5onnecti$it" K )) >hase - 4 5heck Reference 5ounts K )) >hase / 4 5heck 5"l groups K . files, % used, E&-,./.%9 free =,& frags, 99&,/LL, blocks, & &Z K fragmentation@ K 0ount de files"stem# K F mount /afsE K Umount without doing something on the files"stem# K F umount /afsE K Do fsck with alternated superblock# K F fsck 4< ufs 4o b*,&%/&- /de$/md/rdsk/d., K (lternate super block location# ,&%/&K )) /de$/md/rdsk/d., K )) 2ast 0ounted on K )) >hase , 4 5heck Blocks and Si+es K )) >hase . 4 5heck >athnames K )) >hase : 4 5heck 5onnecti$it" K )) >hase - 4 5heck Reference 5ounts K )) >hase / 4 5heck 5"l groups

K <R88 B2U 5OU;!=S@ WRO;G I; SU>8RB2U K S(2?(G8A " K . files, % used, E&-,%&9-. free =,& frags, 99&.:9/- blocks, & &Z K fragmentation@ K ))))) <I28 SNS!80 W(S 0ODI<I8D ))))) K (gain same fsck without mounting fs# K F fsck 4< ufs 4o b*,&%/&- /de$/md/rdsk/d., K (lternate super block location# ,&%/&K )) /de$/md/rdsk/d., K )) 2ast 0ounted on K )) >hase , 4 5heck Blocks and Si+es K )) >hase . 4 5heck >athnames K )) >hase : 4 5heck 5onnecti$it" K )) >hase - 4 5heck Reference 5ounts K )) >hase / 4 5heck 5"l groups K . files, % used, E&-,%&9-. free =,& frags, 99&.:9/- blocks, & &Z K fragmentation@ K ))))) <I28 SNS!80 W(S 0ODI<I8D ))))) K 0odified , without asking somethingT K When doing normal fsck e$er"thing is ok, but when using alternated K superblock =makes no difference which one@ it is alwa"s asking the K sal$age K 'uestion 0akes also no difference if files"stem is mounted or not K mounted K between fsckBs K Wh" is it asking C<R88 B2U 5OU;!=S@ WRO;G I; SU>8RB2U S(2?(G8AC when K doing K fsck with alternated superblock A K Is this normal beha$iourA "es, the alternate SBBs are onl" updated during mkfsHufs=,0@, tunefs=,0@ and growfs=,0@ 4 the" are not kept updated during regular use as far as d"namic changes to allocations is concerned 444 frankB

posted by Brahma at 3:42 PM & comments

1eritas 1olume ,ana9er H #&an9in9 ;ostname


?eritas ?olume 0anager T What are the effects of a )hostname change) on a ser$er which has all of itBs dri$es including root/swap encapsulated b" ?eritas ?olume 0anager AA I ha$e had a worst experience with 2S0 = Digital $ersion of ?eritas ?olume 0anager @ $er" recentl" Gopala, ?eritas ?0 assigns ownership to obQects based on hostname, if "ou change the hostname, the s"stem will no longer own the obQects Ron K Ron If "ou forget to export the $olume group, "ou can manuall" change the $olume group ownership to allow it to be reimported K K (n" discussion on this will be highl" appreciated ItBs not clear what the problem that "ou ran into was 8ncapsulated $olume groups arenBt the cleanest part of ?eritas $olume manager Worst case, donBt start the $olume manager, manuall" delete an"thing "ou can find of the encapsulated root $olume group, restart the $olume manager and re4encapsulate the root $olume group 5anBt gi$e "ou specifics since I donBt ha$e a $olume manager running currentl" If "ou had a stand alone boot disk w/ a cop" of the $olume manager on it, "ou could use it to change host ownership If it turns out that ?eritas canBt handle hostname changes, "ou could ha$e alwa"s delete the root $olume group before hand Deleting $olume manager entities doesnBt delete the actual data Offhand, based on what "ou ha$enBt told us, thatBs all I can think of

I ha$e changed the host name of a machine running ?0 . L =under Solaris . L@ and nothing happens except that some processes are running with the old name, but all works fine 5heck out man $xdctl !he commannd is $xdctl init newname $xdctl init newHname !o confirm the change =and "ou ma" want to sa$e the file before the change, Qust in case @, look in /etc/$x/$olboot =!his is the name $eritas is going to use during imports@ Good 2uck Peff Robinson / 7DG I K encapsulated b" ?eritas ?olume 0anager AA ;one at all ?x?0 doesnBt care a whit what the hostname is ;ow, if "our hostid changes, "ouBll ha$e licensing issues and diskgroup attachment issues, but thatBs not what "ou asked U RDoug 7ughesS K ;one at all ?x?0 doesnBt care a whit what the hostname is Oh, if onl" that was true ?x?0 didnBt find the (,&&& until we changed the hostname into non4<3D; ;ow, wh" it cares is a m"ster" I wouldnBt take an" chances with that software K diskgroup attachment issues, but thatBs not what "ou asked 5hanging the hostname will not affect the $olumes "ouB$e pre$iousl" installed unless "ou issue a $xdctl init command which will change the output of $xdctl list =hostid in there@ this will cause ?x?0 to think the disks are owned b" someone else MbrK;ow, if "our hostid changes, "ouBll ha$e licensing issues and MbrKdiskgroup attachment issues, but thatBs not what "ou asked M/block'uoteK

MpKMbrK5hanging the hostname will not affect the $olumes "ouB$e pre$iousl" installed unless "ou MbrKissue a $xdctl init command which will change the output of $xdctl list =hostid in there@ this will cause ?x?0 to think the disks are MbrKowned b" someone else M K I wouldnBt take an" chances with that software !hat is a problem with rmL, the software that manages the (,&&&, not with ?x?0 I belie$e that the latest rmL fixes this, not ,&&Z sure though 44 (ctuall" what is happening is# (s I said it is called 2S0 = logical storage 0anager, digital ?x?0 @ I start the ser$er in single user mode, then I can see the contents of the /etc/$ol/tempdb director" = which contains all the disk groups listed @ Once I start the ?eritas ser$ices it locks out this director" (nd e$er" ser$ice depends on the contents of this director" !hus all Diskgroups disappear from the picture, including $old = on Sun ?12D @daemon which is needed b" all ser$ices and tools on $eritas 0" 'uestion is# Did it e$er happen to an"one, wherein some directories/file s"stems, encapsulated b" ?x?0, are not accessible in )run le$el :) and are accessible in )run le$el ,) or when mounted as ReadOnl" AA I posted by Brahma at 3:42 PM & comments

3ffective t&rou9&put can < e=pect on a 2i9abit 3t&ernet link 'it& UltraSparc@F #AU
(s there were man" $arious interesting answers, I will 'uote all of them Basicall", I could expect near ,&& 0b"tes/s with Pumbo <rames under Sun<ire =!his does not take the disk backend into account, Qust memor"4to4memor" transfer speaking @ !hank "ou all 44444444444444444444444444444444444444444444444444444444444444 Poe <letcherBs answers# On a ?99& 9x%&& we did some basic tests using ftp which ga$e us about

-/0B/s !his put about a ,&4,/Z o$erhead on the machine =ie it takes about a whole UltraIII cpu to dri$e the card in an" serious sense@ !his is dumping data from an <5 arra" down separate 7B(s to another arra" $olume Pust checked some old results from another site I used to run >robabl" not $er" interesting to "ou but on an (lpha 8S-& -x8?L ser$ing a group of Intel clients we managed to get about 9&0B/s !he (lpha was linked into a :5O0 switch $ia gigabit with the clients each on a ,&&<D port on the same switch 8ach client was tranferring a different set of files, some $ia ftp, some $ia the S0B ser$er software =(SU@ We could get similar results using two (lphas with memor" files"stems mounted which allowed us to get the storage out of the picture ;ot representati$e of real world particularl" but we Qust wanted to see how fast it was capable of going I suspect the file caching helped 'uite a lot where the >5 clients were concerned 44444444444444444444444444444444444444444444444444444444444444 5hristophe DupreBs answer# What ethernet card do "ou ha$e in "our ser$er A Sun has at least two chipsets used in gigabit cards# G80 =with interface as ge&@ and 5assini =sun gigaswift, ce& interface@ !he G80 is older and prett" much all the processing is done b" the 5>U, and the throughput isnBt that great !he 5assini is much better and offload some processing =I> 5R5 and !5> 5R5@ to the card, "ielding much better throughput ;ote that G80 is onl" ,&&&BaseS1, while 5assini does both fiber and copper What do "ou use to compute the throughput A I use iperf and between two ser$ers =both ultrasparc 4. -&&07+, both dual 5>U@, both ha$ing G804based cards connected to a 5isco -/&L switch I get 9/0bit/s for a single connection, and an aggregate of %-0bit/s with about -&Z kernel time according to top !his is using an 0!U of ,/&& =the G80 and 5isco switch donBt do Qumbo frames@ !he !5> Window si+e was L-UB"te B" comparison, iperf runs between a Sun ultraS>(R5: with a Sun gigaswift and a Dell >ower8dge .L/& with a Broadcom ,&&&!1 card connected using the same 5isco catal"st and -9UB"te !5> windows "ield -9&0Bit/s So before upgrading the 5>U "ou should make sure "ou ha$e a card that offloads the 5>U like the gigaswift ;ext, Qumbo frames donBt matter much 4 support is not standardi+ed, not much e'uipment supports it, and "ou can get prett" good performance without IBm not sure how much the 5>U speed is needed, though IBll install a gigaswift in an ultraS>(R5. soon, I can tell "ou the performance difference then 44444444444444444444444444444444444444444444444444444444444444 Pason SantosBs answer# I would suspect that "our bottleneck on the 8,&U would be the SBUS interface, not 5>U speed With a gem or GigaSwift >5I card in a E/&07+ L9&&, we get about L&0B/s o$er ;<S with a single thread Raw UD> or !5>

throughtput would be much higher, although I ne$er tested it 2et me test now, stand b" !his is a 'uick test from a -xE/&07+ L9&& to a -x,.&&07+ ?99& =no network tuning, single thread@# ttcp4t# buflen.EL9, nbuf -9, align:9-/&, port>&, tcp 4K nbmaster ttcp4t# socket ttcp4t# connect ttcp4t# ,&E:E-,9.- b"tes in .: /% real seconds * ----, .9 UB/sec 666 ttcp4t# ,&E:E-,9.- b"tes in .: ,L 5>U seconds * -/.E/ :& UB/cpu sec ttcp4t# :.EL9 I/O calls, msec/call * & E-, calls/sec * ,:99 E% ttcp4t# & ,user .: &s"s &#.:real %9Z &i6&d &maxrss &6&pf :E/L6.L,csw ttcp4t# buffer address &xE-&&& !he fastest Gigabit transfers I ha$e e$er seen were from an IB0 x:-/ =dual Intel 1eon . -G7+@ o$er ;<S to a ;et(pp <(S%L&, I was able to get o$er ,&&0B/sec, which is 9&Z of the theoretical max of ,./0B/sec 44444444444444444444444444444444444444444444444444444444444444 >aul !heodoropoulosBs answer# SunBs BRule of !humbB from the UltraS>(R5 II era was that "ou should ha$e :&&0h+ of ultraS>(R5 II horsepower per gigabit adapter !hatBs BdedicatedB horsepower 4 if "ou had one :&&0h+ cpu and one gigabit adapter, "ouBd ha$e no horsepower to spare for "our applications In practice of course, the gigabit gets throttled down and the horsepower shared But i would expect approximatel" the same performance re'uirements with ultrasparc III, frankl" 44444444444444444444444444444444444444444444444444444444444444 (lex 0addenBs answer# http#//www sun com/blueprints/&.&:/9,E4,L/E pdf Mhttp#//www sun com/blueprints/&.&:/9,E4,L/E pdfK 44444444444444444444444444444444444444444444444444444444444444 P?Bs answer# F.@ !hroughput ma" depend more on the underl"ing storage architectureBs abilit" to R8(D Nou will get better with 7ardware R(ID &/, than software R(ID like Disksuite or ?1?0 F:@ copper or optical gig8A I use optical, but I Qust got $.-&s last month so I am beginning to experiment with their ce interfaces F-@ On optical ge, with ,- column ?eritas stripes, on large4ish dbf files =, /4.GB@, Lx::L0h+ cpus, I can get -/ 0B/sec with :/Z s"s I ha$enBt had a chance to tune and test m" ,&4,. cpu UltraS4II =optical@ or . cpu UltraS4III $.-& =copper ce@ boxes 44444444444444444444444444444444444444444444444444444444444444 !im 5hipmanBs answer# Nou might want to use C ttcp C utilit" to test tcp bandwidth throughput It

is more likel" to represent C best case scenario C throughput that is in4keeping with statements like C gig4ether can do ,&&0b"tes/sec C #4@ we did a bit of testing here a while back, and IBm appending the info below as a general reference, for what use it ma" be test boxes were, athlon 0> running either Solaris x9L OR linux ultraSparcII running solaris9 note, based on m" experience, it seems unlikel" "ou will e$er get C real world data xfer C much abo$e /&4//0b"tes/sec o$er gig4ether C ttcp C benchmarks are one thing, but real4world protocols are another ;O!8# testing done here using two dual4athlon s"stems, identies as follows# wulftest * redhat 9 =dual4,9&&mh+, , gig ram, L-4bit >5I@ wulf. * redhat 9 =dual4.&&&mh+, , gig ram, L-4bit >5I@ thore * solaris9x9L =dual4.&&&mh+, , gig ram, L-4bit >5I@ =note 4 Wulf. V !hore are actuall" the same s"stem with . different 7DDs to boot the alternate OSBes@ ultra/ * .E&mh+ Ultra/ =nb, :.4bit >5I bandwidth onl"@ Gig4ether ;I5s being tested are all L-4bit >5I / 5at/ cards# S"skonnect SU4%9., :5om :5%%LB4! =Broad5om chipset@ =note, we had . x SU nics and , x :com on4hand, so didnBt test :comM4K:com perfo rmance @ Software being used for testing was =,@ !!5> and =.@ ;etbackup =for info on !!5>, $isit the UR2# http#//www pcausa com/Utilities/pcattcp htm Mhttp#//www pcausa com/Utilities/pcattcp htmK @ >arameters tuned include Pumbo <rames =0!U of ,/&& $s %&&&@ W combinations of ;I 5M4K ;I5 and s"stemM4Ks"stem 5onnection between ;I5s was made with a crosso$er cable, appropriatel" wired =al l strands@ such that Gig4ether was operational ;ote these FFBs are ;O! C comprehensi$e C, ie, ;O! e$er" combination of tuneable p arameters has been attempted / documented here Sorr" about that 7opefull", C so mething is better than nothing C R!!5> resultsS S"sUonnect M4K S"sUonnect * EE 0B/s

) Wulftest with S"skonnect =Redhat 9@ ) !hore with S"skonnect =Solaris x9L@ ) Pumbo frames donBt affect speed, but offload the s"stems b" around .&4-&Z for 5>U loading S"sUonnect M4K :5O0 * E9 0B/s ) Wulftest with S"skonnect =Redhat 9@ ) Wulf. with :com =Redhat 9@ ) 0!U * ,/&& S"sUonnect M4K :5O0 * %E 0B/s ) Wulftest with S"skonnect =Redhat 9@ ) Wulf. with :com =Redhat 9@ ) 0!U * %&&& U2!R(/ M4K Wulftest tests with !!5># =S"sUonnect M4K S"skonnect ;I5s@ with Pumbo<rames# ) ./Z 5>U load on Ultra/, .% 0B/s without Pumbo<rames# ) L&Z 5>U load on Ultra/, ,E 0B/s R;etbackup resultsS 2arge (S5II file =/ gigs@ * /& 0B/s ) Wulftest with S"sUonnect =Redhat 9@ ) !hore with :5O0 =Solaris x9L@ ) 0!U ,/&& S"stem backup =OS files, binaries@ * ,, 0B/s ) Wulftest with S"sUonnect =Redhat 9@ ) !hore with :5O0 =Solaris x9L@ ) 0!U ,/&& ORIGI;(2 3U8S!IO; # 7i, Basic 'uestion is # What effecti$e throughput can I expect on a Gigabit 8thernet link with UltraSparc4: 5>U, with or without Pumbo <rame support, with or without multithreaded transfer A I ask this because with UltraSparc4. 5>U =8,&U@ and G8 link =without Pumbo <rame support@ we couldnBt get more than # 4 ,/ 0b"tes/s with monothreaded transfer 4 // 0b"tes/s with multithreaded transfer =the best rate was reached with ,& threads@

=We measured application throughput, that is to sa" !5> throughput@ (s "ou see the 5>U o$erhead with ,/&& 0!U was so high =truss showed 9&Z kernel@, that we had to multithread the transfer to reach the best throughput =// 0b"tes/s@ Unfortunatel" we were far from the theoretical limit =,&& 0b"tes/s A@, e$en if there were still 5>U resources free =/&Z@, and I canBt determine if it was caused b" the small 0!U, the poor US4. throughput or both A I think that Pumbo <rame could increase the throughput and lower the 5>U o$erhead, but how much A Will the US4: throughput help much A Is there an" chance to reach the ,&& 0b"tes/s limit A !hanks for "our feedback, I will summari+e 444 Sebastien D(UBIG;8 posted by Brahma at 3:38 PM / comments

8unin9 t&e Sun 2i9abit 3t&ernet %dapter


(ppendix B# !uning the Sun Gigabit 8thernet (dapter a 5reate a file named /etc/rc. d/S%%netperf b (dd the following lines# i /usr/sbin/ndd 4set /de$/ge instance & ii /usr/sbin/ndd 4set /de$/ge ad$Hpause!1 , iii /usr/sbin/ndd 4set /de$/ge ad$H,&&&autonegHcap & i$ /usr/sbin/ndd 4set /de$/ge ad$H,&&&fdxHcap , c If "ou ha$e more than one CgeC adapter on "our ser$er, "ou can either omit item b i and the settings will affect all instances, or specif" the instance "ou want to refer to posted by Brahma at 3:37 PM & comments

5isk Failure 880


( number of failures on a new machine with a number of disks is 'uite common If this is a two disk ?99&, IBd sa" "ou ha$e a problem If its a ,. disk ?99&, IBd call Sun, swap out the disk and shrug it off

If "ou look at the probabilit" of disk failure o$er time, there is an initial peak as new disks spin in, then se$eral "ears of low probabilit", then a ramping as the" get towards the end of ser$icable life directio shouldnBt make a difference 7owe$er, I would check the ambient temperature inside and around the machine =emphasis on temperature stabilit" rather than $alue@, ensure that it not being bumped or subQect to =excess@ $ibration, note the humidit" of the room and check for dust posted by Brahma at 3:36 PM & comments

;i9& Eernel Usa9e


Bernd 7aug Mh Jberndhaug netK wrote# K sean J"ahoo com Msean J"ahoo comK wrote# KK !O> shows Uernel has been using o$er //Z 5>U KK 7ow can we find what are those kernelBs processesA wh" do those use a KK lot of 5>UA ;ormall" i onl" see about ,&Z K WouldnBt spending some time in s"scalls be prett" normal on a DB K ser$erA ;ot that much K I rather think itBs funn" that "ou ha$e & iowait K 0a"be something went wrong and now "our top conflates the two into K kernel timeA Remember that IOwait is onl" a subset of idle time If "ou ha$e no idle time, then "ou canBt displa" an" IOwait =e$en if the disks are slow@ IBd look to see if the Clast >IDC is increasing rapidl" ( constantl" forking program that creates new processes which are 'uickl" reaped will eat up tons of s"stem time Difficult to trace directl" =well, without Solaris ,& and dtrace@ !ake some guesses and run BtrussB looking for forks posted by Brahma at 3:36 PM & comments

corelation bet'een Iio'ait from top and Ibusy or av'ait from sar @d
0ike7! Mmike. Jgmail comK wrote# K I would like to know from the list if there is an" corelation between K Ziowait from top and Zbus" or a$wait from sar 4d F FA

;o, not necessaril" K Do it mean if K Zbus" is high, then the Ziowait K will be high tooA ;o Zbus" is a description of whatBs happening on a disk =or the dri$er talking to the disk@ Ziowait is a description of whatBs happening on the 5>U In some cases the" ma" be correlated, but thatBs not necessaril" true !here are man" cases where the" would not be K But that corelation is not consistent based on the K data captured from K machines ( V B 0achine BBs de$icesBs Zbus" is high, but Ziowait is K lower Right K 7ow is Ziowait calculated in topA (n" insightsA !hanks Ziowait is the a$erage fraction of time that the 5>U is bus" and that the s"stem has at least one outstanding I/O re'uest !he outstanding I/O ma" or ma" not ha$e an"thing to do with "our Zbus" disk ;ote that a s"stem ma" be completel" I/O swamped while no indi$idual disk is all that bus" (lso, "ou could ha$e a disk that shows ,&&Z bus", but it is meanwhile able to keep up with re'uests $er" rapidl" So these numbers ma" not mean a lot in isolation !he"Bre most useful when looking at changes o$er time, or relationships between components ;ote the iowait is a subset of BidleB If "ou can keep the 5>Us bus" b" working them harder, the"Bll ne$er displa" iowait !hatBs a maQor difference between ( and B below B ma" be more swamped while at the same time doing more 5>U Qobs =so that it has less idle time@ 44 !hanks Darren for the repl"

7igh Ziowait could also indicate that path to the disk de$ices =805 s"mmetric in this case@ could be problematicA We are using 805 powerpath Repl" 0ike7! Mmike. Jgmail comK wrote# K !hanks Darren for the repl" K 7igh Ziowait could also indicate that path to the disk de$ices =805 K s"mmetric in this case@ could be problematicA It )could), but it probabl" doesnBt Ziowait is a $er" $isible number that doesnBt often indicate a problem ( well4tuned, perfectl" reasonable machine ma" still ha$e somewhat ele$ated iowait figures during normal operation 0an" admins tr" to CfixC it when the" shouldnBt =;ote that because of this and a few other reasons, Solaris ,& apparantl" does not track this an" longer, so it will alwa"s appear as +ero@ 2ook for problems b" anal"+ing performance, not b" looking at iowait Does the application workA Does it respond in good timeA (re the throughput and latenc" figures on "our storage what "ou expectA !he iostat figures are much more likel" to be rele$ant than the s"stem iowait number posted by Brahma at 3:35 PM & comments

>var fills '&en usin9 pk9add--- Duery


/$ar fills when using pkgadd soplaris 9 on a sparc .& =T@ i ha$e a psarc .& that will do a $er" nice Qob for me 4 I Qust need to install samba on it It has a , Gb disk that is car$ed up =historical installation@ When I attempt to install the samba package it fails becaus ethe fairl" small /$ar partition fills I added a - Gb disk I had Qand" and created a -gb parttion =/data@ to pla" with I ha$e shel$ed off $aruious areas of /$ar to /data to lea$e more sopace in /$ar but e$en this doesnBt sol$e the matter 'uer"

So 4 the crux of m" 'uer" (lthough samba is being installed into a completel" seperate parttion to /$ar, what is it in /$ar that is filling =ie being usedA@ IB$e hi$ed off /$ar/spool/pkg to /data utilising a soft link, but that doesnBt sol$e it So ,@ what is being used in /$ar an"wa" .@ is there an"thing I can do with m" pkgadd to a$oid use of /$ar at allA =4R doesnWt sol$e it for instance @ K ,@ what is being used in /$ar an"wa" /$ar/tmp K .@ is there an"thing I can do with m" pkgadd to a$oid use of /$ar at K allA =4R doesnWt sol$e it for instance @ set Y!0>DIR to a location where "ou ha$e an ade'uate amount of space See pkgadd=,0@, .d paragraph under D8S5RI>!IO; Repl" Kutilising a soft link, but that doesnBt sol$e it /$ar/sadm 5asper posted by Brahma at 3:34 PM & comments

ufsdump 'arnin9
K lolo wrote# KK When a make ufsdump KK /usr/sbin/ufsdump &uf Ser$er,#/de$/rmt/On /export/home KK I ha$e this message KK DU0># Dumping =>ass I?@ Rregular filesS KK DU0># Warning 4 block ,/-:/&:9E. is be"ond the end of `/de$/md/rdsk/d:B K thatBs a t"pical error when "ou tr" to backup a files"stem that is K acti$e 8ither unmount /export/home or check Cman fssnapC

IB$e ne$er seen that error on simpl" an acti$e files"stem If the files"stem is larger than d:, "ou can get that message !o the O>, can "ou post Bmetastat d:B, and Bfst"p 4$ /de$/md/rdsk/d: I grep si+eB, and prt$toc info for the disk or disks holding d:A posted by Brahma at 3:33 PM & comments

Aass'ord %9in9, Aart 2


>assword (ging, >art . If "ouBre starting with a group of users who ha$e been acti$e for a long time and not had their passwords aged, how should "ou go about introducing password agingA !o start, "ou might first take a look at the dates on which "our usersB passwords were last changed !o $iew the dates b" themsel$es, "ou might use a command such as this =run as root@# F cat /etc/shadow I awk 4<# B[print Y:]B I sort 4n I uni' 4c !his command sorts the lastchg =last time the password was changed@ field numericall" and prints out the number of records with each particular date $alue Of course, the dates in this commandBs output are going to be presented to "ou as a list of numbers =rather than recogni+able dates@ Nou will see something that looks more or less like this# E L--/ , ,,.9% . ,,L:. /: ,,LEL / ,,LEE . ,,L9: , ,,9-% . ,.&:9 .: ,.:-/ , ,.99, , ,:&L. !hese numbers are a little hard to interpret, but the range of $alues and the CpopularC $alues suggest that most users on this s"stem ha$e not changed their passwords in a $er" long time and that man" of them might ha$e last changed their passwords in response to a re'uest to do

so =since two groups of people changed their passwords on the same two da"s@ But letBs tr" to pin these numbers down and get an idea what dates we are reall" looking at 7ow do "ou do thisA Well, if "ou ha$e the G;U date command installed on "our s"stem, "ou can $iew toda"Bs date with a command such as this# Z expr `date 6Zs` / 9L-&& (lternatel", "ou can package this date con$ersion command in in a script such as that shown below, call it Ctoda"C and run it whene$er "ou want to know what the current date looks like in the da"s4since4the4epoch format If "ouBre reading this column on the da" that it was first published, that $alue would be ,:&L. FT/usr/bin/perl 4w F toda"# a script to print date in da"s4since4epoch format Ynow*`/usr/local/bin/date 6Zs`W YH*Ynow / 9L-&&W =Ytoda"@*/=\d6@ /W F number of da"s since &,/&,/,%E& print CYtoda"\nCW In both the command and the Ctoda"C script, we use the Cdate 6ZsC command to produce the current date/time as the number of seconds since midnight on Panuar" ,, ,%E& We then di$ide this $alue b" the number of seconds in a da" =9L,-&&@ to con$ert this $alue to the number of da"s since Panuar" ,, ,%E& !he commented line lops off the digits on the right side of the decimal point =along with the decimal point itself@ !his gi$es us a $alue for toda" !o determine how long ago one of the other dates in the lastchg list abo$e happened to be, we can use an expr to calculate the number of da"s between toda" and the date the password was last changed 2etBs choose the most popular $alue =line -@ for this# F expr ,:&L. 4 ,,LEL ,:9L !hatBs ,,:9L da"s ago 44 nearl" four "earsT ;O!8# !he shadow records with L--/ in the lastchg field are disabled accounts and, thus, donBt factor into our password aging concerns

If the bulk of "our users ha$e the same last4set date, the" ha$e probabl" ne$er changed their passwords 44 or ne$er changed them since the" were last re'uired to do so Whene$er "ou change a userBs password or one of "our users changes his own password, that field in the /etc/shadow file will be updated So, how do "ou introduce password aging in a situation such as thisA If "ou add a max $alue when a userBs password hasnBt been reset for nearl" four "ears, chances are that his password will alread" be expired and he will not be able to log in ( better approach would be to initiate password aging b" modif"ing the lastchg date in "our shadow records and then selecting a max $alue that will gi$e "our users time to change their passwords before the" run out of time Nou should also publish notices explaining the change and focusing "our users attention on the need to change their passwords from time to time <or example, if "ou make the lastchg date of a record fi$e months in the past and then re'uire that the user change his password e$er" six months, this would gi$e him a month to change his password before he is locked out (nd, from that point forward, he would need to change his password e$er" six months <i$e months in the past would roughl" put the =fictitious@ lastchg date at ,.%,. =,:&L. 4 =/ ) :&@@ ( shadow entr" such as that shown below would, therefore, force sbob to change his password within the month and would gi$e him a monthBs worth of warnings before heBs locked out of his account# sbob#dOlPpU;""usab#,.%,.#:&#,9&#:&### On login, sbob would see something like this# Nour password will expire in :& da"s 2ast login# Wed Oct L ,L#.9#:- .&&/ from corp particles com Sun 0icros"stems Inc SunOS / 9 Generic <ebruar" .&&/ If "ouB$e ne$er used password aging before, itBs probabl" a good idea to get "our usersB attention to the fact that passwords are going to expire !he one4line warning abo$e ma" not be enough to get "our usersB attention >erhaps a notice like this in "our /etc/motd file would be more effecti$e#

KKK >asswords must be changed e$er" L months MMM KKK 2ook for password expiration information MMM KKK in the s"stem output abo$e MMM When a message like this is displa"ed on login for a month, "our users are likel" to notice and take action before their passwords expire Nou can also change the default settings for password aging in the /etc/default/passwd file <or example, if "ou want users to be re'uired to keep a password for a month and change it e$er" L months, "our $alues might look like this# 0(1W88US*.L 0I;W88US*- >(SS28;G!7*L ;ext week, we will look at a script that anal"+es the aging parameters in the /etc/shadow file and warns "ou about users who are getting close to their password expiration dates posted by Brahma at 3:33 PM & comments

5isk performance
U;I1 0useum wrote# K 7i there, K I am tr"ing to understand wh" m" SB,U gi$es me ab"smal performance on K se'uential read/write K So, it appears to me that the culprit is the scratch files"stem I K tried to mount the dri$e with forcedirectio, but it looks like it made K things e$en worse Does an"bod" ha$e an" suggestionA Nepp, forcedirectio is for databases that do their own caching If "ou are doing $er"largefiles "ou should # , make the filess"stem with fragsi+e set e'ual to blocksi+e . set c"linder group si+e to :. : set the CmaxbpgC to /&Z or %%Z of the amount of blocks in a c"linder group 2ook at fst"p=,0@ and tunefs=,0@ and newfs=,0@ //2ars posted by Brahma at 3:32 PM & comments

%pac&e installation
Greetings, K K I know this is a Solaris forum, but IBm ha$ing problems installing K apache on Solaris %W ma"be someone on solaris4l has experience K installing apache IB$e done an exhausti$e search using GoogleW no K useful information was returned 2isted below are the s"stem specifics# K K (pache $ersion# . & -9 K 5ompiled (pache source using gcc : - K OS# Solaris % K K I used the following commands to compile the apache source# K K , /configure 44prefix*/mp,/software/apache4. & -9 44enable4module*so K . make K : make install K K !he abo$e three steps completed without error !he configure option of K C44enable4module*soC was listed in m" installation guide =not apache K doc @ as being necessar" K K When I attempt to start apache b" using, Capachectl startC, the K following error is returned# K K Illegal instruction 4 core dumped K K !he error is being generated when attempting to run the ChttpdC command K (ll of the other commands in Y(>(578H7O08/bin load and run without K errors K K (n" help to get apache up and running would be greatl" appreciated K K 0ike Badar Re# (pache installation >osted B" 2uis 7ansen Im using apache . &/- with Solaris % I compiled# /configure 44enable4module*so 44enable4module*all 44with4mpm*worker 44enable4shared*max 44prefix*/usr/local/apache.&/with mpm*woker apache works in fork V thread ,mpm its an h"brid

5heck if in /usr/local/lib if some librar" is missing the user must be nobod" as group too in the httpd conf file check "our configuration with /apachectl configtest regards posted by Brahma at 3:32 PM & comments

6eplacin9 ,ultiple Failed 5isks on Store3d9e 8F %rray


Replacing 0ultiple <ailed Disks on Store8dge !: (rra" Nou had a double failure, the data is lost, so the s"stem cant reenable it on its own, the simplest is to remo$e the $olume and rebuild it so that it can create the parit" correctl" With a single failure it would ha$e reco$ered on its own when "ou replaced the dri$e, if it doesnt "ou reco$er it with $ol recon Mdri$eK Rfrom Standb"S if "ou didnt ha$e a standb" it can reco$er an"wa", it Qust takes longer (lso see to that "ou ha$e the latest firmware for the arra" and that no disk in the log has gi$en the Cdisk error &:C code which might indicate that the" will be kicked out of config during an upgrade of firmware or $er" soon after running the command $ol $erif" M$olumeK once a week is a good practice since it will test for read failures hopefull" before "ou ha$e double ones, check the log for the test result posted by Brahma at 3:31 PM & comments

#isco #ounters meanin9


5ounters ) >ackets input 4 !otal number of error4free packets recei$ed ) Broadcasts 4 !otal number of broadcast or multicast packets recei$ed ) Runts 4 ;umber of packets discarded because the" are smaller

than the mediumBs minimum packet si+e ) Giants 4 ;umber of packets that are discarded because the" exceed the mediumBs maximum packet si+e ) !hrottle 4 !his counter indicates the number of times the input buffers of an interface ha$e been cleaned because the" ha$e not been ser$iced fast enough or the" are o$erwhelmed !"picall", an explorer storm can cause the throttles counter to increment ItBs important to note that e$er" time "ou ha$e a throttle, all the packets in the input 'ueue get dropped !his causes $er" slow performance and ma" also disrupt existing sessions ) >arit" 4 ;umber of parit" errors on the 7SSI ) R1 Disabled 4 Indicates inabilit" to get a buffer when accessing a packet ) Input 8rrors 4 Sum of all errors that pre$ented the receipt of datagrams !his ma" not balance with the sum of the enumerated output errors, because some datagrams ma" ha$e more than one error and others ma" ha$e errors that do not fall into an" of the specific categories ) 5R5 4 5"clic redundanc" checksum generated mismatch 5R5 errors also are reported when a far4end abort occurs and when the idle flag pattern is corrupted !his makes it possible to get 5R5 errors e$en when there is no data traffic ) <rame 4 ;umber of packets recei$ed incorrectl" ha$ing a 5R5 error and a noninteger number of octets ) O$errun 4 ;umber of times the serial recei$er hardware was unable to hand recei$ed data to a hardware buffer because the input rate exceeded the recei$erBs abilit" to handle the data ) Ignored 4 ;umber of recei$ed packets ignored b" the interface because the interface hardware ran low on internal buffers ) (bort 4 ;umber of packets whose receipt was aborted ) B"tes 4 !otal number of b"tes, including data and 0(5 encapsulation, transmitted b" the s"stem ) Underruns 4 ;umber of times that the far4end routerBs transmitter has been running faster than the near4end routerBs recei$er can handle !his ma" ne$er happen =be reported@ on some interfaces ) 5ongestion Drop 4 ;umber of messages discarded because the output 'ueue on an interface grew too long ) Output 8rrors 4 Sum of all errors that pre$ented the final transmission !his ma" not balance with the sum of the enumerated output errors, because some datagrams ma" ha$e more than one error and others ma" ha$e errors that do not fall into an" of the specific categories ) Interface Resets 4 ;umber of times an interface has been completel" reset ) Restarts 4 ;umber of times the controller was restarted because of errors ) 5arrier !ransitions 4 ;umber of times the carrier detect signal of a serial interface has changed state

posted by Brahma at 3:31 PM & comments

solaris : ss& a&an9s on e=it )


solaris % ssh ahangs on exit A On solaris %, recommended patches as of Dec /th applied On occasion, exiting from an ssh session to another machine hangs Is there a fix for that A WeBre using solarisB ssh !hanks K On occasion, exiting from an ssh session to another machine hangs Is there K a fix for that A It usuall" happens when "ou start a background process and it doesnBt properl" close its stdin/out/err (dding K/de$/null and .KV, to command line usuall" helps Ue"word here is Cusuall"C 44 if "ou run a program that does something funn", like piping its stdout to childBs stdin with dup=@, all bets are off !he real problem is in SS7 protocol and that canBt be fixed in implementation So the real fix is to not use ssh Dima 44 K!he real problem is in SS7 protocol and that canBt be fixed in Kimplementation So the real fix is to not use ssh So what )do) "ou use, if, sa", "ou want to go from "our cable modem connection and log into the Cshell accountC "ou ha$e on an ispA 8$er"one sa"s that telnet wa", wa" too dangerous, too eas" to hack into !hanks K So what )do) "ou use, if, sa", "ou want to go from "our Nou use ssh D0 was being pedantic in sa"ing that because the protocol is broken then the onl" CfixC is not to use it 44 unless "ou fanc" impro$ing the protocol On the other hand, IBm guessing that ssh handles all of "our needs bar the occasional hung session Poin the club

Read the section on 8scape 5haracters in the manual and when "our session hangs on exit appl"# RR8!UR;S ^ V or RR8!UR;S ^ as appropriate ;oting, of course, that if "ouB$e sshBd through se$eral boxes "ou ma" need to increase the number of escape chars 5heers, Ian K the club Nep Interacti$e sessions are not a problem as thereBs a human there to press enter4tilde4dot if it doesnBt close ItBs when "ou run it from e g cron is when "ou should worr" Dima 44 !hings seemed simpler before we kept computers 44 I1, Re$elation posted by Brahma at 3:30 PM & comments

Solaris : ss&d > ss& e=it codes


Solaris % sshd / ssh exit codes On Solaris %, with the latest ssh/sshd patches installed ,,-:/L4&:# SunOS / %# /usr/bin/ssh >atch ,,:.E:4&L# SunOS / %# /usr/lib/ssh/sshd >atch wh" is there inconsistent beha$iour with ssh exit codesA Wh" are there sporadic exit codes of & from the following ssh commandA Z repeat ,&& sh 4c Bssh 4n localhost Cexit ::C W echo YAB :: :: :: :: ::

:: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: & :: :: :: :: :: & & & & :: :: :: :: :: :: :: :: :: :: :: aO Suspended Puergen Ueil MQ Jtools deK writes# KOn Solaris %, with the latest ssh/sshd patches installed K ,,-:/L4&:# SunOS / %# /usr/bin/ssh >atch K ,,:.E:4&L# SunOS / %# /usr/lib/ssh/sshd >atch K wh" is there inconsistent beha$iour with ssh exit codesA Wh" are Kthere sporadic exit codes of & from the following ssh commandA

ItBs a bug which is being addressed =!hereBs a race condition between processes exiting and stdin/stdout being closed, so sshd can close the connection before it has seen the exit status@ 5asper KK wh" is there inconsistent beha$iour with ssh exit codesA Wh" are KKthere sporadic exit codes of & from the following ssh commandA K ItBs a bug which is being addressed K =!hereBs a race condition between processes exiting and stdin/stdout K being closed, so sshd can close the connection before it has seen K the exit status@ Is that the same bug that causes m" 5?S o$er ssh sessions to hangA Dragan 4 K& K:: K:: KaO KSuspended Ob$iousl" "our ClocalhostC is round4robin D;S to hosts with different definitions of CexitC T 7a$e "ou had a $isit from m" S(s A Is it more informati$e to do Cuname W exit ::C to let "ou see whether the remote command got run A KIs that the same bug that causes m" 5?S o$er ssh sessions to hangA It happens mostl" on 2inux clients backup script# 7ere is what I do for m" Star

Hcmd*` e$al echo CYS!(R 4c0 4time f*YR!(>8 ?O27DR* Yhost#Yi YS!(RH(RGS YS!(RH81!R( 45 Yi \W r*\Y\A \W sleep ,& \W exit \Y\rC` ssh 4' CYhostC 4l root CYHcmdC excode*YA if R Yexcode 4ne & SW then echo C4444K 81I5OD8# Yexcode for Yhost#YiC fi

posted by Brahma at 3:29 PM & comments

s& not endin9 JsometimesK from inside a script, '&y)


ssh not ending =sometimes@ from inside a script, wh"A Oka" I ha$e this script file that runs from cron Qob =on a unix box running solaris % with SS7 $ersion SunHSS7H, & protocols , //. &@ and most the time it works Qust find 8xcept e$er" so often one of the three ssh commands I ha$e in the script Qust doesnBt know itBs done and that of course causes the whole thing to hangT !he ssh command has executed I can tell this because the command is as follows# ssh usernameJhostname Cls /somedirector"C Ksomedir file and a new somedir file has been created on the machine running the cron script (lso, when this happens I can use the Ckill sshprocessidC command and the cron script will continue, fat dumb and happ"T !he machine IBm CsshCing to is a unix box with OpenSS7H: E ,p. protocols , //. &, OpenSS2 & % L on it I ha$e tried running the ssh command in 4$ mode and looking at the out put but canBt reall" make much from it but can see a difference in the order of things when the command hangs !he b$ output when ssh ended properl" is as follows# , 4debug,# 8ntering interacti$e session . 4 debug,# clientHinit id & arg & : 4 debug,# Sending command# ls /Rawdata/(rchi$e./)?5ID- tlm g+ - 4 debug,# channel &# open confirm rwindow & rmax :.EL9 / 4 debug,# channel &# readM*& rfd L len & L 4 debug,# channel &# read failed E 4 debug,# channel &# input open4Kdrain 9 4 debug,# channel &# closeHread % 4 debug,# channel &# input# no drain shortcut ,& 4 debug,# channel &# ibuf empt" ,, 4 debug,# channel &# input drain4Kclosed ,. 4 debug,# channel &# send eof ,: 4 debug,# channel &# rc$d eof ,- 4 debug,# channel &# output open4Kdrain

,/ 4 debug,# channel# & rc$d re'uest for exit4status ,L 4 debug,# cbHfn .LEa- cbHe$ent %, ,E 4 debug,# channel &# rc$d close ,9 4 debug,# channel &# obuf empt" ,% 4 debug,# channel &# output drain4Kclosed .& 4 debug,# channel &# closeHwrite ., 4 debug,# channel &# send close .. 4 debug,# channel &# full closed. .: 4 debug,# channelHfree# channel &# status# !he following connections are open# F& client4session =t- r& i9/& o,.9/& fd 4,/4,@ .- 4 debug,# channelHfree# channel &# dettaching channel user ./ 4 debug,# !ransferred# stdin &, stdout &, stderr & b"tes in & L seconds .L 4 debug,# B"tes per second# stdin & &, stdout & &, stderr & & .E 4 debug,# 8xit status & !he b$ output when ssh hung is as follows# , 4 debug,# 8ntering interacti$e session . 4 debug,# clientHinit id & arg & : 4 debug,# Sending command# ls /Rawdata/(rchi$e./)?5ID- tlm g+ - 4 debug,# channel &# open confirm rwindow & rmax :.EL9 / 4debug,# channel &# readM*& rfd L len & L 4 debug,# channel &# read failed E 4 debug,# channel &# input open4Kdrain 9 4 debug,# channel &# closeHread % 4 debug,# channel &# input# no drain shortcut ,& 4 debug,# channel &# ibuf empt" ,, 4 debug,# channel &# input drain4Kclosed ,. 4 debug,# channel &# send eof ,: 4 debug,# channel &# rc$d eof ,- 4 debug,# channel &# output open4Kdrain ,/ 4 debug,# channel &# obuf empt" ,L 4 debug,# channel &# output drain4Kclosed ,E 4 debug,# channel &# closeHwrite ,9 4 debug,# channel &# send close ,% 4 debug,# channel# & rc$d re'uest for exit4status .& 4 debug,# cbHfn .LEa- cbHe$ent %, ., 4 debug,# channel &# rc$d close .. 4 debug,# channel &# full closed. .: 4 debug,# channelHfree# channel &# status# !he following connections are open# F& client4session =t- r& i9/& o,.9/& fd 4,/4,@ .- 4 debug,# channelHfree# channel &# dettaching channel user

;ote I put the numbers on the trace I figure there is a race condition of some kind going on for the end of command signal and once in awhile it gets missed but I Qust donBt know where else to look IBll take an" ideas or comments, pleaseT http#//www snailbook com/fa'/background4Qobs auto html 44 SubQect# Re# ssh not ending =sometimes@ from inside a script, wh"A !hank "ou for the link I did read through this before posting m" 'uestion but I Qust read through it again and wonder if the answer to m" 'uestion is not simpl" it is going to hang sometimes and there is nothing I can do about it !his is of course not the answer I was hoping for but if it is so I guess I should mo$e on and Qust write code to kill the process after a period of time I Qust donBt think that this answer is $er" prett" #= (gain an" thoughts or comments are welcome, and thanks U"m 8nd of messages posted by Brahma at 3:27 PM & comments

SS; FreDuently %sked !uestions


SS7 <re'uentl" (sked 3uestions Sometimes m" SS7 connection hangs when exiting X the shell =or remote command@ exits, but the connection remains open, doing nothing 3uick <ix NouBre probabl" using the OpenSS7 ser$er, and started a background process on the ser$er which "ou intended to continue after logging out of the SS7 session <ix# redirect the background process stdin/stdout/stderr streams =e g to files, or /de$/null if "ou donBt care about them@ <or example, this hangs# clientZ ssh ser$er ser$erZ xterm V ser$erZ logout hangs

but this beha$es as expected# clientZ ssh ser$er ser$erZ xterm M /de$/null KV /de$/null V ser$erZ logout SS7 session terminates clientZ Short 8xplanation !his problem is usuall" due to a feature of the OpenSS7 ser$er When writing an SS7 ser$er, "ou ha$e to answer the 'uestion, CWhen should the ser$er close the SS7 connectionAC !he ob$ious answer might seem to be# close it when the ser$er4side user program started b" client re'uest =shell or remote command@ exits 7owe$er, itBs actuall" a bit more complicatedW this simple strateg" allows a race condition which can cause data loss =see the explanation below@ !o a$oid this problem, sshd instead waits until it encounters end4of4file =eof@ on the pipes connecting to the stdout and stderr of the user program !his strateg", howe$er, can ha$e unexpected conse'uences In Unix, an open file does not return eof until all references to it ha$e been closed When "ou start a background process from the shell on the ser$er, it inherits references to the shellBs standard streams Unless "ou pre$ent this b" redirecting these, or the process closes them itself =daemons will generall" do this@, the existence of the new process will cause sshd to wait indefinitel", since it will ne$er see eof on the pipe connecting it to the =now defunct@ shell process X because that pipe also connects it to "our background process !his design choice has changed o$er time 8arl" $ersions of OpenSS7 beha$ed as described here <or some time, it was changed to exit immediatel" upon exit of the user programW then, it was changed back when the possibilit" of data loss was disco$ered Race 5ondition Details (s an example, letBs take the simple case of# ssh ser$er cat foo txt !his should result in the entire contents of the file foo txt coming back to the client X but in fact, it ma" not 5onsider the following se'uence of e$ents# ) !he SS7 connection is set upW sshd starts the target accountBs shell as shell 4c Ccat foo txtC in a child process, reading the shellBs stdout and sending the data o$er the SS7 connection sshd is waiting for the shell to exit

) !he shell, in turn, starts cat foo txt in a child process, and waits for it to exit !he file data from foo txt which cat write to its stdout, howe$er, does not pass through the shell process on its wa" to sshd cat inherits its stdout file descriptor =fd@ from it parent process, the shell X that fd is a direct reference to the pipe connecting the shellBs stdout to sshd ) cat writes the last chunk of data from foo txt, and exitsW the data is passed to the kernel $ia the write s"stem call, and is waiting in the pipe buffer to be read b" sshd !he shell, which was waiting on the cat process, exits, and then sshd in turn exits, closing the SS7 connection 7owe$er, there is a race condition here# through the $agaries of process scheduling, it is possible that sshd will recei$e and act on the SIG572D notif"ing it of the shellBs exit, before it reads the last chunk of data from the pipe If so, then it misses that data !his se'uence of e$ents can, for example, cause file truncation when using scp posted by Brahma at 3:22 PM & comments

Friday, *ctober 0L, 2005


!lo9ic 5river Solaris
(ll, 7ow do I get m" Solaris 9 ser$er to CseeC what is attached on the switchA IB$e read the >rocedure 0anual =:/& pages@ for the Brocade :./& as well as the 32ogic 0anuals but so far I ha$e not found an" good documentation that deals with the integration between the 7B( and the Brocade switch I ha$e , 2!O. tape dri$e on a :./& Brocade switch, I ha$e a lot more actuall", but I want to start out simple, with , attached de$ice (lso, in m" cfgadm 4al it shows the de$ice that is attached to the switch as failing c: fc4pri$ate connected configured unknown c:##/&&,&-f&&&/.cf.. tape connected configured unknown c- fc4pri$ate connected configured unknown c-##/&&,&-f&&&/.cf./ tape connected configured

unknown c/ fc4fabric connected configured unknown c/##/&&,&-f&&&/.cf,c una$ailable connected configured failing c/##/&&,&-f&&&/.cf,f una$ailable connected configured failing cL fc connected unconfigured unknown ;ote# c/ is the card/port=s@ that is/are connected to the switch Diagram# Sun ?--&# 4444444444444444 I I7B(I I 4444444444444444 I I / / / I =Brocade@ 4444444444444444444 I >& >, >. >: I 4444444444444444444 I I 4K 7>Ultrium42!O. .GBps Dri$e 7ere is the switch information# s:./&#adminK nsshow [ !"pe >id 5OS >ort;ame ;ode;ame !!2=sec@ ; &,&&&&W :W.,#&&#&&#e&#9b#,-#,.#&/W.&#&&#&&#e&#9b#,-#,.#&/W na <5-s# <5> <abric >ort ;ame# .&#&&#&&#&/#,e#:/#E9#EE ;2 &,&,//W :W/&#&,#&-#f&#&&#/.#cf#&-W/&#&,#&-#f&#&&#/.#cf#&:W na <5-s# <5> R7> Ultrium .4S5SI U-E&S <abric >ort ;ame# .&#&,#&&#&/#,e#:/#E9#EE !he 2ocal ;ame Ser$er has . entries ] s:./&#adminK

I ha$e setup a +one for this tape dri$e# s:./&#adminK +oneshow Defined configuration# cfg# m"config&&, +one, +one# +one, :,.,W :,/& +one# +one. /&#&,#&-#f&#&&#/.#cf#&+one# +one: /&#&,#&-#f&#&&#/.#cf#&: 8ffecti$e configuration# cfg# m"config&&, +one# +one, :,., :,/& 7ere is m" current 'lc conf# F cat 'lc conf I grep 4$ aF I grep I sort hba&4adapter4hard4loop4ID*&W hba&4enable4adapter4hard4loop4ID*&W F pkginfo 4i I grep 'lc s"stem SU;W'lc 3logic IS> ..&&/..&. <ibre 5hannel De$ice Dri$er s"stem SU;W'lcx 3logic IS> ..&&/..&. <ibre 5hannel De$ice Dri$er =L- bit@ F prtdiag 4$ I grep 'lc & pci LL >5I. SU;W,'lc4pci,&EE,.:,. =scsi46 & pci LL >5I. SU;W,'lc4pci,&EE,.:,. =scsi46 & pci :: >5I: SU;W,'lc4pci,&EE,.:,. =scsi46 & pci :: >5I: SU;W,'lc4pci,&EE,.:,. =scsi46 Nes, I know I ha$e two dual4port cardsW I am onl" using the first one at the moment IB$e noticed there are actual 32OGI5 7B( dri$ers, I ha$e installed them in the past but either I did not configure them properl", or something44 as I did not notice an" effect with the dri$ers installed or not installed !he dri$ers being#

Solaris 32ogic 7B( <iber Dri$ersY ls !roubleshooting\ <or\ !he\ 32ogic\ .:-.\ 7B(s pdf 'la.:&&4readme txt 'la.:&& sparcHpkg O sansurfer. & :&b.:4,HsolarisHinstall bin scli , &L ,L4,/ S>(R5419L Solaris pkg O (n"one ha$e an" cluesA !hanks, Pustin posted by Brahma at 11:24 AM , comments

lar9e file limitation 1eritas


SubQect# R8# large file limitation !hanks to all for "our replies, ob$iousl" man" options but I went with the option below to use fsadm to reconfigure the <S to use largefiles on the fl", !hanks to ?1<S, and also thanks to Pames Scott for a similar repl" Worked like a charm >aul SubQect# Re# large file limitation ?x<S Good #4@ .GB not an issue, can enable on the fl" without unmounting etc /usr/lib/fs/$xfs/fsadm 4o largefiles /0OU;!>OI;! = ex# /usr/lib/fs/$xfs/fsadm 4o largefiles /data,@ $erif"# /usr/lib/fs/$xfs/fsadm /data, !here "ou are, that is wh" "ou ha$e ?eritas #4@ 5heers 8

>aul SagneriJcox com wrote# K GuruBs K K I ha$e Lgig of data that I need to tar up and mo$e to m" local dri$e and K would like to mo$e it all in one tar file 7owe$er, m" tar bombs out K after the .g limitation IBm running Solaris 9 with $xfs but didnBt K make the file s"stem using the largefiles option K K Is there a wa" to tar up a director" structure larger than .g at this K point I thought this was onl" a restriction in . L and prior K K !I( K K >aul Sagneri posted by Brahma at 11:24 AM & comments

Aermissions messed in >devices @ easy fi=)


SubQect# RSU00(RNS >ermissions messed in /de$ices 4 eas" fixA 44444 Original >ost# Due to an errant command during a securit"4tightening process, I ha$e a Solaris 9 box that has had all of the Other Write bits turned off on the special files in /de$ices Is there a reasonabl" eas" method to get Solaris to regenerate /de$ices from scratchA IB$e tried Ctouch /reconfigure and rebootC 4 no dice 4 doesnBt seem to regenerate something thatBs needed thatBs alread" there Suggestion# how about nuking /de$ices and /de$ from a script as the last thing the OS does on the wa" down then boot 4rA 44444 I07O the best responses came from 5asper Dik and Da$id <oster to use pkgchk 4f SU;Wcsd to force the reinstallation =and presumabl" permissions@ of the de$ices Unfortunatel", this ad$ice came too late What I did was touch /reconfigure

rm 4rf /de$ /de$ices from single user mode init & at which point the s"stem locked <rom this point on the s"stem would lock sometime shortl" after reading /etc/s"stem I made man" efforts to restore /de$ices to no a$ail after that point (ttempts included# )@ disabled S?0 4 I could, after all, onl" reall" change one side of the mirror when booting from 5D )@ boot from 5D, cop" /de$ices and /de$ from the running image to the boot dri$e )@ boot from 5D, use the suggested de$fsadm 4r /tmp/a method to rebuild the hierarch" )@ 2ast message I was getting looked like the s"stem had loaded the RD(5 dri$er for m" S(; disks, so I disabled it Basicall" got the same lock e$er" boot attempt Interestingl" enough, on all these boot attempts where the 99& locked, it would not e$en respond to BR8(U on the tt"a line =what IBm using for console@ In all attempts I had to power c"cle the box !he box is now back in production with a fresh new Solaris % load It is something we probabl" should ha$e started at !uesda" noon instead of Wednesda" afternoon, but hindsight is alwa"s .&/.& !hanks for all replies 44444 !his would generall" be m" experience, from Grant# I would be careful about the /de$ices director" I had to restore a s"stem from backup, using ;etBackup and the s"stem wouldnBt boot (fter I rebuilt the s"stem from a full backup, the s"stem wouldnBt boot I e$en tried rebooting with 4r and e$en touch /reconfigure It turned out the /de$ices tree wasnBt restored =;etBackup doesnBt back up the /de$ices director"@ !he s"stem would hang right after reading the s"stem file I finall" had to boot from cdrom, run de$fsadm on the mounted /a files"stem, and then rebooted !hen it booted 7ope this helps 44444 <rom !im# >ossibl" a red herring, but wouldnBt a sudo find /de$ 4name B)B 4exec chmod o6w \W do the trickA Response# Nes, but Nes ;ot e$er"thing should ha$e write permission

44444 Remo$e e$er"thing )except) for "our boot de$ice, rename /etc/pathHtoHinst then Breboot 44 4raB ItBll ask "ou if "ou want to rebuild the pathHtoHinst Response# might ha$e worked, but I didnBt need pathHtoHinst rebuilt as far as I knew (s stated earlier, keeping the path to the boot de$ice would ha$e been useful posted by Brahma at 11:23 AM & comments

"ive Up9rade ;elp


SubQect# U>D(!8# 2i$e Upgrade 7elp 7i Gurus, I ha$enBt recei$ed an" response to this I need help to resol$e this as we are planning to upgrade all our >roduction Ser$ers from Solaris . L to Solaris 9 b" next week (n" 7elp will be greatl" appreciated I tried it on a different box with same result One thing which i noticed is SU;Wluu and SU;lur I installed both from m" Pumpstart Box Solaris 9 //&: howe$er li$e upgrade $ersion is# C2i$e Upgrade . & ,&/&,C I ha$e onl" one $ersion of Solaris 9 //&: on m" Pumpstart Box (2so i am not clear about profile which i am using 0" profile file is upgrade and its content is installHt"pe upgrade 7ere is theoutput of m" 2i$e Upgrade# 444444444444444444444444444444444444444444444444444444444444444444444444 444444444444444444444444444444444444444444444444444444444444444444444444 444444444444444444444444444444444444444444444444444444444444444444444444 44444444444444444444444444 F lucreate 4c CSolaris.LC 4m /#/de$/dsk/c&t,d&s&#ufs 4m /usr#/de$/dsk/c&t,d&s/#ufs 4m /$ar#/de$/dsk/c&t,d&s:#ufs 4m /opt#/de$/dsk/c&t,d&s-#ufs 4m /home#/de$/dsk/c&t,d&sL#ufs 4m 4#/de$/dsk/c&t,d&s,#swap 4m /citadon#/de$/dsk/c&t,d&sE 4n CSolarisH9C >lease wait while "our s"stem configuration is determined ;o name for 5urrent B8 5urrent B8 is named MSolaris.LK 5reating initial configuration for primar" B8 MSolaris.LK >B8 configuration successful# >B8 name MSolaris.LK >B8 Boot De$ice

M/de$/dsk/c&t&d&s&K Determining what file s"stems should be in the new B8 Searching /de$ for possible B8 files"stem de$ices >lease wait while the configuration files are updated >lease wait 5onfiguration $alidation in progress )))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) )))))))))))))))))))) Beginning process of creating Boot 8n$ironment MSolarisH9K ;o more user interaction is re'uired until this process is complete )))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) )))))))))))))))))))) Setting B8 MSolarisH9K state to ;ot 5omplete 5reating file s"stems on B8 MSolarisH9K 5reating MufsK file s"stem on M/de$/dsk/c&t,d&s&K /de$/rdsk/c&t,d&s&# ,&.E.,L sectors in .,9 c"linders of ,% tracks, .-9 sectors /&, L0B in ,- c"l groups =,L c/g, :L 9,0B/g, ,ELL- i/g@ super4block backups =for fsck 4< ufs 4o b*F@ at# :., E/L9&, ,/,:.9, ..L%EL, :&.L.-, :E9.E., -/:%.&, /.%/L9, L&/.,L, L9&9L-, E/L/,., 9:.,L&, %&E9&9, %9:-/L, 5reating MufsK file s"stem on M/de$/dsk/c&t,d&sLK /de$/rdsk/c&t,d&sL# .,&,//. sectors in --L c"linders of ,% tracks, .-9 sectors ,&.L ,0B in .: c"l groups =.& c/g, -L &.0B/g, ,,.&& i/g@ super4block backups =for fsck 4< ufs 4o b*F@ at# :., %-/.9, ,9%&.-, .9:/.&, :E9&,L, -E./,., /LE&&9, LL,/&-, E/L&&&, 9/&-%L, %--%%., ,&:%-99, ,,::%9-, ,..9-9&, ,:..%EL, ,-,E-E., ,/,,%L9, ,L&L-L-, ,E&&%L&, ,E%/-/L, ,99%%/., ,%9---9, .&E9%--, 5reating MufsK file s"stem on M/de$/dsk/c&t,d&s-K /de$/rdsk/c&t,d&s-# ,.:.L/%. sectors in .L,L c"linders of ,% tracks, .-9 sectors L&,9 90B in ,,% c"l groups =.. c/g, /& L.0B/g, L.&9 i/g@ super4block backups =for fsck 4< ufs 4o b*F@ at# :., ,&:%/., .&E9E., :,,E%., -,/E,., /,%L:., L.://., E.E-E., 9:,:%., %:/:,., ,&:%.:., ,,-:,/., ,.-E&E., ,:/&%%., ,-/-%,., ,//99:., ,LL.E/., ,ELLLE., ,9E&/%., ,%E-/,., .&E9-:., .,9.:/., ..9L.E., .:%&,%., .-%-,,., ./%9&:., .E&,%/., .9&/9E., .%&%E%., :&,:E,., :,,EL:., :..,//., ::,E.9&, :-.,.&&, :/./,.&, :L.%&-&, :E:.%L&, :9:L99&, :%-&9&&, -&--E.&, -,-9L-&, -././L&, -:/L-9&, --L&-&&, -/L-:.&, -LL9.-&, -EE.,L&, -9EL&9&, -%9&&&&, /&9:%.&,

/,9E9-&, /.%,EL&, /:%/L9&, /-%%L&&, /L&:/.&, /E&E--&, /9,,:L&, /%,/.9&, L&,%.&&, L,.:,.&, L..E&-&, L::&%L&, L-:-99&, L/:99&&, LL:-/.9, LE:9--9, L9-.:L9, L%-L.99, E&/&.&9, E,/-,.9, E./9&-9, E:L,%L9, E-L/999, E/L%9&9, ELE:E.9, EEEEL-9, E99,/L9, E%9/-99, 9&9%-&9, 9,%::.9, 9.%E.-9, 9-&,,L9, 9/&/&99, 9L&%&&9, 9E,.%.9, 99,L9-9, 9%.&EL9, %&.-L99, %,.9L&9, %.:./.9, %::L--9, %--&:L9, %/--.99, %L-9.&9, %E/.,.9, %9/L&-9, %%/,EEL, ,&&//L%L, ,&,/%L,L, ,&.L:/:L, ,&:LE-/L, ,&-E,:EL, ,&/E/.%L, ,&LE%.,L, ,&E9:,:L, ,&99E&/L, ,&%%&%EL, ,,&%-9%L, ,,,%99,L, ,,:&.E:L, ,,-&LL/L, ,,/,&/EL, ,,L,--%L, ,,E,9-,L, ,,9..::L, ,,%.L./L, ,.&:&,EL, ,.,:-&%L, ,..:9&,L, 5reating MufsK file s"stem on M/de$/dsk/c&t,d&s/K /de$/rdsk/c&t,d&s/# -,%9:%. sectors in 9%, c"linders of ,% tracks, .-9 sectors .&/& &0B in -, c"l groups =.. c/g, /& L.0B/g, 9./L i/g@ super4block backups =for fsck 4< ufs 4o b*F@ at# :., ,&:%/., .&E9E., :,,E%., -,/E,., /,%L:., L.://., E.E-E., 9:,:%., %:/:,., ,&:%.:., ,,-:,/., ,.-E&E., ,:/&%%., ,-/-%,., ,//99:., ,LL.E/., ,ELLLE., ,9E&/%., ,%E-/,., .&E9-:., .,9.:/., ..9L.E., .:%&,%., .-%-,,., ./%9&:., .E&,%/., .9&/9E., .%&%E%., :&,:E,., :,,EL:., :..,//., ::,E.9&, :-.,.&&, :/./,.&, :L.%&-&, :E:.%L&, :9:L99&, :%-&9&&, -&--E.&, -,-9L-&, 5reating MufsK file s"stem on M/de$/dsk/c&t,d&s:K /de$/rdsk/c&t,d&s:# ,&.E.,L sectors in .,9 c"linders of ,% tracks, .-9 sectors /&, L0B in ,- c"l groups =,L c/g, :L 9,0B/g, ,ELL- i/g@ super4block backups =for fsck 4< ufs 4o b*F@ at# :., E/L9&, ,/,:.9, ..L%EL, :&.L.-, :E9.E., -/:%.&, /.%/L9, L&/.,L, L9&9L-, E/L/,., 9:.,L&, %&E9&9, %9:-/L, 0ounting file s"stems for B8 MSolarisH9K 5alculating re'uired si+es of file s"stems for B8 MSolarisH9K >opulating file s"stems on B8 MSolarisH9K 5op"ing file s"stem contents to B8 MSolarisH9K I;<OR0(!IO;# Setting as"nchronous flag on (B8 MSolarisH9K mount point M/ alt .E&:/$arK file s"stem t"pe MufsK I;<OR0(!IO;# Setting as"nchronous flag on (B8 MSolarisH9K mount point M/ alt .E&:/usrK file s"stem t"pe MufsK I;<OR0(!IO;# Setting as"nchronous flag on (B8 MSolarisH9K mount point M/ alt .E&:/optK file s"stem t"pe MufsK I;<OR0(!IO;# Setting as"nchronous flag on (B8 MSolarisH9K mount point M/ alt .E&:/homeK file s"stem t"pe MufsK I;<OR0(!IO;# Setting as"nchronous flag on (B8 MSolarisH9K mount point M/ alt .E&:/K file s"stem t"pe MufsK 5op"ing of file s"stem / director" M/$arK is in progress 5op"ing of file s"stem / director" M/$arK completed successfull" 5op"ing of file s"stem / director" M/usrK is in progress 5op"ing of file s"stem / director" M/usrK completed successfull"

5op"ing of file s"stem / director" M/optK is in progress 5op"ing of file s"stem / director" M/optK completed successfull" 5op"ing of file s"stem / director" M/homeK is in progress 5op"ing of file s"stem / director" M/homeK completed successfull" 5op"ing of file s"stem / director" M/K is in progress 5op"ing of file s"stem / director" M/K completed successfull" 5reating compare database for file s"stem M/$arK 5reating compare database for file s"stem M/usrK 5reating compare database for file s"stem M/optK 5reating compare database for file s"stem M/homeK 5reating compare database for file s"stem M/K Updating compare database on other B8s Updating compare database on B8 MSolarisH9K 5ompare databases updated on all B8s 0aking Boot 8n$ironment MSolarisH9K bootable 0aking the (B8 bootable Updating (B8Bs /etc/$fstab file !he update of the $fstab file on the (B8 succeeded Updating (B8Bs /etc/mnttab file !he update of the mnttab file on the (B8 succeeded Updating (B8Bs /etc/dumpadm conf file !he update of the dumpadm conf file on the (B8 succeeded Updating partition ID tag on boot en$ironment MSolarisH9K de$ice M/de$/rdsk/c&t,d&s.K to be root slice Updating boot loader for MSU;W,UltraS>(R54IIi4c8ngineK on boot en$ironment MSolarisH9K de$ice M/de$/dsk/c&t,d&s&K to match OS release 0aking the (B8 MSolarisH9K bootable succeeded Setting B8 MSolarisH9K state to 5omplete 5reation of Boot 8n$ironment MSolarisH9K successful 5reation of Boot 8n$ironment MSolarisH9K successful F luupgrade 4u 4n CSolarisH9C 4s /opt/install/SolarisH.9H/&: 4Q /opt/install/config/li$eupgrade/upgrade ?alidating the contents of the media M/opt/install/SolarisH.9H/&:K !he media is a standard Solaris media !he media contains an operating s"stem upgrade image !he media contains MSolarisK $ersion M9K !he media contains patches for the product 2ocating upgrade profile template to use 2ocating the operating s"stem upgrade program 5hecking for existence of pre$iousl" scheduled 2i$e Upgrade re'uests 5reating upgrade profile for B8 MSolarisH9K Updating (B8Bs /etc/$fstab file !he update of the $fstab file on the (B8 succeeded Determining packages to install or upgrade for B8 MSolarisH9K >erforming the operating s"stem upgrade of the B8 MSolarisH9K 5(U!IO;# Interrupting this process ma" lea$e the boot en$ironment

unstable or unbootable Segmentation <ault !he operating s"stem patch installation completed W(R;I;G# B8 file s"stem M/de$/dsk/c&t,d&sLK not mounted !he Solaris upgrade of the B8 MSolarisH9K failed 444444444444444444444444444444444444444444444444444444444444444444444444 444444444444444444444444444444444444444444444444444444444444444444444444 444444444444444444444444444444444444444444444444444444444444444444444 7i Gurus, I figured out the problem It was t"po in the lucreate command near /opt =s was missing@ (fter rectif"ing that I was able to create B8 but while in upgrade process it failed with error Csegmentation faultC luupgrade 4u 4n CSolarisH9C 4s /install/SolarisH.9H/&:/ 4Q /install/config/li$eupgrade/upgrade Snip 5reating upgrade profile for B8 MSolarisH9K Updating (B8Bs /etc/$fstab file !he update of the $fstab file on the (B8 succeeded Determining packages to install or upgrade for B8 MSolarisH9K >erforming the operating s"stem upgrade of the B8 MSolarisH9K 5(U!IO;# Interrupting this process ma" lea$e the boot en$ironment unstable or unbootable Segmentation <ault !he operating s"stem patch installation completed !he Solaris upgrade of the B8 MSolarisH9K failed (n" help/pointer will be greatl" appreciated I will summari+e Regards B 7i Gurus, !his is m" first 2i$e Upgrade so please bear with me if m" 'uestions sound sill"

I am tr"ing to do li$e upgrade from Solaris . L to Solaris 9 and ran into following error# F lucreate 4c CSolarisH.LC 4m /#/de$/dsk/c&t,d&s&#ufs 4m /usr#/de$/dsk/c&t,d&s:# ufs 4m /$ar#/de$/dsk/c&t,d&s-#ufs 4m /opt#/de$/dsk/c&t,d&L#ufs 4m 4#/de$/dsk/c&t,d&s,#swap 4m /home#/de$/dsk/c&t,d&s/ 4n CSolarisH9C >lease wait while "our s"stem configuration is determined ;o name for 5urrent B8 5urrent B8 is named MSolarisH.LK 5reating initial configuration for primar" B8 MSolarisH.LK >B8 configuration successful# >B8 name MSolarisH.LK >B8 Boot De$ice M/de$/dsk/c&t&d&s&K Determining what file s"stems should be in the new B8 Searching /de$ for possible B8 files"stem de$ices luconfig# 8RROR# !emplate files"stem definition failed for /opt 8RROR# 5onfiguration of B8 failed I id the flowing steps to create a boot en$ironment# ,@ Install 2atest patch 5luster on !arget Box .@ Install SU;Wluu and SU;Wlur from Solaris 9 5D to target box :@ 5reated partition on !arget box on second Disk -@ 0ount Pumstart /opt/install to target box as /install /@ Ran lucreate to create a boot en$ironment on target box second disk as below# F lucreate 4c CSolarisH.LC 4m /#/de$/dsk/c&t,d&s&#ufs 4m /usr#/de$/dsk/c&t,d&s:# ufs 4m /$ar#/de$/dsk/c&t,d&s-#ufs 4m /opt#/de$/dsk/c&t,d&L#ufs 4m 4#/de$/dsk/c&t,d&s,#swap 4m /home#/de$/dsk/c&t,d&s/ 4n CSolarisH9C ,@ Do I need to create a file s"stem with newfsA Or Qust partition will doA .@ On Pumpstart Box what steps I need to follow besides creating a profile file which contains 4 CinstallHt"pe upgradeC A

:@ 7ow do I select cluster t"peA 5luster SU;W5allA -@ 7ow do I select the >atch 5luster for Solaris 9 on Qumpstart BoxA (n" help will be greatl" appreciated !I( B posted by Brahma at 11:22 AM & comments

;o' do < tell '&at caused my mac&ine to cras&)


SubQect# L ,@ 7ow do I tell what caused m" machine to crashA !he crash messages will usuall" be displa"ed on the console, and are usuall" logged to /$ar/adm/messages $ia s"slog as well after a warm reboot In older $ersions of Solaris, the CdmesgC command ma" also show crash messages If "our s"stem repeatedl" crashes with similar looking errors, tr" searching through the patch list on the Sun patch database for a description that matches "our machine In $ersions of Solaris . up to and including Solaris . L, uncomment the Csa$ecoreC line in the file /etc/init d/s"setup to enable crash dumps (s of Solaris E and later, crash dumps are enabled b" defaultW see the manual page for dumpadm=,0@ for information on how to customi+e s"stem dump configuration !o report a crash dump, "ou need a s"mbolic traceback for it to be useful to the person looking at it !"pe the following# cd /$ar/crash/`hostname` echo BYcB I adb 4k unix & $mcore & !he CcrashC utilit" can be useful for anal"+ing crash dumps for Solaris up to and including Solaris 9 C5rashC has been superseded b" CmdbC =modular debugger@ as of Solaris 9 posted by Brahma at 11:18 AM & comments

M&at can < do if my mac&ine slo's to a cra'l or /ust &an9s)


SubQect# L .@ What can I do if m" machine slows to a crawl or Qust hangsA !r" running CpsC to look for large numbers of the duplicate programs or processes with a huge si+e field Some s"stem daemons occasionall" can

get into a state where the" fork repeatedl" and e$entuall" swamp the s"stem Uilling off the child processes doesnBt do an" good, so "ou ha$e to find the CmasterC process It will usuall" ha$e the lowest pid (nother useful approach is to run $mstat to pin down what resource=s@ "our machine is running out of Nou can tell $mstat to gi$e ongoing reports b" specif"ing a report inter$al as its first argument !he programs CtopC and CspsC are good for finding processes that are loading "our s"stem C!opC will gi$e "ou the processes that are consuming the most cpu time CSpsC is a better $ersion of CpsC that runs much faster and displa"s processes in an intuiti$e manner !op is a$ailable at ftp#//ftp groups"s com/pub/top/ Sps is a$ailable at ftp#//ftp cs$ warwick ac uk/pub/solaris./sps4sol. tar g+ Doug 7ughes MDoug dot 7ughes at 8ng dot (uburn dot 8DUK has written a small, 'uick >S workalike called C'psC, a$ailable from his web page at http#//www eng auburn edu/users/doug/second html Sometimes "ou run out of memor" and "ou wonBt be able to run enough commands to e$en find out what is wrong Nou will get messages of the t"pe Cout of memor"C or Cno more processesC ;ote that Cout of memor"C refers to $irtual memor", not ph"sical memor" On a Solaris s"stem, $irtual memor" is generall" e'ual to the sum of the swap space and the amount of ph"sical memor" =less a roughl" constant amount for the kernel@ on the machine !he command Cswap 4sC will tell "ou how much $irtual memor" is a$ailable Nou can s"nc the disks to minimi+e files"stem corruption if "ou ha$e to crash the s"stem# Use the 2,4( se'uence to crash the s"stem If "ou are on an older s"stem, t"pe Cg&C and "ou will get the message Cpanic# s"ncing file s"stemsC When "ou see the word CdoneC, hit 2,4( again and reboot On s"stems with the CnewC prom, t"pe CnC to get into the new command mode and t"pe Cs"ncC posted by Brahma at 10:09 AM & comments

;o' do < find out &o' muc& p&ysical memory a mac&ine &as)
SubQect# L :@ 7ow do I find out how much ph"sical memor" a machine hasA Use /usr/sbin/prtconf if the machine is running Solaris If itBs a sun-u running Solaris 9 or pre$ious, /usr/platform/sun-u/sbin/prtdiag is $er" helpful ItBs /usr/sbin/prtdiag in Solaris % and later

On high4end machines, /usr/sbin/cfgadm 4al can also pro$ide memor" information !he banner message on reboot =or t"pe CbannerC in the monitor on machines with Openboot proms@ will usuall" report the amount of ph"sical memor" (lternati$el", "ou can open up the case and count SI00S and/or memor" boards ( perl script CmemconfC is also a$ailable that identifies the si+es and locations of SI00/DI00 memor" modules installed in a Sun s"stem It also works on se$eral S>(R5 clones and with Sun 8xplorer data It is maintained b" !om Schmidt Mtschmidt at micron dot comK Download memconf from http#//www -schmidts com/unix html posted by Brahma at 10:07 AM & comments

;o' do < find out '&at my mac&ine?s memory is bein9 used for) ;o' can < tell if < need more memory)
SubQect# L -@ 7ow do I find out what m" machineBs memor" is being used forA 7ow can I tell if I need more memor"A !o disco$er how much $irtual memor" =i e swap@ is free, run Cswap 4sC or C$mstatC If "ouBre using tmpfs for /tmp, Cdf /tmpC will also work Disco$ering how ph"sical memor" is being used can be more difficult, howe$er 0emor" pages that are not being used b" processes are used as a sort of extended cache, storing pages of memor"4mapped files for possible later use !he kernel keeps onl" a small set of pages free for short4term use, and frees up more on demand 7ence the free memor" reported b" $mstat is not an accurate reflection, for example, of the amount of memor" a$ailable for user processes (n eas" wa" to determine whether or not "our machine needs more memor" is to run $mstat and examine the po =page out@ column and the sr =scan rate@ column If these columns consistentl" show large numbers, this suggests that "our machine does not ha$e enough memor" to support its current workload, and fre'uentl" needs to write pages belonging to acti$e processes to disk in order to free up enough memor" to run the current Qob posted by Brahma at 10:06 AM & comments

;o' can my pro9ram tell '&at model Sun it is runnin9 on)

7ow can m" program tell what model Sun it is running onASubQect# % .@ On older suns, the model t"pe is encoded in the hostid <or suns with the COpenbootC prom =(ll sparcstations and the L&& series@, /usr/sbin/prtconf will re$eal the model t"pe CSunt"peC, written b" Pohn Di0arco =QddJcs toronto edu@ is a shell script which does the appropriate thing on all suns It is a$ailable for anon"mous ftp at ftp#//ftp cs toronto edu/pub/Qdd/sunt"pe (lternati$el", grab 0ichael 5ooperBs Mmcooper at magnicomp dot comK Cs"sinfoC program, which pro$ides all sorts of information about a gi$en s"stem, including the machine t"pe s"sinfo is a$ailable on the web at http#//www magnicomp com/, although it is now a commercial product that is free onl" for educational and non4profit organi+ations posted by Brahma at 10:05 AM & comments

,y remote ufsdump is failin9 'it& a .Arotocol botc&ed. messa9eSubQect# ,& ,@ 0" remote ufsdump is failing with a C>rotocol botchedC message What do I doA !he problem produces output like the following# DU0># Dumping /de$/rsd&a =/@ to /de$/nrst9 on host foo DU0># mapping =>ass I@ Rregular filesS DU0># mapping =>ass II@ RdirectoriesS DU0># estimated 9.:. blocks =- &.0B@ on & && tape=s@ DU0># >rotocol to remote tape ser$er botched =in rmtgets@ rdump# 2ost connection to remote host DU0># Bad return code from dump# , !his occurs when something in cshrc on the remote machine prints something to stdout or stderr =eg stt", echo@ !he remote ufsdump command doesnBt expect this, and chokes Other commands which use the rsh protocol =eg rdist, rtar@ ma" also be affected !he wa" to get around this is to add the following line near the beginning of cshrc, before an" command that might send something to stdout or stderr# if = T YAprompt @ exit

!his causes cshrc to exit when prompt isnBt set, which distinguishes between remote commands =eg rdump, rsh@ where these $ariables are not set, and interacti$e sessions =eg rlogin@ where the" are posted by Brahma at 10:04 AM & comments

;o' do < restore to a different location t&e contents of a tarfile created 'it& absolute pat&names
SubQect# ,& -@ 7ow do I restore to a different location the contents of a tarfile created with absolute pathnamesA !arfiles should not normall" be created with absolute pathnames, onl" with relati$e pathnames Do not t"pe Ctar c /path/nameC to create a tar archi$e, t"pe C=cd /pathW tar c name@C instead ;ote# if "ou do C=cd /path/nameW tar c @C, "ou will indeed a$oid absolute pathnames, but beware that the tarfile created ma" silentl" o$erwrite the permissions of the current director" when unpacked !hatBs OU if "ou unpack it $ia# Cmkdir nameW cd nameW tar xf /m"/tarfile tar !hatBs not OU if "ou unpack it $ia# Ccd /tmpW tar xf /m"/tarfile tarC 44 "ou will change the permissions of /tmp If "ou do ha$e an archi$e created with absolute pathnames, "ou can unpack it in a different location b" using G;UBs $ersion of tar, which will strip off the leading / (lternati$el", "ou can use pax to strip off the leading /, as follows# pax 4r 4s B/a\///B Mabspath tar Or "ou can use chroot and a staticall" linked $ersion of tar, as follows# cp /usr/sbin/static/tar /tmp/restore F cd /tmp/restore F cat abspath tar I chroot /tmp/restore /tar xf 4 posted by Brahma at 10:03 AM & comments

M&y do bot& my net interfaces &ave t&e same et&ernet address)


SubQect# ,. ,@ Wh" do both m" net interfaces ha$e the same ethernet addressA !he 8thernet $ersion . & specification =;o$ember ,%9.@ states#

!he ph"sical address of each station is set b" network management to a uni'ue $alue associated with the station, and distinct from the address of an" other station on an" 8thernet !he setting of the stationBs ph"sical address b" network management allows multiple multiple data link controllers connected to a single station to respond to the same ph"sical address !his doesnBt normall" constitute a problem because each interface will t"picall" be on a different subnet If, for some reason, different ethernet addresses are re'uired on different interfaces =for example, to attach two interfaces to the same subnet@, a new one ma" be assigned using the ifconfig command (lternati$el", for all modern Sun hardware, "ou can set the Clocal4mac4addressAC eeprom $ariable to CtrueC, which will cause each ;I5 to use a uni'ue 0(5 address !his is needed for man" failo$er and trunking configurations posted by Brahma at 9:58 AM & comments

;o' do < set my &me interface to e-9- 100,b full duple=


SubQect# ,. :@ 7ow do I set m" hme interface to e g ,&&0b full duplexA !his applies onl" to Solaris . / or laterW hme interfaces are not supported under SunOS - x or earlier $ersions of Solaris SunBs ,&/,&& network interface on the Ultra s"stems and on the SunSWI<! network cards are capable of negotiating with a network switchW if this is working, and if the other end is capable of ,&&0b full duplex =<D@ operation, the hme card will automaticall" set itself properl" 7owe$er, this ma" not necessaril" work with some networking gear If the two ends ha$e different ideas about what mode the link is, "ou ma" see Clate collisionC messages, dropped packets, or complete failure !o force a particular mode, e g ,&&0b <D, "ou can use ndd as follows# F turn off autonegotiation ndd 4set /de$/hme ad$HautonegHcap & F turn on ,&&0b full4duplex capabilit" ndd 4set /de$/hme ad$H,&&fdxHcap , F turn off ,&&0b half4duplex capabilit" ndd 4set /de$/hme ad$H,&&hdxHcap & F turn off ,&0b full4duplex capabilit" ndd 4set /de$/hme ad$H,&fdxHcap &

F turn off ,&0b half4duplex capabilit" ndd 4set /de$/hme ad$H,&hdxHcap & Nou ma" ha$e to force the other end =e g switch@ to use the same mode 5onsult the manual for "our switch ;B# <ast ethernet hubs are alwa"s ,&&0b half4duplex, and ethernet hubs are alwa"s ,&0b half4duplex If "ou ha$e more than one hme card in "our s"stem, before issuing the abo$e ndd commands, "ou need to first select the specific hme card "ou want to set <or example, to select hme., t"pe# ndd 4set /de$/hme instance . Subse'uent ndd commands to /de$/hme will onl" appl" to hme. If "ou want to force all the hme cards on "our s"stem to a specific mode at machine boot, "ou can set hme dri$er $ariables in /etc/s"stem <or example, to force all hme cards on the s"stem to use ,&&0bit <D, put the following in /etc/s"stem# set hme#hmeHad$HautonegHcap*& set hme#hmeHad$H,&&fdxHcap*, set hme#hmeHad$H,&&hdxHcap*& set hme#hmeHad$H,&hdxHcap*& set hme#hmeHad$H,&fdxHcap*& posted by Brahma at 9:38 AM & comments

;o' do < find out '&at process is usin9 a particular port)


SubQect# ,. -@ 7ow do I find out what process is using a particular portA >orts are held open in the same wa" as files are, b" file handles within the process In most states, a port will also ha$e a handle into another process on the other side of that connection If "ou need to find out which process is holding open a particular port, run lsof =ftp#//ftp cerias purdue edu/pub/tools/unix/s"sutils/lsof@ and grep for the port number !hanks to Stuart Whitb" Mswhitb" at legato dot comK posted by Brahma at 9:37 AM & comments

<?ve for9otten t&e root pass'ordN &o' can < recover)


SubQect# ,/ ,@ IB$e forgotten the root passwordW how can I reco$erA Nou need to ha$e access to the machineBs console

, ;ote the root partition =e g /de$/sd&a or /de$/dsk/c&t:d&s&@ . 7it S!O>4( or 2,4( =or, on an (S5II terminal or emulator, send a MBR8(UK@ to halt the operating s"stem, if itBs running : Boot single4user from 5D4RO0 =boot cdrom 4s@ or network install/Qumpstart ser$er =boot net 4s@ =;B# if it asks "ou for a prom password, see below @ - 0ount the root partition =e g /de$/dsk/c&t:d&s&@ on C/aC C/aC is an empt" mount point that exists at this stage of the installation procedure =mount /de$/dsk/c&t:d&s& /a@ / Set "our terminal t"pe so "ou can use a full4screen editor, e g $i ="ou can skip this step if "ou know how to use CexC or C$iC from open mode@ If "ouBre on a sun console, t"pe C!8R0*sunW export !8R0CW if "ouBre using an ascii terminal =or terminal emulator on a >5@ for "our console, set !8R0 to the terminal t"pe =e g !8R0*$t,&&W export !8R0@ L 8dit the passwd file =/a/etc/passwd for SunOS - x, /a/etc/passwd adQunct for SunOS - x with shadow passwords/5. securit"@, /a/etc/shadow for Solaris . x and remo$e the encr"pted password entr" for root E cd to /W !"pe Cumount /aC 9 reboot as normal in single4user mode =Cboot 4sC@ !he root account will not ha$e a password Gi$e it a new one using the passwd command !hanks to Stefan ?oss Ms dot $oss at terradata dot deK >RO0 passwords# ;aturall", "ou ma" not want an"one with ph"sical access to the machine to be able to do the abo$e to erase the root password Suns ha$e a securit" password mechanism in the >RO0 which can be set =this is turned off b" default@ !he man page for the eeprom command describes this feature If securit"4mode is set to CcommandC, the machine onl" be booted without the prom password from the default de$ice =i e booting from 5D4RO0 or install ser$er will re'uire the prom password@ 5hanging the root password in this case re'uires mo$ing the default de$ice =e g the boot disk@ to a different S5SI target =or e'ui$alent@, and replacing it with a similarl" bootable de$ice for which the root password is known If securit"4mode is set to full, the machine cannot be booted without the prom password, e$en from the default de$iceW defeating this re'uires replacing the ;?R(0 on the motherboard C<ullC securit" has its drawbacks 44 if, during normal operations, the machine is power4c"cled =e g b" a power outage@ or halted =e g b" S!O>4(@, it cannot reboot without the inter$ention of someone who knows the prom password posted by Brahma at 9:37 AM & comments

modifyin9 scripts 'it& binary inside

SubQect# SU00(RN# modif"ing scripts with binar" inside 7i 0anagers, Sorr" for the long dela" I ha$e Qust completed fixing m" problem I want to thank "ou all for "our responses (t the end of this msg I ha$e attached the :4- suggestions I had from ppl I ha$e not tried editing the binar" but I wanted "ou all to see the other suggestions 0" goal was to edit the text portion of the script w/o corrupting the binar" <irst of all this file did in fact ha$e text and binar" w/i one file =script@ !he script remo$es the binar" w/ the CtailC cmd and then un+ips, Ctar xfC and installs the binar" !he binar" contains patches and packages, so the script was huge .-&0B 6 !hat posed another problem, the file being too large for $i I attacked this problem using BradBs method !hank "ou Brad ObQecti$e# Remo$e the binar", edit the text portion, and still be able to run m" script (t first I wanted to reattach m" edited text back to the binar" but instead I Qust made the edited script =which has no binar" now@ access the original script and work with the binar" from that file !his worked wonderfull" Solution# FF!ake the binar" out Y m$ scriptname scriptname "uck Y strings scriptname "uck K scriptname Y $i scriptname FF(bo$e works but the binar" was turned into cra+" chars and sta"ed inside the file, so still too large for $i so here are the cmds to deal w/ that FF'uote from Brad Use split=,@ IBd recommend split 4b ,m pre4re' install orig nobin chunk !his will produce about ,/L one4megab"te files, named chunk aa, chunk ab, etc !hen use#

for <I28 in chunk ) do file Y<I28 done K /tmp/chunkst"le ;ow scan /tmp/chunkst"le for the first file that file=,@ reports to be non4text If, for example, that one is chunk Qe, edit chunk Qd to remo$e the binar" characters at the end =if an"@, then# cat chunk Ra4iS) chunk QRa4dS K script (fterwards, script should contain "our script ( better wa" is to find out which chunk contains the last line of the script ItBs probabl" Cexit &C, test this with# grep Cexit &C pre4re' install orig nobin If "ou onl" get one result, thatBs the string to use to find the end of the file in the middle of some chunk# grep Cexit &C chunk ) !hen edit that chunk to get rid of binar" characters, and cat using wildcards as abo$e If "ou donBt get the wildcards part, hereBs the scoop# chunk Ra4iS) matches chunk aa, chunk ab, , chunk i+ Nou could also use chunk Ra4iSRa4+S !he second expression =chunk QRa4dS@ matches chunk Qa, chunk Qb, chunk Qc, and chunk Qd !his assumes that the end of the script and the beginning of the binar" data is in the file chunk Qd Be sure to read the man page for split=,@, and of course, take great care not to clobber "our original, pre4split files FF 8;D 'uote from Brad I Qust edited the chunk that contained the text script portion which was the first one (ll the other Qunks had cra+" chars =$er" much readable@ that represented the binar" 2ike I said up top m" edited script =no bin@ was modified to Qust access and create the tar file from the orig text/binar" script Suggestions from others# =Nou can use plain old Bill Po" $i Qust fine $im, on the other hand, will corrupt the binar" portion @ =Nou probabl" need a hex editor !r" this one Mhttp#//www hhdsoftware com/hexeditor htmlK @ =If "ou can replace text with the same number of characters "ou ma" get

awa" with using emacs If "ouBre not familair with emacs, pla" with it a little on some othe files first ItBs $er" powerful, but it has a bit of a learning cur$e (lso, and this should go without sa"ing, work on a cop" of the script, not the original, and test the modified $ersion before putting it up for general consumption (llan@ =>erl but $i should work, too @ K SubQect# modif"ing scripts with binar" inside K K I am Qust curious as to what is used to modif" text scripts that also ha$e binaries inside of them K I want to modif" the text onl" portion I was told "ou canBt use $i K K !hank "ou for "our time K K (l posted by Brahma at 9:09 AM & comments

0 &ard'are disk mirrorin9

SubQect# Summar"# ?--& hardware disk mirroring 0an" thanks to e$er" one who replied, the builtin 2SI controller does not show an" progress indicator when s"ncing disks, ie BZ completeBW there is no extra arg to the BraidctlB cmd that will cause a progress indicator to be displa"ed onl" two of the four internal disks can be mirrored with the builtin hardware R(ID controller, the other . internal disks can be mirrored with S?0 George K I ha$e bunch of newl" bought ?--& ser$ers and am keen on using the K 7ardware 0irroring feature K K One thing I ha$e noticed that there does not seem to be an" indication K of a progress when rebuilding/s"ncing the disks K K 3# K o does an"one know where I can get more information on this K hardware feature A K K o is there a wa" to see the progress when it is s"ncing disks A

K K o after a ser$er is built and mirroring is acti$e, can one disk K be pulled out and used in another ser$er as a base for that new K s"stem A IB$e been doing this with DiskSuite for some time now but K an not sure how this will work under hardware mirroring K K o does an"one ha$e an" good or bad things that in regards to K hardware mirroring that might help me A K posted by Brahma at 9:08 AM & comments

file belon9s to '&ic& packa9e )


7ow do I know which file =such as /usr/lib/libgtk4x,,4. & so @ belongs to which packageA Z pkgchk 4l 4p MfilenameK 44 posted by Brahma at 8:01 AM & comments

Summary0 Sun patc&es cluster broke sendmail


SubQect# Summar"# Sun patches cluster broke sendmail !hanks to William 5ole, Rob Windsor and 5hrist 5lark 0" problem was that a patch broke m" sendmail (ll told me the reason was because there was a sendmail package original from Sun remaining in the s"stem, while we ha$e been using a locall" compiled sendmail =SU;Wsndmu and SU;Wsndmr from patch ,,&L,/4,:@ 7ence the mixup ?ersion 9 ,, Ep,6Sun I Qust had to F pkginfoIgrep 4i sendmail 9HRecommendedF find 4name BSU;Wsndm)B 7ere are some lessons CGo look for the patches from the last batch that touched sendmail in /$ar/sadm/pkg/sndmr/sa$e and /$ar/sadm/pkg/sndmu/sa$e C

C!he o$erall lesson is that "ou should alwa"s work with the package s"stem when changing an" file on Solaris that is part of an existing Sun package !he patch tools all assume that the package database is correct, so if "ou are going to modif" or replace an" file that alread" has an entr" in /$ar/sadm/install/contents "ou should start b" remo$ing whate$er package that file is part of and replacing e$er" piece of that package, preferabl" with "our own packaged collection C !hanks all ******* original post ************** 4 Solaris 9, Sun<ire.9&R 4 I applied the latest recommended patch cluster and suddenl" IBm seeing problems with m" sendmail 5ould an"one with similar experience help me pinpoint the problem patch and tell me if I can remo$e itA If this is not a proper forum to ask, can I get some pointers on where to lookA >roblems I see are# 4 We used to be on ?L, but now sendmail re'uires ?- for the 'ueue file $ersion =unsupported 'f file $ersion error@ 4 rR<5 line causes in$alid 'ueue format error =bad line error@, and itBs CalmostC the same as R><D line, so I remo$e them b" scripts, but IBm not comfortable with that 0" problem is similar to whatBs described here http#//www issociate de/board/post/.,:,:%/<orceHsendmailH9 ,:HtoHwriteH?.4 st"leH'fHfile sH HisHitHpossibleA html !hereBs a slight complication, since we are running : daemons, ,st and :rd in the main host and .nd in a linux box which onl" handles ama$is processing sendmail 4d& , 4b$ root shows# ,@ main host ?ersion 9 ,, Ep,6Sun .@ ama$is host ?ersion 9 ,: ,

!he C6SunC part is reall" gi$ing me a headache !hat patch seems to be a retro I ha$e some customi+ed configuration so itBs not eas" to upgrade sendmail $ersion I had to ask for permission to appl" patches for a $er" long time before getting this chance (nd now I find m"self guilt" Which makes me feel I canBt Qustif" the time spent on fixing them, so IBm hoping to find the problem and take that specific patch out posted by Brahma at 7:59 AM & comments

S&are cdrom Gumpstart 310k


(fter talking with a Sun Support 8ngineer I finall" decided to share the cdrom and run the addHinstallHclient off the cdrom it works so ,@ F share 4< nfs 4o ro,anon*& /cdrom/cdrom&/s& .@ F cd /cdrom/cdrom&/s&/SolarisH. L/!ools :@ F /addHinstallHclient newdomain sun-u, and output is MF.&K ok MF.&K ok limit4ecache4si+e MF.&K ok boot 'fe& 4s$ !imeout waiting for (R>/R(R> packet !imeout waiting for (R>/R(R> packet .ee&& 1 Re'uesting Internet address for &#&#be#aL#a:#a% Internet address is ,%. ,L9 -. /& * 5&(9.(:. hostname# banner4a whoami# no domain name root ser$er# sspp4'fe. root director"# /cdrom/solH.HLH/%9HsparcHsmccHs$r/s&/SolarisH. L/!ools/Boot SunOS Release / L ?ersion GenericH,&/,9,4&/ RU;I1=R@ S"stem ? Release - &S 5op"right =c@ ,%9:4,%%E, Sun 0icros"stems, Inc whoami# no domain name 5onfiguring de$ices SU;W,'feE# 2ink Down 4 cable problemA SU;W,'feE# 2ink Down 4 cable problemA SU;W,'feE# 2ink Down 4 cable problemA SU;W,'feL# 2ink Down 4 cable problemA SU;W,'feL# 2ink Down 4 cable problemA

SU;W,'feL# 2ink Down 4 cable problemA SU;W,'fe/# 2ink Down 4 cable problemA SU;W,'fe/# 2ink Down 4 cable problemA SU;W,'fe/# 2ink Down 4 cable problemA SU;W,'fe-# 2ink Down 4 cable problemA SU;W,'fe-# 2ink Down 4 cable problemA SU;W,'fe-# 2ink Down 4 cable problemA SU;W,'fe:# 2ink Down 4 cable problemA SU;W,'fe:# 2ink Down 4 cable problemA SU;W,'fe:# 2ink Down 4 cable problemA SU;W,'fe,# 2ink Down 4 cable problemA SU;W,'fe,# 2ink Down 4 cable problemA SU;W,'fe,# 2ink Down 4 cable problemA etc etc etc K 44444Original 0essage44444 K <rom# Saxon, Stuart K Sent# &/ September .&&/ ,9#&. K !o# BsunmanagersJsunmanagers orgB K SubQect# ,&k Qumpstart solaris . L problems K K K K 5an some kind soul please tell me what am I doing wrong here thanks K K K ,&k netcon output K 444444444444444444444444444 K SU;W,Ultra48nterprise4,&&&&, using ;etwork 5onsole K OpenBoot : . ,:L, ,&.-& 0B memor" installed, Serial F,&%.&9E: K 8thernet address &#&#be#aL#a:#a%, 7ost ID# 9&aLa:a% K K K K MF.&K ok K MF.&K ok limit4ecache4si+e K MF.&K ok boot 'fe& 4s$ K Boot de$ice# /sbusJ//,&/SU;W,'feJ&,9c.&&&& <ile and args# 4s$ K !imeout waiting for (R>/R(R> packet K !imeout waiting for (R>/R(R> packet K !imeout waiting for (R>/R(R> packet K !imeout waiting for (R>/R(R> packet K .ee&& 1 K Re'uesting Internet address for &#&#be#aL#a:#a% K Internet address is ,%. ,L9 -. /& * 5&(9.(:.

K hostname# banner4a K whoami# no domain name K root ser$er# sspp4'fe. K root director"# /export/install/SolarisH. L/!ools/Boot K R>5# !imed out K lookup# R>5 error K boot# cannot open kernel/unix K 8nter filename Rkernel/unixS# K K K K shares on the ssp K 444444444444444444444444444 K rootJsspp F share K 4 /export/install ro,anon*& CC K K K /etc/bootparams K 44444444444444444444444 K K rootJsspp F cat /etc/bootparams K banner4a root*sspp4'fe.#/export/install/SolarisH. L/!ools/Boot install*sspp4'fe.#/export/install/SolarisH. L boott"pe*#in rootopts*#rsi+e*:.EL9 K K posted by Brahma at 7:59 AM & comments

6emove 5isk "abel


Da$e Uhring wrote# KK (nd execute `suninstall` after the disks are labelled KWell what I now did is create m" own disk t"pe with the harddisk Kspecifications from www seagate com and labelled the disk but still onl" K9 GB is seen I am now clueless and donBt know what to do to get the .& KGB a$ailable K(n" other ideas A Did "ou tr"# dd if*/de$/+ero of*/de$/rdsk/c1dNtOs. count*,L

and then restart so that it looks unlabeled 5asper posted by Brahma at 7:57 AM & comments

53>dtterm0 any OmouselessO 'ay to .blacken. J'&ole screen)K


I noticed that .4click selects word, :4click selects line so I tried -4click to see what happens #4@ Repl" SubQect# Re# 5D8/dtterm# an" )mouseless) wa" to CblackenC =whole screenA@A ?ia ke"4strokeA K KK (n" ke"4direct wa" to CchooseC the whole screenA K KI donBt think dtterm =or xterm@ has a Select (ll =mouseless@ feature K K!he shortest wa" I can think of is to 'uad4click on the screen K Kto select all ItBs not mouseless but beats dragging the mouse K ( C'uad4clickCA - clicks, fastA K What =short doc@ did "ou read to learn thatA (ctuall", the 'uadruple click was defined in the ;extstep 7uman Interface Guidelines 4 the reasoning was# Single click 4 set insertion point Double click 4 select word !riple click 4 select line 3uadruple click 4 select all text ( somewhat logical progression 0ind "ou, IBm going off m" memor" here =itBs been a while since IB$e messed about with OpenS!8>@ 44 Uen posted by Brahma at 7:56 AM & comments

#&eck Arocess
7i, I ha$e another re'uest

Simulate this problem, and then when ps is hung, take truss V pstack output of the process using the options for showing complete contents of buffers while reading V writing !hat should help us to find out wh" ps is hanging !hanks, ^(mol sr$.,LbdnfsF truss 4eaf 4o /tmp/trussHps4eaf txt 4p ./L% sr$.,LbdnfsF pstack ./L% r$.,LbdnfsF truss 4eaf 4o /tmp/trussHps4eafHother txt ps 4eaf posted by Brahma at 7:56 AM & comments

;o' SolarisB8,C *peratin9 System calculates available s'ap)Ue"word=s@#)swap, swapfs, swapfsHminfree, tmpfs )Description#) When configuring swap space on a s"stem, it is useful to know how SolarisR!0S Operating S"stem calculates a$ailable swap )Document Bod"#) Swap si+e is e'ual to all a$ailable ph"sical memor" =R(0 swap@ plus an" ph"sical disk partitions dedicated for swap, plus space allocated to swap in the form of swapfiles !he amount of memor" a$ailable for R(0 swap is less than the si+e of ph"sical memor" !his is because onl" pageable memor" is a$ailable for R(0 swap 0emor" that is not pageable includes most of the kernel, an" memor" that is mlock=@ed and intimate shared memor" =IS0@ Nou can see the summar" of memor" b" running Cnetstat 4k s"stemHpagesC or Ckstat 4n s"stemHpagesC ;ote that the 4k option to the netstat command is undocumented and its use is deprecated In Solaris ,& the 4k option is una$ailable and Ckstat 4n s"stemHpagesC must be used !he output format of Ckstat 4nC differs from that of Cnetstat 4kC howe$er all the $alues of interest are present in Ckstat 4nC output and ha$e the same names as the" do in the output of Cnetstat 4kC with the exception of Cpages totalC which is renamed CpagestotalC

!he discussion below uses Cnetstat 4kCW similar $alues for CppHkernelC, CpageslockedC and CpagestotalC would be displa"ed b" Ckstat 4n s"stemHpagesC Z netstat 4k s"stemHpages s"stemHpages# ph"smem ,/,/: nalloc /%:,&%L nfree /9L9,,/ nallocHcalls :&%. nfreeHcalls .:9L kernelbase .L9-L:-:. econtig .9&E/L..- freemem ,E,% a$ailrmem ,,%:. lotsfree .:L desfree ,,9 minfree /% fastscan E/L9 slowscan ,&& nscan & desscan ./ ppHkernel .EE: pagesfree ,E,% pageslocked :.&- pages total ,/,:L aaaaaaaaaaaaaa aaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaa !he kernel on this ,.90B machine is .EE: pages, or .,0B, and the total si+e of locked memor" =including the kernel@ is :.&- pages, ./0B =;ote that on Solaris ,& and abo$e, ppHkernel excludes pageslocked, and thus the" must be added@ ( page is 9UB =9,%. b"tes@ One would expect this machine to ha$e a $irtual swap si+e of# ,.90B 4 ./0B * ,&:0B ;ote howe$er that Cpages totalC is ,/,:L pages which corresponds to ,,90B and not the ,.90B of ph"sical memor" installed During boot, some of the s"stemBs memor" is used for staticall"4allocated portions of the kernel, such as the kernel text, !SBs =translation storage buffers@, page structures, the page table, etc 0emor" left after those allocations is shown in the ph"smem abo$e In this case, there is ,,90B =,/,/: ) pagesi+e, or 9UB@ memor" for which page structures are created =;ote that on Solaris ,& and abo$e, this memor" is alread" accounted for in ppHkernel@ So, we ha$e ,,90B 4 ./0B * %:0B of pageable $irtual memor", but there is one last factor !he swap file s"stem lea$es a reser$e of ,/9th of memor", or ,,9/9 * ,- L0B !he minimum for this is .0B Summar"# !otal 0emor" ,.90B 4 static kernel ,&0B 4 Uernel ./0B 4 swapfsHminfree ,/0B 444444444444444444444 44444 !otal Ram Swap E90B !otal Swap space * Ram swap 6 disk swap

7ow to read df 4k /tmp output# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ <iles"stem kb"tes used a$ail capacit" 0ounted on swap /..9& LL- /,L,L .Z /tmp tmpfs =when mounted on /tmp@ d"namicall" changes its si+e depending upon how much memor" =or swap@ is a$ailable !he Ckb"tesC column in Cdf 4k /tmpC output is the amount of swap space a$ailable, rather than the total !he tmpfs file s"stem also has a minfree, so the total is slightl" less than the amount of swap a$ailable Ckb"tesC column of Cdf 4k /tmpC output actuall" correspond to Cswap 4sC output of swap a$ailable ;ormall", these two numbers are prett" close !he difference is due to the tmpfsHminfree $alue, which is .0B b" default Z swap 4s total# ,.&.E.k b"tes allocated 6 .LL%Lk reser$ed * ,-L%L9k used, /:L%Lk a$ailable If some process would de4allocate some swap, and swap 4s would show more swap a$ailable, then the df 4k /tmp would also show that its total file s"stem si+e has increased posted by Brahma at 7:55 AM & comments

Fibre #&annel
<ibre 5hannel 2ike 8thernet or (!0, <ibre 5hannel is a networking standard that is designed to mo$e data through specific de$ices at specific speeds <ibre 5hannel is used primaril" for ser$er backbones and as a wa" of attaching a ser$er to a storage de$ice, such as a R(ID arra" or a tape backup de$ice In fact, <ibre 5hannel is the architecture of choice for man" storage area networks 0an" I! pros find that <ibre 5hannel is an answer to their storage pra"ers Since a compan"Bs data grows dail", each night the s"stem is backing up a little bit more data than the night before !hus, the window for completing the backup tends to shrink a little bit each "ear !he onl" wa" to back up more data in less time is to get a faster storage de$ice and a faster medium for transmitting the data

from the ser$er to the storage de$ice In production networks, <ibre 5hannel products ha$e been able to accomplish a sustained transfer rate of %E 0B per second when backing up large files 5ompanies that use <ibre 5hannel on database ser$ers ha$e reported these ser$ers can handle tens of thousands of I/Os per second due to <ibre 5hannel technolog" posted by Brahma at 7:54 AM & comments

6esettin9 N16%, on a Sun system


Document (udience# S>85!RU0 Document ID# E&-E !itle# Resetting ;?R(0 on a Sun s"stem Update Date# !ue Sep ,: &&#&&#&& 0D! .&&/ >roducts# Solaris, Sun Blade .&&& Workstation, Sun Blade ,&&& Workstation, Sun <ire .9&R Ser$er, Sun <ire ?99& Ser$er, Sun <ire ?-9& Ser$er, Sun <ire ?9%& Ser$er, Sun <ire ?-%& Ser$er !echnical (reas# ;?R(0 =;on4?olatile Read4Onl" 0emor"@ 44444444444444444444444444444444444444444444444444444444444444444444444444444444 44444444444444444444444444444444444444444444444444444444444444444444444444444444 Ue"word=s@#resetting, n$ram, netra .&, sun fire, sun blade, sun, s"stems Description# !his document explains how to reset the ;?R(0 back to its default settings on a Sun s"stem Document Bod"# ;O!8# Before executing the following, it is important and highl" recommended to note =print out@ the current ;?R(0 settings before changing these options back to their default settings !here are two wa"s of resetting the ;?R(0# ,@ (t the OU prompt#

ok set4defaults resets most parameters ok set4default BparameterB resets that one parameter for example# ok set4default auto4bootA .@ (t boot !his is helpful when an improperl" created de$ice alias for a monitor has been created and no displa" is going to the screen !he most common method is to issue 2,6n from the ke"board =WNS8@ while powering on the s"stem 7old down this ke" combination until "ou see $ideo with a message stating that the ;?R(0 parameters ha$e been set to their default $alues On some Sun ke"boards, the C2,C ke" is replaced with a CS!O>C ke" !herefore, issue the ke" se'uence S!O>6n simultaneousl" from the ke"board while powering on the s"stem 7old down this ke" combination until "ou see $ideo with a message stating that the ;?R(0 parameters ha$e been set to their default $alues ;ewer s"stems =Sun BladeR!0S workstations and Sun <ireR!0S hardware@ are using USB Ue"boards and 0ice Unlike the older 9 pin mini4din ke"boards, these s"stems do not ha$e a CS!O>6;C ke" se'uence to reset the OB>/;?R(0 parameters Instead, a Csafe ;?R(0C boot mode is a$ailable Remember that unlike a S!O>6; which restores (22 factor" ;?R(0 parameters, the Csafe ;?R(0C boot onl" alters a few parameters and onl" for that one boot c"cle !he described work around allows booting an" USB ke"board t"pe s"stem, including RS5 e'uipped ser$ers, to the OU prompt and communicating with these s"stems $ia the serial tt"a console ;ote# <or securit" reasons this procedure does not reset the settings for

securit"4mode and securit"4password !he information from this Infodoc cannot be used to reco$er from a lost OB> password >lease contact Sun Ser$ice to get a replacement ;?R(0 in such circumstances ******************** >rocedure ******************** , >ress the power button to power up the s"stem . Once the maintenance 28D starts to flash rapidl", immediatel" press the >ower button twice =similar to double4clicking a mouse, but lea$e a short gap of around , second between presses, to ha$e the action reliabl" registered @ !he actual time when "ou do the double press of the power button is the point in >OS! when the maintenance 28D =wrench light@ rapidl" flashes ;O!8# If "ou double press too late or too soon, the s"stem will power off Do not get confused with the earlier occurrences of the maintenance and OU to remo$e 28Ds flashing together !his is a part of the s"stem test to make sure the 28Ds are functional If "ouBre running >OS! e$en in 0I; le$el, it will be se$eral minutes depending upon "our configuration, before the maintenance 28D flashes rapidl" ( screen similar to the following is displa"ed to indicate that "ou ha$e successfull" reset the OpenBoot ;?R(0 configuration $ariables to their default $alues# Sun <ire xxx =9 1 UltraS>(R54III@, Ue"board >resent OpenBoot x x, ./L 0B memor" installed, Serial Fxxxxxxxx

8thernet address xx#xx#xx#xx#xx#xx, 7ost ID# xxxxxxxx Safe ;?R(0 mode, the following n$ram configuration $ariables ha$e been o$erridden# diag4switchA is true use4n$ramrcA is false input4de$ice , output4de$ice are defaulted tt"a4mode , tt"b4mode are defaulted !hese changes are temporar" and the original $alues will be restored after the next hardware or software reset Once "ou are at the OU prompt, it is at this point "ou make "our changes to the OB> parameters, or use set4defaults to reset all parameters to factor" default settings On the ;etraR!0S .& ser$er, the defaults cannot be set b" hitting the power button twice !he power button does not function in the same wa" as it does on the Sun <ire or Sun Blade !he 2O0 command bootmode will need to be used as shown below# lomK poweroff lomK bootmode resetHn$ram lomK poweron !his will reset the n$ram to default $alues ;ote# If the RS5 card is "our console de$ice, resetting the ;?R(0 will take the console awa" from the RS5 and put it back to the default =example, input4de$ice posted by Brahma at 7:54 AM & comments

useradd>pass'd script

R8# useradd/passwd script I found this script that might work for "ou I ha$enBt tried it m"self I hope it helps 7ere is the link for this script# http#//groups google com/group/comp os linux misc/msg/b.9LEefd9&,eEEabA dmode*sourceVhl*en FT/bin/sh FF S5RI>! !O (DD 0U2!I>28 US8RS !O ( 2I;U1 SNS!80 FF FF !he script will add users, generate secure password and mail FF info to the users (lso a log file is madeT FF FF Nou need to make it work# FF FF mailx 4 traditional command4line4mode mail user agent FF pwgen 4 password generator FF http#//sourceforge net/proQects/pwgen/FF FF userHlist format# US8R;(08 ;(08S 2(S!;(08 52(SS 80(I2 FF FF =c@ .&&/ 0anuel de la !orre FF F 0odif" this $ariables if "ou need 0I;D(NS*& F 5hange password at an"time 0(1D(NS*-/ F 0ax da"s password is $alid W(R;D(NS*,& F Warning message before expire passwd 81>D(NS*,9& F Da"s to expire account from now I;(5!I?8*-/ F Da"s to lock after passwd expires F 5alculte da"s from 8poch N8(RSH<RO0H8>O57*CY===Y=date 6ZG@ 4 ,%E& @ ) :L/ @@C D(NSH!7ISHN8(R*CY===Y=date 6ZQ@@@@C D(NSH<RO0H8>O57*Y== YN8(RSH<RO0H8>O57 6 YD(NSH!7ISHN8(R 6 9 @@ F Define some colors first# red*B\eR&W:,mB R8D*B\eR,W:,mB blue*B\eR&W:-mB B2U8*B\eR,W:-mB c"an*B\eR&W:LmB

5N(;*B\eR,W:LmB ;5*B\eR&mB F ;o 5olor F 8nsure that root is running the script W7O(0I*`/usr/bin/whoami` if R YW7O(0I T* CrootC SW then echo CSorr" Nou must be root to add new usersC exit , fi F 8nsure proper format of the command thiscmd*`basename Y&` if R CYFC 4ne , SW then echo CUS(G8# Ythiscmd userHfileC VV exit , fi USRH<I28*Y, F Remo$e blank lines from input file F Used this solution because of problems F with the I<S in a if R 4n S statement F F 5heck if buffer file exist, then remo$e if R 4a /tmp/buffer S then rm /tmp/buffer fi F Read input file, and delete blank lines cat YUSRH<I28 I while read !80> do if R 4n CY!80>C SW then echo CY!80>C KK /tmp/buffer fi done F 5op" temporal file to input file

cp /tmp/buffer YUSRH<I28 rm /tmp/buffer F F Sa$e the current $alue of the I<S ifs*CYI<SC F Define the separator =!(B@ between fields F if "our input has tabs between fields FI<S*`echo t I tr t B\tB` F Define the separator =5O00(@ between fields F if "our input has spaces between fields I<S*C,C F assumning the file has one line per user, in a la"out like# F F US8R;(08 ;(08S 2(S!;(08 52(SS 80(I2 F F 5onfigure the useradd program global"# F useradd 4D 4b YD8<H7O08 4e Y81>IR8 4g YGROU> cat YUSRH<I28 I while read US8R;(08 ;(08S 2(S!;(08 52(SS 80(I2 do US8R;(08*`echo YUS8R;(08 I tr (4O a4+` Flower case <U22;(08*CY;(08S Y2(S!;(08C 5O008;!*CY<U22;(08,Y52(SSC F 5heck if users exists in s"stem ;O81IS!8*`cut 4d# 4f, /etc/passwd I grep 4i YUS8R;(08` if R 4n CY;O81IS!8C SW then echo 4e C5reating user YUS8R;(08# \t Y[R8D]<(I28DY[;5]C else F Some output to keep "ou happ" echo 4e C5reating user YUS8R;(08# \t Y[5N(;]SU558SSY[;5]C F (dd the user useradd YUS8R;(08 4c CY5O008;!C 4m F Set the initial password

>(SSWORD*`pwgen 4s` echo YUS8R;(08#Y>(SSWORD I chpasswd F 5hange expitation of passwords chage 4m Y0I;D(NS 40 Y0(1D(NS 48 Y== Y81>D(NS 6 YD(NSH<RO0H8>O57 @@ 4I YI;(5!I?8 4d & YUS8R;(08 F 0ail password echo 4e Clogin# YUS8R;(08 \npassw# Y>(SSWORDC I mail 4s C(ccount InfoC 4b MemailJremo$edK Y80(I2 F 2og the results echo CYUS8R;(08#Y<U22;(08#Y>(SSWORD#Y52(SS#`date`C KK usersHcreatedHlog fi done posted by Brahma at 7:52 AM & comments

Aass'ord %9in9
>assword (ging, >art , I!world com, Unix in the 8nterprise ,&/-/&/ Sandra 7enr"4Stocker, I!world com While itBs clearl" possible to use the /etc/passwd and /etc/shadow files in Solaris and other Unix s"stems without making use of the password aging features, "ou could be taking ad$antage of these features to encourage "our users to practice better securit" 44 and, with the right password aging $alues, "ou can configure a good password4changing polic" into "our s"stem files while limiting the risk that "our users will be locked out of their accounts In this weekBs column, we look at the $arious fields in the shadow file that go$ern password aging and suggest settings that might gi$e "ou the right balance between user con$enience and good password securit" !he /etc/shadow <ile

!o begin our re$iew of how password aging works on a Solaris s"stem, letBs examine the format of the /etc/shadow file 8ach colon4separated record looks like this# Qohndoe#>aSsWoRdx"eEd#,:&L.#:&#,.&#,&#inacti$e#expire# aaaaaaaaa IIIIIIIII username#password#lastchg#min#max#warn#inacti$e#expire#flag !he first field is clearl" the username !he next is the password encr"ption !he third is the date when the password was last changed expressed as the number of da"s since Panuar" ,, ,%E& !he min field is the number of da"s that a password 0US! be kept after it is changedW this is used to keep users from changing their passwords and then immediatel" changing them back to their pre$ious $alues =thereb" in$alidating the intended securit"@ !he max field represents the maximum number of da"s that an" password can be used before it is expired If "ou want "our users to strictl" change their passwords e$er" :& da"s, for example, "ou could set both of these fields to :& Generall", howe$er, the max field is set to a considerabl" larger $alue than min !he warn field specifies the number of da"s prior to a password expiration that a user is warned on login that his/her password is about to expire !his should not be too short a period of time since man" users donBt log in e$er" da" and the displa" of this message in the login messages is eas" to o$erlook !he inacti$e field sets the number of da"s that an account is allowed to be inacti$e !his $alue can help pre$ent idle accounts from being broken into !he expire field represents the absolute da" =expressed as the number of da"s since Panuar" ,, ,%E&@ that the password will expire Nou might use this field if "ou want all of "our usersB passwords to expire at the end of the fiscal "ear or at the end of the semester !he last field, flag, is unused until Solaris ,& at which point it records the number of failed login attempts If the lines in "our shadow file look like this# sbob#dOlPpU;""usab#,.:-/###### !he username and password are set and the date on which the password was last changed has been recorded, but no password aging is taking effect If it looks like this, the account is locked dumbo#)2U)#######

?arious other combinations of the shadow file are possible, but the min, max and warn fields will onl" make sense if the lastchg field is set <or example# Qdoe#w&'Qde9-krZp&#,:&L.#L&##### User must keep a password for L& da"s once he changes it, but no password changes are re'uired Qdoe#w&'Qde9-krZp&#,:&L.##L&#### User must change his password e$er" L& da"s, but can change it at an" time =including immediatel" changing it back to its pre$ious $alue@ 5hoosing 0in and 0ax Settings If "ou want to turn on password aging, the combination of minimum =must keep@ and maximum =in$alid after@ $alues enforces a practical password update scheme Suggested settings depend in part on the securit" stance of "our particular network 7owe$er, general consensus seems to be that passwords, once changed, should be kept for a month =min*:&@ and that passwords should be changed e$er" three to six months =from max*%& to max*,9&@ Once a user has used a password for :& da"s, heBs probabl" not going to reset it back to its pre$ious $alue B" then he should know it well enough to continue using it 5hanging a password more often than e$er" month or so would probabl" make it hard for users to remember their passwords without writing them down !he down side of min $alues is that this setting doesnBt allow someone to change his password if he belie$es it has been compromised when the compromise happens within the CminC period Whate$er s"stem "ou adopt should, therefore, make it painless for a user to re'uest that his password be reset whene$er he belie$es it ma" no longer be secure Wrap Up We hear a lot about the tradeoff between securit" and con$enience as it permeates so man" of our decisions about how we manage our networks but, when it comes to passwords, we must be careful not to cross the line between securing logins and pre$enting them altogether 2ocking our users too easil" out of their accounts can reduce securit" as easil" as enhance it Using password aging with the proper settings

can limit the risk that securit" constraints turn into unintended denials of ser$ice ;ext week, weBll look at how to introduce password aging on a s"stem where users ha$e ne$er had their passwords expire posted by Brahma at 7:52 AM & comments

Mednesday, *ctober 05, 2005


5NS client 8roubles&ootin9
D;S trouble nslookup alwa"s uses dns ping uses /etc/nsswitch conf to determine which method of address lookup Recommend that "ou F cp /etc/nsswitch dns /etc/nsswitch conf does ping with an I> number workA If it does then there is something wrong with nsswitch conf or possibl" nscd or e$en /etc/hosts !r" $iewing a webpage b" I> address for example# http#//.&% .-% ,,L ,%/ =Sun Site@ If this donBt work then itBs a routing problemW if it does, then "ou need to check "our dns files# resol$ conf et all (lso worth =as suggested b" someone else@ posting the output of# dig www sun com J.&- ,9L .: L/ and ma"be, dig www sun com J,%. ,9 ,.9 ,, dns. is outside m" main network .&- ,9- .: L/ dig Jdns. google com works dig google com works dig Jgate google com does not work, as expected, since it is not a dns ser$er I think that since I can go to websites b" ip fine, m" defaultroute must be correct, same with netmasks = it has to be .// .// & & since we use both ,%. ,L9 ,& and ,%. ,L9 .& on this section of the network

double check /etc/nsswitch conf is called exactl" that and has appropriate perms, I donBt know what the" HshouldH be but L-- shouldnBt hurt (nd it contains at least hosts# files dns double check /etc/resol$ conf is called exactl" that and contains appropriate entries then pick an external address that "ou )know) wonBt be in /etc/hosts OR ha$e been cached b" nscd But one that "ou know has at least one I> address then tr" getent hosts "our chosen host getent is an interface to "our s"stem resol$ers and is dictated b" /etc/nsswitch conf and if appropriate, /etc/resol$ conf If this displa"s nothing Cecho YAC will show the return of the getent 4 a failed lookup is C.C ( successful one is C&C ( successful one though, should show "ou an address and stuff, If this fails tr" rebuilding /etc/nsswitch conf and /etc/resol$ conf to ensure there is no parsing errors or the like BnslookupB uses the D;S resol$er libraries directl" It thus b"passes the name ser$ice switch =configured $ia /etc/nsswitch conf@ If "ouBre seeing applications fail to resol$e addresses, but nslookup works fine, then the next thing to tr" is this# Z getent hosts Chost name hereC If that works, then itBs an application problem of some sort !he application is Qust misconfigured =perhaps it has a SO5US prox" configured that it doesnBt need, or needs one and doesnBt ha$e it@ If that doesnBt work, then the problem is almost certainl" in /etc/nsswitch conf 5heck the firewall, whether port /: tcp and udp are passed 0" guess is that onl" one of them ma" pass posted by Brahma at 1:14 PM & comments

Sun Solaris 10 on 2806 P Brocade F250 %ttac&ment and Sun Solaris 10 on 2806 P Brocade F250 %ttac&ment and #onfi9uration
SubQect# Sun Solaris ,& on .9&R V Brocade :./& (ttachment and 5onfiguration Ser$er# Sun .9&R 5ard# )SU;) .:-. Dual >ort 7B( =uses 325 dri$er@ Switch# Brocade Silkworm :./& I need some assistance getting a Sun .9&R to see tape dri$es attached to a Brocade :./& switch RswitchS 4K box =port &@ 4K tape, =port ,@ 4K tape. =port .@ 4K tape: =port :@ 4K tape- =port -@ 7ere are m" de$ices according to a Brocade Silkworm :9.& I am not sure I am adding the +ones correctl" Basicall", I want one +one per dri$e# DRI?8,M4KOO;8, DRI?8.M4KOO;8. DRI?8:M4KOO;8: DRI?8-M4KOO;87owe$er, m" first step is Qust to get the Solaris ,& box to see all four tape dri$es 7ere are the de$ices# s:./&#adminK nsshow [ !"pe >id 5OS >ort;ame ;ode;ame !!2=sec@ ; &,&&&&W :W.,#&&#&&#e&#9b#,-#,.#&/W.&#&&#&&#e&#9b#,-#,.#&/W na <5-s# <5I> <5> <abric >ort ;ame# .&#&&#&&#&/#,e#:/#E9#EE ;2 &,&,//W :W/&#&,#&-#f&#&&#/.#cf#,fW/&#&,#&-#f&#&&#/.#cf#,eW na <5-s# <5> R7> Ultrium .4S5SI U-B&S <abric >ort ;ame# .&#&,#&&#&/#,e#:/#E9#EE ;2 &,&.//W :W/&#&,#&-#f&#&&#/.#cf#..W/&#&,#&-#f&#&&#/.#cf#.,W na <5-s# <5> R7> Ultrium .4S5SI U-B&S

<abric >ort ;ame# .&#&.#&&#&/#,e#:/#E9#EE ;2 &,&://W :W/&#&,#&-#f&#&&#/.#cf#,cW/&#&,#&-#f&#&&#/.#cf#,bW na <5-s# <5> R7> Ultrium .4S5SI U-B&S <abric >ort ;ame# .&#&:#&&#&/#,e#:/#E9#EE ;2 &,&-//W :W/&#&,#&-#f&#&&#/.#cf#./W/&#&,#&-#f&#&&#/.#cf#.-W na <5-s# <5> R7> Ultrium .4S5SI U-B&S <abric >ort ;ame# .&#&-#&&#&/#,e#:/#E9#EE !he 2ocal ;ame Ser$er has / entries ] s:./&#adminK +onecreate Cgreen+oneC, C:,.,W :,/&C s:./&#adminK +onecreate Cred+oneC, C.,#&&#&&#e&#9b#,-#,.#&/W -,:C s:./&#adminK cfgsa$e 44 On the Solaris side of the fence# I belie$e c: and c- is the Sun 32ogic =325@ .:-. adapter bash4: &&F cfgadm 4c configure cbash4: &&F bash4: &&F cfgadm 4al$ (pHId Receptacle Occupant 5ondition Information When !"pe Bus" >h"sHId c& connected configured unknown bash4: &&F cfgadm 4c configure c- W cfgadm 4al$ (pHId Receptacle Occupant 5ondition Information When !"pe Bus" >h"sHId c& connected configured unknown una$ailable scsi4bus n /de$ices/pciJ9,E&&&&&/scsiJL#scsi c&##dsk/c&tLd& connected configured unknown !OS7IB( D?D4RO0 SD40,-&, una$ailable 5D4RO0 n /de$ices/pciJ9,E&&&&&/scsiJL#scsi##dsk/c&tLd& c, connected configured unknown una$ailable fc4pri$ate n /de$ices/pciJ9,L&&&&&/SU;W,'lcJ-/fpJ&,&#fc c,##.,&&&&&c/&&,9Ef/ connected configured unknown S8(G(!8 S!:E::&E<SU;E.G una$ailable disk " /de$ices/pciJ9,L&&&&&/SU;W,'lcJ-/fpJ&,&#fc##.,&&&&&c/&&,9Ef/ c,##.,&&&&&c/&&,9daa connected configured unknown S8(G(!8 S!:E::&E<SU;E.G una$ailable disk n

/de$ices/pciJ9,L&&&&&/SU;W,'lcJ-/fpJ&,&#fc##.,&&&&&c/&&,9daa c. connected unconfigured unknown una$ailable scsi4bus n /de$ices/pciJ9,E&&&&&/scsiJL,,#scsi c: connected unconfigured unknown una$ailable fc4fabric n /de$ices/pciJ9,L&&&&&/SU;W,'lcJ,/fpJ&,&#fc c- connected unconfigured unknown una$ailable fc n /de$ices/pciJ9,L&&&&&/SU;W,'lcJ,,,/fpJ&,&#fc usb&/, empt" unconfigured ok una$ailable unknown n /de$ices/pciJ9,E&&&&&/usbJ/,:#, usb&/. empt" unconfigured ok una$ailable unknown n /de$ices/pciJ9,E&&&&&/usbJ/,:#. usb&/: empt" unconfigured ok una$ailable unknown n /de$ices/pciJ9,E&&&&&/usbJ/,:#: usb&/- empt" unconfigured ok una$ailable unknown n /de$ices/pciJ9,E&&&&&/usbJ/,:#bash4: &&F Does an"one ha$e a good doc for attaching <iber 5hannel !ape Dri$es to a brocade switch and then getting Solaris to see the de$icesA #@ !hanksT Pustin posted by Brahma at 9:29 AM & comments

5isk usa9e monitorin9


Disk usage monitoring !akeawa"# 2earn to use scripting and cron to run regular scripts that will monitor "our disk space ad$ertisement 0onitoring disk usage is a critical part of running an" ser$er !here is nothing worse than ha$ing a runawa" process or malicious user fill up a files"stem onl" to find out about it when the boss calls to indicate she canBt connect to or write to the ser$er With a little bit of shell scripting and cron usage, "ou can ha$e a script run e$er" hour or at an" other inter$al that will indicate if "ou need to be concerned about disk space filling up

!he script itself is $er" small# McodeK FT/bin/sh fs*`mountIegrep Ba/de$BIgrep 4i$ cdromI awk B[print Y:]B` t"peset 4i thresh*C%&C t"peset 4i warn*C%/C for i in Yfs do skip*& t"peset 4i used*`df 4k YiItail 4,Iawk B[print Y/]BIcut 4d CZC 4f ,` if R CYusedC 4ge CYwarnC SW then echo C5RI!I5(2# files"stem Yi is YusedZ fullC fi if R CYusedC 4ge CYthreshC 4a CYusedC 4le CYwarnC SW then echo CW(R;I;G# files"stem Yi is Yused ZfullC fi done M/codeK !he first thing the script does is get the list of mount points from the mount program and filters out an" mounted 5D4rom dri$es It also doesnBt take into account an" special file s"stems like /proc or /s"s b" making sure the mount point de$ice is an actual de$ice =b" making sure the de$ice name starts with /de$@ ;ext, set "our threshold to something sensible, like %&Z full (dQust this to tasteW this Qust generates a warning 2ikewise, "ou set "our critical warning $alue to %/Z ;otice that the command t"peset 4i is

used to ensure that bash treats these numbers as integers, which "ou need for comparing the $alues obtained from df !he Yused $ariable gets set on each files"stem with the UseZ column output from the df tool !his is compared to "our thresholds !he script simpl" outputs the warnings to standard output !he script can easil" be adQusted to ha$e it send an e4mail to someone should one of the thresholds be breached !o ha$e this executed e$er" :& minutes $ia cron, edit the s"stem crontab to include# McodeK &,:& ) ) ) ) ) /usr/local/bin/diskmon sh M/codeK In this case, all the warnings will be sent $ia cron to whoe$er recei$es cronBs output mails posted by Brahma at 9:25 AM & comments

F8A tutorial
!here are also some higher ports abo$e ,&.- that <!> uses to displa" files and folders <!> Qust grabs those ports whene$er it needs them <ollowing is a short <!> tutorial# (cti$e <!> $s >assi$e <!>, a Definiti$e 8xplanation Introduction One of the most commonl" seen 'uestions when dealing with firewalls and other Internet connecti$it" issues is the difference between acti$e and passi$e <!> and how best to support either or both of them 7opefull" the following text will help to clear up some of the confusion o$er how to support <!> in a firewalled en$ironment !he Basics <!> is a !5> based ser$ice exclusi$el" !here is no UD> component to <!> <!> is an unusual ser$ice in that it utili+es two ports, a BdataB port and a BcommandB port =also known as the control port@ !raditionall" these are port ., for the command port and port .& for the data port !he confusion begins howe$er, when we find that depending on the mode, the data port is not alwa"s on port .&

(cti$e <!> In acti$e mode <!> the client connects from a random unpri$ileged port =; K ,&.-@ to the <!> ser$erBs command port, port ., !hen, the client starts listening to port ;6, and sends the <!> command >OR! ;6, to the <!> ser$er !he ser$er will then connect back to the clientBs specified data port from its local data port, which is port .& <rom the ser$er4side firewallBs standpoint, to support acti$e mode <!> the following communication channels need to be opened# <!> ser$erBs port ., from an"where =5lient initiates connection@ <!> ser$erBs port ., to ports K ,&.- =Ser$er responds to clientBs control port@ <!> ser$erBs port .& to ports K ,&.- =Ser$er initiates data connection to clientBs data port@ <!> ser$erBs port .& from ports K ,&.- =5lient sends (5Us to ser$erBs data port@ When drawn out, the connection appears as follows# In step ,, the clientBs command port contacts the ser$erBs command port and sends the command >OR! ,&.E !he ser$er then sends an (5U back to the clientBs command port in step . In step : the ser$er initiates a connection on its local data port to the data port the client specified earlier <inall", the client sends an (5U back as shown in step !he main problem with acti$e mode <!> actuall" falls on the client side !he <!> client doesnBt make the actual connection to the data port of the ser$er44it simpl" tells the ser$er what port it is listening on and the ser$er connects back to the specified port on the client <rom the client side firewall this appears to be an outside s"stem initiating a connection to an internal client44something that is usuall" blocked >assi$e <!> In order to resol$e the issue of the ser$er initiating the connection to the client a different method for <!> connections was de$eloped !his was known as passi$e mode, or >(S?, after the command used b" the client to tell the ser$er it is in passi$e mode In passi$e mode <!> the client initiates both connections to the ser$er, sol$ing the problem of firewalls filtering the incoming data port connection to the client from the ser$er When opening an <!>

connection, the client opens two random unpri$ileged ports locall" =; K ,&.- and ;6,@ !he first port contacts the ser$er on port .,, but instead of then issuing a >OR! command and allowing the ser$er to connect back to its data port, the client will issue the >(S? command !he result of this is that the ser$er then opens a random unpri$ileged port => K ,&.-@ and sends the >OR! > command back to the client !he client then initiates the connection from port ;6, to port > on the ser$er to transfer data <rom the ser$er4side firewallBs standpoint, to support passi$e mode <!> the following communication channels need to be opened# <!> ser$erBs port ., from an"where =5lient initiates connection@ <!> ser$erBs port ., to ports K ,&.- =Ser$er responds to clientBs control port@ <!> ser$erBs ports K ,&.- from an"where =5lient initiates data connection to random port specified b" ser$er@ <!> ser$erBs ports K ,&.- to remote ports K ,&.- =Ser$er sends (5Us =and data@ to clientBs data port@ When drawn, a passi$e mode <!> connection looks like this# In step ,, the client contacts the ser$er on the command port and issues the >(S? command !he ser$er then replies in step . with >OR! .&.-, telling the client which port it is listening to for the data connection In step : the client then initiates the data connection from its data port to the specified ser$er data port <inall", the ser$er sends back an (5U in step - to the clientBs data port While passi$e mode <!> sol$es man" of the problems from the client side, it opens up a whole range of problems on the ser$er side !he biggest issue is the need to allow an" remote connection to high numbered ports on the ser$er <ortunatel", man" <!> daemons, including the popular WU4<!>D allow the administrator to specif" a range of ports which the <!> ser$er will use !he second issue in$ol$es supporting and troubleshooting clients which do =or do not@ support passi$e mode (s an example, the command line <!> utilit" pro$ided with Solaris does not support passi$e mode, necessitating a third4part" <!> client, such as ncftp With the massi$e popularit" of the World Wide Web, man" people prefer to use their web browser as an <!> client 0ost browsers onl" support passi$e mode when accessing ftp#// UR2s !his can either be good or bad depending on what the ser$ers and firewalls are configured to support Summar" !he following chart should help admins remember how each <!> mode works#

(cti$e <!> # command # client K,&.- 4K ser$er ., data # client K,&.- M4 ser$er .& >assi$e <!> # command # client K,&.- 4K ser$er ., data # client K,&.- 4K ser$er K,&.posted by Brahma at 9:23 AM & comments

Friday, September 1Q, 2005


9nu date increment by 1
K 7i K With gnu date, how can I get the list of dates continuosl" between a K specific period sa" for example apr .,.&&/ to Qul" :,,.&&/ in the K format ZN/Zm/Zd K command should be in the form of K /script 4d, &-/&./.&&/ 4d. &L/:,/.&&/ I!N0 &E/:,/.&&/ K .&&//&-/&. K .&&//&-/&: K .&&//&-/&K K K K .&&//&E/.% K .&&//&E/:&/ K .&&//&E/:& K 7elp is $er" much appreciated K !hanks, Something like this should work# now*`date 6CZN/Zm/ZdC 4d C&-/&./.&&/C` end*`date 6CZN/Zm/ZdC 4d C&E/:,/.&&/C`

while R CYnowC T* CYendC S do now*`date 6CZN/Zm/ZdC 4d CYnow 6 , da"C` echo CYnowC done ;ote that date handles some in$alid dates like C&L/:,/.&&/C b" tr"ing to map them to a close real date Regards, 8d posted by Brahma at 3:50 PM & comments

sets net'ork nic parameters value


Bhushan Mbhushan li Jgmail comK wrote# K (dd following line in /etc/s"stem file K set bge#bgeHad$HautonegHcap*& K !his sets $alue to permannetl" e$en after reboot !hatBs the most inflexible wa" of doing it# , It re'uires a reboot to acti$ate . It sets the $alue on all instances of the dri$er Nou ha$e more flexibilit" with ndd# ndd 4set /de$/bge& ad$HautonegHcap & I hope Sun will make a consistent interface for all network dri$ers one da" !he situation toda" is frustating 4 some dri$ers ha$e a single /de$ entr", "ou ha$e to set instance first then the parameter# ndd 4set /de$/'fe instance : ndd 4set /de$/'fe ad$HautonegHcap & 4 others =like bge@ create a separate /de$ entr" for each instance# ndd 4set /de$/bge: ad$HautonegHcap & 4 some dri$ers use completel" different names 4 some dri$ers =mostl" x9L@ donBt ha$e a ndd interface at all posted by Brahma at 3:49 PM & comments

et&er address on multi@port cards


ether address on multi4port cards Wh" is the ethernet address the same for e$er" port on a multiport ethernet card, and what are the implied conse'uences of thisA Specificall" the - bge interfaces in a ?.,&, or the - ce interfaces on a 'uad gigaswift !he s"stem gets this hardware address from the 88>RO0 not from the ethernet hardware K !he s"stem gets this hardware address from the 88>RO0 not from the K ethernet hardware not default on the $.,&, as it has# local4mac4addressA*true tr" F eeprom local4mac4addressA*true if "ou want 'uads to ha$e different addresses $.,&# F ifconfig 4a lo&# flags*,&&&9-%MU>,2OO>B(5U,RU;;I;G,0U2!I5(S!,I>$-K mtu 9.:. index , inet ,.E & & , netmask ff&&&&&& bge&# flags*,&&&9-:MU>,BRO(D5(S!,RU;;I;G,0U2!I5(S!,I>$-K mtu ,/&& index . inet ,:E /9 ,LL ./, netmask ffffff&& broadcast ,:E /9 ,LL .// ether &#:#ba#da#a9#9f bge,# flags*,&&&9-:MU>,BRO(D5(S!,RU;;I;G,0U2!I5(S!,I>$-K mtu ,/&& index : inet ,:E /9 ,LE ./, netmask ffffff&& broadcast ,:E /9 ,LE .// ether &#:#ba#da#a9#%& bge.# flags*,&&&9-:MU>,BRO(D5(S!,RU;;I;G,0U2!I5(S!,I>$-K mtu ,/&& index inet ,:E /9 ,L9 ./, netmask ffffff&& broadcast ,:E /9 ,L9 .// ether &#:#ba#da#a9#%, bge:# flags*,&&&9-:MU>,BRO(D5(S!,RU;;I;G,0U2!I5(S!,I>$-K mtu ,/&& index / inet ,:E /9 ,L% ./, netmask ffffff&& broadcast ,:E /9 ,L% .// ether &#:#ba#da#a9#%. /Qcrgen KWh" is the ethernet address the same for e$er" port on a multiport Kethernet card, and what are the implied conse'uences of thisA

KSpecificall" the - bge interfaces in a ?.,&, or the - ce interfaces on a K'uad gigaswift !hatBs because the >RO0 programs them that wa"W there are no supposed conse'uences as generall" "ou donBt ha$e all cards in the same domain But all of our current interfaces ha$e on4board pri$ate mac addresses "ou can use b" setting# eeprom local4mac4addressA*true and then rebooting !he 'fe cards ha$e a Clocal4mac4addressC propert" =and from the looks of it, so do man" other cards@ which re$eals their programmed mac4address e$en if booted with local4mac4addressA*false prtconf 4$p I grep local local4mac4addressA# BtrueB local4mac4address# &&&:ba:& c&flocal4mac4address# &&&:ba:& c&f/ local4mac4address# &&&:ba:& c&fL local4mac4address# &&&:ba:& c&fE local4mac4address# &9&&.&a% fLEe posted by Brahma at 3:48 PM & comments

Solaris 8 &un9 on bootR8# Solaris 9 hung on boot If "ou want to determine what is is hanging on, "ou can# 4 boot from 5D 4 mount the root <S 4 edit /etc/rc. find the section that looks like this# for f in /etc/rc. d/S)W do if R 4s Yf SW then case Yf in ) sh@ Yf WW )@ /sbin/sh Yf start WW esac

fi done and change the line with BstartB on it to look like this# )@ /sbin/sh 4x Yf start WW 4 unmount the <S, and reboot On the next start up, "ou will see a $erbose output of what is actuall" running Nou should then be able to determine what line the startup is hanging on !hat will gi$e us/"ou a better idea of whatBs wrong Often, itBs network related, like it canBt resol$e a name or address encountered in a config file somewhere Brian posted by Brahma at 3:47 PM & comments

delete a file on lo99in9 UFS


When "ou delete a file on logging U<S, the file and its allocated resources are not freed immediatel", what happens is that the director" entr" gets +apped and the inode is put onto a so called delete 'ueue and the delete thread will run from time to time to drain the 'ueue =also on umount and lockfs 4f re'uests@ when the delete 'ueue gets drained, the inode and its allocated resources are freed, this is done within a transaction in case of logging and as part of this delete transaction the allocated blocks are freed as well, but are not immediatel" a$ailable for re4use as long as the whole transaction is not committed to the log this does not mean that a log roll must happen to be able to re4use those blocks, committing the entire transaction to the log makes them a$ailable for new allocations if "ou run out of space U<S will detect a possible 8;OS>5 failure and will forcibl" drain the delete 'ueue in this case to free up an" resources still lurking around in the delete 'ueue and re4do the allocation attempt before e$entuall" failing with 8;OS>5 posted by Brahma at 3:46 PM & comments

clonin9 &ard disk to ne', bi99er ones--<ixed font 4 >roportional font cloning hard disk to new, bigger ones SubQect# cloning hard disk to new, bigger ones IBm using g-u =basicall" a cle$er script which the heart is dd@ to clone old hard disks containing Interacti$e Unix =sigh@ to new, bigger one 0" 'uestion is # because the geometr" of the disk differs, at least for the c"linder count, I feel that I should adQust some parameters to reflect the disk change !he free si+e is not an issue, but I would like to do things as best as possible I suspect I should modif" the >artitions file, but how A Is it possible to use s"sadmin to do that A !hanks 0atthieu Repl" K IBm using g-u =basicall" a cle$er script which the heart is dd@ to clone old K hard disks containing Interacti$e Unix =sigh@ to new, bigger one K 0" 'uestion is # because the geometr" of the disk differs, at least for the K c"linder count, I feel that I should adQust some parameters to reflect the K disk change !he free si+e is not an issue, but I would like to do things as K best as possible K I suspect I should modif" the >artitions file, but how A Is it possible to K use s"sadmin to do that A classic method is with tar boot up into single4user4mode, then initiali+e the new disk with "our partitions !hen for each partition "ou want to mo$e o$er, mount it =sa" in /mnt@, and do something like this# F cd /mnt F tar cf 4 /$ar I tar xfpB 4 !hat would ha$e mo$ed "our $ar onto the new partition

(fter "ouB$e mo$ed e$er"thing o$er, donBt forget to make the new disk bootable On Solaris, there is a command would be BinstallbootB, hopeful" IU had something similar posted by Brahma at 3:46 PM & comments

8erminal #&aracters
stt" erase a7 tells the terminal dri$er upon which character it should perform the Cbacward erase characterC operation in its built4in line editor !hat built4in line editor is onl" used when the terminal is in canonical mode, ie when the terminal sends the data to the reading application onl" when "ou press enter !"picall", neither bash nor $im use that canonical mode as the" need to be able to get each t"ped character as soon as the" are t"ped But $im ma" want to 'uer" the terminal dri$er to find out what character is supposed to be the backspace character =if itBs good for the terminal builtin editor, then it will be good for $im@ bash doesnBt care It treats both aA and a7 as a backspace character What I think is that when "ou press MBackspaceK, "ou get a aA character So, "ou should instruct "our terminal dri$er =and indirectl" $im@ that CeraseC is aA with stt" erase BaAB K ;ow I am using an application, it has its shell, in pressing U> K arrow ke", I see aSS(, I look through manpage of stt", I do not see how K to redefine U> arrow ke" stt" is not to redefine ke"s, itBs to tell the terminal dri$er on which recei$ed character it should perform its special operations It works onl" for single characters aRR( is a se'uence of : characters (nd the builtin terminal line editor has few operations "ou can map a ke" to, mainl" Cbackward erase characterC, =a7, aA@ Cbackward erase wordC =aW@, Ckill lineC =aU@, CinterruptC =a5@, C'uitC =a\@

If "ou need a more complex line editor, then "ou need to implement one Qust as bash =readline@ or $im do !hat means, lea$e the canon mode stt" 4icanon !ell the terminal "ou want to recei$e characters as soon as the" are t"ped# stt" min , time &, ="ou ma" want to disable the signal ke"s as well stt" 4isig, or the automatic con$ersion of 5R into ;2 stt" 4icrnl stt" raw ma" e$en be what "ou want@ read characters one at a time =c*Y=dd bs*, count*, .K /de$/null@@ then do the processing for each character# if itBs a aR, then read the next one, then if itBs a CRC, read the next one, then if itBs a C(C then perform whate$er "ou want to be done on the pressing of the Up ke" 44 KK 7i, KK I am using B(S7 . &/ on Red 7at 2inux, I ha$e the following command KK in bashrc, KK stt" erase Ca7C K !he linux console and xterm both produce a D82 character =aA@ when K "ou hit the big backspace ke" R S <or xterm, it depends on the implementation on the default $alue of the terminal dri$er and on the configuration posted by Brahma at 3:45 PM & comments

find comand
When "ou use a pipeline to run $i like this, itBs stdin isnBt the terminal an" more !hatBs what CInput not from terminalC means !he input is coming from the pipe instead !r" $i `find 4name config xml` or find 4name config xml 4exec $i [] \W or

find 4name config xml I while read fWdo $i YfWdone Poe uppose we want to compress all txt files in an entire subtree Simple enough, using what weB$e learned before# find /path/to/tree 4name B) txtB I xargs g+ip (nother extremel" useful wa" find can sift through files is to find files created or modified recentl" Often "ou want to know what has changed recentl" <or instance, to list all of the files in "our home director" that changed within the past two da"s hours# find ^/ 4mtime 4. !o find the files that ha$enBt been modified in the past two da"s, "ou can change the 4mtime parameter# find ^/ 4mtime 6. Nou can also select files b" the last time the" were accessed =atime@ or created =ctime@ 2ike bashBs test command, find has a wide $ariet" of optionsW reading the manpage is ad$ised =not Qust for reference, eitherW it will gi$e "ou an idea of the flexibilit" of this peculiar command@ posted by Brahma at 3:44 PM & comments

o'ners&ip for all t&e files pk9c&k


K (ll, K K B" mistake someone changed the ownership for all the files under / K etc, now no K one can access that s"stem an"more K K Is there an"wa" to reco$er /etcA Nes What "ouBre looking for is the pkgchk command <irst, find out what packages reference /etc#

pkgchk 4l 4p /etc !hen take each package listed in that output and run# pkgchk 4af Mpacckage,K Mpackage.K /dale posted by Brahma at 3:43 PM & comments and so on

Settin9 Up t&e Solaris *S to Mork 'it& #able ,odems


Setting Up the Solaris OS to Work with 5able 0odems Introduction !his tip is written to help "ou configure a machine running the Solaris OS as D75> client to work with DS2 cable modem D"namic 7ost 5onfiguration >rotocol =D75>@ D75> pro$ides the I> address, default route, and name ser$ers Nou need Solaris . L or higher for D75> Setup >rocedure !he following steps are re'uired as root# , touch /etc/dhcp hme& Replace the hme& with whate$er the 8thernet interface for "our s"stem might be, as shown b" ifconfig 4a . cp /de$/null /etc/hostname hme& or K /etc/hostname hme& Important note# Nou need to make sure that this file is empt" 44 otherwise, the D75> configuration wonBt work : 0ake sure that /etc/inet/hosts onl" has one line in it, the one containing ,.E & & , localhost (n" other lines will be ignored, and an" additional necessar" lines will be added b" the D75> client at boot time -

touch /etc/notrouter !his creates a file to tell the Solaris OS that "our s"stem will not be performing routing or packet4forwarding duties If this file is alread" there, lea$e it the wa" it is / cp /de$/null /etc/defaultrouter Since the D75> client software will automaticall" put the needed entries in this file, we Qust need to make sure that it exists as an empt" file If it alread" exists, rename it and create the empt" file in its place L cp /de$/null /etc/resol$ conf !he D75> client will add the necessar" entries If "ou alread" ha$e this file, rename it and create an empt" file in its place E 5heck the file /etc/nsswitch conf and look at the hosts# line 0ake sure that it reads hosts# files dns !his will enable "our machine to resol$e addresses using D;S, the Domain ;ame S"stem Reboot "our machine While booting, "ou will see status messages about the D75> clientW this is normal Once the machine is booted, t"pe the ifconfig 4a command Nou will see output similar to this# lo&# flags*,&&&9-%MU>,2OO>B(5U,RU;;I;G,0U2!I5(S!,I>$-K mtu 9.:. index , inet ,.E & & , netmask ff&&&&&& hme&# flags*,&&&9-:MU>,BRO(D5(S!,RU;;I;G,0U2!I5(S!,I>$-K mtu ,/&& index inet ,%. ,L9 , :/ netmask ffffff9& broadcast ,%. ,L9 , .// ether 9#&#.&#d.#,/#.f 5onclusion If "ou ha$e followed all m" instructions, the Solaris machine is read" to get its networking information b" means of D75> posted by Brahma at 3:42 PM & comments

debu9 a process
!hanks e$er"one (gain I had lots of replies, and I will cop" the the most complete answers below#

RRic (ndersonS !here are man" truss 4p pid shows what s"stem calls a process is making ps 4fp pid shows general status pldd pid shows what d"namic libraries = so@ files a process is using In addition, there are a number of tools in /usr/proc/bin that let "ou look at the actions of a process If "ou ha$e lsof installed, then lsof 4p pid will show open files for a process Some debuggers =e g , gdb@ can also be used with a pid to interacti$el" debug a running process RPonathan BirchallS It all depends on how deep "ou wish to go and what $ersion of Solaris "ou are using !russ 4wall 4$all 4fall 4oMoutputfilenameK 4p M>IDK will gi$e "ou details of s"stem calls etc see 0an truss Nou can also use the p commands see man pfiles , ptree , pmap etc In Solaris ,& "ou can also now use dtrace for a detailed $iew of what the process is doing Using a mixture of the about should gi$e "ou a fairl" detailed $iew of what is happening Nou can also use adb =debugger@ =solaris %@ which also pointed me to mdb

With RicBs help, using lsof, we managed to track down the problem posted by Brahma at 3:41 PM & comments

s'ap

Pason Stout wrote K !he space problem is a good guess but I donBt think thats it !he K OpenBSD box has >28;!N of storage space free !he Solaris box is K onl" running about /&Z on the disk IBm ftpBing to and /tmp is K fine df 4k doesnBt show me swap space so ma"be thatBs it I K donBt e$en know how to check swap space usage (n" helpA solarisY swap 4l swapfile de$ swaplo blocks free /de$/dsk/c&t:d&s, :.,./ 9 ,%L//. ,9.:.9 OR solarisY swap 4s total# ,&.&9k b"tes allocated 6 :E.&k reser$ed * ,:%.9k used, ,L%9-&k a$ailable 5heck to make sure that /tmp is being mounted as a swap files"stem solarisY grep tmp /etc/$fstab swap 4 /tmp tmpfs 4 "es 4 If not, make sure that "ouBre ftpBing the file to a files"stem that has enough free space unless "ou ha$e more than %&&mb of swap space, and "ouBre ftpBing a %&&mb file to /tmp that would explain the problem K !he space problem is a good guess but I donBt think thats it !he K OpenBSD box has >28;!N of storage space free !he Solaris box is K onl" running about /&Z on the disk IBm ftpBing to and /tmp is K fine df 4k doesnBt show me swap space so ma"be thatBs it I K donBt e$en know how to check swap space usage (n" helpA swapctl 4l W see swapctl=9@ posted by Brahma at 3:40 PM & comments

process can not be stopped- %nd it keeps t&e file al'ays opened
mp,.: Mtmp Jmenta netK wrote# K 7ello all, K In a real time s"stem, mission critical, there are the following K problem# K One process is writting a file with ClogC information =now useless@ K !he

K process can not be stopped (nd it keeps the file alwa"s opened for K writting It depends how the file was opened b" the running process If the file was opened with the OH(>>8;D flag, "ou can safel" truncate the file# cp /de$/null /some/log/file If "ou do abo$e on files which will be written to without the OH(>>8;D flag used on open=@, further log writes will write at the end of the old offset In this case "ou end up with a sparse file empt" =null b"tes@ in the first few megab"tes and the real log messages somewhere behind posted by Brahma at 3:39 PM & comments

%dd ne' disks to an e=istin9 Sol:


8ric Webb wrote# K 7i gu"s, K K ;eed basic pointers/starters on how to add new disks to an existing Sol% K install I ha$e two extra dri$es IBm adding to an 8./&, the idea is to use K them as a mirrored pair for data 5oming from other )nixes, IBm kinda lost K without an 2?0 W@ Insert disks 5reate the de$ice nodes# host#root#/#, F de$fsadm 4$ 4c disk Run format It should find two new disk de$ices 2etBs sa" the"Bre c&t,d& and c&t.d& 2abel them if necessar" and set up the following slices# slice & 44 entire disk except the last /&0B, tag usr, flags wm slice . 44 entire disk, tag backup, flags wu slice E 44 last /&0B, tag usr, flags wm Remember to write the new label and partition map to the disks (ssuming "ouBre not alread" running metade$ices# 5reate metadb replicas host#root#/#. metadb 4a 4f 4c : c&t[,,.]d&sE

I suggest creating either one or three metadb replicas on "our boot disk as well, if "ou ha$e a small extra slice "ou can use for the purpose !he solaris metatools re'uire that half the total metadb replicas, rounded down, plus one, must be a$ailable at boot time Set up the metade$ices using metatools# host#root#/#: F metainit d,, , , c&t,d&s& host#root#/#- F metainit d,. , , c&t.d&s& host#root#/#/ F metainit d,& 4m d, d. 5reate a files"stem on the mirror# host#root#/#L F newfs /de$/mb/rdsk/d,& Set up a line in /etc/$fstab to mount the files"stem where "ou want it Remember to use /de$/md/dsk/d,& and /de$/md/rdsk/d,& for the de$ices 2ogging is a good idea Nour /etc/$fstab line should end up looking something like this# /de$/md/dsk/d,& /de$/md/rdsk/d,& /data ufs , "es logging !hen Qust mount the new files"stem# host#root#/#E F mount /data (nd "ouBre done 44 >hil Stracchino K http#//docs sun com/app/docs/doc/9,L4-/.& 4 Solaris ?olume 0anager K (dministration Guide !here are a number of good step4b"4step guides out there on the web to go along with the official docs for S?0, or CDiskSuiteC for us old timers# http#//www unixwa" com/$m/disksuite/index html http#//slacksite com/solaris/ http#//www adminschoice com/docs/>HSolsticeHdisksuite htm http#//s"sunconfig net/unixtips/solaris htmlFs$m I still refer to these to remind m"self of s"ntax when doing things that are =hopefull"@ rare, like replacing failed disks

posted by Brahma at 3:37 PM & comments

SunF<63 28060 ;o'to disable a memory module usin9 t&e Solaris :


SubQect# Re# Sun<IR8 .9&R# 7owto disable a memor" module using the Solaris % K 7ello, K we ha$e a Sun<IR8 .9&R with a fault" memor" module 7ow can we disable K this memor" module until weBre able to replace itA >op the box and remo$e the bank, to m" knowledge "ou cant disable a bank of memor" ina .9&R, best bet is to let Sun replace it, "ou ha$e enough soft errors to get it replaced, "ou also had a double bit error which led to the U8 e$ent, the 58Bs dont break the s"stem so that can be a scheduled replacement but if "ou ha$e U8Bs often "ou should get a replacement asap I dont know "our le$el of ser$ice with Sun =if an"@ but if "ou ha$e one check with them for a possible <5O match Uncorrectable s"stem bus =U8@ 8$ent 5orrected s"stem bus =58@ 8$ent !he <8 handbook on sunsol$e shows which are which and I beli$e the s"stemBoard as well shows the component name, howe$er, "ou need to pop the whole bank of four DI00S if "ou do since the" work in 'uads in the .9&R So "ou need - identical DI00 0odules in at least one Bank to boot the machine otherwise "ou get messages like that# !his happens when "ou ha$e one DI00 missing in a Bank# 5>U seeprom format# &&&& &&&& &&&& &&&,8RROR# set4bank4present# DI00s or DI00 <RUproms missingT >owering off s"stemT !his happens when "ou ha$e mixed different DI00s in one bank# d>U seeprom format# &&&& &&&& &&&& &&&, 5orrected 855 8rror ok 5orrected 855 8rror ok 5orrected 855 8rror

posted by Brahma at 3:36 PM & comments

Matc&>vie' s&ell script lines durin9 e=ecution)


Watch/$iew shell script lines during executionA K (n" suggestionsA IBm primaril" running Solaris with occasional fora"s K into 2inux Nou didnBt sa" which shell If itBs a Bourne shell $ariant, "ou can use two $ariables 4$ >rint shell input lines as the" are read 4x >rints lines after eexpanding $alues !here are se$eral wa"s to do this ,@ sh 4x command arguments sh 4$ command arguments Nou can combine this with sh 4x$ command arguments .@ start the first line with FT/bin/sh 4x FT/bin/sh 4$ FT/bin/sh 4x$ :@ In the middle of the script set 4x =turns it on@ set 6x =turns it off@ set 4$ set 6$ <or csh/tcsh, the first two techni'ues work csh 4x$ command arguments FT/bin/csh 4x$ in addition, "ou can use 41 or 4?, which turns the flag on before executing ^ tcshrc/ cshrc <or in4the4middle4of4the4script, use set echo set $erbose

unset echo unset $erbose OOOOOOOOOOOOORRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR <or ksh $ariants, set >S-# FT/bin/ksh >S-*BRY2I;8;OS6B 5reate a function# F))))))))))))))))))))))))))))))))))) function debugOn [ t"peset 4ft Y=t"peset 6f@ ] (nd include a getopts such as# F))))))))))))))))))))))))))))))))))) while getopts CdC 5 do case Y5 in d@ debugOnWW esac done !he ad$antage of this o$er the C4xC, Cset 4xC, echo, etc alread" mentioned is that "ou donBt ha$e to insert/delete Qunk when "ou want to see whatBs going on and it works for functions where the C4xC on the first line doesnBt posted by Brahma at 3:33 PM & comments

script to 9et all t&e relevant parameters from eri


ggJradier#/export/home/ghost/binF more nddHeri FT/bin/sh Fscript to get all the rele$ant parameters from eri for pram in `ndd /de$/eri \A I grep 4$ BAB I awk B[print Y,]B` do echo CYpram \cC ans*`ndd 4get /de$/eri Ypram`

echo Yans done echo CFF/YSU;data =`ifconfig hme& I grep inetI awk B[print Y.]B`@ posted by Brahma at 3:33 PM & comments

<s input from file or standard in)


Is input from file or standard inA Is there a wa" to check if the input to a Bash script is from a file or standard inA Repl" K 7i, K Is there a wa" to check if the input to a Bash script is from a file or K standard inA man test look at the 4t option Bill Sei$ert Repl" posted by Brahma at 3:28 PM & comments

solaris nfs cleanup script


hi, this is solaris nfs cleanup script 44444444444444444444444444444444444444 F crontab 4l I grep nfs ,/ : ) ) & /usr/lib/fs/nfs/nfsfind 44444444444444444444444444444444444444 F more /usr/lib/fs/nfs/nfsfind 44444444444444444444444444444444444444 FT/bin/sh F 5op"right =c@ ,%%: b" Sun 0icros"stems, Inc Fident CJ=F@nfsfind sh , E &&/&E/,E S0IC F F 5heck shared ;<S files"stems for nfs) files that

F are more than a week old F F !hese files are created b" ;<S clients when an open file F is remo$ed !o preser$e some semblance of Unix semantics F the client renames the file to a uni'ue name so that the F file appears to ha$e been remo$ed from the director", but F is still usable b" the process that has the file open if R T 4s /etc/dfs/sharetab SW then exit W fi F Get all ;<S files"stems exported with read4write permission DIRS*`/usr/bin/nawk B=Y: T* CnfsC@ [ next ] =Y- ^ /arwYIarw,Iarw*I,rw,I,rw*I,rwY/@ [ print Y,W next ] =Y- T^ /aroYIaro,Iaro*I,ro,I,ro*I,roY/@ [ print Y, ]B /etc/dfs/sharetab` for dir in YDIRS do find Ydir 4t"pe f 4name nfs\) 4mtime 6E 4mount 4exec rm 4f [] \W done 444444444444444444444444444444444444444444444444444 /Pcrgen posted by Brahma at 3:27 PM & comments

#ross@over connection bet'een &osts


5ross4o$er connection between hosts I ha$e . Sun <ire ?.-& machines with a Gigabit card on each machine =we are not using the onboard 'uad card@ We need to transfer data between these two machines Since we dont ha$e a Gigabit Switch we connected a cross o$er cable between the . Gigabit card network interfaces I ha$e done the following to make these . interfaces communicate but no luck On 0achine (# ifconfig ce& plumb ifconfig ce& ,%. ,L9 & , .// .// & & broadcast 6 up route add net ,%. ,L9 & & ,%. ,L9 & , , On 0achine B#

ifconfig ce& plumb ifconfig ce& ,%. ,L9 & . .// .// & & brodcast 6 up route add net ,%. ,L9 & & ,%. ,L9 & . , But if I run the command Bping ,%. ,L9 & .B from 0achine ( it sa"s host unreachable Same problem if I run the command Bping ,%. ,L9 & ,B from machine B What ha$e I done wrong here (n" help would be appreciated !hanks (dding the routes is not necessar", since there is no router between the machines !his ma" do bad rather than good (lso, please post the output of# /usr/sbin/ndd 4set /de$/ce instance & /usr/sbin/ndd 4get /de$/ce linkHstatus on both machines !he abilit" to communicate peer4to4peer o$er crossed U!> ma" depend on Ctpe4link4testAC $ariable in OB> =althoug I am not 'uite sure if this still applies to CceC interface Regards, If I dont add routes it will use the default route to communicate which is not ,%. ,L9 & x I can ping ,%. ,L9 & , from 0achine (, so the interface is up Similarl" I can ping ,%. ,L9 & . from 0achine B (n"wa" IBll post the ndd output !hanks K If I dont add routes it will use the default route to communicate which K is not ,%. ,L9 & x ;o, when the CifconfigC command brings the interface up, it will add a route to that network onl" based on the netmask, and since that route is more specific than the default route, it will use that route =and that interface@ for traffic that goes directl" to that network K I can ping ,%. ,L9 & , from 0achine (, so the K interface is up Similarl" I can ping ,%. ,L9 & . from 0achine B

Nes, that means the kernel has associated an I> address with that interface and will recogni+e packets with that destination I> address as local packets But that does not mean that the de$ice dri$er for "our ethernet interface is able to do an"thing producti$e or e$en that "ou ha$e an electrical connection of an" t"pe on the ethernet hardware =!he interface can be in the CupC state without either of those things being true @ 0" ad$ice is to Qust go get a gigabit switch It would be nice to use professional grade e'uipment for a situation like this, but e$en cheap consumer grade e'uipment is probabl" better =in the sense of reliabilit" and maintainabilit"@ than putting together a s"stem that ob$iousl" re'uires careful manual configuration Qust to get the machines to talk to each other 7owe$er, if a switch isnBt possible for some reason, another idea is to tr" the same crosso$er cable on the built4in ethernet instead of the gigabit ethernet I donBt know all the intricacies and 'uirks of autonegotiation on gigabit $s fast ethernet, but it seems possible that it might be easier with the slower interface t"pe (nd, if "ou can get it to work there, then "ou ha$e pro$ed that "our cable is not totall" defecti$e, and "ouB$e pro$ed that "ou know the right configuration commands except for what to do specificall" on a pair of gigabit ports 4 2ogan !hanks a lot for "our post I donBt ha$e a Gigabit switch so that is not an option !hat is the reason we are using cross o$er cable between the . machines IBll tr" the same on the built4in ethernet card which is also ,&/,&&/,&&& Base ! ethernet 'uad card IBll reomo$e the manual routes and tr" this K !hanks a lot for "our post I donBt ha$e a Gigabit switch so that is K not an option !hat is the reason we are using cross o$er cable between K the . machines Nour crosso$er cable 44 is it a crosso$er for ,&&base4! or is it for ,&&&base4!A ,&&base4! doesnBt re'uire all - pairs to be crossed while ,&&&base4! does, so it could be that the cable "ou ha$e donBt ha$e all pairs crossed / I think "our netmask is wrong, "our using 5lass 5 pri$ae address ,%. x x x, "our netmask should be .// .// .// &

if this didnBt work, to test network connection goto open boot prompt use test4net command posted by Brahma at 3:27 PM & comments

c&eck if t&e s&ell is interactive or not in t&e profile


On Sun, ,, Sep .&&/ ,&#&9#-% 6&.&&, Mn att Jtiscali itK wrote# K Barr", K how can I check if the shell is interacti$e or not in the profileA What I sa" here applies to the Bourne (gain shell =bash@, but I belie$e ksh is similar# >S, is set and Y4 includes an BiB if the shell is interacti$e if R CY[>S,6set]C * set S then echo interacti$e else echo non4interacti$e fi and case Y4 in )i)@ echo interacti$eWW )@ echo non4interacti$eWW esac or more briefl"# RR Y4 *^ i SS VV echo interacti$e II echo non4interacti$e !he shell will be interacti$e if a@ both stdin and stdout is connected to a terminal, b@ the shell was not started with non4option command line arguments, and c@ the shell was not started with the 4c option So, if RR 4t & 4a 4t , 4a YF 4e' & 4a Y4 *^ c SS then echo CNessur, a, b, and c C fi

since the C*^C operator exists in RR SS but not in R S >eople are often happ" to test onl" R 4t & S, which works as intended in most cases K Is it something about the tt"A Nes 48nri'ue posted by Brahma at 3:25 PM & comments

delete an unusually named file usin9 its i@node value


7ow can I delete an unusuall" named file using its i4node $alueA (ssuming the inode is ,.:-/, find 4inum ,.:-/ 4exec rm []\W posted by Brahma at 3:25 PM & comments

6emovin9 old files t&at contain a p&rase usin9 crontab


Remo$ing old files that contain a phrase using crontab && - ) ) ) find /sapHbasis/log 4name Cdecr"ptHD7%:9:>S log)C 4mtime 6,4exec sh 4c Bgrep C;o 0atchesC Y, K/de$/null .KV, VV rm Y,B [] [] \W !his is a tin" shell script =written inline@, which runs grep and if that reports success then runs rm !he doubled [] are to handle case that Y& is assigned the first arguement, and Y, the second one Pust for fun, a further refinement# grep 4l will output file names onl", and each file at most once, ob$iating the need to cut and sort 4u find /sapHbasis/log 4name Cdecr"ptHD7%:9:>S log)C 4mtime 6,- I xargs grep 4l C;o 0atchesC I xargs rm posted by Brahma at 3:24 PM & comments

;o' to s&o' s&msys0s&minfoRs&mse value)


SubQect# Re# 7ow to show shms"s#shminfoHshmse $alueA K One $alue is missing in /etc/s"stem, though# shms"s#shminfoHshmse I

aaaaaaaaaaaaaaaaaaaa 7ere is a little t"po as the ending ``gBB is missing K donBt know the current $alue and do not want to risk reducing the K parameter !he <(3 gi$es nothing Nou can examine and set these parameters d"namicall" using mdb R,S# thalesF echo shminfoHshmseg/D I mdb 4kw I tail 4, shminfoHshmseg# .&& thalesF (ndreas posted by Brahma at 3:23 PM & comments

.split >s'ap bet'een 2 disks.0 ;*M) Jand, .2**5).K


SubQect# Re# seen4ad$ice# Csplit /swap between . disksC# 7OWA =and, CGOODAC@ K ?arious times IB$e seen the ad$ice, when setting K up partitions, to CsplitC /swap between two disks (s rule, that is good ad$ice, because Solaris will use the slices in a round4robin manner, spreading the I/O load =so disks on different controllers are ideal@ K Pust how does one do thatA K ie, what commands do "ou gi$eA (ssuming "ouBre partitioned the other disk with format, the easiest wa" to add the swap is to edit /etc/$fstab Right now this machine has one swap slice, on c,t,d&s,# /de$/dsk/c,t,d&s, 4 4 swap 4 no 4 If "ou add =sa"@ target ., "ouBd add another line like this# /de$/dsk/c,t.d&s, 4 4 swap 4 no 4 (ssuming "ou want to put swap on slice , of that disk too

Nou can also add swap on the fl" using the swap command, but it will go awa" when "ou next reboot if "ou donBt add it to /etc/$fstab 8 g , swap 4a /de$/dsk/c,t.d&s, will add the abo$e de$ice SubQect# Re# seen4ad$ice# Csplit /swap between . disksC# 7OWA =and, CGOODAC@ K On <ri, % Sep .&&/, Da$id 5ombs wrote# KK ?arious times IB$e seen the ad$ice, when setting KK up partitions, to CsplitC /swap between two disks K (s rule, that is good ad$ice, because Solaris will use K the slices in a round4robin manner, spreading the I/O K load =so disks on different controllers are ideal@ !o note one exception to the rule# If reliabilit" is more important than performance, making a mirror for all slices, including swap, is probabl" the better idea# Pust because swap is strictl" non4persistent data doesnBt mean "ou want to lose it in4flight 0" guess for an unreco$erable defect on swap would be a kernel panicW ne$er had it though Nours, Bernd posted by Brahma at 3:21 PM & comments

command line ar9uments


CYJC produces the list of positional paramters =command line arguments@ YJ and Y) are similar, but beha$e differentl" in some cases# echo Bfor word in CYJCW do echo CMYwordKCW doneB K /tmp/trash sh /tmp/trash C( couple of sinsC C( spaced sentenceC some single words produces M( couple of sinsK M( spaced sentenceK MsomeK MsingleK MwordsK

but if "ou replace CYJC with CY)C "ou get M( couple of sins ( spaced sentence some single wordsK and if "ou drop the 'uotation marks, as in Cfor words in Y)W do C M(K McoupleK MofK MsinsK M(K MspacedK MsentenceK MsomeK MsingleK MwordsK Without the 'uotation marks it does not matter if "ou use Y) or YJ posted by Brahma at 3:20 PM & comments

mount t&e #50


If the 2?0 =2ogical ?olume 0anager@ is running =it should be started automaticall" at bootup@ all "ou will need to do is put the 5D into the 5D cadd" and the 2?0 will mount it automaticall" If the 2?0 is not running, follow these steps to mount the 5D# , Open the 5D door and load the 5D onto the cadd" . su to root =su 4@ : cd / - ?erif" the mount point /cdrom exists If it does not exist create it using, Cmkdir cdromC / mount the cd with the following command# Z mount 4r 4< hsfs /de$/dsk/c&tLd&s& /cdrom L If "ou use, Ccd /cdromC, "ou should see the data on the 5D 2et us know if "ou are successful posted by Brahma at 3:19 PM & comments

savin9 a set of data from a file to anot&er file in 1i editor


Re# sa$ing a set of data from a file to another file in ?i editor

What do "ou mean b" sa$eA Sa$e to a new fileA !r"# #./,-/w/some/path/filename Brian K K 7i Gurus, K K K K Do "ou know in ?i, how to sa$e the data from one line to anotherA K K I mean I want to sa$e data from line ./ to line -/, whereas the file K contains /&& lines K K 7ow I can achie$e thisA I want to do this when I am in $i in the edit/read K onl" mode K K K K !hanks V Rgds, K K ;ara"an K posted by Brahma at 3:19 PM & comments

Mit&in sorted files, determine if 9ap e=ists


Re# Within sorted files, determine if gap exists 7i !r" this, kati"arJ/export/home/kati"ar/testK cat sortedHfile 7R;D (&/&-&,&&&&%EO55H,EE raw E-E O5( 7R;D (&/&-&,&,&&&,O55H,EE raw E-9 O5( 7R;D (&/&-&,&.&&&/O55H,EE raw E-% O5( 7R;D (&/&-&,&:&&&LO55H,EE raw E/& O5( 7R;D (&/&-&,&-&&&EO55H,EE raw E/, O5( 7R;D (&/&-&,&/&&&9O55H,EE raw E/. O5( 7R;D (&/&-&,&L&&&%O55H,EE raw E/: O5( 7R;D (&/&-&,&E&&,&O55H,EE raw E/- O5( 7R;D (&/&-&,&9&&,,O55H,EE raw E// O5( 7R;D (&/&-&,&%&&,.O55H,EE raw E/L O5(

7R;D (&/&-&,,&&&,:O55H,EE raw E/E O5( 7R;D (&/&-&,,,&&,-O55H,EE raw E/9 O5( 7R;D (&/&-&,,:&&,LO55H,EE raw EL& O5( 7R;D (&/&-&,,-&&,EO55H,EE raw EL, O5( 7R;D (&/&-&,,/&&,%O55H,EE raw EL. O5( 7R;D (&/&-&,,L&&.&O55H,EE raw EL: O5( kati"arJ/export/home/kati"ar/testK cat script sh next*. pre$*, lines*`wc 4l sortedHfile` while R Ynext 4ne Ylines S do $al,*`e$al sed 4n \BYpre$ p\B sortedHfileIcut 4d 4f-` $al.*`e$al sed 4n \BYnext p\B sortedHfileIcut 4d 4f-` $al,*`expr Y$al, 6 ,` if R Y$al, 4ne Y$al. SWthen echo C0issing file number # Y$al,C fi pre$*Ynext next*`expr Ynext 6 ,` done kati"arJ/export/home/kati"ar/testK /script sh 0issing file number # E/% kati"arJ/export/home/kati"ar/testK 7ope it helps, 7i ?ram, (ctuall" I am not $er" comfortable with awk #@@ now answer to "our 3 regarding BYpre$ pB Inorder to print a particular line of a file sa" /th thru sed we write sed B/ pB filename Similarl" I ha$e the line number stored in pre$ $ariable and want to use it in sed but since Y has a special meaning in sed I need to e$aluate Ypre$ first and then pass that $alue to sed (n Be$alB before sed does this for me 7ope I am clear <eel free to re$ert back if still there are an" doubts 4n option is used to a$oid printing of line twice 7ope it helps Re# Within sorted files, determine if gap exists In awk it would look something like this# awk 4< B[curr*Y-];RT*,VVpre$6,T*curr[print CGap Between# Cpre$C Ccurr][pre$*Y-]B

!he output from "our example input would be# Gap Between# E/9 EL& Brian 4 ;o C after curr the 'uotes balance now , set around CGap Between#C and one set around a space between pre$ and curr I ha$enBt tested this, but this HmightH work where the numbers wrap# awk 4< B[curr*Y-W if =curr&@[curr*,&&&]];RT*,VVpre$6,T*curr K K [print CGap Between# Cpre$C Ccurr][pre$*curr&&]B If "our file is sorted, then wonBt &&& come first instead of after %%%A Brian !o print out the entire filename change to# [print CGap Between# Cpre$C CcurrCat line# CY&] !hat will print the line (<!8R the gap Brian posted by Brahma at 3:18 PM & comments

6elations&ip bet'een load avera9e and #AU busy or #AU idle


SubQect# Re# Relationship between load a$erage and 5>U bus" or 5>U idle Qs wrote# K Is there some kind of relationship between the load a$erage figure and 5>U K bus" / idle percentage A Nes, thereBs SO08 relationship, but itBs not a reall" simple one K !hus, what I am concluding so far is that a load a$erage nearing ;45>Us will K ha$e a $er" low 5>U idle Z 8$er" thread on the machine can either be runnable or not <or example, if "ou call Csleep=,&&@WC in a thread, then for the next ,&& seconds, the thread isnBt runnable 2ikewise if "ouBre waiting on the network But if "our thread is in the middle of doing processing =actuall" on a

processor@ or in principle )could) be doing processing if a processor were a$ailable, then itBs runnable !o make matters a tad bit more complicated, there is a third state on Unix s"stems, which is that "our thread is blocked because of some short4term I/O, like reading from or writing to a disk Because Unix expects disk I/O to finish reall" soon =at which point "our thread will become runnable again@, this is basicall" counted as Calmost runnableC So, the load a$erage is computed b" periodicall" looking at the state of all the threads and counting the ones the number of ones that are running, runnable but not running, and Calmost runnableC =in short4term disk wait@ But, the load a$erage is also a deca"ing a$erage o$er a certain inter$al =, minute, / minutes, or ,/ minutes@, so it doesnBt necessaril" reflect what the situation is at an" gi$en moment 0eanwhile, idle time is computed b" looking at what the processors are doing !he s"stem keeps statistics about what percentage of the time the 5>U is running, idle, etc It does this b" periodicall" waking up =$ia an interrupt@ and gathering statistics about each 5>U for a certain instant in time It puts together lots of these samples to get a more accurate picture of how much time is spent doing what But the stuff with short4term disk wait makes things complicated again (s I understand it, if there is (;N outstanding short4term disk wait =for (;N processorT@, then at the time that routine takes its sample, it counts (22 processors that are idle as in short4term disk wait instead So, in a - processor s"stem, one processor waiting for short4term disk I/O and : processors idle will be counted Qust the same as all if all - processors were reall" waiting for short4term disk I/O So, to recap# ) load a$erage means periodicall" sample the run 'ueue and determine how man" threads are running, runnable, or Calmost runnableC =short term disk wait@, then make a deca"ing a$erage of this ) 5>U idle/s"stem/user means periodicall" sample all the 5>Us and determine what percentage of the time the"Bre running and not, but if a 5>U is idle and it or (;N O!78R 5>U has a short4term disk wait going on, count that as disk wait =non4idle@ So "es, "our conclusion is basicall" correct If "ou ha$e a load a$erage of ;, and if "ou ha$e ; processors, "ou are going to ha$e a low idle percentage !his assumes "ou donBt ha$e a processor set defined that makes things more complicated# "ou could ha$e ,&&& 5>U4bound threads that do no I/O at all, but using a processor set, put all ,&&& of them on a single processor in a - processor s"stem, and run nothing else so

that the other : processors are idle !hen "our load a$erage would be ,&&&, but "our idle percentage would be E/Z One more note# the Can" other 5>UC thing means something a bit funn" for a multiprocessor s"stem that does I/O If "ou ha$e one single thread that is doing nothing but disk I/O on a - processor s"stem, "ou might expect to see E/Z idle, but "ou wonBt NouBll see more like &Z idle and ,&&Z iowait !hatBs because one of the 5>Us is basicall" perpetuall" in iowait, and though the others are perpetuall" idle, the" are all getting counted as in iowait b" the routine that collects the statistics I guess if "ou didnBt know this, "ou could get an inaccurate sense of the I/O load on a multiprocessor s"stem =( better measure would probabl" be whether I/O ser$ice times tend to increaes as the ser$erBs load grows @ B" the wa", IB$e based a lot of the abo$e on the Solaris Internals book and on http#//sunsite uakom sk/sunwor ldonline/swol4&94,%%E/swol4&94 insidesol Both of these are se$eral "ears old, so itBs possible something has changed in more recent $ersions of Solaris =ItBs also possible IB$e totall" misunderstood e$er"thing @ !he Cload a$erageC is the number of runnable QobsW so it would stand to reason that if the load a$erage is K* F of 5>Us that "our 5>Us will then be bus" 5asper 44 posted by Brahma at 3:17 PM & comments

Aroduce a list of t&e &ome directories of t&e listed usersK ))))))))))))))))))))))))))))))))))))))))))))) FT/bin/sh F 7omeDir RuserS K FF >roduce a list of the home directories of the listed users F If no users K are gi$en, produce all home directories 7i, !r" this script assuming ur groupHid is stored in Ygrp I<S*BaPB for i in `cat /etc/passwd` do if R `echo YiIcut 4d# 4f-` 4e' Ygrp SWthen user*`echo YiIcut 4d# 4f,` mkdir /home/Yuser fi done 7ope it helps note that u canBt simpl" cut from password file

otherwise u will be creating director" for s"stem accounts too n Something like this should work# cat /etc/passwd I awk 4<# B[print Cmkdir CYLC VV chown CY,C#CY-C CYL]B I sh !r" it without the CIshC first to see if it looks correct It should attempt to create the director", but if it alread" exists, will get an error and not do the BchownB If it doesnBt exist =and succeeds@, it should do the chown posted by Brahma at 3:16 PM & comments

script to autosend customer report to *ps P Sys %dmin


***************************************** FT/usr/bin/ksh F script to autosend customer report to Ops V S"s (dmin B(S8DIR*/usr/local/mrtg/customer OI>*/usr/bin/+ip UU8;5OD8*/usr/bin/uuencode 0(I2!O*CopsgroupJabc com s"sadmJabc comC !OD(N*`date 6CZdZmZ"C` cd YB(S8DIR for DIR in `ls 4l I egrep CadC I awk B[ print Y% ]B`W do <I28;(08*YDIRY!OD(N YOI> 4r Y<I28;(08 YDIR K /de$/null .KV, YUU8;5OD8 Y<I28;(08 +ip Y<I28;(08 +ip I mailx 4s C0R!G Report for YDIR 4 Y!OD(NC Y0(I2!O rm Y<I28;(08 +ip done posted by Brahma at 3:15 PM & comments

Summary0 probably over a million files to delete


SubQect# Summar"# probabl" o$er a million files to delete !hanks all Some of the replies # ( couple replies sa" I will still some time to complete the

deletion, so I probabl" can do Cnohup Mdelete commandK V to let it run b" itself in the background (s I need to remo$e files older than ,9& da"s, I chose # cd Mdir where files existK find 4xde$ 4t"pe f 4mtime 6,9& 4exec rm [] \6 V ********** Other replies # 0ount the files"stem with logging on Nou can do this without unmounting the files"stem mount 4o remout,logging Mde$K Kfiles"stemK 44444444444 cd Mdirector"K find 4name B).&&-),.B 4o 4name B).&&-),,)B 4o 44444444444 , find 4exec rm [] \W . for x in `ls`W do rm Yx W done 44444444444 Nou ran into a limitation on the abilit" of the shell I ha$e run into similar problems in the past 7ere is how I worked around it It re'uires the use of perl It will remo$e all files within the director" where executed !est to $erif" for "ourself how it works ls I perl 4ne BchompW unlinkB posted by Brahma at 3:14 PM & comments I xargs rm 4f V

find and no NFS


SubQect# Summar"# find and no ;<S !he original post was about locate world4writeable file and setuid files etc

I want to limited the find to local files"stems onl" I donBt want multiple ;<S clients run the find on the same ;<S export I got some permission errors and CStale ;<S file handleC errors with C4localC !here were man" man" replies Sorr", I canBt list e$er"one replied !he suggestions are# , It is "our fault, R!<0 again 0anpage said 4local )WI22) descend the hierarch" of non4local directories . 5heck out C4pruneC (lwa"s "ields true Does not examine an" directories or files in the director" structure below the pattern Qust matched : use 4xde$ Same as 4mount primar" - tr" 4mount / 0anpageT !hereBs an example in the manpage 8xample %# >rinting local files without descending non4local directories Zfind T 4local 4prune 4o 4print (nwser ******** , !he main point is C4localC still descend ;<S mounted directories !hatBs wh" I got some errors . !o get the Qob done444K Since I want find to drill down from / on man" s"stems with probabl" different files"stem setup I canBt use C4mountC for each files"stem Darren Dunham pointed out that find / \= 4fst"pe ufs 4o 4fst"pe $xfs \@ 4t"pe f 4perm 4L&&& 4print K(ll that happens there is that the result on remote files is false It KdoesnBt stop the recursion Nou need 4prune for that !hatBs what K8xample % in the man page does Dan Stromberg suggested K find 4fst"pe nfs 4prune 4o 4print ;ope, I donBt ha$e an exact answer "et I was out "esterda" I pla"ed with this a bit this morning !he followings seems to good so far

find / 4fst"pe nfs 4prune 4o 4perm 4. 4print find / \T 4local 4prune 4o 4perm 4. 4print !hanks a lot man page and IBll remember to boot up m" brain before reading the

posted by Brahma at 3:13 PM & comments

touc&0 >opt>FrontBase>Backups>8est cannot create


Dear managers, I got a bunch of responses to m" summar" telling me that using anon*& is no good It gi$es root access to e$er"one which is definitel" not what I want 0" first attempt share 4< nfs 4o rw,root*merkur /opt/<rontBase/Backups failed I finall" tried it with the <3D; share 4< nfs 4o rw,root*merkur smartsoft internal /opt/<rontBase/Backups and this works like a charm !hanks a lotT Regards, (ndreas K 0ike suggested to do K K Share 4< nfs 4o rw,root*Mhostname or ipaddress of clientK K /opt/<rontBase/Backups K K !his did not make a difference I then followed the suggestion of K Saxon and 0ichael K K share 4< nfs 4o ro,anon*& /export/install K K !his workedT !hanks a lotT K K Original posting# KK Dear managers, KK

KK I ha$e exported a director" on a Solaris 9 machine as follows KK KK share 4< nfs 4o rw /opt/<rontBase/Backups KK KK and mounted the director" on a Sol % machine with KK KK mount 4< nfs ,& & & .&&#/opt/<rontBase/Backups /opt/<rontBase/Backups KK KK mount tells me that the director" is mounted read write KK KK /opt/<rontBase/Backups on ,& & & .&&#/opt/<rontBase/Backups KK remote/read/write/setuid/xattr/de$*-%&&&&: on Wed (ug .- ,-#..#// KK .&&/ KK KK 7owe$er, creating a file as root on the Sol % machine fails# KK KK bash4. &/F touch /opt/<rontBase/Backups/!est KK touch# /opt/<rontBase/Backups/!est cannot create KK KK What am I missingA posted by Brahma at 3:12 PM & comments

a c&eats&eet 'it& Sun commands to nmana9e t&ese stora9e arrays)


Original 'uestion# I Qust inherited a bunch of (,&&&, D,&&&, D/.&& arra"s, connected to SunBs -/&&,L/&&, 8-.& etc Some are standalone, some ?eritas ?x$m/?5S controlled Does an"bod" ha$e a cheatsheet with Sun commands to manage these storage arra"sA Darren Dunham from !(OS 5O0 summed it best# (,&&&/(:/&& ha$e on4board R(ID controllers Nou need to grab Raid manager L .. , from Sun =and not be running Solaris ,&@ to manage them BrmLB is the GUI tool thatBs generall" used D,&&& is PBOD scsi ;o real commands here (/x&& are PBOD fiber !he onl" commands "ou might need here would be BluxadmB to aid online/offline and disco$er" of indi$idual dri$es Nou might also need

BcfgadmB to configure controllers or targets up and down posted by Brahma at 3:11 PM & comments

8&ursday, September 08, 2005


veritas free space
Run, $xdg 4g MdiskgroupK free and see if "ou ha$e an" disk space left Oakaria 0attar wrote# K7i, K KI am tr"ing to create a $olume in a disk group ha$ing %L G B free space Kbut I am getting ;o more space in disk group configuration posted by Brahma at 1:16 PM & comments

#ron format
anon"mous wrote# K 7ow to make sertain task to be runned with cron on e$er" monthBs first K sunda" =or months first full week da" sunda"@ K and how about e$er" second sunda" I donBt think cron has support for that built into it So, "ou will ha$e to go another route !he easiest wa" is to run the cron Qob e$er" da" for the first E da"s of the month Onl" one of those da"s will be a Sunda", so Qust check if the current da" is Sunda" and exit if it isnBt Sunda" <or example# FT /bin/sh if R `/usr/bin/date B6ZOwB 4ne & S then F itBs not Sunda", so exit exit & fi F rest of cron Qob goes here

!he second Sunda" of the month can be done in a similar wa" Since the first Sunda" will fall in da" ,4E, and since the second Sunda" is E da"s after the first, the second Sunda" will fall on da" 94,- So, run the Qob e$er" da" from da" 9 to da" ,-, and check if itBs a Sunda" IBm not sure what "ou mean b" Cmonths first full week da" sunda"C If "ou mean the Sunda" that falls during the first full week of the month, then to me that is e'ui$alent to the first Sunda" of the month, because the week begins on Sunda" =in the United States, at least@ 7ope that helps 4 2ogan Repl" K (ctuall" "ou should be able to set the date ,4E and the da" of the week K to &=or sun@ (s cron onl" executes the command if all parameters K match, this will onl" run when da" ,4E falls on a Sunda" so no need to K build the logic into "our command I know "ou can specif" b" da"4of4month and b" da"4of4week, but the 'uestion is whether, when "ou do this, cron interprets it as the union or the intersection of the two sets of da"s 2ooking at Cman crontabC, it would appear that the rule is a bit counter4intuiti$e# it seems to be that itBs the union, unless one of the fields is Qust the asterisk =C)C@, in which case itBs the intersection IBm basing this on two examples from the from the crontab manual page One sa"s that & & ,,,/ ) , would run the command Con the first and fifteenth of each month, as well as on e$er" 0onda"C =so the union of the two sets@, and then another example sa"s that &&)), would run the command Conl" on 0onda"sC =which would be the intersection of the two sets since in this case C)C means e$er" da" of the month@

I guess IB$e ne$er looked at cron in this much depth before, but it occurs to me that this notation is reall" confusingT !he rules arenBt clear about when itBs intersection $s union posted by Brahma at 1:15 PM & comments

Solaris (8Q Gumpstart usin9 5;#A and A(3


SubQect# Summar"# Solaris 19L Pumpstart using D75> and >18 7ere was m" 'uestion# I need to install -L& pcs with Solaris ,& :/&/ 0" Boot and Install Ser$er are based on a Ultra Sparc ./& s"stem If a install an" >5 using rarp e$er"thing works perfect !he pc is installed automatic using the configuration store in the s"sidcfg, etc, etc But here is the problem (ll the -L& pc need to be installed using D75> and >18 procedure !he pc boot from the net perfect, but I do not wh" ignores the s"sidcfg and start a interacti$e install I ha$e done# 4 ran the addHinstallHclient 4 checked the files in /tftpboot 4 added a macro to m" D75> ser$er 4 added a >18 macro to m" D75> ser$er 4 added a client entr" which includes the networkHip macro 4 added all the $endor options to the networkHip macro Solution# 5reate a file Cs"stem confC file under the /etc/netboot under de Qumpstart director" tree and add the following entries to the s"stem configuration file# Ss"sid5<*CPumpStart4Se$er#/wrk/QumpstartC SQumps5<*CPumpStart4Ser$er#/wrk/QumpstartC (nd $oilaTTTT !hanks to (ndrew posted by Brahma at 1:14 PM & comments

Aanic '&ile c&eckin9 devices durin9 a reboot


>roblems and their solutions ) >anic while checking de$ices during a reboot Occasional when booting the ser$er, a message similar to the following ma" appear# 5onfiguring /de$ and /de$ices panicRcpu,S/thread*:&&&,.,9fe&# bad kernel 00U miss at !2 . Ztl Ztpc Ztnpc Ztstate Ztt , &&&&&&&&&,&:/cc- &&&&&&&&&,&:/cc9 --9&&&,L&/ &L9 Zccr# -- Zasi# 9& Zcwp# / Zpstate# ,LM>8<,>RI?,I8K . &&&&&&&&&,&&E,f& &&&&&&&&&,&&E,f- %,9&&&,/&L &L9 Zccr# %, Zasi# 9& Zcwp# L Zpstate# ,/M>8<,>RI?,(GK Zg&4:# &&&&&&&&&&&&&&&& &&&&&&&&&&&&&&&. &&&&&&&&EE,%L%&& &&&&&&&&EE,%L%&& Zg-4E# &&&&&&&&&&&&&&&& &&&&&&&&&&&&&&&. &&&&&&&&&,-&a-c& &&&&&&&&&&&&&&L9 Register window L, caller kmemHcacheHalloc6LZo&4:# &&&&&:&&&&&&bb99 &&&&&.a,&&.cL&&& &&&&&&&&&&&&&&:, &&&&&&&&&&&&&&&& Zo-4E# &&&&&&&&&&&&&.a, &&&&&&&&E9&-f%L& &&&&&.a,&&.cE/&, &&&&&&&&&,&ac/.& Zl&4:# &&&&&&&&&,&:/cc- &&&&&&&&&,&:/cc9 &&&&&&--9&&&,L&/ &&&&&&&&&,&.bf/Zl-4E# &&&&&:&&&&&&bd:& &&&&&:&&&&&&bd/9 &&&&&&&&&&&&&&&& &&&&&.a,&&.cEdb& Zi&4:# &&&&&:&&&&&&b-&9 &&&&&:&&&,.,9fe& &&&&&&&&&&&&&&&& &&&&&&&&&&&&&&&&

!his appears to be caused b" one of the ser$er 5>Us becoming slightl" unseated !he 5>Us are secured to the motherboard b" screws which are tightened using the tor'ue screwdri$er pro$ided with each ser$er !he 5>U retaining screws in e$er" ser$er we ha$e put into ser$ice so far ha$e been far looser than the" should be leading to this problem occurring !he screws ha$e now been tightened but should this problem occur, the first thing to tr" is re4tightening the screws !he screwdri$er can be found to the front of the ser$er when the co$er is remo$ed =itBs bright green and is hard to miss@ and instructions for tightening the screws are attached to the top of the 5>Us posted by Brahma at 1:13 PM & comments

,ike?s 9oodies

more R8(D08 !his shar archi$e contains all the C(uto (dminC files which originated on the 7>4U1 s"stems running 7>4U1 % &, in the Department of 5hemistr" at the Uni$ersit" of !oronto 8xcept for C2ocalstuffC, these files are now being used on our SGI IRI1 / 1 and L 1 s"stems, SunOS - , 1 s"stems, Solaris . 1 s"stems, on 2inux Red 7at / 1, and on <reeBSD : 1 Unfortunatel", I donBt ha$e a newer 7> s"stem to check that these scripts still work properl" on 7>4U1 !he Bautoadmin texB file contains the text of the talk I ga$e at the InterWorks 5onference in Orlando =0a" ,%%-@, but does not completel" describe all the C(uto (dminC files in this archi$e, or all their features, since the files here are m" latest $ersions 2ook o$er the files 5(R8<U22N before using them on "our s"stem !he Binstallhp outB file is located in B/usr/local/docB on m" s"stems !he rest of the files are in B/usr/local/binB on m" s"stems Nou will also need to create a soft link in B/usr/local/binB# ln 4s <indHsetuid <indHlinks !he crontab entries used to run these commands are# F F General checks F F&,,/,:&,-/ ) ) ) ) /bin/csh 4c /usr/local/bin/7ourl"stuff K/de$/null .KV, && ) ) ) ) /bin/csh 4c /usr/local/bin/7ourl"stuff K/de$/null .KV, F F (ccounting and clean up F F Do cpu accounting and other stuff at L#,/ (0 e$er" da" ,/ L ) ) ) /bin/csh 4c /usr/local/bin/Dail"stuff K/de$/null .KV, F Do disk accounting and other stuff at ,.#:& (0 e$er" Sunda" :& & ) ) & /bin/csh 4c /usr/local/bin/Weekl"stuff K/de$/null .KV, F Do cpu accounting and other stuff at L#-/ (0 e$er" month -/ L , ) ) /bin/csh 4c /usr/local/bin/0onthl"stuff K/de$/null .KV, F Do !eststuff 4 acti$ate when needed F&&,&/,,&,,/,.&,./,:&,:/,-&,-/,/&,// 94,L ) ) ) /bin/csh 4c /home/mikep/bin/!eststuff K/de$/null .KV, and should be installed b" root with Bcrontab 4l K/tmp/rootB, edit C/tmp/rootC, Bcrontab 4rB, Bcrontab /tmp/rootB I ha$e included Binstallhp outB which contains the 7>4U1 s"stem

install/update steps that are carried out manuall"W some of these could probabl" be added to the B2ocalstuffB gi$en some effort IBd like to hear about other steps which "ou automate Nou might also want to check out the following UR2 for some other information on automating $arious aspects of s"stem administration# http#//www oac uci edu/support/ddcs/automation/ posted by Brahma at 1:13 PM & comments

Friday, September 02, 2005


%ccessin9 metadevices '&en bootin9 from #56*,
!his does assume that the s"stem isnBt using DiskSuite or ?eritas, howe$er 4 if the s"stem is mirrored, thatBll ha$e to be undoneR,S before rebooting after editing an"thing, otherwise I recall thereBs the risk of files"stem corruption R,S*<or DiskSuite, an o$er$iew is at # http#//unixwa" com/$m/disksuit e/bootcdrom html Or, as itBs Solaris %, he could Qust load the DiskSuite dri$er # http#//sunportal sunmanagers o rg/pipermail/summaries/.&&/4Pu l"/&&LLL, SU00(RN# (ccessing metade$ices when booting from 5DRO0A Gu" D d"Et at "ahoo com Sun Pul .- ,L#.9#,. 8D! .&&/ ) >re$ious message# SU00(RN# >atch cluster breaking ssh ) ;ext message# SU00(RN# Replacing ;IS sla$e ser$er and automount problem ) 0essages sorted b"# R date S R thread S R subQect S R author S !hanks to e$er"one who responded# CSanthakumar, Si$aC MSi$a Santhakumar at na$itaire comK CSandwich 0akerC Madh at an bradford ma usK C!homas 0 >a"erleC Mpa"erle at ph"sics umd eduK C>etri UallbergC M>etri Uallberg at Sun 5O0K !he definiti$e answer came from >etri who =probabl" because of where he works@ pointed me to a Sun document that gi$es step4b"4step directions on performing this procedure It is Document ID# E/.,& =SolarisR!0S ?olume 0anager Software and Solstice DiskSuiteR!0S Software# 0ounting

0etade$ices@ I am not sure if "ou need to ha$e a Sun support contract to read it =tr" searching at sunsol$e sun com for the document ID @ I will Qust cop" it here for an"one who is interested# 444444444444444444444444444444444444444444444444444 >roblem Statement# !op 7ow can "ou access data which is located on a mirrored, R(ID/, or a concatenated metade$ice when the s"stem is booted from a 5D4RO0 into a single user modeA =<or example, reset the root password on a mirrored root partition @ Resolution# !op ,@ Boot to single user mode using SolarisR!0S % O8 ,/. 5DRO0 =or D?D@ ok boot cdrom 4s .@ <ind the SolarisR!0S ?olume 0anager md dri$er and unload it F modinfo I grep md :9 ,,d,E&: ff% 4 , md/ =0D/ 0essage Digest (lgorithm@ ,,: ,.f,b&. ,ecf E& , ramdisk =ramdisk dri$er $, ,/@ ,.E E&/c.&&& .:E/a 9/ , md =Solaris ?olume 0anager base mod@ F modunload 4i ,.E <or Solaris % Operating S"stem =Solaris OS@ metade$ices# :@ 0ount one of the sub4mirrors of "our root metade$ice as read4onl" to get a cop" of metadb configuration information ;O!8# NouBll need to mount a regular disk de$ice for this step F mount 4r /de$/dsk/c&t&d&s& /a F cp /a/kernel/dr$/md conf /kernel/dr$/md conf F umount /a

<or pre4Solaris % OS metade$ices# :@ Before Solaris % OS, information about metadbBs was stored in the /etc/s"stem file instead of in /kernel/dr$/md conf and the format used was slightl" different 0ount one of the sub4mirrors of "our root metade$ice as read4onl" to get a cop" of metadb configuration information ;O!8# NouBll need to mount a regular disk de$ice for this step F mount 4r /de$/dsk/c&t&d&s& /a F cp /a/etc/s"stem /tmp/s"stem F umount /a <ind metadb information from /tmp/s"stem, for example# ) Begin 0DD database info =do not edit@ set md#mddbHbootlist,*Csd#E#,L sd#E#,&/& sd#E#.&9- sd#,/#,L sd#,/#,&/&C set md#mddbHbootlist.*Csd#,/#.&9-C ) 8nd 0DD database info =do not edit@ !his information can be con$erted into a format that Solaris % OS understands simpl" b" adding C#id&C after each metadb identifier !hese lines are then added to the end of /kernel/dr$/md conf !he pre$ious example would then look like the following# mddbHbootlist,*Csd#E#,L#id& sd#E#,&/&#id& sd#E#.&9-#id& sd#,/#,L#id& sd#,/#,&/&#id&CW mddbHbootlist.*Csd#,/#.&9-#id&CW ;O!8# Remember to add CWC at the end of each line TTT -@ 2oad the Solaris ?olume 0anager md dri$er and s"nchroni+e meta de$ices

F modload /kernel/dr$/md F metas"nc 4r /@ R8(DN TT ;ow "ouBre able to use "our existing metade$ices as usual !o $iew "our metade$ice configuration and status, use the metastat command F metastat 444444444444444444444444444444444444444444444444444 OU, I did not actuall" tr" this, but it looks like it should work It still seems like wa" too much work to me that I need to add a bunch of lines in cr"ptic format to /kernel/dr$/md conf Qust so it can figure out where the metade$ice database replicates are located 2et me add one last stor" to this drama 8arlier, I booted the s"stem using a Solaris % install 5D But, I forgot to boot the s"stem with Cboot cdrom 4sC and Qust used Cboot cdromC So, the s"stem booted off the 5D and started running the processes for installing a new OS =asking me what language I want to use, etc @ I was using a graphics terminal, so I Qust ignored that and opened another xterm window I was astonished to see =after a unknown amount of time@ that when I entered CmetadbC and CmetastatC that I was able to see all of m" existing metade$ice databases and metade$icesT But, after another period of time, I was notT I figured that the Solaris installer must be smart enough to probe for old metade$ices and would probabl" offer me the option to retain them if I continuted to install the OS One person assumed that I had a R(ID4, root files"stem, and suggested that I boot from 5D, mount /de$/dsk/c1d1t1s1 =directl" specif"ing a known, good root partition slice@, then change the /etc/$fstab file on that slice to indicate the root files"stem should be mounted from /de$/dsk/c1d1t1s1 rather than /de$/md/dsk/d11, then reboot into that slice @ !wo people pointed out that the default metadb si+e became larger starting in Solaris % and were worried

that might be causing the trouble But, this turned out not to be a factor !hanks again for e$er"oneBs help 0" original 'uestion is below# 444 CGu" D C Md"Et at "ahoo comK wrote# K 7ello, K K I ha$e a Solaris 9 s"stem with se$eral R(ID & and K R(ID K , files"stems created with Solstice Disk Suite =SDS@ K K ;ow, I belie$e that SDS was incorporated into K Solaris K % V ,& =and renamed to Solaris ?olume 0anager @ I K was K wondering how I could access m" R(ID files"stems if KI K lost the root files"stem and had to boot from 5D K K !he Solaris 9 5D does not support SDS =it was an K optional package @ But, I thought if I used a K Solaris K % or Solaris ,& install 5D, I would be able to K configure them to be able to access the SDS K metade$ices K K But, when I finall" tried it, I was not successful K It seemed to me that I should ha$e Qust needed to K use K Cmetadb 4a Mslices containing metadb replicatesKC K (n" ad$ice for what I need to doA I know where all K the metadb replicates are located K K I would think this would be a fairl" common task K =reco$ing data from metade$ices if the root K fils"stem K failes@ but I ha$e not been able to find an" K answers K K !hanks, K Doug

posted by Brahma at 2:57 PM & comments

capture important information about processes


!his simple ad hoc script could help to capture important information about processes, but could also be easil" modified to do additional things 44 such as start the process if it isnBt running or log the number of such processes that are running at each check inter$al !he complete script appears below for eas" cutting and pasting MpreK FT/bin/bash F watch>roc# monitor a process and log start and stop times sleepInter$al*L& logDir*/$ar/tmp F 4444 is proc name suppliedA 4444 if R CY,C * CC SW then echo 4n CwatchAK C read proc;ame else proc;ame*Y, fi F 4444 determine if process=es@ are running at in$ocation 4444 pre$Status*`pgrep Yproc;ame I wc 4l I awk B[print Y,]B` dt*`date` F 4444 if proc not currentl" running, ask user to confirm monitoring 4444 if R CYpre$StatusC * & SW then "n*`ck"orn 4p CYproc;ame is not running now 44 monitor an"wa"AC 4d "` case Y"n in RN"S)@ echo CYdt# starting monitor task for Yproc;ameC I tee 4a YlogDir/Yproc;ame log echo CYdt# Yproc;ame is downC I tee 4a YlogDir/Yproc;ame log WW R;nS)@ echo ok exit WW ) echo exiting exit WW esac else echo CYdt# starting monitor task for Yproc;ameC I tee 4a YlogDir/Yproc;ame log echo CYdt# Yproc;ame is runningC I tee 4a YlogDir/Yproc;ame log fi F 4444 continue monitoring at configured inter$al 4444 while true do dt*`date` newStatus*`pgrep Yproc;ame I wc 4l I awk B[print Y,]B` if R YnewStatus T* Ypre$Status SW then case YnewStatus in &@ echo CYdt# Yproc;ame is downC KK YlogDir/Yproc;ame log WW ) echo CYdt# Yproc;ame is runningC KK YlogDir/Yproc;ame log WW esac pre$Status*YnewStatus fi sleep YsleepInter$al done M/preK posted by Brahma at 2:57 PM & comments

<ssue 'it& /oin command

Re# Issue with Qoin command >osted B" Don Rowland On Saturda", (ugust ,:, .&&/ at 9#,, >0 (mit S !r" this# file, contents# file, 4 line, file, 4 line. file, 4 line: file, 4 linefile. contents# file. 4 line, file. 4 line. file. 4 line: file. 4 lineShell script append# FT /bin/ksh F FF append line from file. to end of line from file, F awk B[ <RO;! * Y& getline B(5U M Cfile.C print <RO;! B(5U ]B file, Output# /append file, 4 line,file. 4 line, file, 4 line.file. 4 line. file, 4 line:file. 4 line: file, 4 line-file. 4 line;o space between <RO;! and B(5U Don posted by Brahma at 2:54 PM & comments

%pplication Server cras&

>roblem 0ustGather for problems with a WebSphere (pplication Ser$er crash on the Solaris platform Gathering this information before calling IB0 support will help familiari+e "ou with the troubleshooting process and sa$e "ou time Solution !his document lists what is needed to begin troubleshooting an (pplication Ser$er crash on Sun 0icros"stems Solaris platform If "ou ha$e alread" contacted support, continue on to the componentBs specific 0ustGather information Otherwise, click# 0ustGather# Read first for all WebSphere (pplication Ser$er products 5rash on Solaris specific 0ustGather information , Important# Before executing an" of the following instructions, please make a backup cop" of the core file >erform the following for each core file =the core file will be in the working director", which is /opt/WebSphere/(ppSer$er/bin b" default@ . If running Solaris 9 or abo$e,enter the following from a command4line# /usr/proc/bin/pstack RcoreSKpstack out /usr/proc/bin/pmap RcoreSKpmap out /usr/proc/bin/pldd RcoreSKpldd out where# RcoreS is the name of the core file pstack out is changed for each core file pmap out is changed for each core file pldd out is changed for each core file : If not running Solaris 9 or abo$e and dbx is installed on the Solaris machine, enter the following from a command4line# /dbxtraceHsun sh RexecutableS RcoreSKdbxtrace out where# RexecutableS is opt/WebSphere/(ppSer$er/Qa$a/bin/sparc/nati$eHthreads/Qa$a RcoreS is the name of the core file dbxtrace out is changed for each core file

- If not running Solaris 9 or abo$e and gdb is installed on the Solaris machine, enter the following from a command4line# /gdbtrace sh RexecutableS RcoreSKgdbtrace out where# RexecutableS is opt/WebSphere/(ppSer$er/Qa$a/bin/sparc/nati$eHthreads/Qa$a RcoreS is the name of the core file gdbtrace out is changed for each core file / In addition to the preceding information, capture the following# ) <or ?L & release# o (ll files in MinstallHrootK/profiles/M>rofile;ameK/logs/MSer$er;ameK director" o ( cop" of ser$er xml located in MinstallHrootK/profiles/M>rofile;ameK/config/cells/M5ell;ameK/nodes/M;ode;ameK/ser $ers/MSer$er;ameKdirector ) <or ?/ & and ?/ , releases# o Include all of the files from the MinstallHrootK/logs/MSer$er;ameKdirector" o ( cop" of ser$er xml located at MinstallHrootK/config/cells/M5ell;ameK/nodes/Mnode;ameK/ser$ers/MSer$er;ameK director" ) <or ?: / and ?- & releases# o Include all of the files from the MinstallHrootK/logs director" o ( cop" of 1028xport for the ser$er configuration ) en$ K en$ out ) ulimit 4a K ulimit out ) uname 4a K uname out ) showre$ 4p K showre$ out ) pkginfo 4l K pkginfo out ) /$ar/adm/messages ) (ll hsHerrHpid) log files ) ;ote# <or all $ersions, If "ou ha$e configured the (pplication Ser$er to write logs into a different location, send them accordingl" L <ollow instructions tosend diagnostic information to IB0 support <or a listing of all technotes, downloads, and educational materials specific to the 5rash component, search the WebSphere (pplication Ser$er support site

Related information !en Steps to Getting Support posted by Brahma at 2:54 PM & comments

Solaris application cras&es


When a Solaris application crashes, it usuall" produces a core file, which is a disk cop" of the applicationBs memor" at the time of the crash One wa" to generate a traceback is to use a debugger such as dbx with the core file# Z dbx /path/executable core =dbx@ where K traceback t 3,:# ( UD8 application crashed and I want to file a bug report at http#//bugs kde org, but the backtrace in the UD8 5rash 0anager is CuselessC What can I doA (,: DrUon'i !o get backtraces from crashing applications on Solaris "ou need to run them in gdb or use Dtrace =Solaris ,&@ (dditionall" most of the Solaris binar" packages are not compiled with debugging information enabled, so "ou will probabl" ha$e to recompile them first# 4 !o enable debugging support in a UD8 port, build it with W(;!HUD8HD8BUG defined Nou can set it on the commandline =example# make 4DW(;!HUD8HD8BUG VV make install or put it into /etc/make conf =W(;!HUD8HD8BUG*N8S ( similar switch exists for enabling debugging s"mbols in 3!# W(;!H3!HD8BUG ;ote that those switches O;2N work in the ports of the main UD8 module ports like kdebase, kdemultimedia, arts, etc !he" will not work in ports of :rd part" UD8 apps like for example kmldonke" or kbear 4 !o run an application in gdb, do# gdb /path/to/application !his will gi$e "ou a prompt# =gdb@ Nou can run the program now b" t"ping run# =gdb@ run !hen "ou make the program crash Nou will be returned to the prompt !"pe bt# =gdb@ bt and "ou will get the backtrace "ou want Some UD8 applications spawn a new process after being launched and thus donBt sta" under gdbBs control 4 an example for such an application is kmail !o debug

those, "ou need to t"pe =gdb@ set args 44nofork prior to run on the gdb prompt posted by Brahma at 2:53 PM & comments

Solaris 2U< not displayin9


Solaris GUI not displa"ing 7i IBm a newbie to Solaris so please be gentileTT MgrinK 7a$e a problem getting the UD8 or 5D8 =A@ GUI running

I ha$e a Sun<ire ?99& with Solaris % and Oracle ,&G currentl" running !he box and apps were running fine and the GUI displa"ed as well !he Oracle DB( wanted to CtuneC memor" so he made a change to a parameter in the /etc/s"stem file Upon completeing this change he gracefull" shutdown the box =init L@ !he box failed to boot up and the displa" would not show at all, dark screen So we thought it might be a problem in the U?0 and therefore direct connected a Sun monitor to the box !his showed us a command line and the OS complaining about a memor" error I arri$ed on site and initiated a boot from the solaris % cd, mounted the partition and edited the /etc/s"stem file restoring the original parameters Rebooted the box and =it took a 2ooonnnggg while ,&6 minutes@ the OS started, Oracle started, but the 1 ser$er failed So m" customers are happ" that the dB is running but I canBt get 1 to start 7elpTTT !hanks in ad$ance 444Uenn" Uenn", What happens if "ou do the following at the command prompt# /usr/openwin/bin/xinit Do "ou ha$e /usr/openwin/bin as part of "our >(!7 en$ironment $ariableA 0ike

0ike, 7ello, When I enter CxinitC I recei$e the following# 1# s"ntax error at line ,# `=B unexpected /xinit# ser$er error !hanks for helpingT Uenn" Going that route, "ou could tr" entering it into "our >(!7 statement >(!7*Y>(!7#/usr/openwin/bin IB$e recentl" been going thru the same stuff and found that if I entered the following, as long as I was running and configured for B1B, that m" GUI came up Simpl" t"pe /usr/dt/bin/1session V Good luckT, 5hris Barbot Uenn", (re "ou tr"ing to start 1 from the console or a remote machineA If "ou are using a remote machine, are "ou using CtelnetCA If "ouBre on a remote machine make sure "ou do the following# , Before logging into the ser$er, run the following commandW Cxhost Mser$er hostnameKC . (fter logging into the ser$er, run the following commandW Cexport DIS>2(N*Mhostname of "our remote machineKC I run the k4shell so "our s"ntax for F. will be different if "ou use csh or sh !he error that is returned when "ou run xinit is indicati$e of a shell error, not a program error Did "ou run CxinitC or C/usr/openwin/bin/xinitCA Determine if "ou are running the proper CxinitC command b" using, Cwhich xinitC Nou can also use, Cfile /usr/openwin/bin/xinitC to determine if the CxinitC command "ou are calling is shell script or an executable 0ike posted by Brahma at 2:52 PM & comments

&ere command in uni= s&ell script function


here command in unix shell script function 7ello (ll, I use here command to whene$er I need to connect to Oracle through korn shell script sa" e g s'lplus user/passwdJdatabase MM 8O< S8285! ) from tabW 8O< But I am not able to this from function written in korn shell script eg raiseHerror=@ [ FF some code s'lplus user/passwdJdatabase MM 8O< S8285! ) from tabW 8O< FF some code ] While I tr" to run this shell script, it gi$es me s"ntax error# 0essage# s"ntax error at line LL, MM unmatached >lease can an"bod" help me how I can connect to Oracle from unix shell script function !hanks, ;ice osted B" Reggie Bea$ers On 0onda", (ugust .., .&&/ at ,&#/: (0 7i ;ice, !r" it this wa"# echo Bselect ) from tabWB I s'lplus user/passJdb /nolog

Regards, 44 Reggie Bea$ers posted by Brahma at 2:51 PM & comments

M&at e=actly is .rss. from ps and prstat )


What exactl" is CrssC from ps and prstat A Got a 'uick 'uer" 4 what exactl" is the CrssC or resident set si+e of a process, as reported b" CpsC A 0" understanding from the man page is that it is the si+e of the program actuall" in memor", as opposed to itBs si+e in $irtual memor" 7owe$er, this doesnBt seem to be the case If I run a 'uick script to add up the total amount of memor" used b" a BhttpdB process # F ps 4e 4o comm,rss I grep httpd I awk B[sum6*Y.] 8;D [print sum]B ,,:/-9:. So it appears that httpd processes =(pache@ are taking up ,,:/-9:. Uilob"tes, or nearl" ,, Gigab"tes !his is also confirmed b" the output from prstat, which also shows ,,G in the RSS field Which would be a nift" trick, gi$en that the box onl" has -Gb I assume IB$e totall" misunderstood what RSS refers toW if an"one could clarif" this for me, it would be greatl" appreciatedT !hanks, K Which would be a nift" trick, gi$en that the box onl" has -Gb !hanks to shared libraries and fork=@s without subse'uent exec=@s, a significant part of the memor" is shared ( (h, that certainl" explains it !hanks 5ould someone explain what the best method is to obtain the figure IBm after thenA Ideall", IBd like to find out the total amount used b" each process, excluding shared pages, and then how much memor" is shared between them !hese figures could then be added up to show the CrealC amount of memor" used b" the gi$en set of processes

pmap 4x looks like it ma" hold the answer, but IBm still not entirel" clear what I need to look for 2ooking at Rich !eerBs CSolaris S"stems >rogrammingC, it appears that IBd want to add up the amount used b" the stack and heap of each process Is this correct A ! K stack and heap of each process Is this correct A IBm afraid that things are more difficult thanks to cop"4on4write which is in effect after fork=@ !hat means that some of the pages of a stack or heap can still be shared while other pages ha$e alread" been copied (nd there are man" other mappings that re'uire swap space !ake initiali+ed and uninitiali+ed $ariables for example or storage areas that ha$e been allocated through mmap=.@ with 0(>H(;O; added to the flags (ndreas posted by Brahma at 2:49 PM & comments

3=tremely poor net'ork performance after *BA


SubQect# Re# RSun782>S 8xtremel" poor network performance after OB> upgrade=and os reinstal@ It ma" not be the Sun at all If the other end is a 2inux machine, there is a bug in the e,&&& dri$er in the . L kernel distributed with R782- , which causes nice Intel ,&&& mbit cards to perform worse than ,& mbit cards in certain cases with tcp Work around is here# http#//dsd lbl go$/!5>4tuning/linux html !he difference is rather dramatic# F ethtool 4U eth, tso on F iperf 4c ,%. ,L9 % ,& R :S & &4., - sec - EE 0B"tes , 9E 0bits/sec posted by Brahma at 2:48 PM & comments

benc&mark 'it& ?time mkfile Q50, testfile?


7i, we use an old 8-/& =. 1 UltraS>(R54II -&&07+@ with Sun Solaris 9 installed 4 mainl" as fileser$er

!he two internal disk are mirrored with SDS and used for /, /usr, /$ar, /local, /opt (ttached to the 8-/& is a Stor8DG8 (,&&& set up as R(ID/ and used as separate mount point /proQekte I use U<S logging for all disks ( 'uick benchmark with Btime mkfile L/&0 testfileB showed the following results ) R(ID/ de$ice /proQekte Y time mkfile L/&0 testfile real &m:, :,&s user &m& .:&s s"s &m,& E,&s ,/0B/s might be ok for R(ID/ ) mirrored de$ice /local Y time mkfile L/&0 testfile real -m-% -&Es user &m& ,9&s s"s &m,, %-&s !hatBs onl" ^.0B/sT 7ow can I debug the problem furtherA (n" hintsA !hanks, Ralf hi i donBt ha$e an answer, butBs reall" poor here the result of m" old e-/& 4 not mirrored fs as a $alue to compare F time mkfile L/&0 testfile real &m.& :.s user &m& .:s s"s &m,& ::s

and this is the result of a mirrored fs on $99& but the $olume manager is from $eritas real &m,L 9.s user &m& ,:s s"s &m/ EEs best regards hans posted by Brahma at 2:48 PM & comments

#orrect 'ay to find s'ap si+e>usa9e


5orrect wa" to find swap si+e/usage 7ello, Which is the best wa" to find out the total swap space and used swap space on a Solaris machineA !here are . or : options, all are gi$ing different $alues , sar 4r . swap 4l : swap 4s - df 4k swap K ?adi kstat unix#&#$minfo#) Repl" What do "ou mean b" BswapBA !hereBs at least two common definitions depending on which utilit" "ou use K !here are . or : options, all are gi$ing different $alues K , sar 4r K . swap 4l K : swap 4s K - df 4k swap DonBt forget BtopB and B$mstatB Did "ou read the man pages for them and see what $alues the" are displa"ingA !he" seem rather clear to me

IBm actuall" somewhat anno"ed b" what Bdf 4k swapB chooses to displa" =I think it should return nothing@ BdfB is a utilit" to show files"stem information Using it to understand o$erall s"stem swap configuration is not recommended Is it ok if we use the output of swap 4l 4 this gi$es the disk/swapfile usage swap 4s gi$es the swap usage including some portion of ph"sical memor" $mstat gi$es onl" a$ailable swap, not total swap top gi$es . fields # in use V free can we add theseA basicall" some person will Qust ha$e to run a command and cop" the $alues and send them for reporting =as a Z@ 4 so if there is a direct,simple wa" to get the $alues !hanksT R K direct,simple wa" to get the $alues swap 4s I nawk B [ gsub=CkYC,CC,Y%@W gsub=CkYC,CC,Y,,@W used*Y%W total*Y%6Y,,W printf=C?0\n!otal# Z/d 0B\nC,total/,&.-@W printf=CUsed # Z/d 0B C,used/,&.-@W printf=C=ZdZZ@\nC,=used),&&@/total@W 4 7ide 'uoted text 4 4 Show 'uoted text 4 ]B posted by Brahma at 2:47 PM & comments

time and >bin>time


time and /bin/time differ primaril" in that time is built into the 5 shell !herefore, it cannot be used in Bourne shell scripts or in makefiles It also cannot be used if "ou prefer the Bourne shell =sh@ /bin/time is an independent executable file and therefore can be used in an" situation !o get a simple program timing, enter either time or /bin/time, followed b" the command "ou would normall" use to execute the program <or example, to time a program named anal"+e, enter the following command#

Z time anal"+e inputdata outputfile % &u L Es &#:& ,9Z .:6.-k .9/6,-9io L./pf6&w !his indicates that the program spent % & seconds on behalf of the user =user time@, L E seconds on behalf of the s"stem =s"stem time, or time spent executing U;I1 kernel routines on the userBs behalf@, and a total of :& seconds elapsed time 8lapsed time is the wall clock time from the moment "ou enter the command until it terminates, including time spent waiting for other users, I/O time, etc posted by Brahma at 2:46 PM & comments

%vera9e #ommand 6untimes 'it& runtime


:% - ($erage 5ommand Runtimes with runtime runtime !he time command =:% .@ will time a single run of a command 4 but the results can $ar" from run to run !he runtime script runs a command the number of times "ou specif", then a$erages the results <or example# Z runtime 4/ getdata & / outfile wait a while runtime summar" 4 / runs of Z getdata & / outfile =working director" * /users/Qerr"/ src/getdata@ <irst run started at# !hu 0ar ,% &%#::#/9 8S! ,%%. 2ast run finished at# !hu 0ar ,% &%#:L#-, 8S! ,%%. 444444444444444444444444 RU; F )))I;DI?IDU(2 R8SU2!S))) , , &u E -s ,#&L ,.Z &6,&9k &6&io &pf6&w . & .u & 9s &#&/ ,LZ &6,.9k &6&io &pf6&w : & .u , :s &#,, ,:Z &6,,Lk &6&io &pf6&w - & -u . Es &#./ ,.Z &6,&9k &6&io &pf6&w / & %u / %s &#/: ,.Z &6,&9k &6&io &pf6&w (?8R(G8S# & /-u : L.s &#:. &6,,:k &6&io &pf6&w ItBs good for testing different $ersions of a program to find the fastest =or slowestT@ If "ouBre writing a program that will run a lot, sha$ing ,&Z or .&Z off its time can be worth the work

;ote that the command "ou run canBt ha$e an" redirection in itW thatBs because runtime does some redirection of its own Nou can redirect the output of runtime into a log file though, and run the whole mess in the background <or example# Z runtime 4/ getdata & / outfile K runtime out V R,S ,..:: !he summar" will go to the runtime out file posted by Brahma at 2:45 PM & comments

Eno' M&en to Be .nice. to *8&er Users---and M&en Not to


:% % Unow When to Be CniceC to O!her Users and When ;ot to nice !he nice command modifies the scheduling priorit" of time4sharing processes =for BSD and pre4? - releases of S"stem ?, all processes@ !he G;U $ersion is on the 5D4RO0 =the discBs install s"stem will onl" install nice if "our s"stem has the appropriate facilities@ If "ouBre not familiar with U;I1, "ou will find its definition of priorit" confusing 4 itBs the opposite of what "ou would expect ( process with a high nice number runs at low priorit", getting relati$el" little of the processorBs attentionW similarl", Qobs with a low nice number run at high priorit" !his is wh" the nice number is usuall" called niceness# a Qob with a lot of niceness is $er" kind to the other users of "our s"stem =i e , it runs at low priorit"@, while a Qob with little niceness will hog the 5>U !he term CnicenessC is awkward, like the priorit" s"stem itself Unfortunatel", itBs the onl" term that is both accurate =nice numbers are used to compute priorities but are not the priorities themsel$es@ and a$oids horrible circumlocutions =Cincreasing the priorit" means lowering the priorit" C@ 0an" supposedl" experienced users claim that nice has $irtuall" no effect DonBt listen to them (s a general rule, reducing the priorit" of an I/O4bound Qob =a Qob thatBs waiting for I/O a lot of the time@ wonBt change things $er" much !he s"stem rewards Qobs that spend most of their time waiting for I/O b" increasing their priorit" But reducing the priorit" of a 5>U4bound process can ha$e a significant effect 5ompilations, batch t"pesetting programs =troff, !e1, etc @, applications that do a lot of math, and similar programs are good candidates for nice On a moderatel" loaded s"stem, I ha$e found that nice t"picall" makes a 5>U4intensi$e Qob roughl" :& percent slower and conse'uentl" frees that much time for higher priorit" Qobs Nou can

often significantl" impro$e ke"board response b" running 5>U4intensi$e Qobs at low priorit" ;ote that S"stem ? Release - has a much more complex priorit" s"stem, including real4time priorities >riorities are managed with the priocntl command !he older nice command is a$ailable for compatibilit" Other U;I1 implementations =including 7> and 5oncurrent@ support real4time scheduling !hese implementations ha$e their own tools for managing the scheduler !he nice command sets a QobBs niceness, which is used to compute its priorit" It ma" be one of the most non4uniform commands in the uni$erse !here are four $ersions, each slightl" different from the others BSD U;I1 has one nice that is built into the 5 shell, and another standalone $ersion can be used b" other shells S"stem ? also has one nice that is built into the 5 shell and a separate standalone $ersion Under BSD U;I1, "ou must also know about the renice=9@ command =:% ,,@W this lets "ou change the niceness of a Qob after it is running Under S"stem ?, "ou canBt modif" a QobBs niceness once it has started, so there is no e'ui$alent ;O!8# !hink carefull" before "ou nice an interacti$e Qob like a text editor See article :% ,& WeBll tackle the different $ariations of nice in order :% % , BSD 5 Shell nice Under BSD U;I1, nice numbers run from 4.& to .& !he 4.& designation corresponds to the highest priorit"W .& corresponds to the lowest B" default, U;I1 assigns the nice number & to user4executed Qobs !he lowest nice numbers =4.& to 4,E@ are unofficiall" reser$ed for s"stem processes (ssigning a userBs Qob to these nice numbers can cause problems Users can alwa"s re'uest a higher nice number =i e , a lower priorit"@ for their Qobs Onl" the superuser =, .-@ can raise a QobBs priorit" !o submit a Qob at a greater niceness, precede it with the modifier nice <or example, the command# Z nice awk 4f proc awk datafile K awk out runs an awk command at low priorit" B" default, csh $ersion of nice will submit this Qob with a nice le$el of - !o submit a Qob with an arbitrar" nice number, use nice one of these wa"s#

Z nice 6n command Z nice 4n command where n is an integer between & and .& !he 6n designation re'uests a positi$e nice number =low priorit"@W 4n re'uest a negati$e nice number Onl" a superuser ma" re'uest a negati$e nice number :% % . BSD Standalone nice !he standalone $ersion of nice differs from 5 shell nice in that it is a separate program, not a command built in to the 5 shell Nou can therefore use the standalone $ersion in an" situation# within makefiles =.9 ,:@, when "ou are running the Bourne shell, etc !he principles are the same nice numbers run from 4.& to .&, with the default being +ero Onl" the s"ntax has been changed to confuse "ou <or the standalone $ersion, 4n re'uests a positi$e nice number =lower priorit"@ and 44n re'uests a negati$e nice number =higher priorit"4superuser onl"@ 5onsider these commands# Y nice 4L awk 4f proc awk datafile K awk out F nice 44L awk 4f proc awk datafile K awk out !he first command runs awk with a high nice number =i e , L@ !he second command, which can be issued onl" b" a superuser, runs awk with a low nice number =i e , 4L@ If no le$el is specified, the default argument is 4,& :% % : S"stem ? 5 Shell nice S"stem ? takes a slightl" different $iew of nice numbers nice le$els run from & to :%W the default is .& !he numbers are different but their meanings are the same# :% corresponds to the lowest possible priorit", and & is the highest ( few S"stem ? implementations support real4time submission $ia nice Pobs submitted b" root with extremel" low nice numbers =4.& or below@ allegedl" get all of the 5>UBs time S"stems on which this works properl" are $er" rare and usuall" ad$ertise support for real4time processing In an" case, running Qobs this wa" will destro" multiuser performance !his feature is completel" different from real4time priorities in S"stem ? Release With these exceptions, the 5 shell $ersion of nice is the same as its BSD cousin !o submit a Qob at a low priorit", use the command# Z nice command !his increases the commandBs niceness b" the default amount =-, the same as BSD U;I1@W command will run at nice le$el .- !o run a Qob at an arbitrar" priorit", use one of the following commands#

Z nice 6n command Z nice 4n command where n is an integer between & and ,% !he 6n entr" re'uests a higher nice le$el =a decreased priorit"@, while 4n re'uests a lower nice le$el =a higher priorit"@ (gain, this is similar to BSD U;I1, with one important difference# n is now relati$e to the default nice le$el !hat is, the command# Z nice 6L awk 4f proc awk datafile K awk out runs awk at nice le$el .L :% % - S"stem ? Standalone nice Once again, the standalone $ersion of nice is useful if "ou are writing makefiles or shell scripts or if "ou use the Bourne shell as "our interacti$e shell It is similar to the 5 shell $ersion, with these differences# ) With no arguments, standalone nice increases the nice number b" ,& instead of b" -W this is a significantl" greater reduction in the programBs priorit" ) With the argument 4n, nice increases the nice number b" n =reducing priorit"@ ) With the argument 4 4n, nice decreases the nice number b" n =increasing priorit"W superuser onl"@ 5onsider these commands# Y nice 4L awk 4f proc awk datafile K awk out F nice 44L awk 4f proc awk datafile K awk out !he first command runs awk at a higher nice le$el =i e , .L, which corresponds to a lower priorit"@ !he second command, which can be gi$en onl" b" the superuser, runs awk at a lower nice le$el =i e , ,-@ 4 02 from OBReill" V (ssociatesB S"stem >erformance !uning, 5hapter : :% ,& ( nice Gotcha

;O!8# ItBs ;O! a good idea to nice a foreground Qob =,. ,@ If the s"stem gets bus", "our terminal could Cfree+eC waiting to get enough 5>U time to do something Nou ma" not e$en be able to kill =:9 %@ a niceBd Qob on a $er" bus" s"stem because the 5>U ma" ne$er gi$e the process enough 5>U time to recogni+e the signal waiting for itT (nd, of course, donBt nice an interacti$e program like a text editor unless "ou like to wait #4@ 4 P> posted by Brahma at 2:45 PM & comments

M&at ,akes 7our #omputer Slo') ;o' 5o 7ou Fi= <t)


:% ,. What 0akes Nour 5omputer SlowA 7ow Do Nou <ix ItA (rticle :% / discussed the $arious components that make up a userBs perception of s"stem performance !here is another e'uall" important approach to this issue# the computerBs $iew of performance (ll s"stem performance issues are basicall" resource contention issues In an" computer s"stem, there are three fundamental resources# the 5>U, memor", and the I/O subs"stem =e g , disks and networks@ <rom this standpoint, performance tuning means ensuring that e$er" user gets a fair share of a$ailable resources 8ach resource has its own particular set of problems Resource problems are complicated because all resources interact with one another Nour best approach is to consider carefull" what each s"stem resource does# 5>U, I/O, and memor" !o get "ou started, hereBs a 'uick summar" of each s"stem resource and the problems it can ha$e :% ,. , !he 5>U On an" time4sharing s"stem, e$en single4user time4sharing s"stems =such as U;I1 on a personal computer@, man" programs want to use the 5>U at the same time Under most circumstances the U;I1 kernel is able to allocate the 5>U fairl"W howe$er, each process =or program@ re'uires a certain number of 5>U c"cles to execute and there are onl" so man" c"cles in a da" (t some point the 5>U Qust canBt get all the work done !here are a few wa"s to measure 5>U contention !he simplest is the U;I1 load a$erage, reported b" the BSD uptime =:% E@ command Under S"stem ?, sar 4' pro$ides the same sort of information !he load a$erage tries to measure the number of acti$e processes at an" time =a process is a single stream of instructions@ (s a measure of 5>U

utili+ation, the load a$erage is simplistic, poorl" defined, but far from useless Before "ou blame the 5>U for "our performance problems, think a bit about what we donBt mean b" 5>U contention We donBt mean that the s"stem is short of memor" or that it canBt do I/O fast enough 8ither of these situations can make "our s"stem appear $er" slow But the 5>U ma" be spending most of its time idleW therefore, "ou canBt Qust look at the load a$erage and decide that "ou need a faster processor Nour programs wonBt run a bit faster Before "ou understand "our s"stem, "ou also need to find out what "our memor" and I/O subs"stems are doing Users often point their fingers at the 5>U, but I would be willing to bet that in most situations memor" and I/O are e'uall" =if not more@ to blame Gi$en that "ou are short of 5>U c"cles, "ou ha$e three basic alternati$es# ) Nou can get users to run Qobs at night or at other low4usage times 4suring the computer is doing useful work .- hours a da"@ with batch or at =-& ,@ ) Nou can pre$ent "our s"stem from doing unnecessar" work ) Nou can get users to run their big Qobs at lower priorit" =:% %@ If none of these options is $iable, "ou ma" need to upgrade "our s"stem :% ,. . !he 0emor" Subs"stem 0emor" contention arises when the memor" re'uirements of the acti$e processes exceed the ph"sical memor" a$ailable on the s"stemW at this point, the s"stem is out of memor" !o handle this lack of memor" without crashing the s"stem or killing processes, the s"stem starts paging# mo$ing portions of acti$e processes to disk in order to reclaim ph"sical memor" (t this point, performance decreases dramaticall" >aging is distinguished from swapping, which means mo$ing entire processes to disk and reclaiming their space >aging and swapping indicate that the s"stem canBt pro$ide enough memor" for the processes that are currentl" running, although under some circumstances swapping can be a part of normal housekeeping Under BSD U;I1, tools such as $mstat and pstat show whether the s"stem is pagingW ps can report the memor" re'uirements of each process !he

S"stem ? utilit" sar pro$ides information about $irtuall" all aspects of memor" performance !o pre$ent paging, "ou must either make more memor" a$ailable or decrease the extent to which Qobs compete !o do this, "ou can tune s"stem parameters, which is be"ond the scope of this book =see OBReill" V (ssociatesB S"stem >erformance !uning b" 0ike 2oukides for help@ Nou can also terminate =:9 ,&@ the Qobs with the largest memor" re'uirements If "our s"stem has a lot of memor", the kernelBs memor" re'uirements will be relati$el" smallW the t"pical antagonists are $er" large application programs :% ,. : !he I/O Subs"stem !he I/O subs"stem is a common source of resource contention problems ( finite amount of I/O bandwidth must be shared b" all the programs =including the U;I1 kernel@ that currentl" run !he s"stemBs I/O buses can transfer onl" so man" megab"tes per secondW indi$idual de$ices are e$en more limited 8ach kind of de$ice has its own peculiarities and, therefore, its own problems Unfortunatel", U;I1 has poor tools for anal"+ing the I/O subs"stem Under BSD U;I1, iostat can gi$e "ou information about the transfer rates for each disk dri$eW ps and $mstat can gi$e some information about how man" processes are blocked waiting for I/OW and netstat and nfsstat report $arious network statistics Under S"stem ?, sar can pro$ide $oluminous information about I/O efficienc", and sadp =? -@ can gi$e detailed information about disk access patterns 7owe$er, there is no standard tool to measure the I/O subs"stemBs response to a hea$" load !he disk and network subs"stems are particularl" important to o$erall performance Disk bandwidth issues ha$e two general forms# maximi+ing per4process transfer rates and maximi+ing aggregate transfer rates !he per4process transfer rate is the rate at which a single program can read or write data !he aggregate transfer rate is the maximum total bandwidth that the s"stem can pro$ide to all programs that run ;etwork I/O problems ha$e two basic forms# a network can be o$erloaded or a network can lose data integrit" When a network is o$erloaded, the amount of data that needs to be transferred across the network is greater than the networkBs capacit"W therefore, the actual transfer rate for an" task is relati$el" slow ;etwork load problems can usuall" be sol$ed b" changing the networkBs configuration Integrit" problems occur when the network is fault" and intermittentl" transfers data incorrectl" In order to deli$er correct data to the applications using the network, the network protocols ma" ha$e to transmit each block of data man" times 5onse'uentl", programs using the network will run $er" slowl" !he onl" wa" to sol$e a data integrit" problem

is to isolate the fault" part of the network and replace it :% ,. - User 5ommunities So far we ha$e discussed the different factors that contribute to o$erall s"stem performance But we ha$e ignored one of the most important factors# the users who submit the Qobs In talking about the relationship between users and performance, it is eas" to start seeing users as problems# the creatures who keep "our s"stem from running the wa" it ought to ;othing is further from the truth 5omputers are tools# the" exist to help users do their work and not $ice $ersa 2imitations on memor" re'uirements, file si+e, Qob priorities, etc , are effecti$e onl" when e$er"one cooperates 2ikewise, "ou canBt force people to submit their Qobs to a batch 'ueue =-& L@ 0ost people will cooperate when the" understand a problem and what the" can do to sol$e it 0ost people will resist a solution that is imposed from abo$e, that the" donBt understand, or that seems to get in the wa" of their work !he nature of "our s"stemBs users has a big effect on "our s"stemBs performance We can di$ide users into se$eral classes# ) Users who run a large number of relati$el" small Qobs# for example, users who spend most of their time editing or running U;I1 utilities ) Users who run a small number of relati$el" large Qobs# for example, users who run large simulation programs with huge data files ) Users who run a small number of 5>U4intensi$e Qobs that donBt re'uire a lot of I/O but do re'uire a lot of memor" and 5>U time >rogram de$elopers fall into this categor" 5ompilers tend to be large programs that build large data structures and can be a source of memor" contention problems (ll three groups can cause problems Se$eral do+en users running grep and accessing remote files"stems can be as bad for o$erall performance as a few users accessing gigab"te files 7owe$er, the t"pes of problems these groups cause are not the same <or example, setting up a Cstriped files"stemC will help disk performance for large, I/O4bound

Qobs but wonBt help =and ma" hurt@ users who run man" small Qobs Setting up batch 'ueues will help reduce contention among large Qobs, which can often be run o$ernight, but it wonBt help the s"stem if its problems arise from users t"ping at their text editors and reading their mail 0odern s"stems with network facilities =, ::@ complicate the picture e$en more In addition to knowing what kinds of work users do, "ou also need to know what kind of e'uipment the" use# a standard terminal o$er an RS4.:. line, an 1 terminal o$er 8thernet, or a diskless workstationA !he 1 Window S"stem re'uires a lot of memor" and puts a hea$" load on the network 2ikewise, diskless workstations place a load on the network Similarl", do users access local files or remote files $ia ;<S or R<SA posted by Brahma at 2:44 PM & comments

sed to clean script output


FT/bin/sh F >ublic domain F >ut 5!R240 in Ym and 5!R247 in Yb F 5hange \&,& to \,EE if "ou use D82 for erasing e$al `echo m*0 b*7 I tr B07B B\&,/\&,&B` exec sed Cs/Ym\Y// #x s/RaYbSYb// t xC Y) Nou can also hack the sed script in script tid" to delete some of "our terminalBs escape se'uences =/ 9@W article -, ,, explains how to find these se'uences =( reall" automated script tid" would read "our termcap or terminfo entr" and look for all those escape se'uences in the script file @ 4 P> posted by Brahma at 2:44 PM & comments

,akin9 an %rbitrary@Si+e File for 8estin9


/, ,, 0aking an (rbitrar"4Si+e <ile for !esting

!he "es command =.: -@ outputs text o$er and o$er If "ou need a file of some si+e for testing, make it with "es and head =./ .&@ <or example, to make a file ,&&k =,&.,-&&@ characters long, with ,.,9&& 94character lines =E digits and a newline@, t"pe# Z "es ,.:-/LE I head 4,.9&& K ,&&k4file ;O!8# On some U;I1 s"stems, that command ma" ChangC and need to be killed with 5!R24c 4 because head keeps reading input from the pipe If it hangs on "our s"stem, replace head 4,.9&& with sed ,.9&&' 4 PIU, P> posted by Brahma at 2:43 PM & comments

route in Sun 10
SubQect# SU00(RN# route in Sun ,& !hanks to all those who replied !o make a permanant route one can use the follwing , use file /etc/init d/inets$c OR make a script in /etc/rc. d with the route content like# FT/sbin/sh FSLEstatic4route file F static route table for echo C Setting static routes C route add ,E. ,L , & 4netmask .// .// .// & ,& E & .-& K /de$/console echo C Done with setting static routes C FFDoneT Some people also ha$e suggested /etc/default/inetinit to put the route, but not tested <or second 'uestion, one should use pkgchk 4l 4p /path/to/file Or alternati$el" grep <I28;(08 /$ar/sadm/install/contents posted by Brahma at 2:43 PM & comments

*vervie' of Net'ork Aerformance

O$er$iew of ;etwork >erformance ef 5ongested or 5ollision 4 resend ;etwork has the bankwidth, and so can onl" transmit a certain amount of data ef 8ther;et ,&0bit/sec=,-,-&& packes/sec@ Si+e of , packet 4 L- b"tes =about ,-,-&& packets/sec@ 0aximum packet si+e # ,/,9 b"tes Inter packet gab # % L micro4second :&4-&Z utili+ation because of collision contention ef 2atenc" ;ot important as much as disk 0ust consider that remote s"stem has resources including disk ef ;<S UD> # 5ommon protocol in use, being part of !5>/I> and allows fast network throughput with little o$erhead 2ogical packet si+e # %Ub"tes On ethernet # L ) ,/,9 b"tes (fter collision, ha$e to resend (22 ser$eral ethernet packets ef Slower remote ser$er !he remote ser$er is 5>U bound ef ;etwork 0onitoring !ool nfsstat netstat

snoop ping spra" ping command 7ow to use ping FK ping Send a packet to a host on the network 4s # send one packet per second 7ow to read ping 4s output gh . single S>(R5stations on a 'uiet 8ther;et alwa"s respond with less than , millisecond 8xample of ping FK ping 4s host >I;G host# /L data b"tes L- b"tes from host =, , , ,@# icmpHse'*& timeE ms L- b"tes from host =, , , ,@# icmpHse'*& timeE ms 4444host >I;G Statistics4444 / packets transmitted, / packets recei$ed, &Z packet loss round4trip =ms@ min/a$g/max * ,/./E spra" command 7ow to use spra" FK spra" Send a one4wa" stream of packets to a host Reports 7ow ma" were recei$ed and the transfer R(!8 4c # count=number@ of packets 4d # specifies the dela", in microseconds

Default# % L microsecond 4l # specifies the 2ength=si+e@ of the packet 7ow to read spra" output gh If "ou use 4d option, if there are man" packet dropped the packet, *K 5heck 7ardware such as loose cables or missing termination *K 5heck the possible a congested network *K Use the netstat command to get more information 8xample of spra" FK spra" 4d .& 4c ,&& 4l .&-9 host sending ,&& packets of length .&-9 to host no packets dropped b" host /L& packets/sec, ,,-E/EL b"tes/sec netstat 4i command 7ow to use netstat 4i FK netstat 4i / errs # the number of errors packets # the number of packets colls # the number of collisions ) 5ollision percentage rate * colls/output packets ) ,&& 7ow to read netstat data gh collision percentage K /Z =one s"stem@ *K 5hecking the network interface and cabling gh collision percentage K /Z =all s"stem@ *K !he network is congested

gh errs field has data *K Suspect B(D hardware generating illegal si+ed packets *K 5heck Repeated ;etwork 8xample of netstat FK netstat 4i / input le& output input =!otal@ output packets errs packets errs colls packets errs packets errs colls E,9/: , .E.E& 9 -9:% E./.L , .E%-: 9 -9:% E&&&&E&&&& ,- & & & & ,- & & & & snoop command 7ow to use snoop FK snoop 5apture packets from the network Displa" their contents 8xample of snoop FK snoop host, FK snoop 4o filename host, host. FK snoop 4i filename 4t r I more FK snoop 4i filename 4p%%,,&9 FK snoop 4i filename 4$ 4p,&, FK snoop 4i filename rpc nfs and host, and host. nfsstat 4c command 7ow to use nfsstat 4c FK nfsstat 4c Displa" a summar" of ser$ers and client statistics 5an be used to ID8;!I<N ;<S problems retrans # ;umber of remote procedure calls=R>5s@ that were retransmitted

badxids # ;umber of times that a duplicat acknowledgement was recei$ed for a single ;<S re'uest timeout # ;umber of calls that timed out readlink # ;umber of reads to s"mbolic links 7ow to read nfsstat data gh Z of retrans of calls K /Z # ma"be network problem *K 2ooking for network congestion *K 2ooking for o$erloaded ser$ers *K 5heck ethernet interface gh high badxid, as well as timeout # remote ser$er slow *K Increase the time4out period FK mount host#/home /home rw,soft,timeout*,/ & & gh Z of readlink of the calls K ,&Z # too man" s"mbolic links 8xample of nfsstat FK nfsstat 4c 5lient rpc# calls badcalls retrans badxid timeout wait newcred timers ,:,9/ & 9 & 9 & & /& 5lient nfs# calls badcalls nclget nclcreate ,:,-E & ,:,-E & null getattr setattr root lookup readlink read & &Z E%- LZ ,& &Z & &Z .,-, ,LZ .E.& .,Z L.9: -9Z wrcache write create remo$e rename link s"mlink & &Z /9, -Z :: &Z .% &Z - &Z & &Z & &Z mkdir rmdir readdir statf & &Z & &Z /:% -Z ,: &Z ;etwork Solutions ,st 5onsider adding the >restoser$e ;<S Write accelerator

*K Write Z from nfsstat 4s K ,/Z, consider installing it .nd Subneting *K If "our network is congested, consider subnetting *K !hat is collision rate K /Z, subnetting :rd Install the bridge *K If "our network is congested and ph"sical segmentation is ;O! possible *K Isolate ph"sical segments of a bus" network -st Install the local disk into diskless machines posted by Brahma at 2:42 PM & comments

last lo9in
!he third =preferred@ method is to build or ac'uire a tool that will read and interpret the contents of the wtmpx file and displa" login records along with the "ear in which each login occurred <or example, "ou could locate source code for the last command and modif" it to displa" the "ear along with the other date information (lternatel", "ou could download a cop" of 8d 5ashinBs utxreader c, compile the code on "our s"stem and produce output such as these two entries# user*kendal#fmttime*.&&:&:,E4,::,.,#host*geo lox org#initHid*ts/.pt s/.#de$ice*pts/.#pid*.%,&-#procHt"pe*E#termHstatus*&#exitHstatus*&# user*stingra"#fmttime*.&&:&:,E4,::%,.#host*world std com#initHid*t.&&pt s/-#de$ice*pts/-#pid*.E,&.#procHt"pe*9#termHstatus*&#exitHstatus*&# !he date/time information in these records could benefit from a little reformatting, but itBs fairl" clear !he string C.&&:&:,E4,::,.,C refers to &:/,E/.&&: at ,:#:,#., ;otice that the older records appear first, unlike the last commandBs output which is re$ersed so that the more rele$ant entries appear first !o track down a particular userBs logins using utxreader, "ou would ha$e to pipe the programBs output to a grep command like this# F /utxreader /$ar/adm/wtmpx I grep sbob !o look at his most recent logins, "ou could also pipe the output to tail# F /utxreader /$ar/adm/wtmpx I grep sbob I tail 4:

Source for utxreader c is a$ailable at http#//noserose net/e/code/ (nother option is to build a script in >erl !his could be a $er" trick" process (fter all, information contained in wtmpx records is not stored in string format <ortunatel", howe$er, details on how to read and parse this file using >erl are included in OBReill"Bs C>erl for S"stem (dministrationC =Da$id ; Blank48delman, .&&&@ In fact, a sample chapter from this excellent book =also referred to as Cthe otter bookC@ is a$ailable at this UR2# http#//www oreill" com/catalog/perls"sadm/chapter/ch&% html CStealingC Great >erl 5ode !he sample chapter from the otter book Qust happens to include code for extracting information from the wtmpx file and displa"ing s"stem reboots =look under the heading CStream Read45ountC@ and explains how the unpack command can be used to read and parse wtmpx records Basicall", the script defines a template which it then pro$ides to the unpack command so that each field in a wtmpx record can be extracted and assigned to a separate $ariable I found that the script could be easil" modified to print user logins instead of reboots !o do this, I changed these two lines# if =YutHline e' Cs"stem bootC@[ print Crebooted C scalar localtime=Yt$Hsec@ C\nCW to these# if =YutHuser e' CYusernameC@[ print CYusername C scalar localtime=Yt$Hsec@ C\nCW ;ot much of a challenge, huhA I also added code to prompt for, read and chomp =trim the newline character from@ the username# print CusernameK CW Yusername*MS!DI;KW chomp YusernameW Output from the unmodified sample code looks like this# bosonK /showreboots rebooted !ue (ug ,% .&#:%#.9 .&&: rebooted Sat ;o$ 9 &9#/.#:& .&&: rebooted !hu 0ar ,, ,%#&9#:- .&&- rebooted Wed Dec , ,/#.-#-L .&&- rebooted !hu <eb ,& &/#..#&, .&&/ ;otice that the date includes the "ear

!he showlogins script that I based on this script prompts for a username and displa"s similarl" formatted information# bosonK /showlogins usernameK Qdoe Qdoe Wed (pr .: ,/#.:#&/ .&&: Qdoe Wed (pr .: ,/#.:#., .&&: Qdoe <ri (pr ./ &%#-.#,& .&&: Qdoe <ri (pr ./ ,.#&E#&E .&&: Qdoe <ri (pr ./ ,.#,L#:/ .&&: (gain, notice that the output is not re$ersed but, instead, appears in the order in which the records appear in the /$ar/adm/wtmpx file !his means that the most recent records will appear last !he showlogins script could be modified to look for the username on the command line, making it more amenable for use within other scripts Nou might, for example, want to displa" the most recent login acti$it" in a script that "ou use to disable an account Nou could use lines like these to ensure that a username has been supplied# F $erif" that a username has been pro$ided = & ** YF(RG? @ or die Cusage# Y& usernameCW Yusername*Y(RG?R&SW ;O!8# Since >erl arra"s start with element &, these lines are checking for and using the first and onl" parameter Gi$en this code change, "ou can retrie$e onl" the most recent login like this# bosonK /showlogins sbob I tail 4, sbob !hu Oct .9 &%#.,#.L .&&If "ou take a look at the >erl scripts pro$ided in the sample chapter from the otter book, "ou will probabl" be surprised at how easil" the re'uired data can be extracted from the wtmpx file posted by Brahma at 2:42 PM & comments

,ana9in9 "ibrary Aat&s 'it& crle


0anaging 2ibrar" >aths with crle !o begin with, crle stands for Cconfigure runtime linking en$ironmentC It is a command that allows Solaris s"sadmins to better manage their d"namic linker Specificall", it allows "ou to configure librar" paths so that programs run on a s"stem will ha$e as eas" access to shared librar" files in locations like /usr/local/lib or /opt/lib as the" do to /usr/lib Instead of configuring a 2DH2IBR(RNH>(!7 to gi$e these lib directories $isibilit", "ou run the crle command and augment the load librar" path on a s"stem4wide basis

In other words, the crle command is basicall" the e'ui$alent of updating ld config WhatBs 5onfigured ;owA !o $iew the s"stem librar" path on a Solaris s"stem, "ou can issue the crle command on a line b" itself# F crle Default configuration file =/$ar/ld/ld config@ not found Default 2ibrar" >ath =82<@# /usr/lib =s"stem default@ !rusted Directories =82<@# /usr/lib/secure =s"stem default@ ;otice that, in the absence of an ld config file, a limited librar" search path is established containing onl" /usr/lib for normal usage !his librar" path setting is independent of an" paths "ou ma" ha$e added to "our 2DH2IBR(RNH>(!7 interacti$el" or through settings in "our dot files !he paths shown are the paths that binaries on "our s"stem will use regardless of the 2DH2IBR(RNH>(!7 setting 7ow to 5onfigure ;ew >aths !o add a new path to "our d"namic linker, "ou would use the crle 4l command, but this command o$erwrites the existing path In other words, "ou need to repeat the existing path elements so as not to remo$e them <or example, "ou might t"pe the following command to add /usr/local/lib to what is shown abo$e# M F crle 4l /usr/lib#/usr/local/lib (fterwards, "ou should $erif" the new settings# F crle 5onfiguration file R.S# /$ar/ld/ld config Default 2ibrar" >ath =82<@# /usr/lib#/usr/local/lib !rusted Directories =82<@# /usr/lib/secure =s"stem default@ 5ommand line# crle 4c /$ar/ld/ld config 4l /usr/lib#/usr/local/lib What should "ou do if Nou Break ItA

If "ou t"pe "our crle command carefull", "ou should ha$e an eas" time augmenting "our d"namic loaderBs search path If, on the other hand, "ou break the path 44 for example, b" t"ping crle 4l followed onl" b" the paths "ou intend to add 44 "ou can send "our Solaris s"stem into a $er" troublesome state !he reason is simpleW Qust about e$er" command that "ou t"pe on "our Unix s"stem depends on shared obQect files stored in /usr/lib 44 including commands as benign as ls So, if /usr/lib disappears from "our linkerBs search path, "our abilit" to work wonders on the command line will come to an abrupt end 44 at least until "ou t"pe the command again !he breakage will be illustrated with errors such as this# Y ls ld so ,# ls# fatal# libc so ,# open failed# ;o such file or director" Uilled ;ormal Unix command functionalit" can be restored b" t"ping a second crle command While "ou could also fix the problem for "ourself b" setting "our 2DH2IBR(RNH>(!7 as shown below, this wouldnBt help an"one else who logs into the s"stem 2DH2IBR(RNH>(!7*/lib#/usr/libWexport 2DH2IBR(RNH>(!7 !"ping the crle command with the complete librar" path should fix the problem immediatel" and easil" 44 except when "ou canBt issue it What should "ou do if Nou Break It with sudoA ( second crle wonBt help "ou out of the pit that "ou inad$ertentl" created if "our super powers are be'ueathed through sudo In this case, "ou wonBt be able to reproduce the linkerBs path with a Csudo crleC command because sudo itself depends on /usr/lib Y sudo crle 4l /lib#/usr/lib#/usr/local/lib ld so ,# sudo# fatal# libdl so ,# open failed# ;o such file or director" Uilled In fact, remote access to the box will also fail because telnet, ftp and ssh will tr" to access shared libraries which are no longer in the path Y telnet boson !r"ing ,& ,, ,, /, 5onnected to boson particles org 8scape character is BaSB ld so ,# in telnetd# fatal# libdl so ,# open failed# ;o such file or director" 5onnection closed b" foreign host (nd, while "ou can restore the functionalit" of man" commands b" setting "our 2DH2IBR(RNH>(!7, this wonBt restore remote access 44 and

it wonBt restore "our sudo pri$ileges because sudo, for fairl" ob$ious securit" reasons, doesnBt pa" attention to this en$ironment $ariable While "ou can appeal to a higher authorit" =the gu" who can exercise superuser pri$ilege without using sudo@, thereBs also a workaround that "ou can use to regain "our superuser access without ha$ing to wait for someone with the root password to come to "our rescue !he trick here is to use the 2DH;O5O;<IG en$ironment $ariable to some =an"@ $alue, thus causing the runtime linker to ignore configuration files !his returns "our operational librar" path to the default /usr/lib, thus allowing "our sudo command to perform the repair of the hosed librar" path bashY 2DH;O5O;<IG*trueWexport 2DH;O5O;<IG bashY sudo crle 4l /lib#/usr/lib#/usr/local/lib >assword# Where Did crle 5ome <romA !he crle command had existed in Solaris since Solaris E, but it most familiar to s"stems administrators who need to augment librar" paths when installing applications that install libraries in non4s"stem locations such as /usr/local/lib or /opt/lib Since it established s"stem4wide librar" paths, it is recommended o$er 2DH2IBR(RNH>(!7 settings posted by Brahma at 2:41 PM & comments

&me 8roubles&ootin9
hme !roubleshooting !o examine or set a specific hme interface =hmeF@, specif" it as follows# ndd 4set /de$/hme instance F !o examine parameter $alues, use a ndd 4get command In particular, linkHspeed re$eals whether the interface is operating on ,&0bs or ,&&0bs mode =settings of & and ,, repecti$el"@, and linkHmode re$eals whether it is running at half or full duplex =& and ,, respecti$el"@ ndd 4get /de$/hme linkHspeed ndd 4get /de$/hme linkHmode !o perform a hard set of the linkHspeed and linkHmode parameters for hmeF, se$eral other parameters must be set with the ndd 4set command

In these parameter names, ,& or ,&& refers to linkHspeed, fdx or hdx refers to linkHmode, and autoneg refers to autonegotiation capabilit" !he setting corresponding to the desired mode should be set to C,C and all other parameters should be set to C& C =ad$HautonegHcap*, is the default @ <or example, to set hmeF to ,&&/full duplex# ndd 4set /de$/hme instance F ndd 4set /de$/hme ad$H,&&!-Hcap & ndd 4set /de$/hme ad$H,&&fdxHcap , ndd 4set /de$/hme ad$H,&&hdxHcap & ndd 4set /de$/hme ad$H,&fdxHcap & ndd 4set /de$/hme ad$H,&hdxHcap & ndd 4set /de$/hme ad$HautonegHcap & ndd 4set commands can be used in the /etc/rc. d/SL%inet initiali+ation script to set the interface mode during boot rather than allowing autonegotiation !his can be useful if one of the interfaces is connected to an older switch that is not autonegotiating the line speed or mode correctl" !he line speed and mode can also be set for all hme interfaces on the s"stem b" setting the following in the /etc/s"stem file and rebooting =;ote# !he following are SunBs official recommendations It ma" not be necessar" to set e$er" parameter to either & or ,, but it is easiest to get support when following instructions to the letter @# ) ,&& 0b, full duplex# set hme#hmeHad$HautonegHcap*& set hme#hmeHad$H,&&fdxHcap*, ) ,&& 0b, half duplex# set hme#hmeHad$HautonegHcap*& set hme#hmeHad$H,&&fdxHcap*& set hme#hmeHad$H,&&hdxHcap*, ) ,& 0b, full duplex# set hme#hmeHad$HautonegHcap*& set hme#hmeHad$H,&&fdxHcap*& set hme#hmeHad$H,&&hdxHcap*& set hme#hmeHad$H,&fdxHcap*, set hme#hmeHad$H,&hdxHcap*& ) ,& 0b, half duplex#

set hme#hmeHad$HautonegHcap*& set hme#hmeHad$H,&&fdxHcap*& set hme#hmeHad$H,&&hdxHcap*& set hme#hmeHad$H,&fdxHcap*& set hme#hmeHad$H,&hdxHcap*, 7ardware !esting One elementar" test for the ethernet hardware is to in$oke the watch4net4all command from the okK >RO0 monitor prompt !his performs some simple diagnostics and listens on the ethernet port Since this is at a much lower le$el than the dri$er le$el, it can be used to distinguish between hardware and software problems Debug 0ode !he hme, 'fe and be ethernet dri$ers can be switched into debug mode !his can be done in the /etc/s"stem file b" adding# set hme#hmedebug*, (lternati$el", this can be done on a li$e s"stem using adb# adb 4kw /de$/ks"ms /de$/mem hmedebug/D =to displa" current $alue@ hmedebug/W , =be careful to use uppercase CWC@ Debug mode permits the dri$er to displa" messages to the console Some of the messages are informational, others are error messages When examining the messages, remember that "ou are seeing one s"stemBs $iew of the network, and that this bias needs to be taken into account posted by Brahma at 2:40 PM & comments

net'ork card
!hanks each and e$er" who send me suggestions I got this suggestion from 0r 1u Ning which sol$ed m" problem Nou need to make sure that "ou ha$e correct netmask If the other ser$ers ha$e broadcast of ,& .&& ,E .// Nour netmask should be .// .// .// & =ffffff&&@ Nou could change both netmask and broadcast from command line# Ifconfig eri, netmask .// .// .// & broadcast 6 up posted by Brahma at 2:40 PM & comments

A%8#; 3(<8 #*53S


K DonBt know how current this is, but hereBs the list I sa$ed K =m" notes sa" I;<ODO5 ID# ,E%E:, but IBm not sure@# K >(!57 81I! 5OD8S, taken from an installpatch script with the date of# K F J=F@ installpatch L % %9/,&/&% S0I K F 8xit 5odes# K F & ;o error K F , Usage error K F . (ttempt to appl" a patch thatBs alread" been applied K F : 8ffecti$e UID is not root K F - (ttempt to sa$e original files failed K F / pkgadd failed K F L >atch is obsoleted K F E In$alid package director" K F 9 (ttempting to patch a package that is not installed K F % 5annot access /usr/sbin/pkgadd =client problem@ K F ,& >ackage $alidation errors K F ,, 8rror adding patch to root template K F ,. >atch script terminated due to signal K F ,: S"mbolic link included in patch K F ,- ;O! US8D K F ,/ !he prepatch script had a return code other than & K F ,L !he postpatch script had a return code other than & K F ,E 0ismatch of the 4d option between a K pre$ious patch F install and the current one K F ,9 ;ot enough space in the file s"stems that are targets F of the K patch K F ,% YSO<!I;<O/I;S!HR828(S8 file not found K F .& ( direct instance patch was re'uired but not found K F ., !he re'uired patches ha$e not been installed on the manager K F .. ( progressi$e instance patch was re'uired but not found K F .: ( restricted patch is alread" applied to the package K F .- (n incompatible patch is applied K F ./ ( re'uired patch is not applied K F .L !he user specified backout data canBt be found K F .E !he relati$e director" supplied canBt be found K F .9 ( pkginfo file is corrupt or missing K F .% Bad patch ID format K F :& Dr"run failure=s@ K F :, >ath gi$en for 45 option is in$alid K F :. 0ust be running Solaris . L or greater

K F :: Bad formatted patch file or patch file not found K F :- !he appropriate kernel Qumbo patch needs to be installed posted by Brahma at 2:39 PM & comments

,ountin9 8ape drive


R8# 0ounting !ape dri$e >osted B" chris barbot On Wednesda", (ugust :,, .&&/ at -#-E >0 ;etBackup does allow "ou to multi4thread "our backup sessions so that "ou can ha$e multiple streams from multiple ser$ers writing to that tape de$ice at the same time W/out the software, IBm not sure how "ou can go about doing that IBd ha$e a hard time belie$ing that ;B is the onl" one that can do this though posted by Brahma at 2:38 PM & comments

Mednesday, %u9ust 1L, 2005


<ssue 'it& /oin command
Re# Issue with Qoin command !r" this# file, contents# file, 4 line, file, 4 line. file, 4 line: file, 4 linefile. contents# file. 4 line, file. 4 line. file. 4 line: file. 4 lineShell script append# FT /bin/ksh F FF append line from file. to end of line from file, F

awk B[ <RO;! * Y& getline B(5U M Cfile.C print <RO;! B(5U ]B file, Output# /append file, 4 line,file. 4 line, file, 4 line.file. 4 line. file, 4 line:file. 4 line: file, 4 line-file. 4 line;o space between <RO;! and B(5U Don posted by Brahma at 1:03 PM , comments

,issin9 libraries '&en compilin9 'it& 9cc


0issing libraries when compiling with gcc IBm stumped on this one, and canBt seem to =easil"@ find an" solutions !here are times when I tr" to compile open source packages which reference librar"s such as 4lnet 4lgd etc In the most recent case, 4lsnmp I ha$e crle set to properl" access all of m" librar" directories, and ha$e e$en tried to force gcc to look at specific directories using 5<2(GS*42 4I IBm sure this is an eas"4to4o$ercome problem, and the solution is probabl" right in m" face 44 but I canBt see it In m" most recent case, IBm tr"ing to recompile apcupsd with ;et4S;0> IBm using the ;et4S0!> package from S<W, which installs in /usr/local /usr/local/lib is in m" crle reference, but the autoconf =configure@ script fails when tr"ing to access 4lsnmp or 4lnetsnmp =I think that last one is right, I cleared the screen "esterda" #@ (n" ideas or pointers in the right direction would be greatl" appreciated, and will earn a beer when in m" neighborhood 44 (lan W Rateliff, II

K solution is probabl" right in m" face 44 but I canBt see it 5<2(GS tells the compiler where to find header filesW crle tells the run4time linker where to find libraries when "ou ha$e failed to link "our binaries correctl" Nou ha$e to set 2D<2(GS to tell the compile time linker where to find libraries and "ou use both 42 and 4R arguments <or further enlightenment read the man pages ld=,@ and ld so ,=,@ K right, I cleared the screen "esterda" #@ What does net4snmp4config print when in$oked as# Z net4snmp4config 44libs A K <or further enlightenment read the man pages ld=,@ and ld so ,=,@ I ha$e the same problem, but IBm a newbie and not $er" clear on what "ou mean 5ould "ou please elaborate a bit more on "our repl"A !hanks a lotT K mean 5ould "ou please elaborate a bit more on "our repl"A !hanks a lotT 8laborate on what matterA Setting up crle is ne$er re'uired for binaries which "ou build on the s"stem properl" 0oreo$er, if "ou set up crle incorrectl" "ou are going to be learning how to boot from 5DRO0 to fix "our s"stem 5<2(GS and 2D<2(GS are set in "our en$ironment and properl" written configure scripts will use them to create the 0akefiles On this s"stem# R^SY echo Y5<2(GSW echo Y2D<2(GS 4O. 4pipe 4mcpu*ultrasparc 42/usr/sfw/lib 4R/usr/sfw/lib 42/opt/sfw/lib 4R/opt/sfw/lib 42/usr/openwin/lib 4R/usr/openwin/lib K <or further enlightenment read the man pages ld=,@ and ld so ,=,@ I ha$e pla"ed with all of the abo$e for a few hours and turned up the following results I also want to note that in the past I hed been admonished to not use en$ $ariables during compile or run, thus m" reliance upon crle Browsing through config log I determined that I was using the wrong $ersion of OpenSS2 for this specific instance I installed a new package and tried

again !he configure script failed again, but this time I determined that se$eral kstatH) references in libnetsnmp so were U;D8<Bd libnetsnmp so was linked with 4lkstat ;ow IBm Qust working to resol$e the 4lkstat issue easil" I tried a few other programs which were gi$ing me headaches in the past and 2D<2(GS seems to cure what ails them 44 K I ha$e pla"ed with all of the abo$e for a few hours and turned up the K following results I also want to note that in the past I hed been K admonished to not use en$ $ariables during compile or run, thus m" reliance K upon crle Whoe$er told "ou that did not understand what he was doing K Browsing through config log I determined that I was using the wrong $ersion K of OpenSS2 for this specific instance I installed a new package and tried K again !he configure script failed again, but this time I determined that K se$eral kstatH) references in libnetsnmp so were U;D8<Bd libnetsnmp so was K linked with 4lkstat ;ow IBm Qust working to resol$e the 4lkstat issue K easil" Since libkstat so is in /usr/lib I expect that "our 0akefile does not contain that 4lkstat directi$e !ake a close look at the last line of "our make output starting with CgccC to see if it contains C4lkstatC K I tried a few other programs which were gi$ing me headaches in the past and K 2D<2(GS seems to cure what ails them Solaris binaries are 82< !he headers of the binaries are supposed to contain the librar" search paths !he" get those paths onl" if )"ou) link them correctl", generall" using the 4R argument in "our 2D<2(GS Some configure scripts, notabl" the one in BI;D, ignore "our en$ironment and "ou need to edit the 0akefiles in order to pro$ide the runtime link paths K "our make output starting with CgccC to see if it contains C4lkstatC In m" case, libnetsnmp so was linked with 4lkstat, and a few others So I export 2IBS*C4lkstat 4lm 4lgenC and $oila ( sho$e in the right direction can work wonders !hanks posted by Brahma at 1:03 PM & comments

M&at are t&ree p&ases of System <nstallation)


K What are three phases of S"stem InstallationA Diagnostics =optional@ Disk >artitioning Installing Updating/>atching Restoring the pre$ious files 5ustomi+ing posted by Brahma at 1:00 PM & comments

multiple@t&read application
*************************************************************** *************** !O>I5# can I look at the thread for a executable runA http#//groups google com/group/comp unix solaris/browseHthread/thread/fede9:%%,.,EcE *************************************************************** *************** ** , of , ** Date# !ues % (ug .&&/ &9#/: <rom# 5asper 7 S Dik Pohn Mcc9LJsbcglobal netK writes# K7i, KI ha$e a multiple4thread application on solaris ,&, wonder how can I Ktell from os le$el how man" threads this app is runningA Cps 4o nlwpC =and more so "ou can tell which process is running with that man" lwps@ 5asper 44 8xpressed in this posting are m" opinions !he" are in no wa" related to opinions held b" m" emplo"er, Sun 0icros"stems Statements on Sun products included here are not gospel and ma" be fiction rather than truth ps 4o lwp 4p MpidK posted by Brahma at 12:55 PM & comments

Need &elp to tar files in a directory olderJcreation dateK t&an 5 days old
;eed help to tar files in a director" older=creation date@ than -/ da"s old ;eed help to tar files in a director" older=creation date@ than -/ da"s old sa" there is ,&&& files in the director" and onl" :&& of them are older than -/ da"s old i want to ha$e it archi$e=tar@ onl" the :&& older files and lea$e the rest <ilename structure is# filename dat O =the" ha$e been compressed alread" I Qust cant seem to get an"thing I tr" to work correctl" please helpT I was tr"ing combinations of find and tar wasnBt working right Repl" 0ichael !osch (ug ,,, -#-/ pm show options ; K I was tr"ing combinations of find and tar wasnBt working right 2inux# find 4t"pe f 4mtime 6-/ 4print& I xargs 4& tar cf /file tar Solaris, 7>U1,, ,,# find 4t"pe f 4mtime 6-/ 4exec tar cf /file tar [] 6 If none of the abo$e works, and file names do not ha$e spaces# find 4t"pe f 4mtime 6-/ 4print I xargs tar cf /file tar 44 0ichael !osch J hp # com Repl" Pim (ug ,,, -#/L pm show options K find 4t"pe f 4mtime 6-/ 4print I xargs tar cf /file tar WouldnBt the abo$e methods o$erwrite C /file tarC each time the max F of arguments to BtarB is reached =first and third cases, due to repeating the tar in$ocation with a new list of filename arguments@, or for each new file found =second case, one tar in$ocation per file found@A

Repl" 0ichael 7eiming (ug ,,, /#,L pm show options K find 4t"pe f 4mtime 6-/ 4print& I xargs 4& tar cf /file tar Without xargs# find 4t"pe f 4mtime 6-/ 4print I tar 4cf file tar 4! 4 Seems we are missing something like uuox awardA W4@ R S posted by Brahma at 12:43 PM & comments

#&eckR#able
K is there a wa" within solaris ,& to determine if a network cabel is K plugged in the socket of an ethernet interface =connection 28D is green@ A Nes <or example# F kstat 4n hme& I grep linkHup linkHup , linkHup * & means no link, linkHup * , means has link It does not directl" tell "ou if it is plugged in or not, but "ou can deduce that if linkHup * &, it is probabl" unplugged, plugged in wrong interface, or has a bad cable or bash4. &/F ndd 4get /de$/hme linkHstatus , bash4. &/F ItBll gi$e "ou an idea if there is a ph"sicall" connected de$ice plugged in an"wa"T posted by Brahma at 12:42 PM & comments

patc& cluster you &ave look at

R8# RSolaris4lS Re# Issues with Solaris % >osted B" h"attdQ On <rida", (ugust ,., .&&/ at ,.#-L >0 7a$e "ou installed the patch cluster a$ailable on I belie$e www sun com !o tell what patch cluster "ou ha$e look at uname 4a there is a number separated b" a dash, the first number identifies the patch cluster, the second number =separated b" the dash@ is the patch cluster $ersion !here are usuall" - clusters released each "ear for each supported Sun OS If the latest cluster is ,9 and uname 4a gi$es "ou &-, "ou are about - "ears behind in patches !he media kit from Sun, will ha$e the latest patch cluster a$ailable at build time integrated into it So if "ou ha$e maintenance, call them e$er" :4L months and ha$e them push "ou "our <R88 media kit =free onl" if "ou ha$e maintenance contract, and for each contract "ou can get Sol9, Sol% and Sol,& each 'uarter@ posted by Brahma at 12:41 PM & comments

ufsdump>ufsrestore file system


ufsdump/ufsrestore file s"stem K !he root disk has some bad sectors I am wondering if using K ufsdump/ufsrestore to dump the file s"stems on root disk to another K disk, will the data on the bad sector be loseA =(s when dumping the K file s"stem, there are messages sa"ing Ccannot read block 111111C @ K (n" better wa" to perform in this situationA I recentl" faced the same situation I wound up using the repair facilit" in the format=,0@ command It took an excruciatingl" painful amount of time to actuall" determine W7I57 blocks were fault", but I wound up making it work (ll work was done on a -&07+ I>1 Station under Solaris E One thing I noticed, and it ma" be isolated to the Seagate dri$e I was using, is that the repairs did not sur$i$e a reboot 7ad me W!<Bing all night I was still able to boot off the bad dri$e, it Qust ran into maQor issues after booting So I booted into single4user mode, looking something like this# Installed the new dri$e to de$ice & =the boot de$ice is : @ <ormatted, partitioned, and newfsBs the dri$e Ran CformatC and repaired the bad sectors on the boot de$ice !hen, performed a command like this#

cd /newdri$erootW ufsdump &f 4 / I ufsrestore rf 4 Once done =with all files"stems, in m" case@ I mo$ed the new dri$e to de$ice :, and remo$ed the old, bad dri$e ;ow, I did not ha$e a working 5D dri$e from which to boot, so I can onl" assume that booting from 5D and doing the work might ha$e sa$ed me hassle (ll4in4all, e$er"thing came o$er smoothl" (s an aside, I had to use a L94pin dri$e to replace the old /&4pin dri$e (n"one familiar with the I>1 Stations will tell "ou there is absolutel" ;O room for an" kind of dri$e adapter on the back of the dri$e So, I impro$ised I used a /&<4L9< adapter right in the on4board /&4pin S5SI port, then used a L94pin cable to the dri$e I canBt imagine IBm the first to do this, but I ha$enBt seen an" mention of an"one else Works like a blood" charm, and breathed some extra life into m" little ser$er #@ 44 (lan W Rateliff, II Repl" 0ichael !osch (ug ,., E#.. pm show options KK!he root disk has some bad sectors I am wondering if using KKufsdump/ufsrestore to dump the file s"stems on root disk to another KKdisk, will the data on the bad sector be loseA =(s when dumping the KKfile s"stem, there are messages sa"ing Ccannot read block 111111C @ KK(n" better wa" to perform in this situationA K I recentl" faced the same situation I wound up using the repair facilit" K in the format=,0@ command It took an excruciatingl" painful amount of time K to actuall" determine W7I57 blocks were fault", but I wound up making it K work (ll work was done on a -&07+ I>1 Station under Solaris E I suggest formatK anal"+e and perform a read test !he default setting is to repair an" bad sectors 4 7ide 'uoted text 4 4 Show 'uoted text 4

K One thing I noticed, and it ma" be isolated to the Seagate dri$e I was K using, is that the repairs did not sur$i$e a reboot 7ad me W!<Bing all K night K I was still able to boot off the bad dri$e, it Qust ran into maQor issues K after booting So I booted into single4user mode, looking something like K this# K Installed the new dri$e to de$ice & =the boot de$ice is : @ <ormatted, K partitioned, and newfsBs the dri$e Ran CformatC and repaired the bad K sectors on the boot de$ice !hen, performed a command like this# K cd /newdri$erootW ufsdump &f 4 / I ufsrestore rf 4 K Once done =with all files"stems, in m" case@ I mo$ed the new dri$e to de$ice K :, and remo$ed the old, bad dri$e Nou certainl" ha$e made the new disk boot4able# man installboot K ;ow, I did not ha$e a working 5D dri$e from which to boot, so I can onl" K assume that booting from 5D and doing the work might ha$e sa$ed me hassle K (ll4in4all, e$er"thing came o$er smoothl" K (s an aside, I had to use a L94pin dri$e to replace the old /&4pin dri$e K (n"one familiar with the I>1 Stations will tell "ou there is absolutel" ;O K room for an" kind of dri$e adapter on the back of the dri$e So, I K impro$ised I used a /&<4L9< adapter right in the on4board /&4pin S5SI K port, then used a L94pin cable to the dri$e I canBt imagine IBm the first K to do this, but I ha$enBt seen an" mention of an"one else Works like a K blood" charm, and breathed some extra life into m" little ser$er #@ What an old ironT ItBs more than ,& "ears ago that I maintained I>5 and I>1 stations, but still ha$e some of these tin" onboard4fuses in m" drawer posted by Brahma at 12:40 PM & comments

Se9mentation Fault
(h, no, I wouldnBt sa" that CSegmentation <aultC is Qust ne$er an acceptable wa" to report an error to a user, no matter how botched the configuration file might be !he possible causes =not necessaril" exclusi$e of each other@ I can think of are#

4 bug in inetd 4 bad patch installed 4 corrupted s"stem files =libraries or the inetd executable itself@ 44 can be caused b" cop"ing s"stem files from one s"stem to another rather than using the expected patching and packaging tools 4 someone remo$ed a normal s"stem file and replaced it with something else =a frightening number of people think this is a CreasonableC wa" to administer s"stems@ 4 the s"stem has been compromised and damaged CpstackC and CmdbC should help in debugging the core file If not, then report the problem through the usual support channels K (ssuming thereBs nothing wrong K with the hardware =what caused the crashA@, "ou could tr" and mo$e the K production inetd conf file out of the wa" and see if inetd still K crashes with a minimal inetd conf If "ouBre completel" desperate and ha$e no support contract and no normal means of debugging the problem, I suppose this might possibl" help 8$en if it did help, it would lea$e me with a 'ueas" feeling in m" stomach if it were m" s"stem# how on earth do "ou know "ouB$e reall" sol$ed the problem if "ou ha$enBt disco$ered the root causeA 7ow do "ou know it wonBt come back laterA posted by Brahma at 12:38 PM & comments

su @ leaves me as myself, not root


su 4 lea$es me as m"self, not root !his 'uirk Qust started about a week ago ;e$er had a problem before (s a normal user I cannot become the root user# Y uname 4a SunOS ultra / L GenericH,&/,9,4,/ sun-u sparc SU;W,Ultra4, Y id uid*,&&&=roger@ gid*,&=staff@

Y su 4 >assword# Renter in rootBs passwordS Sun 0icros"stems Inc SunOS / L Generic (ugust ,%%E Y id uid*,&&&=roger@ gid*,&=staff@ Y echo hello KK /Qunk /Qunk# cannot create Y But this works# Y id uid*,&&&=roger@ gid*,&=staff@ Y su >assword# Renter in rootBs passwordS F id uid*&=root@ gid*,=other@ F echo hello K /Qunk F cat /Qunk hello F rm /Qunk F exit Y id uid*,&&&=roger@ gid*,&=staff@ Y SuggestionsA Repl" Pohn 7owells (ug ,L, .#:: am show options ; K SuggestionsA >resumabl" if "ou Cecho YYC "ou are in the same shell for the Csu 4C caseA !he difference between Csu 4C and CsuC is that the en$ironment is set up for the former, so presumabl" something in rootBs profile is terminating the su and putting "ou back to the original shell !r" renaming rootBs profile =and an" other startup stuff if "ou ha$e changed rootBs shell from sh@ and then see what happens Pohn 7owells posted by Brahma at 12:38 PM & comments

link utilisation,
Pohn Smith wrote# K !he linux $ersion of sar =4( option for all@ pro$ides ethernet usage among K other things I know the solaris $ersion doesnBt, but I mention it here K since I am looking for a similar output Is there a tool a$ailable that will K gi$e me ethernet link utili+ation on a particular interface e$er" : secondsA K !hanks, K PS ;ot exactl" link utilisation, but knowing the interface speed, "ou can extrapolate from# kstat R4n MinterfaceKS 4! d 4s BRorSb"tes)B : Repl" posted by Brahma at 12:37 PM & comments

#onfi9ure N<#
!he can add "our entries to configure the ;I5 in the following file /etc/rcS d/S:&rootusr sh !he s"ntax is ndd 4set /de$/CinterfaceC ad$HautonegHcap &/, ndd 4set /de$/CinterfaceC ad$H,&&&fdxHcap &/, ndd 4set /de$/CinterfaceC ad$H,&&hdxHcap &/, ndd 4set /de$/CinterfaceC ad$H,&&fdxHcap &/, ndd 4set /de$/CinterfaceC ad$H,&&hdxHcap &/, ndd 4set /de$/CinterfaceC ad$H,&hdxHcap &/, ndd 4set /de$/CinterfaceC ad$H,&fdxHcap &/, & disable , enable Interface # eri&, 'fe&4:, ce, hme& etc (lternati$el" "ou can create a script in the /etc/init d/ director" and link it to the /etc/rcF d, F can be . or : depending in which run state "ou prefer 7i <irstl" 5heck the status, speed V mode# F ndd 4get /de$/'fe linkHstatus , * up & * down

F ndd 4get /de$/'fe linkHspeed , * ,&& 0b & * ,& 0b F ndd 4get /de$/'fe linkHmode , * <ull Duplex =<D1@ & * 7alf Duplex =7D1@ !hen# !hese commands are usuall" placed in a startup script such as /etc/rc. d/S%%eri (bout to force ,&&0bs <ull Duplex =<D1@ on eri# =8x@ ndd 4set /de$/eri instance , ndd 4set /de$/eri ad$H,&&!-Hcap & ndd 4set /de$/eri ad$H,&&fdxHcap , ndd 4set /de$/eri ad$H,&&hdxHcap & ndd 4set /de$/eri ad$H,&fdxHcap & ndd 4set /de$/eri ad$H,&hdxHcap & ndd 4set /de$/eri ad$HautonegHcap & !hese same thing do on diffrent ethernets 7ope "ou done #@e;PON 0ohammed !an$ir posted by Brahma at 12:37 PM & comments

Slo' lsof on Solaris


Slow lsof on Solaris If lsof is taking se$eral minutes to complete on Solaris, make sure to download the latest package from Sunfreeware =or compile the latest $ersion from source@ !he latest $ersion can make a significant difference, such as this example on a Solaris 9 Sparc s"stem lsof $ersion - -%# F lsof 4$ lsof $ersion information# re$ision# - -% 44 find the latest re$ision at# ftp#//$ic cc purdue edu/pub/tools/unix/lsof configuration info# L- bit kernel constructed# Sun 0a" ,- .&#//#&E 8D! .&&&

constructed b" and on# ste$eJsolaris compiler# /opt/SU;Wspro/bin/cc compiler $ersion# WorkShop 5ompilers / & %9/,./,/ 5 / & compiler flags# 4Dsolaris*9&&&& 4D7(S>RHGWI;DOWS 4xarch*$% 4D7(SI>$L 4D7(SH?SO5U 4D2SO<H?S!R*C/ 9C 4O loader flags# 42 /lib 4llsof 4lk$m 4lelf 4lsocket 4lnsl s"stem info# SunOS solaris / 9 Generic sun-u sparc SU;W,Ultra4/H,& F time /usr/local/bin/lsof 4i #.: real -#.. . user :#:E E s"s L & lsof $ersion - L9# F /usr/local/bin/lsof 4$ lsof $ersion information# re$ision# - L9 latest re$ision# ftp#//lsof itap purdue edu/pub/tools/unix/lsof/ latest <(3# ftp#//lsof itap purdue edu/pub/tools/unix/lsof/<(3 latest man page# ftp#//lsof itap purdue edu/pub/tools/unix/lsof/lsofHman configuration info# L- bit kernel constructed# Wed Pul .: &-#-9#:- 8D! .&&: constructed b" and on# ste$eJsolaris compiler# gcc compiler $ersion# : : compiler flags# 4Dsolaris*9&&&& 4D7(S>RHGWI;DOWS 4mL- 4D7(SI>$L 4D7(SH?SO5U 4D2SO<H?S!R*C/ 9C 4O loader flags# 42 /lib 4llsof 4lk$m 4lelf 4lsocket 4lnsl s"stem info# SunOS solaris / 9 GenericH,&9/.94,, sun-u sparc SU;W,Ultra4/H,& Solaris F time /usr/local/bin/lsof 4i #.: real - , user & 9 s"s . % posted by Brahma at 12:36 PM & comments

ctime, atime, and mtime


ctime, atime, and mtime It is important to distinguish between a file or director"Bs change time =ctime@, access time =atime@, and modif" time =mtime@

ctime 44 In U;I1, it is not possible to tell the actual creation time of a file !he ctime44change time44is the time when changes were made to the file or director"Bs inode =owner, permissions, etc @ It is needed b" the dump command to determine if the file needs to be backed up Nou can $iew the ctime with the ls 4lc command atime 44 !he atime44access time44is the time when the data of a file was last accessed Displa"ing the contents of a file or executing a shell script will update a fileBs atime, for example Nou can $iew the atime with the ls 4lu command mtime 44 !he mtime44modif" time44is the time when the actual contents of a file was last modified !his is the time displa"ed in a long directoring listing =ls 4l@ In 2inux, the stat command will show these three times posted by Brahma at 12:36 PM & comments

System errors defined


0iscellaneous U;I1 notes S"stem errors defined S"stem errors are defined in /usr/include/s"s/errno h on Solaris s"stems and /usr/include/asm/errno h on Red 7at 2inux s"stems !he information in this file is helpful in interpreting output of the truss command =Solaris@ or strace =2inux@ 8xample# Fdefine 8>8R0 , /) Operation not permitted )/ Fdefine 8;O8;! . /) ;o such file or director" )/ Fdefine 8SR57 : /) ;o such process )/ Fdefine 8I;!R - /) Interrupted s"stem call )/ Fdefine 8IO / /) I/O error )/ Fdefine 8;1IO L /) ;o such de$ice or address )/ Fdefine 8.BIG E /) (rg list too long )/ Fdefine 8;O8185 9 /) 8xec format error )/ Fdefine 8B(D< % /) Bad file number )/ Fdefine 857I2D ,& /) ;o child processes )/ 2imiting find to one file s"stem !he find commandBs 4xde$ argument can be used to limit searches to one file s"stem

8xample# find all files on the root file s"stem sorted smallest4to4largest Do not descend other file s"stems =etc /usr, /$ar@ find / 4xde$ 4ls I sort 4n 4k E ?iewing CrawC man pages in nroff/troff format nroff 4man manpage I more 4s 8xample# nroff 4man 'tool 9 I more 4s >rinting man pages !o output a U;I1 man page in a format suitable for printing, pipe the man page through col 4b 8xample# man command I col 4b Disabling ssh, compatibilit" with ssh com ser$er ssh protocol , is $ulnerable to man4in4the4middle attacks with tools like dsniff, and should not be used unless absolutel" necessar" !o disable ssh protocol , with an ssh com ser$er, , 8dit the /etc/ssh./sshd.Hconfig configuration file . 5hange# Ssh,5ompatibilit" "es !o# Ssh,5ompatibilit" no : Send the sshd process a SIG7U> for the change to take effect Oombie processes ( +ombie process is a process that has exited, but whose exit code has not reached its parent process !he parent process has to perform a wait s"stem call to read the exit code of a child Until the parent recei$es the exit code, the child process will remain in C+ombieC state Oombie processes are alread" dead and cannot be Ckilled C !he" consume no s"stem resources except an entr" in the s"stem process table =seen in the proc4s+ column with the sar 4$ command@ !he onl" wa" to remo$e a +ombie process is to kill its parent process

0ore information# http#//groups google com/groupsA'*+ombie6processes6waitVhl*enVlr*Vie*U!<4 9Vselm*,%%:<eb,- &.,L// ,:E.,Z-&acd- acd comVrnum*% /etc/hosts on Windows !he file on Windows that pro$ides the same functionalit" as /etc/hosts in U;I1 is ZS"stemRootZ\s"stem:.\dri$ers\etc\hosts stt"# # In$alid argument !his message is often caused when running stt" in the 5 shell initiali+ation script cshrc with a non4interacti$e shell =ex an ssh, scp, rsh, or rs"nc command@ stt" should onl" be run in an interacti$e shell 8xample change in cshrc to check for an interacti$e shell# 5hange# stt" erase aA !o# if = YAprompt VV [ tt" 4s ] @ stt" erase aA xterm 1t error# 5anBt open displa"# If "ou recei$e this message when tunneling 1,, traffic o$er an ssh tunnel, =,@ make sure that the remote ssh ser$er allows 1,, forwarding with the 1,,<orwarding "es directi$e in the ser$er configuration file =OpenSS7 example@, and =.@ make sure that "ou are enabling 1,, forwarding on "our ssh client with the 41 flag RhutchJhutch hutchSY ssh hutchJser$er RhutchJser$er hutchSY echo YDIS>2(N RhutchJser$er hutchSY RhutchJhutch hutchSY ssh 41 hutchJser$er RhutchJser$er hutchSY echo YDIS>2(N localhost#,& & RhutchJser$er hutchSY 1,, tunneling after su 4 In order to run 1 clients o$er an ssh tunnel after running su 4 for a root login shell, "ou ha$e to manuall" specif" the DIS>2(N and 1(U!7ORI!N en$ironment $ariables !hese steps are not needed when running su, su 4m, or su 4p 8xample#

/bin/su 4 DIS>2(N*localhost#,& & 1(U!7ORI!N*^hutch/ 1authorit" 1Hclient 44 or 44 export DIS>2(N*localhost#,& & 1(U!7ORI!N*^hutch/ 1authorit" 1Hclient sftp problems When attempting to login to an OpenSS7 sftp ser$er, I recei$ed the following error# Re'uest for subs"stem BsftpB failed on channel & 5ouldnBt read packet# 5onnection reset b" peer When recei$ing this error, make sure to check the permissions of sftp4ser$er In this case, the permissions on the director" containing sftp4ser$er were incorrect# F grep sftp4ser$er /usr/local/etc/sshdHconfig Subs"stem sftp /usr/local/libexec/sftp4ser$er F ls 4ld /usr/local/libexec /usr/local/libexec/sftp4ser$er drwx444444 . root other /,. Oct E .&&: /usr/local/libexec 4rwxr4xr4x , root other .9.%. Oct E .&&: /usr/local/libexec/sftp4ser$er !o correct the problem# chmod E// /usr/local/libexec 1,, forwarding problems When attempting to run an 1 client, I recei$ed the following errors# debug,# 1,, connection uses different authentication protocol 1,, connection reQected because of wrong authentication In this case, the file s"stem housing the userBs home director" was full, resulting in a &4b"te ^/ 1authorit" file <reeing up space in the userBs home director" fixed the problem sudo# must be setuid root If "ou recei$e this error when executing sudo, first check to make sure that sudo is setuid root ( less ob$ious cause of this error is that sudo is located on a file s"stem mounted nosuid If this is the case, "ou will ha$e to remount the file s"stem suid if sudo is needed ;ote that mount 4o remount,suid fileHs"stem ma" not workW "ou ma" ha$e to actuall" unmount the file s"stem and remount it to fix the problem

0ore information in this post posted by Brahma at 12:35 PM & comments

6estrictin9 user access 3mail@only access


Restricting user access 8mail4onl" access 5reate a user account with a home director" of /de$/null and a shell that does not permit logins, such as /bin/false or /de$/null <!>4onl" access Set the userBs shell to one that does not permit logins, such as /bin/false or /de$/null ;ote# "our <!> ser$er ma" re'uire that the userBs shell is listed in the /etc/shells file >re$enting <!> access (dd the userBs account name into /etc/ftpusers Restricted access Set the userBs shell to a restricted shell such as /bin/rksh or /bin/rsh !his pre$ents# , Use of the cd command . Setting or changing the >(!7 $ariable : Specif"ing a command or filename containing a slash =/@ 44 onl" filenames in the current director" can be used - Using output redirection =K or KK@ Restricting b" user group (dd the following to /etc/profile# if R 4n C`groups I grep [groupHname]BC S W then echo CUsers from group [groupHname] cannot login to this machine C exit , fi !his would restrict telnet and rsh access for users using Bourne shell or Uorn shell 5 shell users would still be able to access the machine !hanks to (ugustus 5arter for sending the following method of restricting 5 shell, Bourne shell, and Uorn shell access on Solaris s"stems

!he following will restrict the 5 Shell as well as Bourne and Uorn shells under Solaris . L, E, 9, and % s"stems# 5reate a text file called# /etc/suHusers txt !his will ha$e an" entries of usernames like this# luke hans leia (dd the following code to the /etc/profile file# F &-4.L4.&&. 4 Restricts telnet and ssh access for batch user accounts F Bourne =sh@ and Uorn =ksh@ shell users use the script in the /etc/profile file F 5 =csh@ shell users use the script in the /etc/ login file F !he /etc/suHusers txt file contains the list of batch accounts !!N*`tt" I awk 4</ B[printf =Y:C/CY-@]B` US8RH!!N*`w I awk B=\Y.**CBY!!NBC@[print \Y,]B` for US8RID in `cat /etc/suHusers txt` do if R CYUS8RH!!NC * CYUS8RIDC S then echo echo Interacti$e logins for the YUS8RH!!N user are disabled echo >lease login with "our user id and do a su 4 YUS8RH!!N echo exit fi done (dd the following code to the /etc/ login file# F &-4.L4.&&. 4 Restricts telnet and ssh access for batch user accounts F Bourne =sh@ and Uorn =ksh@ shell users use the script in the /etc/profile file F 5 =csh@ shell users use the script in the /etc/ login file F !he /etc/suHusers txt file contains the list of batch accounts set !!N*`tt" I awk 4</ B[printf =Y:C/CY-@]B` set US8RH!!N*`wIawk B[if =Y.**CBY!!NBC@ print Y,]B` foreach US8RID =`cat /etc/suHusers txt`@ if = CYUS8RH!!NC ** CYUS8RIDC @ then echo echo Interacti$e logins for the YUS8RH!!N user are disabled echo >lease login with "our user id and do a su 4 YUS8RH!!N echo logout

endif end posted by Brahma at 12:34 PM & comments

M&ic& Solaris cluster is installed)


Which Solaris cluster is installedA !o determine which CclusterC of the Solaris Operating 8n$ironment "ou ha$e installed# cat /$ar/sadm/s"stem/admin/52US!8R Results# SU;W5re' 44 5ore S"stem Support SU;W5user 44 8nd User S"stem Support SU;W5prog 44 De$eloper S"stem Support SU;W5all 44 8ntire Distribution SU;W51all 44 8ntire Distribution plus O80 support !o list the packages in each of the clusters abo$e, $iew the /$ar/sadm/s"stem/admin/ clustertoc file !his file also contains descriptions of the clusters listed abo$e posted by Brahma at 12:34 PM & comments

sd-conf
. SubQect# Re# sd conf Nou can remo$e all entries in the sd conf file that ha$e target*n lun*m with nT*/ and mK& for "our s"stem It takes ,/- second to determine that a target ID is not responding 0" guess is that b" adding the additional lun entries for those targets which arenBt present, the software is spending ,/- second per lun =e$en though it reall" shouldnBt ha$e to@ !he target ID is the same as the S5SI ID on the S5SI bus !he lun $alue is a 2ogical Unit ;umber for a gi$en target id !he data shown below identifies the de$ice as cntndn c, is the controller number tn is the target id dn is the 2U; So the entries "ou show below identif" that "our s"stem has a controller F, =c,@ with target ID / =t/@ and two 2U;Bs =d& and d,@

If a target ID doesnBt respond to a S5SI selection =selection timeout@ then no 2U;Bs can exist for that target ID !his is wh" "ou can remo$e all entries for those IDBs which "ou donBt ha$e attached to "our bus If a target ID does respond but the 2U; is not a$ailable, the time to determine that a 2U; is not a$ailable is minimal =probabl" in microseconds range@ So it doesnBt hurt to lea$e all 2U;Bs enabled for target ID / e$en if "ou onl" are using two of them Russ 4 7ide 'uoted text 4 posted by Brahma at 12:33 PM & comments

onfi9urin9 <Av interfaces0ifconfi90 setiffla9s0 S<*#S"<FF"%2S0 interface0 #annot assi9n reDuested address interface
Cconfiguring I>$- interfaces#ifconfig# setifflags# SIO5S2I<<2(GS# interface# 5annot assign re'uested address interfaceC (n /etc/hostname interface file exists, but the $alue in /etc/hostname interface file is not in /etc/hosts (dd the I> address and hostname listed in /etc/hostname interface to /etc/hosts posted by Brahma at 12:33 PM & comments

5eterminin9 6A, of a Sun disk


Determining R>0 of a Sun disk Run mkfs 4m /de$/rdsk/cxtxdxs. and multipl" the rps* $alue =re$olutions per second@ b" L& to determine the R>0 ex F mkfs 4m /de$/rdsk/c&t&d&s. mkfs 4< ufs 4o nsect*,::,ntrack*.E,bsi+e*9,%.,fragsi+e*,&.-,cgsi+e*,L,free*,&,rps*%&,nbpi*.&-%,op t*t,apc*&,gap*&,nrpos*9,maxcontig*,L /de$/rdsk/c&t&d&s. -,.%L%& =rps@ ) L& =seconds@ * /-&& R>0 posted by Brahma at 12:32 PM & comments

Solaris routin9 'it& multiple interfaces

Solaris routing with multiple interfaces In this example, we ha$e an hme. network interface with an I> address of L/ .&, .,: ,,E, a network address of L/ .&, .,: ,,., and a subnet mask of .// .// .// .-& !he interface was initiall" enabled using the default subnet mask and broadcast address ifconfig hme. hme.# flags*,&&&9-:MU>,BRO(D5(S!,RU;;I;G,0U2!I5(S!,I>$-K mtu ,/&& index : inet L/ .&, .,: ,,E netmask ff&&&&&& broadcast L/ .// .// .// Routing !able# I>$Destination Gatewa" <lags Ref Use Interface 44444444444444444444 44444444444444444444 44444 44444 444444 444444444 L/ & & & L/ .&, .,: ,,E U , 9 hme. !o correct the routing table# , Specif" the correct subnet mask and broadcast address with ifconfig ifconfig L/ .&, .,: ,,E netmask .// .// .// .-& broadcast L/ .&, .,: ,.E . (dd an /etc/netmasks entr" for the correct netmask to be used after s"stem reboot L/ .&, .,: ,,. .// .// .// .-& 5orrected routing table# Routing !able# I>$Destination Gatewa" <lags Ref Use Interface 44444444444444444444 44444444444444444444 44444 44444 444444 444444444 L/ .&, .,: ,,. L/ .&, .,: ,,E U , , hme. posted by Brahma at 12:29 PM & comments

patc&add return codes


patchadd return codes !he CReturn codesC listed when installing the Sun Recommended >atch 5lusters are listed toward the top of the patchadd script 7ere are some common return codes# F . (ttempt to appl" a patch thatBs alread" been applied F 9 (ttempting to patch a package that is not installed F ./ ( re'uired patch is not applied posted by Brahma at 12:28 PM & comments

.umount0 <>* error.


Cumount# I/O errorC umount# cannot unmount /mountHpoint I recei$ed this error on a Solaris 9 s"stem when the disk containing a ?eritas $olume failed (fter killing all the processed identified with fuser 4c /mountHpoint and confirming no other processes were in use in the file s"stem with lsof 6D /mountHpoint, I had to issue the umount 4f /mountHpoint command to forcibl" unmount the file s"stem# F umount /fileHs"stem umount# I/O error umount# cannot unmount /fileHs"stem F fuser 4c /fileHs"stem /fileHs"stem# F lsof 6D /fileHs"stem F umount 4f /fileHs"stem F mount I grep /fileHs"stem F <or Solaris users, onl" Solaris 9 and later pro$ide the umount 4f =CforceC@ flag Other Unices ma" ha$e the CforceC flag for umount posted by Brahma at 12:28 PM & comments

Bootin9 off an e=ternal #5@6*,


Booting off an external 5D4RO0ooting off an external 5D4RO0 !o boot off an external 5D4RO0, determine the de$ice path with probe4scsi4all from the Open Boot >RO0 =OB> or CokC prompt@ ;ote# "ou ma" want to temporaril" perform a seten$ auto4bootA false and reset4all if OB> warns "ou that executing probe4scsi4all could hang "our s"stem Rele$ant probe4scsi4all output# /sbusJb,&/SU;W,fasJ:,99&&&&& !arget : Unit & Remo$able Read Onl" de$ice >281!OR 5D4R >14R9.&! , &9,,/.,/&& ,L#&& In this example, the S5SI target ID =C!argetC@ is :, and the ph"sical path to the external 5D4RO0 is /sbusJb,&/SU;W,fasJ:,99&&&&& !o boot a Solaris Operating 8n$ironment 5D using this external 5D4RO0, "ou would issue the command#

[e] ok boot /sbusJb,&/SU;W,fasJ:,99&&&&&/sdJ:,&#f In the command abo$e, sdJ:,& refers to the S5SI target =:@ and 2U;/Unit =&@ ;ote# when connecting an external 5D4RO0 de$ice, make sure that the 5D4RO0 dri$e and s"stem are both powered off 5onnect the 5D4RO0, and power on the 5D4RO0 and then the s"stem <ailure to follow this procedure ma" result in the following errors# [e] ok boot /sbusJb,&/SU;W,fasJ:,99&&&&&/sdJ:,&#f Boot de$ice# /sbusJb,&/SU;W,fasJ:,99&&&&&/sdJ:,&#f <ile and args# Bad magic number in disk label 5anBt open disk label package 5anBt open boot de$ice posted by Brahma at 12:28 PM & comments

6epairin9 a &ard disk 'it& bad sectors


Repairing a hard disk with bad sectors !he format command ma" be used to repair a hard disk that is experiencing read/write errors 8xample error# W(R;I;G# /sbusJ:,&/SU;W,fasJ:,99&&&&&/sdJ&,& =sd,.&@# 8rror for 5ommand# read 8rror 2e$el# Retr"able Re'uested Block# /EEE,. 8rror Block# /EEE%L ?endor# S8(G(!8 Serial ;umber# %E:EUE/,9: Sense Ue"# 0edia 8rror (S5# &x,L =data s"nc mark error@, (S53# &x&, <RU# &xd. While the format command allows "ou to repair an indi$idual block, it is probabl" best to run anal"+e and perform at least a read test, as there ma" be more than one bad block on the disk !he anal"+e command will automaticall" repair errors it finds when scanning the hard disk for bad blocks anal"+eK read Read" to anal"+e =wonBt harm SunOS@ !his takes a long time, but is interruptable with 5!R245 5ontinueA " pass & W(R;I;G# /sbusJ:,&/SU;W,fasJ:,99&&&&&/sdJ&,& =sd,.&@#

8rror for 5ommand# read 8rror 2e$el# Retr"able Re'uested Block# /EE9&& 8rror Block# /EE9&& ?endor# S8(G(!8 Serial ;umber# %E:EUE/,9: Sense Ue"# 0edia 8rror (S5# &x,L =data s"nc mark error@, (S53# &x&, <RU# &xd. 0edium error during read# block /EE9&& =&x9d,&9@ =.LE/9/&@ (S5# &x,L (S53# &x& Repairing hard error on /EE9&& =.LE/9/&@ ok posted by Brahma at 12:26 PM & comments

,ountin9 an <S* ima9e


0ounting an ISO image !he following instructions are for Solaris 9 and later Nou must be root to mount the ISO image lofiadm 4a absoluteHpathHtoHISO mount 4< hsfs 4r /de$/lofi/, mountHpoint ex mounting /home/hutch/cdrom iso to /tmp/mnt lofiadm 4a /home/hutch/cdrom iso /de$/lofi/, mount 4< hsfs 4r /de$/lofi/, /tmp/mnt posted by Brahma at 12:26 PM & comments

9+ip0 .1alue too lar9e for defined data type.


g+ip# C?alue too large for defined data t"peC Nou ma" recei$e this error when using g+ip to compress files larger than - gigab"tes in si+e !he g+ip executable pro$ided in Solaris 9 cannot compress files of this si+e, as illustrated b" this example F ls 4l maillog & 4rw4r44r44 , root other ./&/&E%,%:L Dec ,L &-#:- maillog & F /usr/bin/g+ip maillog & maillog &# ?alue too large for defined data t"pe F grep C/usr/bin/g+ipC /$ar/sadm/install/contents /usr/bin/gun+ip* / /usr/bin/g+ip l none SU;Wg+ip /usr/bin/g+cat* / /usr/bin/g+ip l none SU;Wg+ip /usr/bin/g+ip f none &/// root bin L,&:. .9,/9 ,&,%&,&/E% SU;Wg+ip

F pkginfo 4l SU;Wg+ip >UGI;S!# SU;Wg+ip ;(08# !he G;U Oip =g+ip@ compression utilit" 5(!8GORN# s"stem (R57# sparc ?8RSIO;# ,, 9 &,R8?*.&&& &, &9 ,9 ,. B(S8DIR# / ?8;DOR# Sun 0icros"stems, Inc D8S5# !he G;U Oip =g+ip@ compression utilit" >S!(0># on.94patch.&&.&-,L,%:&-% I;S!D(!8# 0ar ,, .&&: ,L#:E 7O!2I;8# >lease contact "our local ser$ice pro$ider S!(!US# completel" installed <I28S# ./ installed pathnames / shared pathnames . linked files / directories 9 executables .&9 blocks used =approx@ !o compress files larger than - gigab"tes in si+e, build and install g+ip with support for these large files, or use the g+ip package , : x or newer from posted by Brahma at 12:26 PM & comments

File descriptors
<ile descriptors ( file descriptor is a handle created b" a process when a file is opened !here is a limit to the amount of file descriptors per process !he default Solaris file descriptor setting is LIf the file descriptor limit is exceeded for a process, "ou ma" see the following errors# C!oo 0an" Open <ilesC C8rrF.- 80<I28C =in truss output@ !o displa" a processB current file descriptor limit, run /usr/proc/bin/pfiles pid I grep rlimit on Solaris s"stems Displa" s"stem file descriptor settings# ulimit 47n =hard limit, cannot be exceeded@ ulimit 4Sn / ulimit 4n =soft limit ma" be increased to hard limit $alue@

Increasing file descriptor settings for child processes =example@# Y ulimit 47n ,&.Y ulimit 4Sn LY ulimit 4Sn ,&.Y ulimit 4Sn ,&.Solaris kernel parameters# rlimHfdHcur# soft limit It ma" be dangerous to set this $alue higher than ./L due to limitations with the stdio librar" If programs re'uire more file descriptors, the" should use setrlimit directl" rlimHfdHmax# hard limit It ma" be dangerous to set this $alue higher than ,&.- due to limitations with select If programs re'uire more file descriptors, the" should use setrlimit directl" posted by Brahma at 12:25 PM & comments

.>usr>ccs>bin>ld0 ille9al option @@ 3.


C/usr/ccs/bin/ld# illegal option 44 8C If "ou recei$e this error when compiling software on a Solaris s"stem, use the G;U $ersion of ld pro$ided b" the Sunfreeware binutils package instead of /usr/ccs/bin/ld If "ou cannot specif" the path to G;U ld =t"picall" /usr/local/bin/ld@ instead of /usr/ccs/bin/ld b" means of an en$ironment $ariable or configuration setting when compiling software, "ou ma" rename /usr/ccs/bin/ld as /usr/ccs/bin/ld sun to ensure that G;U ld is used F m$ /usr/ccs/bin/ld /usr/ccs/bin/ld sun Build and install the software F m$ /usr/ccs/bin/ld sun /usr/ccs/bin/ld posted by Brahma at 12:25 PM & comments

No space left on device. '&en installin9 packa9es


;o space left on de$iceC when installing packages If "ou recei$e this error when running pkgadd on datastream packages,

"ou are likel" filling up the /$ar file s"stem, as pkgadd extracts the contents of the package into /$ar/tmp 8xample errors when filling up the /$ar file s"stem when running pkgadd on a gcc : : package# >rocessing package instance MS05gccK from M/tmp/gcc4: :4solE4sparc4localK gcc =sparc@ : : cpio# 5annot write Creloc/lib/libstdc66 aC, errno .9, ;o space left on de$ice cpio# 5annot write Creloc/lib/libstdc66 so / & -C, errno .9, ;o space left on de$ice cpio# 5annot write Creloc/lib/libsupc66 aC, errno .9, ;o space left on de$ice !he solution is either to s"mbolicall" link /$ar/tmp into a larger file s"stem that can accommodate extracting the package, or to translate the package from datastream format =one monolithic file@ into file s"stem format =extracting the package into its component parts@ I recommend the latter solution <or example, if "ou ha$e a large file s"stem named /files,, "ou can translate the package into file s"stem format with# pkgtrans package /files, ex pkgtrans gcc4: :4solE4sparc4local /files, !o install the package# pkgadd 4d /files, (fter the package is installed, "ou can remo$e the package in file s"stem format with# rm 4r /files,/package ex rm 4r /files,/S05gcc posted by Brahma at 12:25 PM & comments

Backup strate9y
Poe, I would need a great deal more information to gi$e "ou a clear answer I work in an en$ironement with o$er /&& windows ser$ers 5urrentl" we are using ;etBackup b" ?eritas =S"mantic now@ >re$iousl", when we were at ./& ser$ers, we used Backup8xec

I ha$e re$iewed man" options of work group and enterprise solutuions o$er the past six "ears, so I can gi$e "ou a prett" good idea of what to look to 7ere is the information I need# 7ow man" ser$ersdo "ou need to back upA 7ow much data is backedup on a <ull backupA Do "ou know the backup stratig" "ou would like to useA !hat is, do "ou want to perform an incremental on a dail" basis, or a differentialA I would assume "ou would want to perform a full once a week (re "ou running 0S S32 and / or OracleA What are "ou using for email s"stemsA Do "ou ha$e S(; disk storage in placeA (re "ou concerned about backing up U;I1 as well as WindowsA Is there a possibilit" of backing up clientsA What hardware do "ou ha$e to work withA 7ow old is itA What budget do "ou ha$e to work withA Once "ou get this information to me, I will be able to help "ou make that decision !hanks, 0ark Bellows posted by Brahma at 12:24 PM & comments

2et your e=pert 10 Step ,i9ration Survival 2uide and poster


Weekl"# Get "our expert ,& Step 0igration Sur$i$al Guide and poster If "ou ha$e been through an 8xchange migration, "ou alread" know how challenging the" are Nou know to prepare and seek help If "ou ha$enBt been through one, take it from those who ha$e Get help now (sk the experts what to do and "ouBll sur$i$e "our migration 4 and come out a hero !his ,& Step 0igration Sur$i$al Guide and poster will ser$e as a basic roadmap during "our migration and help "ou a$ert disaster and deli$er a migration without impact on "our organi+ation !he ,& steps include# , 0oti$ate . In$estigate : Gather - Restructure / (rchitect

L !est E Implement 9 Organi+e % ;otif" ,& Sign Off Get "our cop" toda" and do more than Qust sur$i$e "our migration posted by Brahma at 12:24 PM & comments

8est for directory name in upper case


R8# !est for director" name in upper case 7i, pl+ tr" i think it should work

ls 4al I grep ad I awk BY% /a\ AR(4OS6Y/B regards, raQ posted by Brahma at 12:23 PM & comments

.No space left on device. '&en installin9 packa9es


C;o space left on de$iceC when installing packages If "ou recei$e this error when running pkgadd on datastream packages, "ou are likel" filling up the /$ar file s"stem, as pkgadd extracts the contents of the package into /$ar/tmp 8xample errors when filling up the /$ar file s"stem when running pkgadd on a gcc : : package# >rocessing package instance MS05gccK from M/tmp/gcc4: :4solE4sparc4localK gcc =sparc@ : : cpio# 5annot write Creloc/lib/libstdc66 aC, errno .9, ;o space left on de$ice cpio# 5annot write Creloc/lib/libstdc66 so / & -C, errno .9, ;o space left on de$ice cpio# 5annot write Creloc/lib/libsupc66 aC, errno .9, ;o space left on de$ice !he solution is either to s"mbolicall" link /$ar/tmp into a larger file s"stem that can accommodate extracting the package, or to

translate the package from datastream format =one monolithic file@ into file s"stem format =extracting the package into its component parts@ I recommend the latter solution <or example, if "ou ha$e a large file s"stem named /files,, "ou can translate the package into file s"stem format with# pkgtrans package /files, ex pkgtrans gcc4: :4solE4sparc4local /files, !o install the package# pkgadd 4d /files, (fter the package is installed, "ou can remo$e the package in file s"stem format with# rm 4r /files,/package ex rm 4r /files,/S05gcc posted by Brahma at 12:23 PM & comments

Solaris packa9es #reation


packages !he following are the steps I used to create a Solaris . L package for the 0utt e4mail client (lthough these steps ma" be applied for other software, please $isit the excellent Sunfreeware com 5reating >ackages page for additional information on creating Solaris packages , Uncompress the mutt source gun+ip 4cd mutt4, -i tar g+ I tar x$f 4 . 5reate an alternate destination director" for the package "ou will create mkdir /tmp/pkg : 5hange muttBs configure file to use /tmp/pkg as the destination director" cd mutt4, $i configure 5hange# acHdefaultHprefix*/usr/local !o# acHdefaultHprefix*/tmp/pkg - Build mutt in the alternate destination director"# /configure VV make VV make install

/ 5reate a package protot"pe file containing a list of all files that were Qust installed cd /tmp/pkg find 4print I pkgproto K /tmp/pkg/protot"pe L 8dit the package protot"pe and change "our username and group to bin In this example, m" username is hutchib and m" group is nsm $i /tmp/pkg/protot"pe 5hange username hutchib and group nsm to bin #Zs/hutchib/bin/g #Zs/nsm/bin/g E (dd the following line to the top of "our protot"pe file i pkginfo* /pkginfo 9 5reate a pkginfo file for "our package $i /tmp/pkg/pkginfo (dd# >UG*CB7muttC ;(08*CmuttC (R57*CsparcC ?8RSIO;*C, -iC 5(!8GORN*CapplicationC ?8;DOR*Cmutt orgC 80(I2*CbrandonhutchinsonJhotmail comC >S!(0>*CBrandon 7utchinsonC B(S8DIR*C/usr/localC 52(SS8S*CnoneC 7ere are descriptions from SunfreewareBs page on what the fields mean# >UG * the name "ou ha$e chosen for the package director" ;(08 * the program name (R57 * the operating s"stem $ersion ?8RSIO; * the $ersion number for "our program 5(!8GORN * the program is an application ?8;DOR * whoe$er wrote the software 80(I2 * an email contact >S!(0> * the person who did the port perhaps B(S8DIR * the /usr/local director" where the files install 52(SS8S * Qust put none here % 5reate the package in datastream format cd /tmp/pkg pkgmk 4r `pwd`

,& !ranslate the package into a file s"stem format cd /$ar/spool/pkg pkgtrans 4s `pwd` /tmp/mutt4, -i ,, 5ompress the package g+ip /tmp/mutt4, -i Nou should now be able to install the package on the appropriate platform using the pkgadd command F pkgadd 4d /mutt4, -i posted by Brahma at 12:22 PM & comments

5isk duplication
Disk duplication It is eas" to duplicate a disk with the same geometr" =c"linders, heads, sectors@ with the dd command In the following example, I will duplicate boot disk c&t&d& with c&t,d& on a Solaris s"stem Of course, this is not the same as mirroring the boot disk !he dd commandBs bit4for4bit cop" includes the partition table and boot block, so duplicating the partition table with prt$toc and making the disk bootable with installboot is not necessar" F format M /de$/null Searching for disks done (?(I2(B28 DISU S8285!IO;S# & c&t&d& MSU;% &G c"l -%.- alt . hd .E sec ,::K /sbusJ,f,&/SU;W,fasJe,99&&&&&/sdJ&,& , c&t,d& MSU;% &G c"l -%.- alt . hd .E sec ,::K /sbusJ,f,&/SU;W,fasJe,99&&&&&/sdJ,,& Specif" disk =enter its number@# , 0ake a bit4for4bit cop" of the source disk to the destination disk with dd Use a , megab"te blocksi+e instead of the /,. b"te default to speed up the operation dd if*/de$/rdsk/c&t&d&s. of*/de$/rdsk/c&t,d&s. bs*,&.-k . 5hange the /etc/$fstab file on the duplicate boot disk to reflect the correct S5SI ID

mkdir /tmp/mnt mount /de$/dsk/c&t,d&s& /tmp/mnt $i /tmp/mnt/etc/$fstab 5hange references of c&t&d& to c&t,d&# #Zs/c&t&d&/c&t,d&/g #w'T umount /tmp/mnt : !est booting off the duplicate boot disk =assuming disk, is the correct Open Boot >rompt de$ice alias for c&t,d&s&@ reboot 44 disk, posted by Brahma at 12:22 PM & comments

2at&erin9 Solaris system information


Gathering Solaris s"stem information ( U;I1 administrator ma" be asked to gather s"stem information about his/her Solaris s"stems 7ere are the commands used on a Solaris E s"stem to gather $arious s"stem information >rocessors !he psrinfo utilit" displa"s processor information When run in $erbose mode, it lists the speed of each processor and when the processor was last placed on4line =generall" the time the s"stem was started unless it was manuall" taken off4line@ /usr/sbin/psrinfo 4$ Status of processor , as of# ,./,./&. &%#./#/& >rocessor has been on4line since ,,/,E/&. .,#,&#&% !he sparc$% processor operates at -&& 07+, and has a sparc$% floating point processor Status of processor : as of# ,./,./&. &%#./#/& >rocessor has been on4line since ,,/,E/&. .,#,&#,, !he sparc$% processor operates at -&& 07+, and has a sparc$% floating point processor !he psradm utilit" can enable or disable a specific processor !o disable a processor# /usr/sbin/psradm 4f processorHid

!o enable a processor# /usr/sbin/psradm 4n processorHid !he psrinfo utilit" will displa" the processorHid when run in either standard or $erbose mode R(0 !he prtconf utilit" will displa" the s"stem configuration, including the amount of ph"sical memor" !o displa" the amount of R(0# /usr/sbin/prtconf I grep 0emor" 0emor" si+e# :&E. 0egab"tes Disk space (lthough there are se$eral wa"s "ou could gather this information, the following command lists the amount of kilob"tes in use $ersus total kilob"tes a$ailable in local file s"stems stored on ph"sical disks !he command does not include disk space usage from the /proc $irtual file s"stem, the flopp" disk, or swap space df 4lk I egrep 4$ C<iles"stemI/procI/de$/fdIswapC I awk B[ totalHkb"tes 6* Y. ] [ usedHkb"tes 6* Y: ] 8;D [ printf CZd of Zd kilob"tes in use \nC, usedHkb"tes, totalHkb"tes ]B ,%..,E/9 of ,:/%-%E// kilob"tes in use Nou ma" want to con$ert the output to megab"tes or gigab"tes and displa" the statistics as a percentage of utili+ation !he abo$e command will list file s"stem usage If "ou are interested in listing ph"sical disks =some of which ma" not be allocated to a file s"stem@, use the format command as the root user, or the iostat 48n command as a non4pri$ileged user >rocessor and kernel bits If "ou are running Solaris . L or earlier, "ou are running a :.4bit kernel Determine bits of processor# isainfo 4b$ Determine bits of Solaris kernel# isainfo 4k$ posted by Brahma at 12:20 PM & comments

#AU statistics
ans m-, wrote# K it gi$es onl" a current snapshot without arguments, it actuall" gi$es an a$erage of stats since last reboot K it isnBt possible to $iew pre$iousl" collected data K with mpstat, isnBt it A mpstat doesnBt collect samples, but "ou can easil" script it, eg# mpstat :& ,.& K /$ar/tmp/mpstat out will collect for one hour with a :& sec inter$al Nou can also directl" peek the kernel counters like this# kstat 4! d 4p cpu#)#s"s#cpuHticksHidle cpu#)#s"s#cpuHticksHkernel cpu#)#s"s#cpuHticksHuser :& posted by Brahma at 12:20 PM & comments

Friday, %u9ust 12, 2005


Need &elp to tar files in a directory olderJcreation dateK t&an 5 days old
eed help to tar files in a director" older=creation date@ than -/ da"s old (ll - messages in topic 4 $iew as tree ;eed help to tar files in a director" older=creation date@ than -/ da"s old sa" there is ,&&& files in the director" and onl" :&& of them are older than -/ da"s old i want to ha$e it archi$e=tar@ onl" the :&& older files and lea$e the rest <ilename structure is# filename dat O =the" ha$e been compressed alread" I Qust cant seem to get an"thing I tr" to work correctl" please helpT I was tr"ing combinations of find and tar wasnBt working right d K I was tr"ing combinations of find and tar wasnBt working right

2inux# find 4t"pe f 4mtime 6-/ 4print& I xargs 4& tar cf /file tar Solaris, 7>U1,, ,,# find 4t"pe f 4mtime 6-/ 4exec tar cf /file tar [] 6 If none of the abo$e works, and file names do not ha$e spaces# find 4t"pe f 4mtime 6-/ 4print I xargs tar cf /file tar K find 4t"pe f 4mtime 6-/ 4print& I xargs 4& tar cf /file tar K find 4t"pe f 4mtime 6-/ 4exec tar cf /file tar [] 6 K find 4t"pe f 4mtime 6-/ 4print I xargs tar cf /file tar WouldnBt the abo$e methods o$erwrite C /file tarC each time the max F of arguments to BtarB is reached =first and third cases, due to repeating the tar in$ocation with a new list of filename arguments@, or for each new file found =second case, one tar in$ocation per file found@A Repl" K 2inux# K find 4t"pe f 4mtime 6-/ 4print& I xargs 4& tar cf /file tar Without xargs# find 4t"pe f 4mtime 6-/ 4print I tar 4cf file tar 4! 4 posted by Brahma at 3:46 PM & comments

Usin9 t&e script command 'it&in a pro9ram


Using the script command ( I want to use the script command within a shell script to capture the commands and their output I know I can redirect stdout/stderr to a file but I would prefer to use the script command If I use it in a bash shell, the command starts up fine but I cannot figure out how to stop it I tried using exit, but it simpl" exits out of the shell script not the command script Is this possible A If so how A !hanks, Ue$in

K If I use it in a bash shell, the command starts up fine but I cannot K figure out how to stop it I tried using exit, but it simpl" exits out K of the shell script not the command script What "ou probabl" want is# script 4c /path/to/"our/script /path/to/output/file 44 K What "ou probabl" want is# K script 4c /path/to/"our/script /path/to/output/file (ssuming that "our script has a B4cB option Otherwise tr" S7822*/path/to/"our/script script /path/to/output/file and reset S7822 inside "our script =Nou can sa$e the $alue of S7822 if needed in another $ariable@ Repl" posted by Brahma at 3:45 PM & comments

8'o <A?s %ddresses


Nou ha$e to create one hostname file for each ip# hostname eri& hostname eri&#, hostname eri&#. hostname eri&#: hostname eri&#hostname eri&#/ hostname eri&#L In e$er" file "ou ha$e to enter one line with the hostname of the ip !he hostname must ha$e an corresponding entr" in /etc/hosts where "ou ha$e to specif" the ip 5u, florian 4444444444444444444444444444444444444444444444444444444444444444444444 =HH@ <lorian 0eister =oo@

/4444444\/ / I II ) IIw444II aa aa C!he onl" problem with troubleshooting is that sometimes trouble shoots back C 4444444444444444444444444444444444444444444444444444444444444444444444 Betreff# !wo I>Bs (ddresses 7ello e$er"one Somebod" know how can I configure two I>Bs addresses =,%. ,L9 - .9 and ,%. ,L9 - ./,@ on the same network card 8thernet ,&/,&&0bpsA !he ser$er is a Sun using Solaris 9 OS !hank "ou 8DSO; posted by Brahma at 3:44 PM & comments

syslo9-conf 'ildcards
****************** !O>I5# s"slog conf wildcards hi i recentl" tried to change the s"slog conf file to ha$e ) ) Jremoteser$er where Cremoteser$erC is a remote host with s"slog daemon running I restarted s"slog b" using kill 47U> Cs"slog pidC When i use the logger command to insert a custom log message, the message did not get transfered to Cremoteser$erC But when i changed the s"slog conf to something like auth notice Jremoteser$er and using the logger command after restarting s"slog, it works !he message did get transfered to Cremoteser$erC wh" doesnBt the wildcard workA Is there something else i need to do A thanks

eight&.L-/%%%J"ahoo com wrote# K i recentl" tried to change the s"slog conf file to ha$e K ) ) Jremoteser$er Solaris s"slog doesnBt allow ) ), tr" the following ) debug Jremoteser$er which should ha$e the same effect =and remember to use !(Bs #4@@ 44 Geoff 2ane !he attitude ``!he computer said so, so it must be rightBB is alwa"s amusing to the people who program them posted by Brahma at 3:42 PM & comments

can < look at t&e t&read for a e=ecutable run)


*************************************************************** *************** !O>I5# can I look at the thread for a executable runA KI ha$e a multiple4thread application on solaris ,&, wonder how can I Ktell from os le$el how man" threads this app is runningA Cps 4o nlwpC =and more so "ou can tell which process is running with that man" lwps@ ps 4o lwp 4p MpidK posted by Brahma at 3:41 PM & comments

8*A<#0 S*"%6<S "5%A #"<3N8 <N8326%8<*N M<8; *A3N"5%A


!O>I5# SO2(RIS 2D(> 52I8;! I;!8GR(!IO; WI!7 O>8;2D(> ******************************* I am starting to setup m" Solaris 9 boxes to talk to a 2inux Openldap ser$er =. . L@ I cannot remember the patchid but IBm patched the Solaris boxes with the latest 2D(> client patches 4 IBm aware there were some issues with the original ldapclient in Sol9 !he howtoBs IBm following ha$e me manuall" editing the ldapHclientHfile =against SunBs recommendation@ but it seems to be the wa" of getting the ;ati$e Sun 2D(> client to speak with Openldap

!he test Solaris boxes happil" 'uer" the 2D(> ser$er for their user information and users can log in 4 the Solaris 2D(> client uses a speciall" created =prox"@ ldap account to log into 2D(> ser$er !he problem I ha$e is the root account cannot arbitraril" reset passwords =as it should normall" do@, if root tries to change a users password it prompts for the users current password before asking for the new one =ala a regular user@ !he password change does work On 2inux using the >(D2 nssHldap libraries there is an option in the 2D(> configuration files to define a CrootC login for 2D(> i e an" process running as UID & uses the gi$en credentials =defined as rootD;@ which will be suitabl" permissioned I donBt ha$e the option of using >(D2 nssHldap libraries on solaris =I know I could compile them@ I ha$e to use what is there alread" 7ow does Solaris normall" get around this problem or is all management functions =e g resetting passwords@ done through some fanc" GUI based tool =weBre not running 1 on the boxes either@ So after rambling awa" m" 'uestion is is there an e'ui$alent configuration option in the Solaris ;ati$e 2D(> client to the >(D2 nssHldap configuration option RootD;A I ha$e a suspicion the answer is no and all management le$el stuff is done purel" through the GUI tool rather than existing ldapified commands e g passwd !hanks in ad$ance for an" insights K I ha$e a suspicion the answer is no and all management le$el stuff is K done purel" through the GUI tool rather than existing ldapified K commands e g passwd We donBt use the GUI tools either, and also donBt use passwd and such We use 2D(> (dministrator =www ldapadministrator com@ to do all administration in 2D(> directl" ;o need to pa" for 2D(> (dministrator, there are also other tools around =2D(> Browser/8ditor b" Parek Gawor is the one IBm using at home@ 7!7, 8rik posted by Brahma at 3:40 PM & comments

tcs& startup tasks

tcsh startup tasks (ll - messages in topic 4 $iew as tree What exactl" does tcsh do after completing processing of cshrcA I ha$e a dela" of : to / seconds e$er" time I login to m" Solaris account, which uses /bin/tcsh as m" login shell I added the line echo C28(?I;G cshrcC as the last line of cshrc !his print statement is printed $er" 'uickl" after I login !hus, the problem does not lie withing cshrc (lso, onl" )after) the :4/ sec dela" is o$er do I enter login =because I added an echo command as the first line of that file@ 7ence, IBm interested in whate$er occurs after cshrc but before login I do not ha$e a tchsrc file, and /etc/csh cshrc and /etc/csh login do not exist Repl" !he Solaris 9 man page sais If the shell is a login shell, this is the se'uence of in$o4 cations# <irst, commands in /etc/ login are executed ;ext, commands from the cshrc file "our home director" are exe4 cuted !hen the shell executes commands from the login file in "our home director"W the same permission checks as those for cshrc are applied to this file and If "ou start csh as a login shell and "ou do not ha$e a login in "our home director", then the csh reads in the /etc/ login !he ,st statement is true, and I07O the .nd is wrong (n"wa" there should be nothing between cshrc and login Nou can test the tcsh login as follows# mkdir tmp cd tmp ln 4s /bin/tcsh /4tcsh en$ >(!7*Y[>(!7]# 4tcsh

(nd replace the latter b" truss 44 0ichael !osch J hp # com Repl" !r" setting the 857O and the ?8RBOS8 $ariables inside "our tcshrc seten$ echo seten$ $erbose Use lowercaseT and make sure to do seten$, not Qust set Nou want these $ariables to carr" on into further processes !hese will show "ou e$er" command executed Repl" I found the culprit 4 an 90B histor" fileT Remo$ed that file and not onl" do logins speed up, but also logouts were affected as well 4Bob (ndo$er, 0( posted by Brahma at 3:33 PM & comments

#&an9e Net'ork parameters


e# Weblogic instance going down again and again dp 4 Nou didnBt pro$ide much information on "our en$ironment for the weblogic ser$ers I donBt think an"one out there could help "ou debug something we donBt ha$e information for 7ereBs some things "ou can do on the OS side to ensure "our issue isnBt related to bad s"stem tunning IBm not going to list the tunables for each OS $ersion, so I will assume it is running Solaris 9 , Nou need to check "our file descriptor limits TTT Solaris 9 is 9,%. 4 check "our open files, using lsof on the application director" with a word count 5heck it against "our current file descriptor limits 4 uname 4a, uname 4n If the limit is not high enough, then bump it up On second thought, bump it up an"wa", it could onl" hurt "ou keeping it too low ) In /etc/s"stem add line set rlimHfdHmax*9,%. and set rlimHfdHcur*9,%. . 7ereBs some common tunables also in the s"stem file

set tcp#tcpHconnHhashHsi+e*:.EL9 set autoup %&& set tuneHtHfsflushr , : Nou ma" also want to increase = as long as enough shared memeor" is a$ailable @ the Qa$a memor" 41ms,.9m 41mx.&&m - finall" set the tcp tunables IBm including the oneBs I use, but should onl" be used as guidelines for "ou !hese will not be permanent, so "ou need to include in a rc startup script /usr/sbin/ndd 4set /de$/tcp tcpHtimeHwaitHinter$al L&&&& /usr/sbin/ndd 4set /de$/tcp tcpHconnHre'HmaxH' ,L:9/usr/sbin/ndd 4set /de$/tcp tcpHconnHre'HmaxH'& ,L:9/usr/sbin/ndd 4set /de$/tcp tcpHipHabortHinter$al L&&&& /usr/sbin/ndd 4set /de$/tcp tcpHkeepali$eHinter$al :.&&&& /usr/sbin/ndd 4set /de$/tcp tcpHrexmitHinter$alHinitial -&&& /usr/sbin/ndd 4set /de$/tcp tcpHrexmitHinter$alHmax ,&&&& /usr/sbin/ndd 4set /de$/tcp tcpHrexmitHinter$alHmin :&&& /usr/sbin/ndd 4set /de$/tcp tcpHsmallestHanonHport :.EL9 /usr/sbin/ndd 4set /de$/tcp tcpHxmitHhiwat ,:,&E. /usr/sbin/ndd 4set /de$/tcp tcpHrec$Hhiwat ,:,&E. /usr/sbin/ndd 4set /de$/tcp tcpHnaglimHdef , /usr/sbin/ndd 4set /de$/ce instance & /usr/sbin/ndd 4set /de$/ce rxHintrHtime :. Regards, Brian posted by Brahma at 3:32 PM & comments

can not crontab @e


Re# can not crontab 4e T 7i , 5heck whether "our editor is set to ?I or not or directl" "ou can do this at command promt set 8DI!OR*$i =enter@ posted by Brahma at 3:30 PM & comments

ptree #53 &an9e


5D8 hang 7i,

When I use the 1 manager to connect to one of the s"stems, it hang on the CStarting the 5ommon Desktop 8n$ironment 5D8 ?ersion , -C after supplied the login ID and password 7ow to sol$e this problemA !hanks in ad$ance Repl" 0ichael !osch Nou can debug it ptree `pgrep dtlogin I head 4,` and run Ctruss 4pC on the "oungest process ID 7ow to go about itA F truss 4p L&&/ poll=&x<<B8<((9, ., 4,@ =sleeping @ signotif"wait=@ =sleeping @ lwpHcondHwait=&x<<,.:-89, &x<<,.:-<9, &x<<,,5D9&@ =sleeping @ lwpHcondHwait=&x<<,,5D.9, &x<<,,5D,&, &x&&&&&&&&@ =sleeping @ lwpHcondHwait=&x<<,.:-89, &x<<,.:-<9, &x<<,,5D9&@ 8rrFL. 8!I08 poll=&x<<B8<((9, ., 4,@ =sleeping @ signotif"wait=@ =sleeping @ lwpHcondHwait=&x<<,.:-89, &x<<,.:-<9, &x<<,,5D9&@ =sleeping @ lwpHcondHwait=&x<<,,5D.9, &x<<,,5D,&, &x&&&&&&&&@ =sleeping @ K Sorr", how to go about running the ptree commandA K N5 man ptree /usr/bin/ptree older Solaris $ersions ha$e /usr/proc/bin/ptree 7ere "ou go# F ptree 4a %%:: , /etc/init 4

L&&/ /usr/dt/bin/dtlogin 4daemon %%:: /usr/dt/bin/dtlogin 4daemon %%/E /bin/ksh /usr/dt/bin/1session %%9: /usr/dt/bin/solregis 4cd %%%E /usr/dt/bin/sdtHshell 4c unset H >WDW /export/home/ope ,&&&& /usr/bin/bash 7mm, "ou ha$e likel" an offending line in "our profile, looks like "ou ha$e C/usr/bin/bashC, which starts another interacti$e session Remo$e this lineT posted by Brahma at 3:29 PM & comments

,onday, %u9ust 08, 2005


searc& inode symbolic links
(fter getting the inode number b" ls 42li file "ou can find hard links b" running Cfind 4inum C on the same file s"stem ( s"mbolic link can be in an" file s"stem, and there are different representations for it =e g C 4K afileC or C 4K /afileC@ K .@ In case we ha$e s"mlinks to that file 4 where the" are A One can tr" to find them b" running Cfind 4follow 4inum C on each file s"stem 7owe$er, there might be s"mbolic links on another host that are not $alid on )this) host posted by Brahma at 8:35 AM & comments

;o' do < find out '&at my mac&ine?s memory is bein9 used for)
SubQect# L -@ 7ow do I find out what m" machineBs memor" is being used forA 7ow can I tell if I need more memor"A

!o disco$er how much $irtual memor" =i e swap@ is free, run Cswap 4sC or C$mstatC If "ouBre using tmpfs for /tmp, Cdf /tmpC will also work Disco$ering how ph"sical memor" is being used can be more difficult, howe$er 0emor" pages that are not being used b" processes are used as a sort of extended cache, storing pages of memor"4mapped files for possible later use !he kernel keeps onl" a small set of pages free for short4term use, and frees up more on demand 7ence the free memor" reported b" $mstat is not an accurate reflection, for example, of the amount of memor" a$ailable for user processes (n eas" wa" to determine whether or not "our machine needs more memor" is to run $mstat and examine the po =page out@ column and the sr =scan rate@ column If these columns consistentl" show large numbers, this suggests that "our machine does not ha$e enough memor" to support its current workload, and fre'uentl" needs to write pages belonging to acti$e processes to disk in order to free up enough memor" to run the current Qob posted by Brahma at 8:32 AM & comments

M&at can < do if my mac&ine slo's to a cra'l or /ust &an9s)


SubQect# L .@ What can I do if m" machine slows to a crawl or Qust hangsA !r" running CpsC to look for large numbers of the duplicate programs or processes with a huge si+e field Some s"stem daemons occasionall" can get into a state where the" fork repeatedl" and e$entuall" swamp the s"stem Uilling off the child processes doesnBt do an" good, so "ou ha$e to find the CmasterC process It will usuall" ha$e the lowest pid (nother useful approach is to run $mstat to pin down what resource=s@ "our machine is running out of Nou can tell $mstat to gi$e ongoing reports b" specif"ing a report inter$al as its first argument !he programs CtopC and CspsC are good for finding processes that are loading "our s"stem C!opC will gi$e "ou the processes that are consuming the most cpu time CSpsC is a better $ersion of CpsC that runs much faster and displa"s processes in an intuiti$e manner !op is a$ailable at ftp#//ftp groups"s com/pub/top/ Sps is a$ailable at ftp#//ftp cs$ warwick ac uk/pub/solaris./sps4sol. tar g+ Doug 7ughes MDoug dot 7ughes at 8ng dot (uburn dot 8DUK has written a small, 'uick >S workalike called C'psC, a$ailable from his web page at http#//www eng auburn edu/users/doug/second html

Sometimes "ou run out of memor" and "ou wonBt be able to run enough commands to e$en find out what is wrong Nou will get messages of the t"pe Cout of memor"C or Cno more processesC ;ote that Cout of memor"C refers to $irtual memor", not ph"sical memor" On a Solaris s"stem, $irtual memor" is generall" e'ual to the sum of the swap space and the amount of ph"sical memor" =less a roughl" constant amount for the kernel@ on the machine !he command Cswap 4sC will tell "ou how much $irtual memor" is a$ailable Nou can s"nc the disks to minimi+e files"stem corruption if "ou ha$e to crash the s"stem# Use the 2,4( se'uence to crash the s"stem If "ou are on an older s"stem, t"pe Cg&C and "ou will get the message Cpanic# s"ncing file s"stemsC When "ou see the word CdoneC, hit 2,4( again and reboot On s"stems with the CnewC prom, t"pe CnC to get into the new command mode and t"pe Cs"ncC posted by Brahma at 8:31 AM & comments

'&at is t&e minor faults meanin9 in mpstat


SubQect# SU00(RN# what is the minor faults meaning in mpstat !hank "ou all for the responses RussellBs answer was the most clear one and I think e$er"bod" can ha$e benefith of reading this ;ot onl" those who donBt know, but also the for the once alread" know it can be refreshing to read this one# ( process running on a t"pical :. bit s"stem is allowed to address -Gb of memor" !here is a reall" huge amount a$ailable to it on a L-bit s"stem !his memor" isnBt reall" there, so it is called C$irtual memor"C !he range of a$ailable addresses in $irtual memor" is called the processBs Caddressspace C 0ost of the time the process will be holding onl" a few pointers into different parts of itBs address space and will be attempting to read and write memor" through those pointers (ll of these memor" accesses are intercepted b" the operating s"stem =OS@ which maps the C$irtualC address the process in using to a real address in R(0 Ob$iousl" there isnBt enough R(0 on most computers to e$en do a one4to4one mapping from the processes $irtual addresses to a ph"sical address <ortunatel", because the process can onl" access itBs address space through pointers, it can onl" access a few addresses at a time 0oreo$er, generall" each new access is to an address that is near the most recent access

Statisticall", most of a processBs pages will onl" get accessed once 7owe$er, in the short run there will be a small block of pages that are being accessed fre'uentl", because most programs contain loops, and repeatedl" read certain pages Onl" rarel", =hopefull"T@ a process will access a page that it last accessed a relati$el" long time ago 7ere is how the OS manages all of this# , 5hunks of real memor" are allocated to the process in pages On Solaris, the page si+e is -&%L b"tes 8ach page is timestamped whene$er a process references it If the process writes on the page it is marked as Cdirt"C . >eriodicall" a kernel process called pageout =>ID*.@ sweeps through ph"sical memor" and mo$es pages that ha$enBt been accessed b" a process for a long time to a free list !hese times are in the order of tens of seconds During a memor" shortage, the sweep rate increases : If there is a shortage of ph"sical memor", the oldest, dirt" pages in the free list get written onto the swap de$ice When a process accesses a $irtual address, one of three things can happen# , !he corresponding ph"sical page is in memor" !he access succeeds . !he page is not in memor" 4 but it is on the disk !his is called a CmaQor faultC !he process is blocked and a context switch occurs While the process is waiting, the page is brought off the disk into memor", the processes 7ardware (ddress !able =7(!@ is updated and the process is marked CrunnableC : !he page is no longer mapped into the process, but is on the free list !his is called a Cminor fault C =I got there at lastT@ In this case a context switch still occurs and the page is remo$ed from the free list and mapped back into the process !here is a more light4hearted explanation here# http#//www netQeff com/humor/item cgiAfile*!he!hingUing posted by Brahma at 8:31 AM & comments

top 5 #AU consumin9 processesprstat 4s cpu 4n / means sort the processes b" 5>U utli+ation for the top / 5>U consuming processes

posted by Brahma at 8:30 AM & comments

#53 &an9
O>I5# 5D8 hang ** , of , ** Date# !hurs - (ug .&&/ ,:#,9 <rom# 0ichael !osch ;ewBie wrote# K 7i, K K When I use the 1 manager to connect to one of the s"stems, it hang on the K CStarting the 5ommon Desktop 8n$ironment 5D8 ?ersion , -C after supplied the K login ID and password K K 7ow to sol$e this problemA K K !hanks in ad$ance K K Nou can debug it ptree `pgrep dtlogin I head 4,` and run Ctruss 4pC on the "oungest process ID posted by Brahma at 8:30 AM & comments

8&ursday, %u9ust 0 , 2005


UN<( system performance and resource utili+ation measurin9 tool
!O>I5# U;I1 s"stem performance and resource utili+ation measuring tool KKK Is there an" U;I1 s"stem performance and resource utili+ation measuring KKK tool KKK with graphical displa" a$ailable for freeA KK KK KK <or Solaris, hereBs one# KK KK http#//www sunfreeware com/setoolkit html

KK KK !r" Cse +oom seC K K (nd if "ou want something fancier than that, "ou can get Orca, which is K built on top of the se toolkit I downloaded but not able to install orca though both se tool and rrdtool had installed successfull" Got the following when make command issued# pod.man 44release*, & -& 44center*rrdtool rrdtool pod K rrdtool , sh# pod.man# not found ))) 8rror code , make# <atal error# 5ommand failed for target `rrdtool ,B 5urrent working director" /export/home/operator/orca4& .E/packages/rrdtool4, & &/doc ))) 8rror code , make# <atal error# 5ommand failed for target `all4recursi$eB 5urrent working director" /export/home/operator/orca4& .E/packages/rrdtool4, & & ))) 8rror code , make# <atal error# 5ommand failed for target `makeHrrdtoolB 5urrent working director" /export/home/operator/orca4& .E/packages ))) 8rror code , make# <atal error# 5ommand failed for target `allB posted by Brahma at 10:04 AM & comments

sendmail
) ?ortex M$ortexHsltJ"ahoo frK wrote# R S K !he line concerning alias in m" sendmail mc is # K K define=`(2I(SH<I28B,`/etc/mail/aliasesB@dnl IBll Qust assume "ou also created a new sendmail cf file from the sendmail mc after changing it and restarted the daemon (s root, run C/path/to/sendmail 4b$ rootC and post the output 44 >rogress =n @# !he process through which Usenet has e$ol$ed from

smart people in front of dumb terminals to dumb people in front of smart terminals 44 obsJburnout demon co uk posted by Brahma at 10:03 AM & comments

Arintinn9
If I `cut filename I telnet a b c d %,&&` the printer prints the file, howe$er if I `lpr 4> hplQ-,&&psH, /etc/printers conf` or I do `lp 4d hplQ-,&&psH,/ profile` onl" the first Qob will be printed =repeatedl"@, the second Qob ne$er prints, both Qobs are stacked in the 'ueue, so I ha$e to remo$e them forcefull" b" `lpc abort all` Does an"bod" successfull" o$ercome this issueA posted by Brahma at 10:03 AM & comments

door File
Its a BdoorB file Door files are used for inter process communication !hanks to all who replied GR K7i gu"s, what t"pe of file is the following KDr44r44r44 , root root & Pan ,& .&&/ picldHdoor K K KWhat does the BDB in the permissions mean A K posted by Brahma at 10:02 AM & comments

Aanics
2og files Related messages in /$ar/adm/messages are checked Sometimes hardware and software failures are prefaced b" messages written to the log file If there are disk error messages in the log file, and U;I1=r@ file s"stem =U<S@ routines listed on a stack trace, it is likel" that there is a disk hardware problem >anics Often, s"stem panics can originate from software, howe$er, it is possible to incur a panic from a hardware fault Some panic

messages that indicate hardware problems include # (s"nchronous memor" error Indicates a memor" problem (s"nchronous memor" fault Usuall" indicates a bus problem between memor" and 5>U posted by Brahma at 10:01 AM & comments

Arintinn9 <ssues
!he inabilit" to cancel a Qob could be attributed to the contents of "our /etc/inetd conf file, specificall" the in lpd line It has to be uncommented (;D it 0US! refer to CtcpLC and not tcp Nou should also run the command pmadm 4l and make certain there are no references to tcp ser$ices +smon ser$ices are OUW the" are for serial ports !5> ser$ices in this context can cause problems and should be remo$ed Urishna, "ou report two problems !he second problem =canBt cancel print Qobs@ compounds the first =print Qobs repeating endlessl"@ In most cases, the second problem is easier to fix than the first, so itBs a good place to start 0artha suggested the correct entr" in /etc/inetd conf !he old4st"le !5> listener daemons can also interfere with the operation of the cancel command, and the" are no longer used for printing Run these commands to disable the listeners to pre$ent them from causing trouble# pmadm 4r 4p tcp 4s lpd pmadm 4r 4p tcp 4s lp pmadm 4r 4p tcp 4s & =thatBs the number +ero@ See if that helps the problem with the cancel command !he problem with the repeated print Qobs is something IB$e seen happen with the 7> Petdirect/7>>I software If "ou look in the file /opt/hpnpl/R8(D08 U;1, "ouBll find some $er" interesting reading in Section III# )))))))))))))))))))))))))))))))))))) III ISSU8S/SO2U!IO;S/WORU(ROU;DS ))))))))))))))))))))))))))))))))))))

: Issue# Pob get printed more than once in 2aserPet 9/&&, ,,&& and ./&&50 printer Solution# !urn off Pob reco$er" for the printer 'ueue In this case, Qobs will not get reco$ered if there is power failure

L Issue# 2arge Qob prints again and again and gi$es C5onnection reset b" peerC error in 2P-/&& when time out is set to %&sec in printer front panel Workaround# Increase the idle4timeout $alue b" increments of %&sec on the 7> Petdirect If the maximum $alue of :L&&sec does not resol$e issue, then tr" &sec E Issue# Pobs are printed multiple times b" hpnpf if the printer is offline for long time Workaround# Increase the idle4timeout $alue b" increments of %&sec on the 7> Petdirect If the maximum $alue of :L&&sec does not resol$e issue, then tr" &sec >erhaps one of those workarounds suggested b" 7> will help Since I recei$ed some replies to m" pre$ious summar", I include a second summar" including them, since the" ma" be of interest to some of "ou Basicall"# !im 7enrion said# I missed "our original 'uestion when it was sent to the list We had this same problem and fixed it the same wa" as "ou did !he problem was caused b" the listener not running 5heck out the man pages for listen and nlsadmin to learn more (nd 0athew Stier was kind enough to include the setup procedure to manuall" define a printer on Solaris . / =which I include at the end of this mail@ Definitel", it seems that some of these steps is performed b" admintool but not b" Qetadmin install printer

7ope this summar" is usefull for someone else there 0ariel ORIGI;(2 >OS! I hope this is an eas" and stupid thing that I am doing I am tr"ing to install an 7> -? network printer I installed Qetadmin I defined the printer using Qetadmin =all the files under /etc/printers are created ok@ When I t"pe# lp', after waiting for a long time, I get the following message# could not talk to print ser$ice at BmachineHnameB When I tr" to print something using lpr 4> printer filename, I get on the console the follwoing message# 8rror transfering print Qob , check 'ueue for =printerHnameJmachineHname@ I shut down and restared the lpsched hundred of times alread", and e$en rebooted the machine =Qust in case@ to no a$ail (n" ideasA <IRS! SU00(RN I am still pu++led about this problem I donBt think I found a solution but Qust a workaround If "ou ha$e a machine, that was ne$er defined as printer ser$er before, "ou install Qetadmin, and then define a printer $ia Qetadmin, "ou get this error !his happens no matter which $ersion of Qetadmin "ou use =I tried with : of them including the last one : ,/@ !he workaround is to define another printer =e$en a non existing one@ using admintool !his makes the lp' and the rest of the commands start working, and "ou are able to use the network printer without an" problems, e$en if afterwards "ou delete that extra printer I think that the problem might be something that is done when admintool defines a printer that the Cadd printerC of Qetadmin doesnBt do, but I do not know what it is >RI;!8R S8!U> >RO58DUR8 I;<ODO5 ID# .&%E

SN;O>SIS# Solaris . printer configuration commands 4 'uick reference D8!(I2 D8S5RI>!IO;# Setting up local printers under Solaris . x Some of these steps are onl" for information# the"Bre commented out 0ost of this has to be done as root <ormat is 8nglish description, then . x command on the right 5heck general printer status lpstat 4s If not running, start /etc/init d/lp start F !o stop all print ser$ices /etc/init d/lp stop Show all printers configured lpstat 4p all Show a particular printer lpstat 4p m"printer Show a particular printer in detail lpstat 4p m"printer 4l 5heck port monitor ser$ices pmadm 4l !urn off the portmonitor on tt"b pmadm 4d 4p +smon 4s tt"b pmadm <2GS changes to BuxB F !o turn O; the portmonitor on tt"b pmadm 4e 4p +smon 4s tt"b F pmadm <2GS changes to BuB (dd a new printer on tt"b cd /de$/term chgrp lp bW chown lp bW chmod LL& b lpadmin 4p m"printer 4$ /de$/term/b Send the output to a file touch /tmp/printout instead chmod LLL /tmp/printout F temporar" lpadmin 4p m"printer 4$ /tmp/printout F Remo$e a printer lpadmin 4x m"printer !o enable enable m"printer

!o accept Qobs accept m"printer !o check status =again T@ lpstat 4p m"printer !o print something lp 4d m"printer /etc/passwd (llow normal users to print without lpadmin 4p m"printer 4o nobanner banners =otherwise, onl" root can print without banners@ <ix up the serial line settings lpadmin 4p m"printer =still no banner@ 4o Cnobanner stt"*Bcs9 ,%.&&BC (dd a description lpadmin 4p m"printer 4D B0" new printerB 0ake it the s"stem default destination lpadmin 4d m"printer (t this point it should be possible to print a Qob and ha$e it appear either in /tmp/printout =if thatBs the output de$ice@ or on the printer (dding filters !he scheduler attempts to match the t"pe of Qob beingprinted to the t"pe of the printer If it does not find one, it prints an error message# F lp 4d m"printer 4! ps /etc/passwd U1#lp# 8RROR# !here is no filter to con$ert the file content !O <I1# Use the lpstat 4p 4l command to find a printer that can handle the file t"pe directl", or consult with "our s"stem administrator F !o force a filter to be applied to a Qob, define# !he t"pe of the input Qob !he t"pe of data which the printer can accept !o print 7>G2 toan OS8L-/& printer, the 7>G2 must be followed b" the string B\&::Z4,.:-/xB =!he first character is 8S5(>8 @ !his can be accomplished as follows#

Define the printer as taking ose lpadmin 4p m"printer 4I ose data !he printer will onl" print data t"pe ose# the scheduler must find a filter to print other t"pes of data to this printer 0ake a director" for local filters mkdir /usr/lib/lp/local (dd a suitable filter cd /usr/lib/lp/local cat Khpgl.ose FT/bin/sh Fecho an"thing to send before the Qob cat 4 echo B\&::Z4,.:-/B exit & aD 0ake it executable, etc cd /usr/lib/lp/local 0ake it executable, etc chmod E// hpgl.ose chown lp hpgl.oseW chgrp lp hpgl.ose (dd a suitable filter definition cd /etc/lp/fd cat Khpgl.ose fd F comments here Input t"pes# hpgl Output t"pes# ose >rinter t"pes# an" >rinters# an" <ilter t"pe# fast 5ommand# /usr/lib/lp/local/hpgl.ose Options# >RI;!8R ) * 4p) aD chown lp hpgl.ose fd chgrp lp hpgl.ose fd chmod LL- hpgl.ose fd (dd it to the list of filters the lpfilter 4f hpgl.ose s"stem knows about 4< /etc/lp/fd/hpgl.ose fd

5heck the filters that the s"stem lpfilter 4f all 4l recogni+es 5heck Qust one filter lpfilter 4f hpgl.ose 4l F Remo$e a filter lpfilter 4f hpgl.ose 4x 5heck the output from the spooler lpadmin 4p m"printer 4$ /tmp/printout =printer is default dest@ cp /de$/null /tmp/printout lp 4! hpgl 4o nobanner /etc/passwd cat 4$ /tmp/printout 5heck that this file will print sleep :&&&& M/de$/term/b V ok if re'uired =stt" settings will stt" cs9 ,%.&& M/de$/term/b $ar"@ cp /tmp/printout /de$/term/b check the output tra" ps 4efl I grep :&&&& kill sleep4pid >oint the printer back at the lpadmin 4p m"printer 4$ /de$/term/b serial line 5onfiguring a print ser$er <ormat is 8nglish description, then . x command below =since the commands are too long to go on the same line@ Install patch ,&&9L: and append this line to /etc/lp/S"stems# 6#x#4#s/#4#n#,&#4#4#(llow all connections 5heck it works # F lps"stem 4l S"stem# 6 !"pe# s/ 5onnection timeout# ne$er Retr" failed connections# after ,& minutes 5omment# (llow all connections F

Identif" the ClistenC port monitor $ersion number =t"p -@ F nlsadmin 4? F Show all port monitors# this shows t"pical output# F sacadm 4l >0!(G >0!N>8 <2GS R5;! S!(!US 5O00(;D +smon tt"mon 4 & 8;(B28D /usr/lib/saf/tt"mon F F Show tcp ClistenC port monitors F sacadm 4l 4p tcp In$alid re'uest, tcp does not exist F (dd a listen port monitor if not present F sacadm 4a 4p tcp 4t listen 4c C/usr/lib/saf/listen tcpC 4$ Show tcp ClistenC port monitors F sacadm 4l 4p tcp >0!(G >0!N>8 <2GS R5;! S!(!US 5O00(;D tcp listen 4 & S!(R!I;G /usr/lib/saf/listen tcp F F Get the print ser$erBs uni$ersal address =in hex@ F lps"stem 4( &&&.&.&:9,%c99fb&&&&&&&&&&&&&&&& F (dd aBSD listener, if re'uired !he B-B is from Bnlsadmin 4?B abo$e F pmadm 4a 4p tcp 4s lpd 4i root 4$ - 4m `nlsadmin 4o /$ar/spool/lp/fifos/listenBSD 4( C\x&&&.&.&:9,%c99fb&&&&&&&&&&&&&&&&C` F

or =in sh, if "ou cannot cut and paste@ F ad*`lps"stem 4(` F pmadm 4a 4p tcp 4s lpd 4i root 4$ - 4m `nlsadmin 4o /$ar/spool/lp/fifos/listenBSD 4( C\xYadC` F 5heck that this has taken effect F pmadm 4l 4p tcp 4s lpd >0!(G >0!N>8 S?5!(G <2GS ID M>0S>85I<I5K tcp listen lpd 4 root \x&&&.&.&:9,%c 99fb&&&&&&&&&&&&&&&& 4 p 4 /$ar/spool/lp/fifos/listenBSD F F !o remo$e the listener at an" time, use F pmadm 4r 4p tcp 4s lpd !o add S"stem ? clients, add the S!R8(0 ser$ice used for print re'uests !he B-B is from Bnlsadmin 4?B abo$e F pmadm 4a 4p tcp 4s lp 4i root 4$ - 4m `nlsadmin 4o /$ar/spool/lp/fifos/listenS/` F 5heck that this has taken effect F pmadm 4l 4p tcp 4s lp >0!(G >0!N>8 S?5!(G <2GS ID M>0S>85I<I5K tcp listen lp 4 root 4 4 p 4 /$ar/sp ool/lp/fifos/listenS/ F F <igure out the address to use for ser$ice &, the nlps ser$er F lps"stem 4( &&&.&.&:9,%c99fb&&&&&&&&&&&&&&&& F which di$ides into#

&&&&&&&&&&&&&&&& ,L +eros for padding 9,%c99fb Ser$erBs I> address in hex &.&: BSD printer port ** /,/ &(58 S"s? printer port ** .ELL &&&. I;8! protocol famil" !he BSD listener uses the /,/ port as reported b" Blps"stem 4(B 4 the S"stem ? spooler uses .ELL, so theaddress must be changed to &&&.&(589,%c99fb&&&&&&&&&&&&&&&& !he C\xC is added to force it to be interpreted in hex (dd ser$ice &, the nlps ser$er F pmadm 4a 4p tcp 4s & 4i root 4$ - 4m C`nlsadmin 4c /usr/lib/saf/nlpsHser$er 4( B\x&&&.&(589,%c99fb&&&&&&&&&&&&&&&&B`C F 5heck that this has taken effect F pmadm 4l 4p tcp 4s & >0!(G >0!N>8 S?5!(G <2GS ID M>0S>85I<I5K tcp listen & 4 root \x&&&.&(589,%c 99fb&&&&&&&&&&&&&&&& 4 c 4 /usr/lib/saf/nlpsHser$er F F !o remo$e the S"stem ? listener at an" time, use F pmadm 4r 4p tcp 4s lp F pmadm 4r 4p tcp 4s & 5onfiguring a print client of a BSD print ser$er Register the print ser$er name with the print ser$ice F lps"stem 4t bsd bsdser$er Cbsdser$erC has been added F !o remo$e the print ser$er, use

F lps"stem 4r bsdser$er Remo$ed Cbsdser$erC F !o check whatBs been added F grep bsdser$er /etc/lp/S"stems bsdser$er#x#4#bsd#4#n#,&#4#4# F (dd the printer to the client s"stem !his information is entered into the director" /etc/lp/printers b" the lpadmin command F lpadmin 4p localHprtHname 4s bsdser$erTrmtHprtHname !o remo$e the printer, use F lpadmin 4x localHprtHname Set the printerBs content and t"pe F lpadmin 4p localHprtHname 4! unknown 4I an" (llow 'ueuing F accept localHprtHname 8nable the printer F enable localHprtHname 5heck the configuration F lpstat 4p localHprtHname 4l printer localHprtHname is idle enabled since Sun 0a" % ,E#/&#,/ BS! ,%%: a$ailable 5ontent t"pes# an" >rinter t"pes# unknown Description# Users allowed# =all@ <orms allowed# =none@ Banner not re'uired 5haracter sets# =none@

Default pitch# Default page si+e# 5onfiguring a print client of a S"stem ? print ser$er Register the print ser$er name with the print ser$ice F lps"stem 4t s/ s"s/ser$er Cs"s/ser$erC has been added F !o remo$e the print ser$er, use F lps"stem 4r s"s/ser$er Remo$ed Cs"s/ser$erC F !o check whatBs been added F grep s"s/ser$er /etc/lp/S"stems s"s/ser$er#x#4#s/#4#n#,&#4#4# F (dd the printer to the client s"stem !his information is entered into the director" /etc/lp/printers b" the lpadmin command F lpadmin 4p localHprtHname 4s s"s/ser$erTrmtHprtHname !o remo$e the printer, use F lpadmin 4x localHprtHname Set the printerBs content and t"pe F lpadmin 4p localHprtHname 4! >S 4I >S Register bundled >ostScript filters using the lpfilter command <rom sh# F cd /etc/lp/fd F for filt in `ls I sed Bs/\ fd//B` K do K lpfilter 4f Yfilt 4< Yfilt fd K done F

5heck the filters ha$e been added F lpfilter 4f all 4l (llow 'ueuing F accept localHprtHname 8nable the printer F enable localHprtHname 5heck the configuration F lpstat 4p localHprtHname 4l printer localHprtHname is idle enabled since Sun 0a" % ,E#/&#,/ BS! ,%%: a$ailable 5ontent t"pes# an" >rinter t"pes# unknown Description# Users allowed# =all@ <orms allowed# =none@ Bannernot re'uired 5haracter sets# =none@ Default pitch# Default page si+e# (ttention print 'ueue gurus 44 I ha$e a few 7> printers 'ueued on m" . L Solaris Ultra4L& box, configured using Qetadmin from 7> !he"B$e been working fine for man" months =some for "ears@, until "esterda" ( user tried to print a file "esterda", and it is now repeatedl" coming out on their printer !he"B$e had to shut the printer off I tried to cancel the print Qob with `cancel 4u cbartle"B, and after about twent" seconds I get# could not talk to print ser$ice at biocomp which repeats another three times I get the same error message =although Qust once@ with `lp' 4> papowersB

I tried stopping and starting the scheduler with `lpshutB and `/usr/lib/lp/lpschedB ;o difference In /$ar/spool/lp/logs/lpsched, I see# ,,/.9 ,-#.-#:/# printer fault t"pe# write root, status# ,msg# =exec exit fault@ I searched DeQa;ews and came up prett" much empt"4handed 0ore info# 444444444444444444444444444444444 ( `ps 4ef I grep lpB "ields# 444444444444444444444444444444444 cbartle" ,,%/& ,,%-% & ,&#/9#/- A &#&& /bin/sh 4c /etc/lp/interfaces/papowers papowers4LE biocompTcbartle" CLE4,C , C root ,,%-% ,,%-: & ,&#/9#/- A &#&& /usr/lib/lpsched cbartle" ,,%E: ,,%E. & ,&#/9#/- A &#&& /bin/sh 4c /etc/lp/interfaces/papowers papowers4LE biocompTcbartle" CLE4,C , C cbartle" ,,%%L ,,%E/ & ,&#/9#// A &#&& cat /$ar/spool/lp/tmp/biocomp/LE4, root ,,%-: , & ,&#/9#/- A &#&& /usr/lib/lpsched cbartle" ,,%E. ,,%/, & ,&#/9#/- A &#&& /usr/spool/lp/bin/lp tell papowers cbartle" ,,%/, ,,%/& & ,&#/9#/- A &#&& /bin/sh 4c /etc/lp/interfaces/papowers papowers4LE biocompTcbartle" CLE4,C , C cbartle" ,,%E/ ,,%E- & ,&#/9#/- A &#&& /usr/bin/sh /etc/lp/interfaces/model orig/papowers papowers4LE biocompTcbartle" 444444444444444444444444444444444 ( `lpstat 4tB "ields# 444444444444444444444444444444444 scheduler is running s"stem default destination# hp:,-E s"stem for Hdefault# biocomp =as printer hp:,-E@ de$ice for hp.,,L# /de$/hp.,,L de$ice for hp:.,&# /de$/hp:.,& de$ice for hp:,-E# /de$/hp:,-E de$ice for papowers# /de$/papowers hp:,-E accepting re'uests since <ri Dec ,9 ,-#&,#&L 5S! ,%%9 hp.,,L accepting re'uests since 0on (pr ,% ,/#&-#/E 5D! ,%%% hp:.,& accepting re'uests since <ri Dec ,9 ,-#&.#:: 5S! ,%%9 papowers accepting re'uests since 0on Pul ,& ,-#-.#,& 5D! .&&& printer hp:,-E is idle enabled since !ue (pr .& ,&#,%#:9 5D! ,%%% a$ailable printer hp:.,& is idle enabled since <ri Dec ,9 ,-#&.#:: 5S! ,%%9 a$ailable printer hp.,,L is idle enabled since 0on (pr ,% ,/#&-#/E 5D! ,%%% a$ailable printer papowers now printing papowers4LE enabled since Wed ;o$ .%

&9#&9#:, 5S! .&&& a$ailable papowers4LE cbartle" ,L:,:/ ;o$ .9 ,-#.& on papowers 444444444444444444444444444444444 ( `lpstat 4p papowers 4lB "ields# 444444444444444444444444444444444 printer papowers now printing papowers4LE enabled since Wed ;o$ .% &9#&9#:, 5S! .&&& a$ailable <orm mounted# 5ontent t"pes# simple >rinter t"pes# unknown Description# 5onnection# direct Interface# /usr/lib/lp/model/netHlQx&&& (fter fault# continue Users allowed# =all@ <orms allowed# =none@ Banner re'uired 5haracter sets# =none@ Default pitch# Default page si+e# Default port settings# (n" ideas about how I can fix thisA 44 Pim Winkle, U;I1 S"stem (dministrator, UW40adison, DoI! 5ontact info# Bio5omp# helpJbiocomp doit wisc edu http#//www4biocomp doit wisc edu/ Other# QwinkleJdoit wisc edu http#//Qwinkle doit wisc edu/ >roblem restatement# 444444444444444444444 ( user printed a file once, but the file continued to come out of their printer, consuming much toner and a small forest !r"ing to cancel the print Qob with `cancelB "ielded =after a :& second dela"@# could not talk to print ser$ice at biocomp Solution# 444444444444444444444 F lpshut F rm 4r /$ar/spool/lp/tmp /$ar/spool/lp/temp /$ar/spool/lp/re'uests F /usr/lib/lpsched

Starting lpsched recreated those directories I deleted IBm still getting the error message =and :& second dela"@# could not talk to print ser$ice at biocomp with cancel and lp', but this ma" be a seperate problem BbiocompB is the name of the U;I1 box on which the printer is 'ueued =same box as I am executing cancel/lp' on@ If an"one has an" ideas, send Bem m" wa" 5ause of the problem# 444444444444444444444 0ost likel" caused b" a network hangup, which lasted longer than the printer timeout 7ereBs how it should work !he spooler sends the the print Qob to the printer, which gets broken up into tcp packets !he printer accepts these packets as it can, handshaking with the ser$er If there is R8(22N slow network response =as in a network storm@, the ser$er doesnBt get the response in time, assumes the printer didnBt get the file, and resends it !he printer itself prints the original, and the retransmission of it !hings can get prett" confused, and the spooler can end up sending endless copies of part of or a whole file !hanks much to respondantsT C5ould not talk to print ser$iceC errors (ll . messages in topic 4 $iew as tree kprasa Sep E .&&&, L#-- pm show options ;ewsgroups# comp s"s sun admin <rom# kpr Jm"4deQa com 4 <ind messages b" this author Date# !hu, &E Sep .&&& ..#.L#:: G0! 2ocal# !hurs, Sep E .&&& L#.L pm SubQect# C5ould not talk to print ser$iceC errors Repl" to (uthor I <orward I >rint I Indi$idual 0essage I Show original I Report (buse I am tr"ing to mo$e a print ser$er from one machine to another On the new machine, which is running Solaris 9, I get the following error when I t"pe in lp' C5ould not talk to >rint Ser$ice at MhostnameKC lpstat 4a shows me that all the printers are accepting re'uests I can print to the printers from workstations around I cannot seem to get the 'ueue status /usr/lib/lpsched is running and all printers ha$e been enabled What am I missing (n" suggestions would help !hanks

UiranC5ould not ta Sent $ia DeQa com http#//www deQa com/ Before "ou bu" Greg (ndrews MhostnameK is probabl" not accepting connections on !5> port /,/, the printing port Or "ou ha$e a packet filter that was opened to allow the old print ser$er to connect to the printers, but not the new one 4Greg Pohn 0artin (h the Qo"s of the Solaris print spooler ItBs been a while since I did this so I might be a bit rust", here goes Shut down the spooler with lpshut cd to /$ar/spool/lp/re'uests/MhostnameK Within this director" will be the re'uest file which indicates to the spooler that there is a re'uest waiting to be ser$iced It will be named with the re'uest number =LE4& I think@ If "ou delete or mo$e this file somewhere else then it effecti$el" remo$es the re'uest from the 'ueue cd to /$ar/spool/lp/tmp/MhostnameK Within this director" will be a temporar" file which holds details about the print Qob, including the name of the file being printed It too will be named with the re'uest number =LE4& I think@ 0o$e this file elsewhere in case "ou need to refer to it later Do a ps and grep for lp Qust to make sure the"Bre all gone Restart the spooler and do an lpstat to check the 'ueue entries If "our spooler makes a cop" of the print file before printing it then "ou ma" need to manuall" remo$e it, refer to the re'uest details sa$ed abo$e (s for "our original problem, I ha$e seen this sort of beha$iour exhibited on some of our printers in the past In our case it was down to slow network

response and the setting of the printer timeout Basicall" what happens is that the spooler sends the re'uest to the printer, if the print file is large enough then it will wait for a response to sa" that it has started printing and to send more please Due to slow network response the repl" doesnBt get through in time so the spooler does a retr" thinking that it has failed the first time etc etc IBm sure that "ou can up the timeout in the Qetdirect interfaces through Qetadmin so tr" looking there 7ope this helps PP 7ere are the two wa"s for solaris . L and later, printing to an 7> network printer that supports >ostscript# ,# lpadmin 4p printername 4$ /de$/null 4m netstandard 4o protocol*bsd 4o dest*printer4ip4 address 4! >S 4I postscript enable printername accept printername ;ote that the last argument to the lpadmin command is 4I, which is a capital letter Ce"eC, not a lowercase letter CellC or the number ConeC If the 7> printer doesnBt support >ostscript, change the last two arguments in the lpadmin command to# 4! hplaser 4I an" =if "ouBre going to print >52 formatted files@ 4! hplaser 4I simple =if "ouBre going to print onl" plain text@ .# (dd an entr" to /etc/hosts =or "our ;IS/;IS6 hosts table, or "our D;S@ that gi$es a hostname to the printerBs I> address lpadmin 4p printername 4$ /de$/null 4m netstandard 4o protocol*bsd 4o dest*printer4 hostname 4! >S 4I postscript enable printername accept printername

See the notes abo$e for $ariations of the lpadmin arguments ;otice that onl" the C4o dest*xxxxC argument changed between the two wa"s With 7> printers, itBs usuall" best to download and install 7>Bs Petadmin software for Solaris It supports mode of the printerBs features than the stock Solaris print s"stems does !hen add the printer through PetadminBs text interface instead of t"ping the abo$e commands 4Greg 44 <il Urohnengold IB$e gotten some help, but IBm still ha$ing trouble hereBs what IBm doing# research#^K lpadmin 4p nets"slp. 4m netstandard 4$ /de$/null 4o protocol*bsd 4o dest*theHrealHipHaddr 4! >S 4I postscript IB$e actuall" tried this a few times without the 4! and 4I options So hereBs where i get confused# research#^K enable nets"slp. destination Cnets"slp.C now accepting re'uests research#^K accept nets"slp. U1#accept# W(R;I;G# Destination Cnets"slp.C was alread" accepting re'uests R7mm S research#^K lpstat 4p nets"slp. printer nets"slp. disabled since Sat ;o$ L .:#:/#.E 8S! ,%%% a$ailable new printer (nd thatBs it !he printer sta"s CdisabledC (nd if I send a Qob to it, itBs stuck in the 'ueue now for e$er research#^K lpstat 4R , nets"slp4, fil -%.- ;o$ &- ,/#.. , nets"slp,4. fil -%.- ;o$ &- ,L#,& research#^K cancel nets"slp,4. could not talk to print ser$ice at research research#^K !ried restarting lpsched too Sad

(n"oneA 4fil IBm tr"ing to configure a printer spool on a SU; Sparc running SunOS / / , and am recei$ing the following error when tr"ing Blp' 4>M'ueuenameKB# could not talk to print ser$ice at Mprint ser$er nameK IB$e tried both local and remote spools and get the same error =onl" the ser$er name changes appropriatel"@ 7owe$er, this problem doesnBt occur for the superuser 44 onl" regular users get this problem !his seems to indicate that some file permissions are set incorrectl" I checked for Br4xB permissions for e$er"bod" in the following places# /$ar/spool/print /etc/lp /etc/lp/model /etc/lp/interfaces Does an"one know what m" problem is and how I can fix itA !hanks, !re$or Wood suggestionW this is solaris learn the nati$e commands lpadmin, lpstat, lps"stem tr" lpstat 4o printername !hen if that doesnBt work, tr" using truss lpstat 4o printername to find out where it is bombing 4 Sorr" that I lose the original thread !o works as a print ser$er, "ou need to configure /etc/lp/S"stems b" lps"stem, and saf b" sacadm and pmadm Did "ou do all theseA !he spec on R<5,,E% for 2>D ensures that an" 2>D connections must be in the range of E., 4 E:, inclusi$e If "our `lp'B is executed at the user le$el and

is an lp' that speaks to a R80O!8 2>D, then "our connection will be refused because user4le$el port restrictions 0ost often lp'Bs talk to the local 2>D which is running as root which in turn talks to the remote 2>D 8nsure that "our $ersion of lp' does in fact talk to the local 2>D, not the remote 2>D Otherwise, "ou ma" indeed ha$e to suid "our lp' binar" IB$e heard of some lp'Bs Qust referencing the printcap for the rm,rp entries instead of talking to a local 2>D !his I07O is more an error with 2>D R<5,,E% than an"thing else I donBt know if this is it, but tr" it and find out Qoeh I thought lpd is listening at port /,/ AA 4 Qoeh wrote# K I thought lpd is listening at port /,/ AA K CP S PensenC wrote# K K !he spec on R<5,,E% for 2>D ensures that an" 2>D connections must be in the K K range of E., 4 E:, inclusi$e If "our `lp'B is executed at the user le$el and Nes, the listening port IS at /,/, howe$er, the R858I?I;G 52I8;! port ="es, it is specified, if "ou can belie$e that@ must be E.,4E:, K K is an lp' that speaks to a R80O!8 2>D, then "our connection will be refused K K because user4le$el port restrictions Unfortunatel" this is wh" a lot of 2>D 'ueries fail 0" /etc/ser$ices file has this line# printer /,//tcp spooler F line printer spooler Do i also need to add the client statement to this fileA Pust checking before i presume Does an"one ha$e a cop" of the line in their /etc/ser$ices fileA Using SunOS / E =Csolaris EC@ !hanks to an"one willing to help Poe

Qoeh wrote# K 0" /etc/ser$ices file has this line# K printer /,//tcp spooler F line printer spooler K Do i also need to add the client statement to this fileA ;o, not at all, as "ou well know, the ser$ices file allows for particular daemons to reference port numbers b" names !he daemon 2>D itself checks the connecting client port Or at least it /should/ according to spec IB$e personall" written 2>Ds where I ignore the client port restriction 44 K0" /etc/ser$ices file has this line# Kprinter /,//tcp spooler F line printer spooler KDo i also need to add the client statement to this fileA KPust checking before i presume KDoes an"one ha$e a cop" of the line in their /etc/ser$ices fileA KUsing SunOS / E =Csolaris EC@ ;o, "ou donBt need to add an"thing else to that file Both ser$ers and clients onl" use the first two fields, which are the same for both 4Greg posted by Brahma at 9:46 AM & comments

Arinter prints, but can?t see DueueSubQect# >rinter prints, but canBt see 'ueue 7i, 0" printer =an 8spon St"lus inQet@ prints from m" Sun =Ultra 9&, Solaris %@ oka", using Ghostscript to con$ert the postscript to 8psonBs language I use the parallel port on the U9& Something like

Z cat file ps I lp works fine and prints oka" using Ghostscript and Z cat file epson I lp 4d st9/&Hdirect will put the file directl" to the printer 7owe$er, lp' will ne$er show what is in the 'ueue 4 either of them !his used to work, but I noticed it failed to work some months ago 5an an"one gi$e me a clue where to start looking for the problem A 2eslie 7a"ward What do "ou get from lpstat 4tA sparrow /export/home/da$ek Z lpstat 4t scheduler is running s"stem default destination# st9/&Hps s"stem for Hdefault# sparrow =as printer st9/&Hps@ de$ice for st9/&Hps# /de$/ecpp& de$ice for st9/&Hdirect# /de$/ecpp& Hdefault accepting re'uests since Sat ;o$ . ,-#:L#/: G0! .&&. st9/&Hps accepting re'uests since Sat ;o$ . ,-#:L#/: G0! .&&. st9/&Hdirect accepting re'uests since Sat ;o$ . ,-#:E#.% G0! .&&. printer st9/&Hps is idle enabled since Sat ;o$ . ,-#:L#/: G0! .&&. a$ailable printer st9/&Hdirect is idle enabled since Sat ;o$ . ,-#:E#.% G0! .&&. a$ailable But lp' sa"s it canBt talk to the print ser$ice sparrow / F /usr/ucb/lp' could not talk to print ser$ice at sparrow =IB$e tried that both as a normal user and as root in the abo$e example@ Da$id, this doesnBt answer "our 'uestion, but "ou ma" be able to help me with mine I see "ouB$e got a printer on the parallel port 7ow did "ou configure itA (ll m" attempts ha$e ended in printless silence, and reliance on the network printer IBm not expert on this and are not ,&&Z con$inced it is oka" now, but it works =minus m" abilit" to read whatBs in the 'ueue@ in the single user en$ironment I took some of the information on setting up Ghostscript $ia the web, from an earlier re$ision of# http#//cfau$cs/ har$ard edu/Se tGSprinter-Solaris html which someone at Sun said was wrong, since m" filter was printing to the

parallel port and not to standard output 7owe$er, despite this, the 'ueue worked then 2ater I changed things to how someone at Sun said it should be, and the" were better, but the 'ueue which is m" present problem was ne$er an issue until relati$el" recentl" =perhaps since I installed Solaris %@ =;ote I did point out to the author of the web page abo$e about this issue with printing to stdout rather than the port itself Nou can see he has made a note about it, but finds it more troublesome himself @ >erhaps I should ha$e another read at the documentation m"self, since this ma" be wh" m" 'ueue is not working I donBt know if "ou ha$e a >ostscript printer or not I donBt has a >ostscript printer, so IBm not sure how helpful the following is, but IB$e installed two 'ueues as "ou see abo$e st9/&Hps goes $ia Ghostscript, so con$erts the >ostscript output b" %%Z of Solaris programs to 8pson control commands !he other 'ueue, st9/&Hdirect connects directl" to the printer, with no processing st9/&Hdirect is set up so I can print $ia Samba from a >5 to the printer on the Sun ,@ !o set up the direct 'ueue, with no processing F ls 4l /de$/ecpp& lrwxrwxrwx , root root /& Sep ,- ,E#&: /de$/ecpp& 4K /de$ices/pciJ,f,-&&&/ebusJ,/ecppJ,-,:&-:bc#ecpp& F ls 4l /de$ices/pciJ,f,-&&&/ebusJ,/ecppJ,-,:&-:bc#ecpp& crw4rw4rw4 , root s"s L-, & ;o$ . .&#-E /de$ices/pciJ,f,-&&&/ebusJ,/ecppJ,-,:&-:bc#ecpp& lpadmin 4x st9/&Hdirect lpadmin 4p st9/&Hdirect 4$ /de$/ecpp& 4! unknown 4I an" enable st9/&Hdirect accept st9/&Hdirect .@ !o set up the 'ueue, printing $ia Ghostscript I essentiall" followed the instuctions at http#//cfau$cs/ har$ard edu/Se tGSprinter-Solaris html IB$e set up a script for this, which I copied below F ,@ remo$e an" printer under the name st9/&Hps lpadmin 4x st9/&Hps F .@ define filter description /etc/lp/fd/>SHtoH8>SO; fd F :@ 0ake ownership correct on filter chown lp#lp /etc/lp/fd/>Sto8>SO; fd

F -@ Define the printer name and the port de$ice the printer will us F (ccording to the (nswerbook, the de$ice to use is /de$/null /usr/sbin/lpfilter 4f >Sto8>SO; 4< /etc/lp/fd/>Sto8>SO; fd F /@ Register the printer F/usr/sbin/lpadmin 4p st9/&Hps 4$ /de$/null 4I 8S5. /usr/sbin/lpadmin 4p st9/&Hps 4$ /de$/ecpp& 4I 8S5. F L@ 8;(B28 >RI;!8R accept st9/&Hps enable st9/&Hps F E@ DIS(B28 !78 B(;;8R (;D S8! S>88D O; F the parrallel port to ,%.&& bits/s lpadmin 4p st9/&Hps 4o Cstt"*,%.&&C 4o nobanner F 9@ 0(U8 I! !78 D8<(U2! 3U8U8 lpadmin 4d st9/&Hps F %@ 5785U I! IS OU(N lpstat 4t st9/&Hps F ,&@ 0ake /de$/ecpp& writable b" an"one if neceessar", F which is was in m" case chmod LLL /de$/ecpp& F;ow replace nobanner*no to nobanner*"es in /etc/lp/interfaces/st9/&Hps /usr/local/bin/replace Bnobanner*CnoCB Bnobanner*C"esCB /etc/lp/interfaces/st9/&Hps and the filter looks like this# sparrow /etc/lp F more /etc/lp/fd/>Sto8>SO; fd Input t"pes# postscript Output t"pes# 8S5. >rinter t"pes# an" >rinters# an" <ilter t"pe# fast Options# 0OD8S fast * 4f Options# 0OD8S slow * 4s Options# 0OD8S photo * 4p Options# 0OD8S high * 4h Options# 0OD8S normal * 4n 5ommand# /usr/local/bin/psHtoHepson9/&

I realised I forgot something from what is in the page at http#//cfau$cs/ har$ard edu/Se tGSprinter-Solaris html I print $ia a script, that allows me to set the resolution sparrow /etc/lp/fd F more />Sto8>SO; fd Input t"pes# postscript Output t"pes# 8S5. >rinter t"pes# an" >rinters# an" <ilter t"pe# fast Options# 0OD8S fast * 4f Options# 0OD8S slow * 4s Options# 0OD8S photo * 4p Options# 0OD8S high * 4h Options# 0OD8S normal * 4n 5ommand# /usr/local/bin/psHtoHepson9/& !he command file /usr/local/bin/psHtoHepson9/& has in it# FT/bin/sh F this is /usr/local/bin/psHtoHepson9/& F default to standard resolution R8S*CJstc9&&p uppC F select high resolution when re'uested if R CY,C * ChighC SW then R8S*CJstc9&&ih uppC fi F run gs with print filtering options =writes to stdout@ F OU exec /usr/local/bin/gs 4' Y[R8S] 4dBufferSpace*./&&&&&&& 4s>(>8RSIO8*a4sOutput<ile*4 4 4c 'uit exec /usr/local/bin/psselect 4r I /usr/local/bin/gs 4' Y[R8S] 4dBufferSpace*./&&&&&&& 4s>(>8RSIO8*a- 4sOutput<ile*4 4 4c 'uit Greg (ndrews Sparrow is the name of the machine "ou t"ped the lpstat command on, and it has in lpd disabled in its /etc/inetd conf file, or "ou ha$e the old !5> listeners interfering with inetd binding to the printer port !o find out if the old !5> listeners are running, t"pe# pmadm 4l 4p tcp !o delete them when the"Bre running, t"pe#

pmadm 4r 4p tcp 4s lpd pmadm 4r 4p tcp 4s lp pmadm 4r 4p tcp 4s & M44 thatBs the number +ero 4Greg 44 !he parallel port de$ice depends on which ser$er/workstation "ou ha$e 7ow well printing works depends on the make/model printer "ou ha$e 5an "ou suppl" those two bits of informationA !he $ersion of Solaris "ouBre using would also be nice to know !hanks a lot Greg, I had indeed commented out# printer stream tcpL nowait root /usr/lib/print/in lpd in lpd in /etc/inetd conf I tried commenting out what I could for securit" reasons and ob$iousl" went one too far I think I checked before that printing was still working oka" after commenting the line out 5learl" I did not go as far as to check that one could see the 'ueue 2pstat could see the 'ueue It was Qust /usr/ucb/lp' that couldnBt 2pstat knows it can talk to lpsched $ia lpschedBs <I<O =aka Cnamed pipeC in the files"stem /usr/ucb/lp' thinks it must make a network connection and talk to in lpd to get the status I would suggest switching from the BSD commands =lpr, lp', lpc, lprm@ to the S?R- commands =lp, enable/disable/accept/reQect, lpstat, cancel@ !he onl" S?R- command that needs lpd to be running is cancel 4Greg 44 posted by Brahma at 9:42 AM & comments

Aarsin9 a date field


>arsing a date field SubQect# >arsing a date field 7i,

I want to be able to extract selected lines from a logfile, where each line is tagged with toda"Bs date eg 0on Pul ./ ,:#/9#,/ .&&/# 2oading file 0on Pul ./ ,:#/9#,L .&&/# Deleting all data from tbl5usip0ap Sa" that toda" is 0on Pul ./ .&&/ 7ow can I extract all of toda"Bs lines from the file =ignoring the timestamp, but including the "ear@ without getting too mess"A 5heersT Repl" Pohn 2 Pul ./, -#:E am Nou need to grep toda"Bs date from the file, and "ou can get toda"Bs date using the date command Because "ou need the date in two sections =the "ear is separate@ "ou could run the date command twice but that will fail around midnight on ;ew NearBs 8$e so Qust run it once and assign the result to shell $ariables set 44 `date 6BZa Zb Zd ZNB` grep CY, Y. Y: R&4%#S) Y-C logfile <or ease of future maintenance, consider using meaningful $ariable names 44 Pohn R Oops Nou should add a a to anchor the pattern to the start of each line, Qust to be on the safe side set 44 `date 6BZa Zb Zd ZNB` grep CaY, Y. Y: R&4%#S) Y-C logfile 44 Pohn

Repl" 5hris < ( Pohnson grep C`date C6aZa Zb Zd R&4%SR&4%S#R&4%SR&4%S#R&4%SR&4%S ZN#C`C 2OG<I28 William Pames rub" 4nae BB8GI;[Ya*!ime now toHs 6=C#C@ splitWYa sliceT=:,-@]Wprint if Ya**Y< $aluesHat=&,,,.,-@B gawk BY,Y.Y:Y/**strftime=CZaZbZdZN#C@B file Pohn W Urahn P perl 4neB B8GI; [ = Ytoda" * localtime @ *^ s/\d6#\d6#\d6/\\d6#\\d6#\\d6/ ] print if /aYtoda"/o B logfile posted by Brahma at 9:38 AM & comments

Friday, Guly 2:, 2005


Aanics
2og files Related messages in /$ar/adm/messages are checked Sometimes hardware and software failures are prefaced b" messages written to the log file If there are disk error messages in the log file, and U;I1=r@ file s"stem =U<S@ routines listed on a stack trace, it is likel" that there is a disk hardware problem >anics Often, s"stem panics can originate from software, howe$er, it is possible to incur a panic from a hardware fault Some panic messages that indicate hardware problems include # (s"nchronous memor" error Indicates a memor" problem (s"nchronous memor" fault Usuall" indicates a bus problem between memor" and 5>U posted by Brahma at 3:42 PM & comments

netstat

!he netstat5ommand !he netstat command returns the contents of network data structures and tables, including status of acti$e sockets, interfaces, routing tables, and D75> =D"namic 7ost 5onfiguration >rotocol@ Some useful options are listed here F netstat 4i <or each interface, this command displa"s the number of input and output packets, errors, collisions, and number of re'uests in the 'ueue <rom this, the collision rate can be calculated b" di$iding the number of collisions b" the number of output packets and multipl"ing b" ,&& Ideall", this $alue should not exceed / to ,& percent posted by Brahma at 3:41 PM & comments

rocess on your system is consumin9 t&e most memory0


E 8nter the following command to determine which process on "our s"stem is consuming the most 5>U time, and which process on "our s"stem is consuming the most memor"# F /usr/ucb/ps 4aux Usuall", in 1 Windows applications, dt , and fsflush are the highest resource users posted by Brahma at 3:41 PM & comments

nslookup
*************************************************************** *************** !O>I5# nslookup doing a re$erse lookup of nameser$er AA http#//groups4 beta google com/group/comp unix solaris/browseHthread/thread/L%9%d,d/&aE..Eef *************************************************************** *************** ** , of , ** Date# !ues .L Pul .&&/ ,:#&L <rom# Qms Solaris9 on S>(R5 I Qust saw toda" that nslookup was doing a re$erse lookup of the nameser$er = an internal machine @ !hat is, if I do Cnslookup www google comC, it

tries to get the re$erse lookup of ,%. ,L9 & , = the nameser$er defined in /etc/resol$ conf @ !hus, all 'uer" fails <unn" thing is, it was working before without this problem Doing an nslookup or dig on another machine that uses the same nameser$er does not exhibit this problem ;ote that I ha$e stopped nscd Qust to make sure F nslookup 4d. www google com WW resHnmk'uer"=3U8RN, , & ,L9 ,%. in4addr arpa, I;, >!R@ 444444444444 SendRe'uest=@, len -. 78(D8R# opcode * 3U8RN, id * ,L.99, rcode * ;O8RROR header flags# 'uer", want recursion 'uestions * ,, answers * &, authorit" records * &, additional * & 3U8S!IO;S# , & ,L9 ,%. in4addr arpa, t"pe * >!R, class * I; 444444444444 444444444444 Got answer =,,% b"tes@# 78(D8R# opcode * 3U8RN, id * ,L.99, rcode * ;1DO0(I; header flags# response, want recursion, recursion a$ail 'uestions * ,, answers * &, authorit" records * ,, additional * & 3U8S!IO;S# , & ,L9 ,%. in4addr arpa, t"pe * >!R, class * I; (U!7ORI!N R85ORDS# 4K ,L9 ,%. in4addr arpa t"pe * SO(, class * I;, dlen * L/ ttl * ,,9 =,,9@ origin * prisoner iana org mail addr * hostmaster root4ser$ers org serial * .&&.&-&9&& refresh * ,9&& =:&0@ retr" * %&& =,/0@ expire * L&-9&& =,W@ minimum ttl * L&-9&& =,W@

444444444444 ))) 5anBt find ser$er name for address ,%. ,L9 & ,# ;on4existent host/domain ))) Default ser$ers are not a$ailable F cat /etc/resol$ conf nameser$er ,%. ,L9 & , F cat /etc/hosts M snip K ,%. ,L9 & , router dns M snip K F cat /etc/nsswitch conf M snip K hosts# files dns ipnodes# files networks# files dns M snip K posted by Brahma at 3:40 PM & comments

pk9add
!O>I5# pkgadd MpkgK (<!8R appl"ing a patch affecting MpkgK http#//groups4 beta google com/group/comp unix solaris/browseHthread/thread/:f.de/:ed-abd9db *************************************************************** *************** ** , of , ** Date# !ues .L Pul .&&/ &%#-: <rom# 5asper 7 S Dik <rank 5usack MfcusackJfcusack comK writes# KSa" I appl" patch ,.:-4&, which affects : packages, . of which are Kinstalled I later install package : Is this package now unpatchedA KDoes the s"stem know this and will it reappl" the patch, or will it Kthink the patch is alread" applied and thatBs it It will be unpatchedW this is a known deficienc" in the Solaris package s"stem which somehow people ha$e been unwilling to fix 5asper 44

posted by Brahma at 3:40 PM & comments

5ifferences bet'een BS5 Sun*S -1-( and System 1 Solaris 2-( ,ar 1::5
444444444444444444444444444444444444444444444444444444444444444444444444444 Differences between BSD SunOS - , 1 and S"stem ? Solaris . 1 0ar ,%%/ 444444444444444444444444444444444444444444444444444444444444 /usr/ucb/lpr <I28 M4K /usr/bin/lp <I28 /usr/ucb/lpr 4> >RI;!8R <I28 M4K /usr/bin/lp 4d >RI;!8R <I28 /usr/ucb/lp' 4> >RI;!8R /usr/bin/lpstat 4d >RI;!8R OR M4K /usr/bin/lpstat 4o >RI;!8R /usr/etc/lpc status >RI;!8R /usr/bin/lpstat 4u US8R /usr/ucb/lprm 4> >RI;!8R POBF M4K /usr/bin/cancel >RI;!8R4POBF /usr/bin/cancel 4u US8R >RI;!8R /usr/etc/lpc disable >RI;!8R M4K /usr/sbin/reQect >RI;!8R /usr/etc/lpc stop >RI;!8R M4K /usr/bin/disable >RI;!8R /usr/etc/lpc enable >RI;!8R M4K /usr/sbin/accept >RI;!8R /usr/etc/lpc start >RI;!8R M4K /usr/bin/enable >RI;!8R /usr/etc/lpc restart >RI;!8R no BSD e'ui$alent M4K /usr/bin/lpmo$e >RI;!8R4POBF ;8WH>RI;!8R ps 4aux I grep lpd kill M4K /etc/init d/lp stop

/usr/lib/lpd M4K /etc/init d/lp start $i /etc/printcap M4K /usr/sbin/lpadmin 4x >RI;!8R 4 remo$e unwanted printer /usr/bin/ps 4aux I grep lpd M4K /usr/sbin/lpshut /usr/bin/kill 2>DH>IDS /usr/lib/lpd M4K /usr/lib/lp/lpsched default printer * Y>RI;!8R M4K default printer * Y2>D8S! posted by Brahma at 3:37 PM & comments

Friday, Guly 22, 2005


,%AA<N2 ,%N ,%NA%8;
0(>>I;G 0(; In Solaris, indexing the man pages# , Set "our 0(;>(!7 $ariable to include all "our man pages to be indexed# 8g FK 0(;>(!7*/usr/man#/usr/dt/man#/opt/?R!S$x$m/manW export 0(;>(!7 . Use catman command to index the man pages# FK catman 4w ;ow "ou can use BwhatisB command to know what a command does and Bman 4kB commands to search for a ke"word in man pages posted by Brahma at 2:56 PM & comments

M&ic& disk &ave < booted from)


7ello I ha$e Qust set up mirrored s"stem disks on an 8-/& s"stem running Solaris 9, Disksuite - . , !he ser$er is sited remotel" and I donBt = at present @ ha$e remote console access I set up an alias for m" mirrored disk and rebooted using reboot 44 boot4mirror F the alias name I canBt seem to determine from /$ar/adm/messages which disk I ha$e actuall" booted from Does an"one know a wa" of doing thisA 0uch (ppreciated 0ark

Repl" Si$akanth 0undru SubQect# Re# Which disk ha$e I booted fromA K I ha$e Qust set up mirrored s"stem disks on an 8-/& s"stem running K Solaris 9, Disksuite - . , K !he ser$er is sited remotel" and I donBt = at present @ ha$e remote K console access K I set up an alias for m" mirrored disk and rebooted using reboot 44 K boot4mirror F the alias name K I canBt seem to determine from /$ar/adm/messages which disk I ha$e K actuall" booted from Does an"one know a wa" of doing thisA K 0uch (ppreciated K 0ark If "ou ha$e set up aliases with eeprom eeprom I grep alias !hen do a prtconf 4p$ I grep bootpath Nou should be able to compare both the paths and tell which mirror "ou are booted off of posted by Brahma at 2:55 PM & comments

multiple successive inputs


0ichael !osch Pul ,%, .#/E pm show options SubQect# Re# multiple successi$e inputs 8dwina 0acka" wrote# K Dear all, K I am not well4$ersed in shell scripting so this is probabl" an eas" K 'uestion IBm using a homemade 5 program gi$en to me b" a colleague, which K I in$oke with some options, like this# K /m"program 4n 4g .

K and the program responds# K >lease enter input set# K to which I repl" something like# K &,:,9,,. K and it spews out the re'uired answer K I would like to run the program, with the same option set, on man" input K sets, without ha$ing to sit there and t"pe them in one after the other on K multiple runs of the program 2etBs sa" I create a file of input sets that K I want to run the program on, and this file looks like this# K &,:,9,,. K &,:,,,,,K &,.,/,L K &,.,9,,, K &,.,E,,: K 7ow do I now run the program on the whole list of input setsA I want K something like =pseudocode@# K for each 2I;8 in m"file do K /m"program 4n 4g 4. RenterS 2I;8 RenterS done K 0an" thanks for helping me out with this Best wishes, 8dwina <irst tr" /m"program 4n 4g . Mm"file If this does not work then run this executable script# FT/bin/sh while read lineW do echo Yline I /m"program 4n 4g 4. done Mm"file 44 0ichael !osch J hp # com I!N0#

echo CYlineC I /m"program 4n 4g 4. or printf CZs\nC CYlineC I /m"program 4n 4g 4. I know thereBs no spaces or special characters in the posted input sample, but 'uoting b" default is a good habit to get into 8d posted by Brahma at 2:54 PM & comments

e=ec overlays t&e runnin9 process 'it& t&e ne' pro9ram @ t&e A<5 is maintainedK FT/bin/sh K echo YY K pidlog K exec m"program K !ried this, but YY is the pid of the script itself and not the program K being run Subse'uent kill on YY result doesnBt stop m"program I Qust tried this on Solaris . L/x9L =sorr", I ha$enBt got access to a S>(R5 $ersion an" longer@# Sun 0icros"stems Inc SunOS / L Generic (ugust ,%%E Y echo YY :-Y exec ksh Y echo YY :-Y ps >ID !!N !I08 50D :-- pts/& &#&& ksh Y (s "ou can see, the exec o$erla"s the running process with the new program 4 the >ID is maintained !hus, the solution proposed b" Icarus will work because as long as "our Cm"programC isnBt itself the result of a fork, the pidlog file will contain the >ID of the execBd program (re "ou sure "ou used CexecCA posted by Brahma at 2:53 PM & comments

;o' to make 5*S look like Uni=

7ow to make DOS look like Unix I!world com, Unix in the 8nterprise E/,%/.&&/ Sandra 7enr"4Stocker, I!world com Ok, well ma"be the subQect line of this column is stretching it Qust a wee bit !hereBs no wa" that "ou can emulate more than a small fraction of Unix power at the DOS 5ommand >rompt But DOS has grown 'uite a bit since the da"s when it was an operating s"stem in its own right With pipes and redirection, a pile of commands that are roughl" e'ui$alent to their Unix counterparts =dir is to ls what t"pe is to cat@ and a little finesse, "ou can make "our time working in DOS seem a little less like a detour through the dark ages and a little more like home !o begin our little makeo$er, letBs look at the t"pical DOS command prompt When I open a command prompt on m" Windows 1> >rofessional laptop, I see something like this# 5#\Documents and Settings\shenr"4stocker\DesktopK ;ot so bad, "ou might be thinking, but an" prompt that stretches more than halfwa" across 0N screen is too much prompt for me 5an I change this the wa" I can change m" prompt on a Unix s"stem =e g , setting >S,*C\hK C@A Nes, in fact I can <or a minimalistic prompt, I like using something like this# prompt*YGYS !his will change the DOS prompt to CK C !he YG represents the greater4than and YS is a space !he default prompt on DOS is usuall" Y>YG 44 the current path followed b" a K and "ou can change it back as easil"# prompt*Y>YG 0an" other $ariables can be also be used in the prompt string# Y3 * =e'ual sign@ YY Y =dollar sign@ Y! 5urrent time YD 5urrent date Y> 5urrent dri$e and path Y? Windows $ersion number Y; 5urrent dri$e

YG K =greater4than sign@ Y2 V =less4than sign@ YB I =pipe@ Y7 Backspace =erases pre$ious character@ Y8 8scape code =(S5II code .E@ YH 5arriage return and linefeed Some of these =such as Y?@ make a perfectl" hideous and worthless prompt, but others can be ad$antageous at times 44 such as Y!YGYS when "ouBre watching the clock on a <rida" afternoon Defining 0acros !o clear the screen in DOS, use the cls command It works Qust like clear on Unix (nd, if "ou donBt like translating between Unix and DOS commands Qust to clear "our screen, "ou can turn clear into a macro 0acros work like aliases in the Unix shells !o make clear e'ui$alent to cls, for example, "ou would do this# doske" clear*cls Once "ou t"pe this at the command prompt, "ou can use CclearC to clear "our screen instead of cls 44 at least until "ou open a new DOS command prompt So now letBs tackle some other anno"ing near4e'ui$alents I often find m"self t"ping ClsC at the command prompt when I meant to t"pe CdirC It runs, but it takes a while to get started If I create a macro to make ls e'ui$alent to dir, on the other hand, the response is 'uick and I donBt feel like such a klut+ for not being able to keep m" operating s"stems straight (nother macro that I find useful is Cdate*date /tC 8$er" time I t"pe CdateC at the DOS command prompt, m" intention is to find out what da" it is 44 ;O! to reset the date B" adding the /t, I a$oid being prompted for a new date and ha$ing to control45 m" wa" out of it <or the same reason, I like to add a macro that makes CtimeC in$oke the Ctime /tC command !hough DOS lacks a pwd command, it is possible to trick it into displa"ing the current director" b" t"ping the CcdC command without parameters Unlike its Unix counterpart, the cd command in DOS does not return "ou to "our home director" when "ou t"pe it without parameters, but it does do one useful thing 44 it displa"s the current path With a Cpwd*cdC macro, I can change m" prompt to one that

doesnBt irritate me and still find out where I happen to be within the file s"stem K pwd 5#\Documents and Settings\shenr"4stocker\0" Documents Se$ere 2imitations Before we get too carried awa" with our goal of making DOS more Unix4like, I ha$e to mention the biggest drawback to DOS macros 44 the" donBt accept parameters <or example, "ou can tr" to make CmanC e'ui$alent to ChelpC and it will work, more or less, but t"ping Cman dirC will not gi$e "ou the same result as t"ping Chelp dirC Instead, it will gi$e "ou the same result as t"ping ChelpC b" itself 0aking Nour 0acros Reusable Once "ou ha$e defined a set of macros to make it a little easier to work at the DOS command prompt, "ouBll undoubtedl" want to sa$e them so that "ou can use them e$er" time "ou open up a DOS command prompt !he first step in this process is to sa$e "our macros in a file Nou can do this with this doske" /m command doske" /m K macros txt !he doske" /m command lists "our macros !he remainder of this command, as "ouBd expect, redirects that listing to a text file !o in$oke "our sa$ed macros at a later time, "ou can issue this command# doske" /macrofile*macros txt Of course, "our $ersion of this command might actuall" turn out to be more like this# doske" /macrofile*5#\Documents and Settings\Qdoe\macros txt DonBt forget all those backward slashesT Of course, e$en this one command can be something of an anno"ance if "ou need to t"pe it e$er" time "ou open up a DOS command prompt !o reduce m" le$el of anno"ance, I put both m" preferred prompt and the doske" command to in$oke m" macros in a batch file which I call customi+e bat# K t"pe customi+e bat Jecho off ## set up macros and custom prompt

doske" /macrofile*5#\batfiles\macros txt prompt YGYS/ I then put this customi+e bat file somewhere on m" search path =I actuall" added 5#\batfiles to m" search path@ ;ow, an"time I open a DOS command prompt, I t"pe Ccustomi+eC Immediatel", m" prompt changes and m" macros take effect If I make an" changes to m" macros txt file =which I edit using the edit command and use control4< to access the edit commandBs menus@, I ha$e to t"pe Ccustomi+eC again !his is like sourcing a dot file and feels normal enough, so it doesnBt bother me 7ereBs a list of the macros IB$e set up so far# K doske" /m time*time /t date*date /t ll*dir ls*dir /w pwd*cd c*cls clear*cls man*help ifconfig*ipconfig alias*doske" /m ;o earth shakers in the list, but each command makes me a little more comfortable working in DOS posted by Brahma at 2:52 PM & comments

;o' to debu9 a very &i9& 'orkload


7ow to debug a $er" high workload A While the s"stem is in the state to use K%&Z kernel cpu time, run the lockstat command to produce a basic kernel profile, e g while a Csleep ,/C command is runing# F lockstat 4kIW 4D .& sleep ,/ What functions are listed as top kernel cpu time consumersA I ha$e reproduced the problem $er" carefull" !he load starts to increase whene$er I remo$e some $er" big files <or exampleW / files

which take up approx .-Gb together !his happens on the disks which are not part of the Raid, Whene$er this happens these are the load consumers# ,99. 9:Z 9:Z & && .E,:L-E cpuR&S logmapHcancel .&: %Z %.Z & && -EL.9%9 cpuR&S fakesoftintHreturn .. ,Z %:Z & && /%&%/&, cpuR&S cpuHhalt IB$e alread" tried to look into logmapHcancel but unfortunatl" SunSol$e seems to be down =I canBt login C/&& 4 internal ser$er errorC@ and google doesnBt help me much here either, so I hope this makes a little more sense to "ou 2ion4O Mn Jm catslair orgK writes# KK F lockstat 4kIW 4D .& sleep ,/ KK What functions are listed as top kernel cpu time consumersA K I ha$e reproduced the problem $er" carefull" !he load starts to K increase whene$er I remo$e some $er" big files <or exampleW / files K which take up approx .-Gb together !his happens on the disks which are K not part of the Raid, Whene$er this happens these are the load K consumers# K ,99. 9:Z 9:Z & && .E,:L-E cpuR&S logmapHcancel K .&: %Z %.Z & && -EL.9%9 cpuR&S fakesoftintHreturn K .. ,Z %:Z & && /%&%/&, cpuR&S cpuHhalt Nes, I can reproduce it on S,& x9L G( =but not on S,& sparc G(@, with a standard U<S logging files"stem =-&G total, ,9G free space@, when deleting three /GB files# Z mkfile /G a b c Z s"nc Z lockfs 4f S"stem is idle, no disk acti$it" at this point !hen# Z rm a b c Z (fter CrmC has exited, kernel cpu time usage rises to K %&Z and a lockstat kernel profile shows that logmapHcancel=@ is responsible for the kernelBs cpu time usage !he kernel is in this state for ^ %& seconds

F lockstat 4kIW 4D .& sleep .& >rofiling interrupt# ,%E. e$ents in .& .-, seconds =%E e$ents/sec@ 5ount ind$ cuml rcnt nsec 7ottest 5>U6>I2 5aller 4444444444444444444444444444444444444444444444444444444444444444444444444444444 ,LE% 9/Z 9/Z & && .-LE,L cpuR&S logmapHcancel ,:. EZ %.Z & && .:%E:& cpuR&S cpuHhalt :/ .Z %-Z & && .:&&&9 cpuR&S =usermode@ ,9 ,Z %/Z & && :./:9% cpuR&S mutexHenter ,. ,Z %/Z & && .-,.%- cpuR&S free ,& ,Z %LZ & && .-:&L/ cpuR&S logmapHcancelHdelta E &Z %LZ & && .,.,-, cpuR&S6,, fakesoftintHreturn L &Z %LZ & && .L&%99 cpuR&S b+ero / &Z %EZ & && .-:E,& cpuR&S rmHassi+e - &Z %EZ & && :-:E-, cpuR&S deltamapHadd - &Z %EZ & && ,,/9%% cpuR&S indirtrunc - &Z %EZ & && ,:L&9E cpuR&S tsdHagentHget - &Z %EZ & && ,%,LLL cpuR&S hash.ints - &Z %9Z & && ,:9E:% cpuR&S breadHcommon : &Z %9Z & && -:::,: cpuR&S logmapHfreeHcancel : &Z %9Z & && :.L,E& cpuR&S kcop" . &Z %9Z & && ,,&L/- cpuR&S pollHcommon . &Z %9Z & && ,9E,-. cpuR&S brelse . &Z %9Z & && :&E99- cpuR&S bdwrite . &Z %9Z & && L,%&- cpuR&S6,, lockHsetHspl 4444444444444444444444444444444444444444444444444444444444444444444444444444444 posted by Brahma at 2:52 PM & comments

Friday, Guly 15, 2005


NetBackup 3rror codes
7iT Status 5ode# /& client process aborted !he client backup aborted One instance when this code appears is if a ;etBackup master or media ser$er is shut down or rebooted when a backup or restore is in process !r" the following# , 8nable detailed debug logging# ) 5reate a bpbkar debug log director" =U;I1 or Windows onl"@

) 5reate a bpcd debug log director" =this log is created automaticall" on 0acintosh clients @ ) On U;I1 clients, add the ?8RBOS8 option to the /usr/open$/netbackup/bp conf file ) On >5 clients, increase the debug or log le$el as explained in the debug log topics in 5hapter : of the !roubleshooting Guide . Retr" the operation and examine the resulting logs : On U;I1 clients, check for core files in the / director" - On U;I1 clients, check the s"stem log =/usr/adm/messages on Solaris@ for s"stem problems / !his problem can sometimes be due to a corrupt binar" On U;I1 clients, use the U;I1 sum command to check the bpcd, bpbkar, and tar binaries, located in /usr/open$/netbackup/bin on the client Reinstall them if the" are not the same as in the client director" under /usr/open$/netbackup/client on the ser$er Run the ;etBackup 5onfiguration ?alidation Utilit" =;5?U@ for the associated ;etBackup clients ;ote the client software checks in section two On a Windows client, check the bpinetd exe, bpcd exe, bpbkar:. exe, and tar:. exe executables located in the installHpath;etBackupbin folder on the client Reinstall the client if these executables are not the same si+e as on other Windows clients or are not at the same release le$el or do not ha$e the same ;etBackup patches applied as other Windows clients Status 5ode# /E client connection refused !he client refused a connection on the port number for bpcd !his can occur because there is no process listening on the bpcd port or there are more connections to the bpcd port than the network subs"stem can handle with the listen=@ call !r" the following# , <or Windows ;etBackup ser$ers# a 0ake sure the ;etBackup client software is installed b ?erif" that the bpcd and bprd port numbers in the ZS"stemRootZs"stem:.dri$ersetcser$ices file on the ser$er matches the setting on the client c ?erif" that the ;etBackup 5lient Ser$ice >ort number and ;etBackup Re'uest Ser$ice >ort number on the ;etwork tab in the ;etBackup 5lient >roperties dialog match the bpcd and bprd settings in the ser$ices file !o displa" this dialog, start the Backup, (rchi$e, and Restore interface on the ser$er and click ;etBackup 5lient >roperties on the <ile menu !he $alues on the ;etwork tab are written to the ser$ices file when the

;etBackup 5lient ser$ice starts d ?erif" that the ;etBackup client ser$ice is running e Use the following command to see if the master ser$er returns correct information for the client# installHpath?8RI!(S;etBackupbinbpclntcmd 4pn . <or U;I1 ser$ers# a 0ake sure the ;etBackup client software is installed b ?erif" that the bpcd port number on the ser$er =either ;IS ser$ices map or in /etc/ser$ices@ matches the number in the clientBs ser$ices file c Run the ;etBackup 5onfiguration ?alidation Utilit" =;5?U@ for the associated ;etBackup nodes ;ote the ;etBackup ser$ices port number checks in section one : <or a 0acintosh or ;etWare target client, $erif" that the ser$er is not tr"ing to connect when a backup or restore is alread" in progress on the client !hese clients can handle onl" one ;etBackup Qob at a time - >erform CResol$ing ;etwork 5ommunication >roblemsC in the !roubleshooting Guide 0a" I know what $ersion of ;etbackup "ou are usingA Nou might also want to check if the /kernel/dr$/st conf and /kernel/dr$/sd conf o$erwritten !hanks posted by Brahma at 3:41 PM & comments

Summary0 System &ard'are mi9ration best practices


SubQect# Summar"# S"stem hardware migration best practices !o# M !hanks for responses from : people (manda W"nn 4 Referred a compan" called Solarcom 444444444444444444444444444444444444444444444444444444444 Uen Rossman suggested the following# <irst, are "ou able to completel" clone the old s"stems o$er to totall" new duplicate =or similar@ hardwareA If so, the Qob should be a good bit easier 4 If "ou are not able to completel" clone o$er e$er"thing, what pieces =e g storageA@ ha$e to sta" the same and simpl" ha$e their connections mo$ed o$er =or howe$er "ou are doing it@A

4 Is the 7DS and 805 storage all S(;4connectedA =or at least fiber channel connected in an" case@A K Brief outline i was thinking is# =oracle DB and 7DS/805 storage@ K K * Build new s"stem with a different name and cop" config files Use K s"s4unconfig on old, s"stems during cuto$er Sounds more or less OU, though there are still some bits and pieces of information I am missing here K * <or data file s"stems from S(;, perform $eritas le$el deport and K import 0ight be the best route, but again, not sure I ha$e enough info here In general, "ouBll want to separate out the concepts of boot en$ironment disks and data disks =but "ou probabl" alread" knew that@ Build the boot en$ironment disks fresh, from scratch, and cop" o$er $arious other specific configuration files "ouBll need !hen, work separatel" with the data disks once "ou know the new platform is stable and close to read" to go If "ou ha$e completel" cloned hardware =including storage, which I suspect is ;O! the case@, "ou could use one of the data s"ncrhoni+er products from either 805 or 7itachi to Cs"ncC the two data storage pools while still li$e !hatBs what the" are good for I donBt remember either name of either product right now, howe$er 4444444444444444444444444444444444444444444444444444444444444444444444444444 nouceJmight" co +a Bs pro$ided some ideas as following# Nou could do flarcreate on old s"stem if SOl9 or higher, then use to install new s"stems (lternati$el", fresh install, find / /usr /$ar /opt /usr/local 4mountIsort 4u K /tmp/installed cut 4c ,49& /$ar/sadm/install/contentsIsed Bs/*/ /gBIawk B[ print Y, ]BIsort 4u K /tmp/reg On old s"stem# sdiff 4w ,L& 4s /tmp/installed /tmp/reg should gi$e GOOD pointers as to whatBs missing on new s"stem, since this shows the additional files on OS

!hen# look at files in /etc for customised files# shadow, passwd, group, inet/), inet/inetd conf, /etc/default/) On the disk side, gr9 if both are on S(; at the same time 5heck $ersion of ?R!S though, and patches on old s"s# umount all <SBes after stopping acti$it" $x$ol 4g "ourHdg stopall $xdg deport "ourHdg On new s"s# $xdg import "ourHdg $x$ol 4g "ourHdg startall now mount ;ame still same in /etc/$fstab =Do grep C"ourHdgC /etc/$fstab K /tmp/$fsadd on old s"s @ !rx to new s"s and do cat /tmp/$fsadd KK /etc/$fstab 0ount manuall" one b" one to test# mount /mnt, mount /mnt. till end !his will $erif" that $olas are working !ake longer than mountall, but sa$es more time if something is wrong #4@ posted by Brahma at 3:40 PM & comments

'9et
Z wget Bhttp#//sunsol$e sun com/pub4cgi/pdownload plAtarget*patchdiag xrefB wget Bhttp#//sunsol$e sun com/pub4cgi/pdownload plAtarget*patchdiag xrefB 44.,#.&#:L44 http#//sunsol$e sun com/pub4cgi/pdownload plAtarget*patchdiag xref *K `pdownload plAtarget*patchdiag xrefB Resol$ing sunsol$e sun com ,%. ,9 ,&9 -& 5onnecting to sunsol$e sun comR,%. ,9 ,&9 -&S#9& connected 7!!> re'uest sent, awaiting response :&. <ound 2ocation# http#//patches sun com/reports/patchdiag xref RfollowingS 44.,#.&#:E44 http#//patches sun com/reports/patchdiag xref *K `patchdiag xref .B Resol$ing patches sun com ,%. ,9 ,&9 L& 5onnecting to patches sun comR,%. ,9 ,&9 L&S#9& connected

7!!> re'uest sent, awaiting response .&& OU 2ength# ,,//.,E/. Rtext/plainS ,&&Z R*************************************************************** ***********KS ,,//.,E/. ,L, E/U/s 8!( &&#&& .,#.&#-E =,/, E/ UB/s@ 4 `patchdiag xref .B sa$ed R,//.E/./,//.E/.S Same works for patches themsel$es Nou want something moreA posted by Brahma at 3:39 PM & comments

c&eck process is runnin9 -s&


Nou think thatBs all there is to itA 5ome on, users are much cle$erer than thatT 7ow about one of these tests nextA 5ould sa$e "ou time later explaining wh" the users latest work has gone missing 8xample file exists if R T 4f Yinfile S then echo CInput file RYinfileS not found 4 (bortingC exit fi ;ote the use of the test not flag =T@ in front of the 4f =file exists@ flag Or how about# 8xample $erif" if R 4f Youtfile S then echo COutput file RYoutfileS alread" existsC /usr//bin/echo COka" to o$erwriteA = "/n @ # \cC read answer if R CYanswerC * CnC S II R CYanswerC * C;C S then echo C(bortingC exit fi fi Well, it might work But there is a failing with this second example !he test of the user answer tests for a C;OTC response If the user

misses the ke", it will carr" on <ar better to test for a CN8STC response which if missed Qust fails safe Re$ise the test line to# if R CianswerC T* C"C S VV R CYanswerC T* CNC S ;ote the use of the logical and =VV@ instead of the logical or =II@ here R$se'ueiJse'ueira chapter,&SY more checkHprocess sh FT/bin/bash process*C/usr/sbin/httpdC start*Cser$ice httpd restartC ps ax I awk B[print Y/]B I grep 4' CaYprocessYC II [ F (pparentl" not running, so start the process e$al CYstartC exit YA ] exit & R$se'ueiJse'ueira chapter,&SY more checkHport sh FT/bin/bash port*C9&C restart*Cser$ice httpd restartC netstat 4ln I awk B/atcp/ [print Y-]B I grep 4' C#YportYC II [ F (pparentl" not listening, so run restart command e$al CYrestartC exit YA ] exit & R$se'ueiJse'ueira chapter,&SY Qust found m"s'ld had died for the second time in a week, nothing ob$ious, so had a search for a good script to check and restart if necessar" IBm clueless when it comes to shell scripting, and e$en if I was IBd still search 4 itBs the kind of thing where it would be eas" to miss something ob$ious I was suprised to findjnothing half4useful =is it so ob$iousA@, so ended up ha$ing a go an"wa" >lan B# use the blog, 2uke Below is what IB$e got =as /etc/cron hourl"/m"s'l checker@, if an"one has something better, please drop in a comment W4@

FT/bin/sh if ps 4( I fgrep m"s'ld K /de$/nullW then echo m"s'ld is running else echo m"s'ld is ;O! running /etc/init d/m"s'l start fi !he script /etc/init d/m"s'l I think is m"s'l ser$er which comes with the 0"S32 source, I ma" ha$e tweaked it F 2uke Gorrie Sa"s# <ebruar" ,/th, .&&/ at ,E#.. In 8rlang we use a Csuper$isorC process that starts the worker !he super$isorBs Qob is to immediatel" restart the worker if it terminates abnormall" !he supre$isor should get an acti$e notification about the child terminating =like Unix SIG572D@ instead of polling or being in$oked manuall" 7ereBs a simple 8rlang4st"le super$isor in bourne shell# FT/bin/sh CYJC II exec CY&C CYJC ;B# 2ike an 8rlang super$isor this is properl" tail4recursi$e #4@ posted by Brahma at 3:39 PM & comments

,ovin9 a disk from SA%6# to =8Q


SubQect# SU00(RN# 0o$ing a disk from S>(R5 to x9L !hanks to# Rich !eer, 5arsten B Unudsen, Bernd Schemmer, !im 5hipman, Darren Dunham, Pason 2eDuc, $incentJcoQot name !here is no practical wa" to mo$e the disk with the data intact Rich and Bernd summed it up most succinctl"# Rich# CNouBll ha$e to do a dump and restore, because the on4disk U<S format is not compatibile between S>(R5 =big endian@ and x9L =little endian@ !he disk itself should be OU, but "ou wonBt see the data C Bernd# CI07O that is not possible due to the different architectures of x9L and

S>(R5 =little4endian $ersus big4endian@ Nou must backup the data, repartition the disk and restore the data C Dunham points out that# C!he anticipated release of O<S should change this in the future =will be cross4architecture compatible@, but doesnBt help "ou toda" C !hanks to all for "our help <rank posted by Brahma at 3:38 PM & comments

ftp9et0 5o'nloadin9 files via ftp


8xample (4,: ftpget# Downloading files $ia ftp FT /bin/sh F YId# ftpget,$ , . %,/&//&E .,#,/#-: moraes 8xp Y F Script to perform batch anon"mous ftp 8ssentiall" con$erts a list of F of command line arguments into input to ftp F **K !his script is nothing but a shell wrapper around CftpC F Simple, and 'uick 4 written as a companion to ftplist F 4h specifies the remote host =default prep ai mit edu@ F 4d specifies the remote director" to cd to 4 "ou can pro$ide a se'uence F of 4d options 4 the" will be cdBed to in turn If the paths are relati$e, F make sure "ou get the se'uence right Be careful with relati$e paths 4 F there are far too man" s"mlinks nowada"s F =default is the ftp login director"@ F 4$ turns on the $erbose option of ftp, and shows all responses from the F ftp ser$er F 4f remotefileR#localfileS gets the remote file into localfile F 4m pattern does an mget with the specified pattern Remember to 'uote F shell characters F 4c does a local cd to the specified director" F <or example, F ftpget 4h expo lcs mit edu 4d contrib 4f xplaces shar#xplaces sh F 4d /pub/R:/fixes 4c ^/fixes 4m Bfix)B F will get xplaces shar from ^ftp/contrib on expo lcs mit edu, and put it in F xplaces sh in the current working director", and get all fixes from F ^ftp/pub/R:/fixes and put them in the ^/fixes director" F Ob$iousl", the se'uence of the options is important, since the e'ui$alent F commands are executed b" ftp in corresponding order F F 0ark 0oraes MmoraesJcsri toronto eduK, <eb ,, ,%9% F

F **K !hese comments added b" author of this document F >(!7*/local/bin#/usr/ucb#/usr/bin#/bin F export >(!7 F **K (bo$e . lines from original script probabl" superfluous 8HB(D(RGS*L/ !0><I28*/tmp/ftp YY F **K 5reates temp file, using process id of script =YY@ F **K to construct filename SI!8*`domainname` toronto edu F **K BdomainnameB similar to BhostnameB F **K 0a" rewrite this to parameteri+e this for general use usage*CUsage# Y& R4h remotehostS R4d remotedirector"S R4f remfile#localfileS R4c localdirector"S R4m filepatternS R4$SC ftpflags*C4i 4nC $erbflag* set 4f F So we can use globbing in 4m set x `getopt $h#d#c#m#f# Y)` if R YA T* & SW then echo Yusage exit Y8HB(D(RGS fi shift trap Brm 4f Y[!0><I28] W exitB & , . : ,/ F **K Delete tempfile in case of abnormal exit from script echo Cuser anon"mous Y[US8R4gnu]JY[SI!8] K Y[!0><I28]C F **K (dded 'uotes =recommended in complex echoes@ echo binar" KK Y[!0><I28] for i in Y) F **K >arse command line args do case Yi in 4$@ $erbflag*4$W echo hash KK Y[!0><I28]W shiftWW 4h@ remhost*Y.W shift .WW 4d@ echo cd Y. KK Y[!0><I28]W if R xY[$erbflag] T* x SW then echo pwd KK Y[!0><I28]W fiW shift .WW 4c@ echo lcd Y. KK Y[!0><I28]W shift .WW 4m@ echo mget CY.C KK Y[!0><I28]W shift .WW 4f@ f,*`expr CY.C # C\=Ra#S)\@ )C`W f.*`expr CY.C # CRa#S)#\= )\@C`W echo get Y[f,] Y[f.] KK Y[!0><I28]W shift .WW

44@ shiftW breakWW esac F **K BlcdB and BmgetB are ftp commands See Cman ftpC done if R YF 4ne & SW then echo Yusage exit Y8HB(D(RGS F **K 5hanged from Cexit .C to conform with st"le standard fi if R xY[$erbflag] T* x SW then ftpflags*CY[ftpflags] 4$C fi if R xY[remhost] * x SW then remhost*prep ai mit edu F **K 5hange to match appropriate ftp site fi echo 'uit KK Y[!0><I28] F **K (ll commands sa$ed in tempfile ftp Y[ftpflags] Y[remhost] M Y[!0><I28] F **K ;ow, tempfile batch processed b" ftp rm 4f Y[!0><I28] F **K <inall", tempfile deleted ="ou ma" wish to cop" it to a logfile@ F **K 8xercises# F **K 444444444 F **K ,@ (dd error checking F **K .@ (dd bells V whistles posted by Brahma at 3:37 PM & comments

2eneratin9 random 8@c&aracter pass'ords


8xample (4,- password# Generating random 94character passwords FT/bin/bash F 0a" need to be in$oked with FT/bin/bash. on older machines F F Random password generator for Bash . x b" (ntek Sawicki MtenoxJtenox tcK, F who generousl" ga$e permission to the document author to use it here F F **K 5omments added b" document author **K 0(!RI1*C&,.:-/LE9%(B5D8<G7IPU20;O>3RS!U?W1NOabcdefghiQklmnop'rs tu$wx"+C

F **K >assword will consist of alphanumeric characters 28;G!7*C9C F **K 0a" change B28;G!7B for longer password while R CY[n#*,]C 4le CY28;G!7C S F **K Recall that #* is Cdefault substitutionC operator F **K So, if BnB has not been initiali+ed, set it to , do >(SS*CY>(SSY[0(!RI1#Y==YR(;DO0ZY[F0(!RI1]@@#,]C F **K ?er" cle$er, but trick" F **K Starting from the innermost nesting F **K Y[F0(!RI1] returns length of arra" 0(!RI1 F **K YR(;DO0ZY[F0(!RI1] returns random number between , F **K and Rlength of 0(!RI1S 4 , F **K Y[0(!RI1#Y==YR(;DO0ZY[F0(!RI1]@@#,] F **K returns expansion of 0(!RI1 at random position, b" length , F **K See [$ar#pos#len] parameter substitution in 5hapter % F **K and the associated examples F **K >(SS* simpl" pastes this result onto pre$ious >(SS =concatenation@

F **K !o $isuali+e this more clearl", uncomment the following line F echo CY>(SSC F **K to see >(SS being built up, F **K one character at a time, each iteration of the loop let n6*, F **K Increment BnB for next pass done echo CY>(SSC F **K Or, redirect to a file, as desired exit & posted by Brahma at 3:37 PM & comments

Eillin9 processes by name


8xample ,.4E Uilling processes b" name FT/bin/bash F kill4b"name sh# Uilling processes b" name F 5ompare this script with kill4process sh

F <or instance, F6 tr" C /kill4b"name sh xtermC 44 F6 and watch all the xterms on "our desktop disappear F Warning# F 4444444 F !his is a fairl" dangerous script F Running it carelessl" =especiall" as root@ F6 can cause data loss and other undesirable effects 8HB(D(RGS*LL if test 4+ CY,C F ;o command line arg suppliedA then echo CUsage# `basename Y&` >rocess=es@HtoHkillC exit Y8HB(D(RGS fi >RO58SSH;(08*CY,C ps ax I grep CY>RO58SSH;(08C I awk B[print Y,]B I xargs 4i kill [] .VK/de$/null F aa aa F 44444444444444444444444444444444444444444444444444444444444 F ;otes# F 4i is the Creplace stringsC option to xargs F !he curl" brackets are the placeholder for the replacement F .VK/de$/null suppresses unwanted error messages F 44444444444444444444444444444444444444444444444444444444444 exit YA posted by Brahma at 3:36 PM & comments

debu99in9
If "ou are onl" interested in debugging rather than logging, then "ou might look at setting >S- to something along the lines of >ROG;(08*Y=basename Y&@ >S-*C!R(58 \Y>ROG;(08 \Y<U;5;(08 \Y2I;8;O# C =built4in shell $ariables ma" $ar"@ and "ou can add some timing information if "ou reall" care >S- is printed when tracing with set 4x or 4$ posted by Brahma at 3:26 PM & comments

customi+e my bas& prompt

he", IBd like to customi+e m" bash prompt a bit currentl" I ha$e# >S,*C4\h#\w4 \uY C the problem I ha$e is sometimes I get prett" deep into m" director" structure, and some of m" director" names are prett" long Is there some wa" to change the \w in m" prompt to# ,@ if the director" structure is less than :& characters, Qust displa" it .@ if the director" structure is more than :& characters, change it to displa" three dots =like an ellipsis@ and the last .E characters of the path for instance# /someHreall"HlongHpath/going/to/someHplace gets changed to ngHpath/going/to/someHplace so the prompt would look like# 4hostname# ngHpath/going/to/someHplace4 usernameY thanks in ad$ance Repl" On .&&/4&E4,., Quic"m Jmailinator com wrote# K he", IBd like to customi+e m" bash prompt a bit K currentl" I ha$e# K >S,*C4\h#\w4 \uY C K the problem I ha$e is sometimes I get prett" deep into m" director" K structure, and some of m" director" names are prett" long Is there K some wa" to change the \w in m" prompt to# K ,@ if the director" structure is less than :& characters, Qust displa" K it K .@ if the director" structure is more than :& characters, change it to K displa" three dots =like an ellipsis@ and the last .E characters of the K path K for instance# K /someHreall"HlongHpath/going/to/someHplace gets changed to K ngHpath/going/to/someHplace K so the prompt would look like# K 4hostname# ngHpath/going/to/someHplace4 usernameY

>RO0>!H5O00(;D*Bif R Y[F>WD] 4gt :& S then >S,*C4\h# Y[>WD# 4.E]\uY C else >S,*C4\h#\w4 \uY C fiB 44 posted by Brahma at 3:25 PM & comments

8&ursday, Gune F0, 2005


ss&d #onfi9uration in Solaris 8
Re# sshd 5onfiguration in Solaris 9 >osted B" RaQendra Nada$ On !uesda", Pune .9, .&&/ at E#-9 (0 hi do the following Fmkdir /$ar/empt" Fchown root#s"s /$ar/empt" Fchmod E// /$ar/empt" Fgroupadd sshd Fuseradd 4g sshd 4c CSS7D (dminC 4d /$ar/empt" 4s /bin/false sshd Fssh4ke"gen 4t rsa, 4f /usr/local/etc/sshHhostHke" 4; CC Fssh4ke"gen 4t dsa 4f /usr/local/etc/sshHdsaHke" 4; CC Fssh4ke"gen 4t rsa 4f /usr/local/etc/sshHhostHrsaHke" 4; CC then " start the sshd ser$ices Regard RaQendra 444 sagar $ia solaris4l MemailJremo$edK wrote# K F 5alculating the 5ost of !ape and Disk Storage K Solutions K F 2earn more at# K http#//www I!toolbox com/r/rd aspAi*,&L%E K K F ?iew Group (rchi$e# K http#//I!toolbox com/hrd aspAi*9:&

K K 7i Gu"s K I am new to sshd configuration K I ha$e installed OpenSsh in Solaris9 K K I ha$e a few 3ueries K K What is prngd A Wh" is used K (lso when I start the sshd daemon I am Getting the K following message K >ri$ilege separation user sshd does not exist K K What is the >ri$ilege Separation User K K >lease assist K K Regards K K Sagar K prngd is a random number generator, onl" re'uired if "our kernel does not ha$e a /de$/random and /de$/urandom !here are kernel patches for Solaris that gi$e "ou those de$ices Nou might alread" ha$e them !he sshd pri$ilege separation user is used b" the daemon to lower itBs pri$ileges, so it doesnBt ha$e to run as root all the time, before a user has authenticated =when it runs as that user@ It increases securit" and makes it harder for someone to obtain remote root access in the e$ent that a buffer o$erflow is disco$ered/exploited in sshd posted by Brahma at 1:03 PM & comments

verbose boot
8$er wonder what the box is doing before the banner and OB> prompt is displa"edA 8$er wonder what Solaris is doing before the banner and OU prompt is displa"edA Nou must ha$e console to do this, simpl" t"pe C$C for $erbose Solaris will output its diagnostic report to the console rather than hiding it !his does not increase boot time posted by Brahma at 1:03 PM & comments

Mednesday, Gune 2:, 2005


coreadm 9core
I ha$e a SUID daemon, CdspamC, that I fire up as root, and it suidBs to user CdspamC It segfaults after some time, and I need to get a core file =but cannot get it to lea$e one@ IB$e tried ulimit 4c unlimited as root before I fire up the daemon I ha$e tried coreadm 4e global 4e process 4e global4setid 4e proc4setid !he dspam user owns the director" where the daemon resides and from where I fire it up When it segfaults, no core file is left When I run gcore on it as user dspam, I get gcore# cannot grab ,9,/9# permission denied IBm using Solaris % =/ % GenericH,,E,E,4,E@ 0ore debuuging info, in case it helps# rootJrita4blanca#/use/site/dspam4: - 9/srcK ulimit 4a core file si+e =blocks@ unlimited data seg si+e =kb"tes@ unlimited file si+e =blocks@ unlimited open files ,&.pipe si+e =/,. b"tes@ ,& stack si+e =kb"tes@ 9,%. cpu time =seconds@ unlimited max user processes %9-/ $irtual memor" =kb"tes@ unlimited rootJrita4blanca#/usr/site/dspam4: - 9/srcK coreadm global core file pattern# init core file pattern# core global core dumps# enabled per4process core dumps# enabled global setid core dumps# enabled per4process setid core dumps# enabled global core dump logging# enabled rootJrita4blanca#/usr/site/dspam4: - 9/srcK ls 4l< dspam 4r4sr4sr4x , dspam antispam ,/L&&,L Pun .. ,-#,, dspam)

rootJrita4blanca#/usr/site/dspam4: - 9/srcK /dspam 44daemonV R,S ,9,/9 rootJrita4blanca#/usr/site/dspam4: - 9/srcK ps 4ef I grep 44 44daemon dspam ,9,/9 .,EE & &9#&%#/% pts/:% &#&& /dspam 44daemon rootJrita4blanca#/usr/site/dspam4: - 9/srcK su dspam dspamJrita4blanca#/usr/site/dspam4: - 9/srcK gcore ,9,/9 gcore# cannot grab ,9,/9# permission denied (n" help is greatl" appreciated posted by Brahma at 10:06 AM & comments

Ufsdump 8ape script


K I need a simple script to dump a ser$er mirrored with solstice disksuite to K tape, then demonstrate how to reco$er it to a new disk K K IBm dumping using this# K K ufsdump &uf /de$/rmt/&hn / K ufsdump &uf /de$/rmt/&hn /$ar K ufsdump &uf /de$/rmt/&hn /opt K ufsdump &uf /de$/rmt/&h /usr K K !he tape successfull" rewinds at the end K K !hen I tried this script to see whatBs on the tape# K K ufsrestore t$f /de$/rmt/&hn K /root txt K ufsrestore t$sf /de$/rmt/&hn . K /$ar txt K ufsrestore t$sf /de$/rmt/&hn : K /opt txt K ufsrestore t$sf /de$/rmt/&h - K /usr txt K K !he script crashed sa"ing# K K F /fullrest sh K ioctl 0!<S<# I/O error K 0ount $olume . K then enter $olume name =default# /de$/rmt/&hn@ a5ufsrestore interrupted, K continueA R"nS n K K !he root txt file contains the contents of /$ar

K K so ob$iousl" somethingBs wrong K K IB$e tried fiddling with mt commands to no effect IB$e also tried lea$ing K off the CsC parameter and Qust trusting the order on the tape K K What am I doing wrongA What IBm doing wrong is making things too complicated and using ufsrestore incorrectl" K ufsrestore t$sf /de$/rmt/&h - K /usr txt Should read# ufsrestore t$fs /de$/rmt/&h - K /usr txt but thatBs still too complicated I broke it into two scripts Y more fullback sh FT/bin/sh echo Crewinding tapeC mt 4f /de$/rmt/& rewind echo Cbacking up rootC ufsdump &uf /de$/rmt/&hn / echo Cbacking up $arC ufsdump &uf /de$/rmt/&hn /$ar echo Cbacking up optC ufsdump &uf /de$/rmt/&hn /opt echo Cbacking up usrC ufsdump &uf /de$/rmt/&hn /usr echo Crewinding tapeC mt 4f /de$/rmt/& rewind Y more fulltest sh FT/bin/sh echo Cmo$ing tape to beginningC mt 4f /de$/rmt/& rewind echo Ctesting restoring rootC ufsrestore t$f /de$/rmt/&hn K /root txt echo Ctesting restoring $arC ufsrestore t$f /de$/rmt/&hn K /$ar txt echo Ctesting restoring optC ufsrestore t$f /de$/rmt/&hn K /opt txt echo Ctesting restoring usr

ufsrestore t$f /de$/rmt/&hn K /usr txt echo CrewindingC mt 4f /de$/rmt/& rewind 2ater on I can get fanc" using CmtC with CafsC to position the tape !hanks to# Darren Dunham, (lexandre Wanderle", Rich Uulawiec, >eter Stokes, Ric (nderson, Ue$in Gallagher, Pohn BenQamins, Ra" Brownrigg =I think I got e$er"bod"@ posted by Brahma at 10:02 AM & comments

Script to 9et predefined kernel tunables


FT/bin/ksh F F Script to get predefined kernel tunables F F Y2og# getHkernelH$alues,$ Y F Re$ision , . .&&:/&%/&: .,#-&#.% 0S:/&L9 F ))) empt" log message ))) F F Re$ision , , .&&:/&%/&: .,#:%#-. 0S:/&L9 F Initial re$ision F F Written b" 0atthew Baker 781*& >H:.?(2U8*D >HL-?(2U8*8 if == YF @@ then if RR CY,C ** C4xC SS then 781*, elif RR CY,C ** C4?C SS then clear cat MM4 8O< I more ;O!8# )));O!))) all kernel $alues can be changed d"namicall"TTT

Watch# :.bit or L-bit kernel# /usr/bin/isainfo 4k$ F see if :. or L- bit if :., L- bit D8 1P WO D 4 long decimal, 8 4 9 b"tes unsigned 1 4 - b"tes hex, P 4 9 b"es hex W 4 -4b"te write, O 4 94b"te write to address !o change, use# adb 4kw /de$/ks"ms /de$/mem then i e # ncsi+e/W &t9&&& then i e # maxHpageHget/O &x,ad: then i e # slowscan/O &x,%& Fset slowcan to -&& or echo Bncsi+e/W &t9&&&B I adb 4kw !o list all possible kernel $alues# /usr/ccs/bin/nm /platform/`uname 4m`/kernel/)unix I more 8O< exit & elif RR CY,C ** C4$C SS then cat MM4 8O< I more 2ast Updated# ,./.,/.&&, ;D 4 ;O! D"namic =needs reboot 4 modif" in /etc/s"stem@ D 4 D"namic =can change on acti$e/running s"stem, still need /etc/s"stem to sur$i$e a reboot@ ;O!8# memor" changes =as in slowcan, fastscan, Will be lost if a memor" DR occurs and the" are not in the /etc/s"stem file@ autoup 4 ;D# max age of an" memor"4resident pages that ha$e been modified Rdef# :&, range# -4.-&S bufhwm 4 ;D# max amount of memor" for caching I/O buffers Rdef# .Z of ph"s mem, range# 9&UB to .&Z of ph"s memS

cachefree 4 obsolete coredefault 4 x consistentHcoloring 4 D# method to use for external 5>U cache =&4uses $irtual address bits, ,4ph"sical address is set to $irtual address, .4bin hopping, L4SBSD page coloring scheme@ desfree 4 D# amount of memor" desired to be free at all time on the s"stem Rdef# lotsfree/., range# greater of ,/L- of ph"smem or /,. UB, range# default 4 ,/Z of ph"sical memor"S dnlcHdirHenable 4 D# enables large director" caching Rdef# ,, range# &4,S dnlcHdirHminHsi+e 4 D# min number of entries before caching one director" Rdef# -&, range# &40(1U;I!=no maximum@S dnlcHdirHmaxHsi+e 4 D# max number of entries cached for one director" Rdef# 0(1U;I! =no maximum@, range# &40(1U;I!S doiflush 4 D# flush memor" or not Rdef# ,, range#&4,S dopageflush 4 D# flush memor" or not Rdef# ,, range#&4,S fastscan 4 D# max number of pages per secon the s"stem looks at when scanning and pressure is high Rdef# lesser of L-0B and ,/. of ph"s mem, range# , 4 ,/. of ph"s memS handspreadpages 4 D# two4hand clock Rdef# fastscan, range# ,4number of ph"s memor" pagesS hiresHtick 4 ;D# kernel clock tick resolution Rdef# &, range# &4,S ipcHtcpHconnHhashHsi+e 4 ;D# controls the hash table si+e in the I> module for all acti$e =8S!(B2IS78D@ !5> connections Rdef# /,. range# /,.4,&E:E-,9.-S ipHicmpHerrHinter$al V ipHicmpHerrHburst 4 D# control rate of I> in generating I50> error messages Rdef# ,&& ms for inter$al, ,& for burst range# &4%%%%% ms for inter$al, ,4%%%%% for burstS ipHforwarding V ipLHforwarding 4 D# control whether I> does forwarding between interfaces# Rdef# & =off@, range# &4,S ipHforwarding V ipLHforwarding 4 D# control whether I> does forwarding for a particular interface# Rdef# & =off@, range# &4,S

ipHrespondHtoHechoHbroadcast V ipLHrespondHtoHechoHbroadcast 4 D# control whether I> responds to broadcast I50>$- echo re'uest or multicast I50>$L echo re'uest# Rdef# , =on@, range# &4,S ipHsendHredirects V ipLHsendHredirects 4 D# control whether I> sends out a I50> redirect message Rdef# , =on@, range# &4,S ipHforwardHsrcHrouted V ipLHforwardHsrcHrouted 4 D# 5ontrol whether I>$- or I>$L forwards packets with source I>$- routing options or I>$L routing headers Rdef# , =on@, range# &4,S ipHaddrsHperHif 4 D# max num of logical interfaces assoc with real interface Rdef#./L, range# ,49,%.S ipHstrictHdstHmultihoming V ipLHstrictHdstHmultihoming 4 D# Determine whether a packet arri$ing on a non4forwarding interface can be accepted for an I> address that is not explicitl" configured on that interface If ipHforwarding is enabled, or xxx#ipHforwarding for the appropriate interfaces is enabled, then this parameter is ignored, because the packet is actuall" forwarded Rdef# & =loose multihoming@, range# &4,=strict multihoming@S kmemHflags 4 D# debugging kernel flags Rdef# & =off@, range# &,,,.,-,9,./LS kobQHmapHspaceHlen 4 D# (mount of kernel memor" allocated to store s"mbol table info Rdef# ,0bS lotsfree 4 D# Initial trigger for s"stem pageing to beign =page scanner@Rdef# greater of ,/L- of ph"smem or /,. UB, range# default 4 maxHnumberHofHph"sHmemHpages S lwpHdefaultHstksi+e 4 D, si+e of the kernel stack for lwps =si+e in b"tes and should be multiple of >(G8SIO8@ R&4.L.,--S maxHnprocs 4 ;D, max number of processes that be can created =this $alue is used in computing others@ Rdef# ,& 6 ,L ) maxusers, range# .LL4maxpidS maxHpageHget 4 D# limits the max num of pages that can be alloced in a s"stem Rdef# half the number of pages in s"stem, range# AAAS maxpgio 4 ;D# max num of page I/O re'uests than can be 'ueued b" paging s"stem =di$ided b" - to get the actual max used@ Rdef# -&, range# ,4,&.-S

maxph"s 4 D =but ma" not effect all loaded structures@# Rdef# ,:,&E.=sun-u@, range# pagesi+e 4 0(1I;!S maxpid I pidmax 4 ;D# largets possible >ID =solaris 9 and greater@ Rdef# :&&&&, range# .LL4%%%,%%%S maxuprc 4 ;D# per user process limit Rdef# reser$edHprocs, range# ,4maxHnprocsS maxusers 4 ;D# s"stem wide calculation $alue taken from R(0 si+e =def# lesser of the amount of memor" in 0B and .&-9, range in /etc/s"stem# 94-&%L@ minfree 4 D# minimum acceptable memor" le$el Rdef# desfree/., range# greater of ,/./L of ph"smem or ,.9 UB, range# default 4 max ph"sical memor" pages =E /Z of memor"@S minHpercentHcpu 4 D# min percent of 5>U that pageout can consume Rdef# -, range# ,49&S moddebug 4 D# debug module loading process Rdef# & =off@, common# .,-,9S ngroupsHmax 4 max number of supplementar" groups per user ncsi+e 4 ;D# director" name lookup cache 4 D;25 Rdef# - ) =$ $Hproc 6 maxusers@ 6 :.&, range# & 4 0(1I;!S nd'uot 4 ;D# number of 'uota structure for U<S that should be allocated Rdef# maxusers ) -& / - 6 maxHnprocs, range# & 4 0(1I;!S noexecHuserHstack 4 D# mark stack as not executable 4 for securit" =onl" needed for :. bit onl", L- bit apps ha$e it b" default@ Rdef# & =off@, range# &4,S nrnode 4 ;D# max num of rnodes allocated =;<S inode@ Rdef# ncsi+e, range# AAAS nstrpush 4 D# number of modules that can be inserted =pushed@ into a tream Rdef# %, range %4,LS npt" 4 ;D# total number of - &I- , pseudo4tt"s configed Rdef# -9, range# AAAS pageoutHreser$e 4 D# ;umber of pages reser$ed for the exclusi$e use of the pageout or scheduler threads Rdef# throttlefree/., range# !he minimum $alue is L- Ub"tes or ,//,.th of ph"sical memor", whiche$er is greater, expressed as pages =no more than .Z of ph"s mem@ S

pagesHppHmaximum 4 D# number of pages the s"stem re'uire to be unlocked Rdef# max of triplet =.&&, tuneHtHminarmem 6 ,&&, =,&Z of memor" a$ail at boot@@, max# .&Z of ph"s memS pagesHbeforeHpager 4 ;D# part of s"s threshold that immediatel" frees pages after an I/O completes instead of storing pages for possible reuse Rdef# .&&, range#,4ph"s memS ph"smem 4 D# si+e of ph"sical memor" R,4si+eHofHmemor"S priorit"Hpaging 4 ;D# >R8 . 9, enabling the s"stem to place a boundar" around the file cache =ensure that <S I/O does not cause application paging@ ptHcnt 4 ;D# total number of / E pseudo4tt"s configsed Rdef# &, range# & 4 0(1>IDS ptHpctofmem# ;D# max percent of ph"s mem that can be used b" /de$/pts entries L- bit kernel uses ,EL b"tes per /de$/pts, :. bit ,,. b"tes Rdef# /, range# &4,&&S ptHmaxHpt"# D# max number of pt" the s"stem offers Rdef# & =uses s"stem defined max =see ptHcnt@, range# & 4 0(1U;I!S rechooseHinter$al 4 D# number of clock ticks before a process is deemed to ha$e lost all affinit" for the last 5>U it ran on (fter this inter$al expires, an" 5>U is considered a candidate for scheduling a thread ?alid onl" for threads Rdef# :, range# & 4 0(1I;!S reser$edHprocs 4 ;D# number of s"stem process slots to be reser$ed in >ID table for UID & process Rdef# /, range# / 4 0(1I;!S rlimHfdHcur 4 ;D# current file descriptor =files open@ limit =soft ulimit@ def# ./L, range# , 4 0(1I;!@ rlimHfdHmax 4 ;D# maximum file descriptor =files open@ limit =hard ulimit@ Rdef# ,&.-, range# , 4 0(1I;!S rstchown 4 D# allow chown b" users other than root Rdef#, =on 4 canBt chown unless root@, range# &4,S sadcnt 4 number of sad de$ices nautopush 4 ;D# number of sad autopush structures Rdef#:.S

segkpsi+e 4 ;D# amount of kernel pageable memor" a$ailable primaril" for kernel threads Rdef# :.HbitHkernelF/,.0B, L-HbitF.GB, range# :.HbitF/,.0B, L-HbitF/,.0B4.GBS slowscan 4 D# min number of pages per secon that the s"stem looks at when reclaiming memor" Rdef# lesser of ,/.& of ph"s mem or ,&&, range# , to fastscan/. S strmsgs+ 4 D# max number of b"tes a single s"stem call can pass to a S!R8(0 to be placed in the data part of a message If a write exceeds this si+e, it is broken into multiple messages Rdef# L/,/:L, range &4.L.,--S strctls+ 4 D# max number of b"tes a single s"stem call can pass to a S!R8(0 to be placed in the control part of a message Rdef# ,&.-, range &40(1I;!S swapfsHreser$e# ;# when allocating for actual need on backing store, it keeps the s"stem from deadlock if there is excessi$e consumption Rdef# lesser of -0B or ,/,L ph"s mem, range# default 4 max number of ph"s mem pagesS swapfsHminfree# ;# amount of ph"s mem that is desired to be kept free for the rest of the s"stem Rdef# larger of .0B and ,/9 of ph"s mem, range# , 4 ph"s memS throttlefree 4 D# memor" le$el at which blocking memor" allocation re'uests are put to sleep =def# minfree, range# greater of ,/./L of ph"smem or ,.9 UB, range# default 4 max ph"sical memor" pages =-Z of ph"sical memor"@ S timerHmax 4 ;D# number of >OSI1 timers a$ailable Rdef# :., range# & 4 0(1I;!S tuneHtHflckrec 4 max number of acti$e frlocks tuneHtHfsflushr 4 ;D# fsflush run inter$al R, 4 0(1I;!S tuneHtHgpgslo 4 ;D# page stealing low water mark, see /usr/include/s"s/tuneable h tuneHtHminarmem 4 ;D# min a$ailable resident =not swappable@ memor" needed to a$oid deadlock =in pages@ Rdef# ./, range# ,4ph"sHmem@ tuneHtHminasmem 4 min a$ailable swappable memor" needed to a$oid deadlock =in pages@

tcpHconnHhashHsi+e 4 ;D# controls the hash table si+e in the tcp module for all tcp connections =def# /,. range# /,.4,&E:E-,9.-@ tcpHdeferredHackHinter$al 4 D# time4out $alue for tcp dela"ed (5Us time in milliseconds Rdef# ,&&, range# ,ms4,minuteS tcpHdeferredHacksHmax 4 D# !he maximum number of !5> segments =in units of maximum segment si+e 0SS for indi$idual connections@ recei$ed before an acknowledgment =(5U@ is generated If set to & or ,, it means no dela"ed (5Us, assuming all segments are , 0SS long ;ote that for remote destinations =not directl" connected@, the maximum number is fixed to ., no matter what this parameter is set to !he actual number is d"namicall" calculated for each connection !he $alue is the default maximum Rdef# 9, range# &4,LS tcpHwscaleHalwa"s 4 D# If set to ,, !5> alwa"s sends SN; segment with the window scale option, e$en if the option $alue is & ;ote that if !5> recei$es a SN; segment with the window scale option, e$en if the parameter is set to &, !5> responds with a SN; segment with the window scale option, and the option $alue is set according to the recei$e window si+e Rdef# & =off@, range# &4,SS tcpHtstampHalwa"s 4 D# If set to ,, !5> alwa"s sends SN; segment with the timestamp option ;ote that if !5> recei$es a SN; segment with the timestamp option, !5> responds with a SN; segment with the timestamp option e$en if the parameter is set to & Rdef# & =off@, range# &4,SS tcpHxmitHhiwat 4 D# !he default send window si+e in b"tes Refer to the following discussion of per4route metrics for setting a different $alue on a per route basis Rdef# ,L:9-, range# -&%L4,&E:E-,9.-S tcpHrec$Hhiwat 4 D# !he default recei$e window si+e in b"tes Refer to the following discussion of per4route metrics for setting a different $alue on a per4route basis Rdef# .-/EL, range# .&-94,&E:E-,9.-S tcpHmaxHbuf 4 D# !he maximum buffer si+e in b"tes It controls how large the send and recei$e buffers are set to b" an application using Rdef# ,&-9/EL, range# 9,%. 4 ,&E:E-,9.-S tcpHcwndHmax 4 D# max $alue !5> congestion window =cwnd@ in b"tes Rdef# ,&-9/EL, range# ,.94,&E:E-,9.-S tcpHslowHstartHinitial 4 D# DO ;O! 57(;G8T !he maximum initial congestion window =cwnd@ si+e in 0SS of a !5> connection

tcpHslowHstartHafterHidle 4 D# !he congestion window si+e in 0SS of a !5> connection after it has been idled =no segment recei$ed@ for a period of one retransmission timeout =R!O@ Rdef# -, range# ,4,L:9-S tcpHsackHpermitted 4 D# If set to ., !5> alwa"s sends SN; segment with the selecti$e acknowledgment =S(5U@ permitted option If !5> recei$es a SN; segment with a S(5U4permitted option and this parameter is set to ,, !5> responds with a S(5U4permitted option If the parameter is set to &, !5> does not send a S(5U4permitted option, regardless of whether the incoming segment contains the S(5U permitted option or not Rdef# ., range# & =disabled@, , =passi$e enabled@, . =acti$e enabled@S tcpHre$HsrcHroutes 4 D# If set to &, !5> does not re$erse the I> source routing option for incoming connections for securit" reasons If set to ,, !5> does the normal re$erse source routing Rdef# & =off@, range# &4,S tcpHtimeHwaitHinter$al 4 D# !he time in milliseconds a !5> connection sta"s in !I084W(I! state Replaced tcpHcloseHwaitHinter$al See b" Cndd 4get /de$/tcp I grep tcpHtimeHwaitHinter$alC Rdef# minutes, range# , second 4 ,& minutesS tcpHconnHre'HmaxH' 4 D# !he default maximum number of pending !5> connections for a !5> listener waiting to be accepted b" accept=:SO5U8!@ Rdef# ,.9, range ,4-.%-%LE.%LS tcpHconnHre'HmaxH'& 4 D# !he default maximum number of incomplete =three4wa" handshake not "et finished@ pending !5> connections for a !5> listener Rdef# ,&.-, range ,4-.%-%LE.%LS tcpHconnHre'Hmin 4 D# !he default minimum $alue of the maximum number of pending !5> connection re'uests for a listener waiting to be accepted !his is the lowest maximum $alue of listen=:SO5U8!@ an application can use Rdef# ,, range# ,4,&.-S tmpfsHmaxkmem 4 D# max amount of kernel memor" that !0><S can use for its datastructures =tmpnodes and director" entries@ Rrange# number of b"tes in one page to ./Z of a$ailable kernel memor"S tmpfsHminfree 4 D# min amount of swap space the !0><S lea$es for reset of s"stem Rdef# ./LB"tes, range# & 4 max swap space si+eS udpHxmitHhiwat 4 D# def max UD> socket datagram si+e in b"tes Rdef# 9,%., range# -&%L, L//:LS

udpHrec$Hhiwat 4 D# def max UD> socket recei$e si+e in b"tes Rdef# 9,%., range# -&%L, L//:LS ufsHninode 4 D# number of inodes to be help in memor" Rdef# ncsi+e, range# & 4 0(1I;!S ufsH2W 4 D# unflushed U<S data 2ow Water mark Rdef# ./L ) ,&.-, range# & 4 0(1I;!S ufsH7W 4 D# unflushed U<S data 7igh Water mark Rdef# :9- ) ,&.-, range# & 4 0(1I;!S ufsHWRI!8S 4 D# If ufsHWRI!8S is non4+ero, the number of b"tes outstanding for writes on a file is checked See ufsH7W subse'uentl" to determine whether the write should be issued or should be deferred until onl" ufsH2W b"tes are outstanding !he total number of b"tes outstanding is tracked on a per4file basis so that if the limit is passed for one file, it wonBt affect writes to other files Rdef# , =on@, range# &4,S seminfoHsemaem 4 ;D# max $alue that a semaphore $alue in an undo structure can be set to Rdef# ,L:9-, range# ,4L//:/S seminfoHsemmsl 4 ;D# max number of S? semaphores per semaphore identifier Rdef# ./, range# , 4 0(1I;!S seminfoHsemmap 4 ;D# number of entries in the semaphore map Rdef# ,&S seminfoHsemmni 4 ;D# max number of semaphore identifiers Rdef# ,&, range# ,4L//:/S seminfoHsemmns 4 ;D# max number of S? semaphores on s"stem Rdef# L&, range# , 4 0(1I;!S seminfoHsemmnu 4 ;D# total number of undo structures supported b" S? semaphore s"stem Rdef# :&, range# , 4 0(1I;!S seminfoHsemopm 4 ;D# max number of S? semaphone operations per semop call =number of sembufs in the sops arra" that is pro$ided to the semop s"s call@ Rdef# ,&, range# , 4 0(1I;!S seminfoHsemume 4 ;D# max number of S? semaphore undo structures that can be undo b" an" one process Rdef# ,&, range# , 4 0(1I;!S seminfoHsem$mx 4 ;D# max $alue a semaphone can be set to Rdef# :.ELE, range# ,4L//:/S

shminfoHshmmin 4 ;D# DO ;O! 57(;G8T min si+e of S? shared memor" segment that can be created Rdef# ,, range# &4ph"s memS shminfoHshmmni 4 ;D# s"s wide limit on num of shared memor" segments that can be created Rdef# ,&&, range# & 4 0(1I;!S shminfoHshmmax 4 ;D# max si+e of S? shared memor" segment that can be created Rdef# ,&-9/EL, range# :.bitF & 4 0(1I;!, L-bitF & 4 0(1I;!L-S shminfoHshmseg 4 ;D# limit on num of shared memor" segments that an" one process can create Rdef# L, range# &4:.ELES segsptHminfree 4 ;D# pages of s"s memor" that cannot be allocated for IS0 shared memor" Rdef# /Z of a$ail s"s memor" when first IS0 segment is created, range# &4:.ELES scsiHoptions 4 see /usr/include/s"s/scsi/targets/ssddef h sdHioHtime 4 see /usr/include/s"s/scsi/targets/ssddef h sdHmaxHthrottle 4 see /usr/include/s"s/scsi/targets/ssddef h 8O< exit & else print CUsage# Y& R4$I4?I4xI4hSC print C ;o args 4 print out kernel $aluesC print C where 4$ describes what the kernel $alues meanC print C where 4? lists how to change themC print C where 4x prints out $alues in hexC print C where 4h prints out usageC exit , fi fi F F 0ain 4 no command line args F F find out kernel bit t"pe BI!S*Y=isainfo 4k$ I cut 4dB B 4f, @ F if kernel bit t"pe cannot be determined or is :. if RR 4+ YBI!S II YBI!S ** C:.4bitC SS

then F:. bit Fset L- bit $ariables to :. bit F not able to list an" L- as onl" :. bit kernel F so list e$er"thing in :. bit terms if == 781 @@ then >H:.?(2U8*1 >HL-?(2U8*1 else >H:.?(2U8*D >HL-?(2U8*D fi else FL- bit Fuse real L- bit prints Fset L- bit $ariables to appropriate t"pe Fset :. bit $ariables to appropriate t"pe F"ou still list some :. bit $ariable in L- bit kernel F as not e$er"thing is L- bit $ariables if == 781 @@ then >H:.?(2U8*1 >HL-?(2U8*P else >H:.?(2U8*D >HL-?(2U8*8 fi fi F F main area where we displa" the actual kernel $alues F cat MM 8O< I adb 4k /de$/ks"ms /de$/mem I awk B[ if =;< **.@ printf =CZ:&s Z4s \nC, Y,, Y.@]B I grep # I more autoup/Y>H:.?(2U8 bufhwm/Y>HL-?(2U8 coredefault/Y>H:.?(2U8 consistentHcoloring/Y>H:.?(2U8 desfree/Y>HL-?(2U8 dnlcHdirHenable/Y>H:.?(2U8 dnlcHdirHminHsi+e/Y>H:.?(2U8 dnlcHdirHmaxHsi+e/Y>H:.?(2U8 doiflush/Y>H:.?(2U8 dopageflush/Y>H:.?(2U8 fastscan/Y>HL-?(2U8

handspreadpages/Y>HL-?(2U8 hiresHtick/Y>HL-?(2U8 kmemHflags/Y>H:.?(2U8 kobQHmapHspaceHlen/Y>H:.?(2U8 lotsfree/Y>HL-?(2U8 lwpHdefaultHstksi+e/Y>H:.?(2U8 maxHnprocs/Y>H:.?(2U8 maxHpageHget/Y>HL-?(2U8 maxpid/Y>H:.?(2U8 maxpgio/Y>HL-?(2U8 maxuprc/Y>H:.?(2U8 maxusers/Y>H:.?(2U8 minfree/Y>HL-?(2U8 minHpercentHcpu/Y>H:.?(2U8 maxph"s/Y>HL-?(2U8 ph"smax/Y>HL-?(2U8 moddebug/Y>H:.?(2U8 ngroupsHmax/Y>H:.?(2U8 ncsi+e/Y>H:.?(2U8 nd'uot/Y>H:.?(2U8 nautopush/Y>H:.?(2U8 noexecHuserHstack/Y>HL-?(2U8 nrnode/Y>H:.?(2U8 nstrpush/Y>H:.?(2U8 npt"/Y>H:.?(2U8 pageoutHreser$e/Y>HL-?(2U8 pagesHppHmaximum/Y>HL-?(2U8 pagesHbeforeHpager/Y>HL-?(2U8 ph"smem/Y>HL-?(2U8 priorit"Hpaging/Y>HL-?(2U8 ptHcnt/Y>H:.?(2U8 ptHpctofmem/Y>H:.?(2U8 ptHmaxHpt"/Y>H:.?(2U8 rechooseHinter$al/Y>H:.?(2U8 reser$edHprocs/Y>H:.?(2U8 rlimHfdHcur/Y>H:.?(2U8 rlimHfdHmax/Y>H:.?(2U8 rstchown/Y>H:.?(2U8 sadcnt/Y>H:.?(2U8 segkpsi+e/Y>HL-?(2U8 slowscan/Y>HL-?(2U8 strmsgs+/Y>HL-?(2U8 strctls+/Y>HL-?(2U8 swapfsHreser$e/Y>HL-?(2U8 swapfsHminfree/Y>HL-?(2U8 throttlefree/Y>HL-?(2U8

tmpfsHmaxkmem/Y>HL-?(2U8 tmpfsHminfree/Y>HL-?(2U8 timerHmax/Y>H:.?(2U8 tuneHtHflckrec/Y>H:.?(2U8 tuneHtHfsflushr/Y>H:.?(2U8 tuneHtHgpgslo/Y>H:.?(2U8 tuneHtHminarmem/Y>H:.?(2U8 tuneHtHminasmem/Y>H:.?(2U8 ipcHtcpHconnHhashHsi+e/Y>H:.?(2U8 ipHicmpHerrHinter$al/Y>H:.?(2U8 ipHicmpHerrHburst/Y>H:.?(2U8 ipHforwarding/Y>H:.?(2U8 ipLHforwarding/Y>H:.?(2U8 ipHrespondHtoHechoHbroadcast/Y>H:.?(2U8 ipLHrespondHtoHechoHbroadcast/Y>H:.?(2U8 ipHsendHredirects/Y>H:.?(2U8 ipLHsendHredirects/Y>H:.?(2U8 ipHforwardHsrcHrouted/Y>H:.?(2U8 ipLHforwardHsrcHrouted/Y>H:.?(2U8 ipHaddrsHperHif/Y>H:.?(2U8 ipHstrictHdstHmultihoming/Y>H:.?(2U8 ipLHstrictHdstHmultihoming/Y>H:.?(2U8 udpHxmitHhiwat/Y>H:.?(2U8 udpHrec$Hhiwat/Y>H:.?(2U8 ufsHninode/Y>H:.?(2U8 ufsH2W/Y>H:.?(2U8 ufsH7W/Y>H:.?(2U8 ufsHWRI!8S/Y>H:.?(2U8 tcpHconnHhashHsi+e/Y>H:.?(2U8 tcpHdeferredHackHinter$al/Y>H:.?(2U8 tcpHdeferredHackHmax/Y>H:.?(2U8 tcpHwscaleHalwa"s/Y>H:.?(2U8 tcpHtstampHalwa"s/Y>H:.?(2U8 tcpHconnHre'HmaxH'/Y>H:.?(2U8 tcpHconnHre'HmaxH'&/Y>H:.?(2U8 tcpHconnHre'Hmin/Y>H:.?(2U8 tcpHtimeHwaitHinter$al/Y>H:.?(2U8 tcpHre$HsrcHroutes/Y>H:.?(2U8 tcpHsackHpermitted/Y>H:.?(2U8 tcpHslowHstartHafterHidle/Y>H:.?(2U8 tcpHslowHstartHinitial/Y>H:.?(2U8 tcpHcwndHmax/Y>H:.?(2U8 tcpHmaxHbuf/Y>H:.?(2U8 tcpHrec$Hhiwat/Y>H:.?(2U8 tcpHxmitHhiwat/Y>H:.?(2U8 seminfoHsemaem/Y>H:.?(2U8

seminfoHsemmsl/Y>H:.?(2U8 seminfoHsemmap/Y>H:.?(2U8 seminfoHsemmni/Y>H:.?(2U8 seminfoHsemmns/Y>H:.?(2U8 seminfoHsemmnu/Y>H:.?(2U8 seminfoHsemopm/Y>H:.?(2U8 seminfoHsemume/Y>H:.?(2U8 seminfoHsem$mx/Y>H:.?(2U8 shminfoHshmmin/Y>H:.?(2U8 shminfoHshmmni/Y>H:.?(2U8 shminfoHshmmax/Y>H:.?(2U8 shminfoHshmseg/Y>H:.?(2U8 segsptHminfree/Y>H:.?(2U8 scsiHoptions/Y>H:.?(2U8 sdHioHtime/Y>H:.?(2U8 sdHmaxHthrottle/Y>H:.?(2U8 8O< FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF FFFFFFF FFF !his script is submitted to Big(dmin b" a user of the Big(dmin communit" FFF Sun 0icros"stems, Inc is not responsible for the FFF contents or the code enclosed FFF FFF FFF 5op"right .&&/ Sun 0icros"stems, Inc (22 RIG7!S R8S8R?8D FFF Use of this software is authori+ed pursuant to the FFF terms of the license found at FFF http#//www sun com/bigadmin/common/berkele"Hlicense html FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF FFFFFFF posted by Brahma at 10:00 AM & comments

6eadin9 a file and passin9 it as a value to a scriptReading a file and passing it as a $alue to a script (ll . messages in topic 4 $iew as tree 7i (ll, I need some information on how to do the following I ha$e a file =images txt@ the contents are as follws

image, Qpg image.: Qpg image-E Qpg image,&& Qpg and so on What I hope to do is ha$e a script read this file, and for each entr", perform a operation using imagemagick 7ow could I achi$e this, I am using bash : on <reeBSD if this makes a difference 44 0aterialised perl 4e Bprintf CZsiltoZcZsalZcZsZccodegurusZcorgZcC, ma, /9, mw, ,&E, BerB, L-, -L, ,&WB Bart# C5hristmas is a time when people of all religions come together to worship Pesus 5hrist C Repl" SubQect# Re# RbashS Reading a file and passing it as a $alue to a script while read lineW do done M images txt 44 William >ark posted by Brahma at 9:59 AM & comments

F8A issues
Re# <!> Issues >osted B" Don Rowland On Wednesda", Pune .., .&&/ at ,.#,L (0 Rodrigo, 7ere is a routine I use to test ftp, when users report ftp is not working It ftpBs a file from machine4a to machine4b and then ftpBs the file back and compares the two files If an"thing goes wrong, the log files contain all of the ftp status

codes !his routine is a little o$erkill If the netrc file is correct on the remote s"stem, all "ou need are the ftp commands F FF ftp F 4d * enable debugging F 4$ * show (22 responses from remote s"stem F ftp 4$d MMftpHcmds, open macb prompt off put testHfile 'uit ftpHcmds, !he routine runs on machine4a =maca@ testHfile is sent to and retrie$ed from machine4b =macb@ FT /bin/ksh F FF ftp.macb 4 ftp a file from this s"stem to machb and capture the ftp repl" codes F !his routine tests ftp to $erif" the correctness of the file transfers FF Set the following arguments to the ftp command to allow debugging F 4d * enable debugging F 4$ * show (22 responses from remote s"stem F F Don Rowland 4 7ewlett >ackard 5orporation 4 &,/.9/.&&F FF 5lean out an" pre$ious log files F if R 4f ftpHlog, ) S then rm ftpHlog, ) fi if R 4f ftpHlog. ) S then rm ftpHlog. ) fi if R 4f testHfile back S then

rm testHfile back fi F FF WhoamiA I onl" want this routine to run as m"self, especiall" not root F 08*`whoami` if R Y08 T* CMm" account hereKC S then F FF If "ou are ;O! running as Mm" accountK, exit this script F echo CNou must be user Mm" accountK to run ftp.macbTC echo CNou are `whoami`W sorr"TCW exit , fi F FF Does netrc file exist on this s"stemA F W7O*`ls 4al /\ netrc I sed Bs/ )/ /gB I cut 4dC C 4f:` F FF If the user and password in netrc do not match the F logged in user, exit this script F if R Y08 T* YW7O S then echo C netrc does not match logged in userT Sorr"TCW exit , fi F FF Send test file to macb F echo C\n\tS8;D <I28C S!(R!*`date 6CZb Zd Z!C` tail 4, /$ar/adm/messages K ftpHlog, YY F FF ftp F 4d * enable debugging F 4$ * show (22 responses from remote s"stem F record debug responses in file ftpHlog, YY F ftp 4$d MMftpHcmds, KK ftpHlog, YY .KV, open macb M44 !his is the host name of the remote s"stem prompt off put testHfile 'uit

ftpHcmds, tail 4, /$ar/adm/messages KK ftpHlog, YY S!O>*`date 6CZb Zd Z!C` echo CStart * YS!(R!, Stop * YS!O>C KK ftpHlog, YY F FF If we got this far without hanging, purge the log file F F rm ftpHlog, YY F FF Did it workA F FF retrie$e test file from macb F echo C\n\R858I?8 <I28C S!(R!*`date 6CZb Zd Z!C` tail 4, /$ar/adm/messages K ftpHlog. YY F FF record debug responses in file ftpHlog. YY F ftp 4$d MMftpHcmds. KK ftpHlog. YY .KV, open macb M44 !his is the host name of the remote s"stem prompt off get testHfile testHfile back 'uit ftpHcmds. tail 4, /$ar/adm/messages KK ftpHlog. YY S!O>*`date 6CZb Zd Z!C` echo CStart * YS!(R!, Stop * YS!O>C KK ftpHlog. YY F FF Does the file I sent out match the file I got backA F diff testHfile testHfile back sum testHfile testHfile back KK ftpHlog. YY sum testHfile testHfile back F FF If we got this far without hanging, purge the log file F F rm ftpHlog. YY Good 2uck,

Don posted by Brahma at 9:55 AM & comments

root pass'ord &as lost root pass'ord


Re# root login problems >osted B" mkati"ar On !uesda", Pune .,, .&&/ at ,,#&& >0 hi Dan, Sending "ou the article ))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) )))))))))))))))))) Regaining control of a Solaris x9L s"stem where the root password has been lost can be accomplished b" the following steps ;ote that an" sa$$" user can do this with the proper 5D4RO0 and diskette !herefore, of course, ph"sical securit" of a s"stem is important for machines containing sensiti$e data Insert installation boot diskette and installation 5D4RO0 for Solaris x9L Boot s"stem from the installation flopp" and select the 5D4RO0 as the boot de$ice !"pe Cb 4sC =instead of t"ping , or . from the menu@ and itBll drop "ou straight to a root shell, F, =and "ouBll be in single4user mode@ (t the root prompt, F, ke" in the following commands, which will create a director" called hdri$e under the /tmp director" and then mount the root hard dri$e partition under this temporar" director" mkdir /tmp/hdri$e mount /de$/dsk/c&t&d&s& /tmp/hdri$e FS5SIW for (!(>I, omit Ct&C !o use the $i editor, the !8R0 $ariable must be defined Ue" in the following commands !8R0*at:9L export !8R0 Start $i =or some other editor@ and load /tmp/hdri$e/etc/shadow file# $i /tmp/hdri$e/etc/shadow 5hange the first line of the shadow file that has the root entr" to# root##L--/###### Write and 'uit the $i editor with the CTC o$erride command# #w'T 7alt the s"stem, remo$e the flopp" installation diskette, and reboot the s"stem#

halt When s"stem has rebooted from the hard dri$e, "ou can now log in from the 5onsole 2ogin# as root with no password Pust hit enter for the password (fter logging in as root, use the passwd command to change the root password and secure the s"stem R!hanks to 2"nn R <rancis, !exas State !echnical 5ollegeS ))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) )))))))))))))))))) posted by Brahma at 9:52 AM & comments

#lonin9 on Solaris
R8# 5loning on Solaris >osted B" 0ohammed Sadi' On !uesda", Pune .,, .&&/ at L#.: (0 Nou can create a snapshot of complete operating S"stem through fssnap command See details here http#//docs sun com/app/docs/doc/9,E4L%L&/Lmmah%-eiAa*$iew Regards 44444Original 0essage44444 <rom# hemantHk $ia solaris4l Rmailto#MemailJremo$edKS Sent# !uesda", Pune .,, .&&/ ,,#/- (0 !o# 0ohammed Sadi' SubQect# Rsolaris4lS 5loning on Solaris hello, i would like to know if there is an" disk cloning utilit" for solaris on sparc platform for eg s"mantec ghost which we use in windows en$oirnment regards, 5heck out <lar (rchi$e format, this format is similar to ignite or mks"sb and the man page of CflarcreateC 7emant

posted by Brahma at 9:51 AM & comments

ne' virtual &ost in your &ttpd-conf


5reate a new $irtual host in "our httpd conf file i e $i /usr/local/apache/conf/httpd conf M?irtual7ost newweb,K DocumentRoot /apachedocs/newweb Ser$ername www newweb com 8rror2og logs/www newweb com4errorHlog M/?irtual7ostK 7i gu"s, (n" one is used (pache web ser$er in sunsolaris . 9 I neeed to know , how to create a new web site in apache web ser$er >ls tell me as soon as possible posted by Brahma at 9:50 AM & comments

!uery for an e=istin9 bootblk


SubQect# SU00(RN# 3uer" for an existing bootblk 7i ), 0an" thanks to 7utin Bertrand, Ual"an 0anchikanti, Brad 0orrison, Poe <letcher V Si$a Santhakumar 0" 'uestion was# CI ha$e to 'uer" se$eral sun/ 9 sparc boxes to see if the secondar" mirror has a bootblk installed If not I will need to call the following# installboot /usr/platform/`uname 4i`/lib/fs/ufs/bootblk /de$/rdsk/c,t,d&s& Someone suggested# dd if*/de$/rdsk/c,t,d&s& of*mirror $toc bs*/,. count*, Which returns

,6& records in ,6& records outC ))))))))))))) SU;0(;(G8RS 4 7utin suggested# I need to use std $toc to ha$e something to compare to# dd if*/de$/rdsk/c,t&d&s& of*std $toc bs*/,. count*, dd if*/de$/rdsk/c,t,d&s& of*mirror $toc bs*/,. count*, Ccmp std $toc mirror $toc C and compare the outcomeBs, an" difference would suggest a different bootblk C 4 I carried out this and sure enough found that a machine without the platform specific bootblk returned a different result Si$a explained# Cdd command taking the input from /de$/rdsk/c,t,d&s& and write =single@ of /,. block si+e In "our case if "our current boot disk is c&t&d&s& and alternate boot disk is c,t,d&s& then t"pe# dd if*/de$/rdsk/c&t&d&s& of*/de$/rdsk/c,t,d&s& bs*/,. count*, make sure disks names are correct Brad suggested and explained# CWhen dd sa"s# ,6& records in ,6& records out it means that it has successfull" read and written , record of the si+e "ou specified =HH, in this case@ !hat is, Cit workedC #4@ (n"thing else could be an error, unless "our record si+e doesnBt correspond to what dd found !r" creating a file with ,&./ b"tes and run# dd if*,&./4b"te4file of*/de$/null bs*,&.dd should answer with ,6, records in ,6, records out to indicate one complete ,&.-4b"te record, plus one partial record

!hereBs one more step after ddBing the area where the bootblock should be# compare it to the bootblock "ouBd install if "ou found it missing (fter ddBing whatBs on a gi$en s"stem to some temp file, use cmp to compare it to /usr/platform/`uname 4i`/lib/fs/ufs/bootblk C 4 !his pro$ed to be the case, and helped me to $erif" further Poe Suggested# C(n" reason wh" "ou donBt Qust run the boot block installs on all the disks and forget the restA If itBs alread" there it Qust gets o$erwritten, if itBs not there then the install is done C ))))))))))) So it seems the dd command was not crucial to commiting an installboot =not cause an" damage@, as I could simpl" o$erwrite an" existing bootblk with the correct architecture 4 But I learnt a lot more in the process, which is alwa"s a good thing #@ !hanks (llTTT 5heers, 2uke posted by Brahma at 9:47 AM & comments

Script for c&an9in9 t&e pass'ord


SubQect# <W# SU00(RN# Script for changing the password 7i 0anagers, 7ere is the more compact $ersion updated script !hanks to C(ndrew 7allC for ad$ising me to use case statement !his a$oids using ;<S mount FT/usr/bin/ksh 4x FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF F FFFFFFFF FScript Written on .Eth Pune &/ F!his script is used to change the root password of all unix hosts F0ake sure /usr/s"sadm/scripts/minoti/all4hosts is updated with li$e hosts before running this script FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF

F FFFFFFF for i in `cat /usr/s"sadm/scripts/minoti/test4hosts` do OS*`remsh Yi uname` case YOS in SunOS@ rsh Yi Crm /tmp/shad)C rsh Yi Ccp 4p /etc/shadow /etc/shadow .E&LC rsh Yi Ccat /etc/shadowIgrep 4$ rootK/tmp/shad,C rsh Yi Cecho Croot#,8D7xu&awLQR8#,.%/9######CK/tmp/shad.C rsh Yi Ccat /tmp/shad,KK/tmp/shad.C rsh Yi Ccp /tmp/shad. /etc/shadowC rsh Yi C/usr/sbin/pwcon$C rsh Yi Cchown root#s"s /etc/shadowC rsh Yi Cchmod -&& /etc/shadowC WW 7>4U1@ rsh Yi Crm /tmp/shad)C rsh Yi Crm /tmp/pass)C rsh Yi Ccp 4p /etc/passwd /etc/passwd .E&LC rsh Yi Ccat /etc/passwdIgrep 4$ rootK/tmp/shad,C rsh Yi Cecho Croot#WkmiDPgf>bUB #&#:##/#/sbin/shCK/tmp/shad.C rsh Yi Ccat /tmp/shad,KK/tmp/shad.C rsh Yi Ccp /tmp/shad. /etc/passwdC rsh Yi Cchown root#other /etc/passwdC rsh Yi Cchmod --- /etc/passwdC WW 2inux@ rsh Yi Crm /tmp/shad)C rsh Yi Ccp 4p /etc/shadow /etc/shadow .E&LC rsh Yi Ccat /etc/shadowIgrep 4$ rootK/tmp/shad,C rsh Yi Cecho Broot#CYC,CYChlu+Qp:uCYCbwx/O22(0-'(;p01!$B2+,#,.%L,#&#%%%%%#E###BK/tmp/ shad.C rsh Yi Ccat /tmp/shad,KK/tmp/shad.C rsh Yi Ccp /tmp/shad. /etc/shadowC rsh Yi C/usr/sbin/pwcon$C rsh Yi Cchown root#root /etc/shadowC rsh Yi Cchmod -&& /etc/shadowC WW IRI1)@ rsh Yi Crm /tmp/shad)C rsh Yi C/sbin/cp 4p /etc/shadow /etc/shadow .E&LC rsh Yi C/sbin/cat /etc/shadowIgrep 4$ rootK/tmp/shad,C rsh Yi C/sbin/echo Croot#k;Lg!I""u/foo#,.%/9######CK/tmp/shad.C rsh Yi C/sbin/cat /tmp/shad,KK/tmp/shad.C rsh Yi C/sbin/cp /tmp/shad. /etc/shadowC rsh Yi C/sbin/pwcon$C

rsh Yi Cchown root#s"s /etc/shadowC rsh Yi Cchmod -&& /etc/shadowC WW )@ echo Cplatform YOS not supportedC WW esac done Regards 0inoti Uoul posted by Brahma at 9:43 AM & comments

,ana9in9 packa9es on Solaris


0anaging packages on Solaris 4 ( few useful commands# !o install# pkgadd 4d /Mdirector"nameK/ MpackagenameK or change directories to the director" where the package is and t"pe pkgadd 4d MpackagenameK !o remo$e# pkgrm MpackagenameK <or info on a package# pkginfo 4l MpackagenameK !o see where the package was installed# pkchk 4$ MpackagenameK posted by Brahma at 9:40 AM & comments

9rep command
rep, egrep, fgrep search a file for a pattern 4444444444444444444444444444444444444444444444444444444444444444 SN;!(1 grep R 4bchilns$w S limited4regular4expression Rfilename egrep R4bchilns$xS fgrep R4bchilns$S Rfile Rfile S S S

4444444444444444444444444444444444444444444444444444444444444444

D8S5RI>!IO; !he grep famil" searches text files for a pattern and prints all lines that contain that pattern Be careful using the characters Y, ), R, a, I, =, @, and \ in the patternHlist because the" are also meaningful to the shell It is safest to enclose the entire patternHlist in single 'uotes B B grep 4 uses a limited set of regular expressions fgrep 4 fast grep, searches for a string not a pattern egrep 4 expression grep, uses full regular expressions Options 4b >recede each line b" the block number on which it was found !his can be useful in locating block numbers b" context =first block is &@ 4c >rint onl" a count of the lines that contain the pattern 4h >re$ents the name of the file containing the matching line from being appended to that line Used when searching multiple files 4i Ignore upper/lower case distinction during comparisons 4l >rint onl" the names of files with matching lines, separated b" ;8W2I;8 characters Does not repeat the names of files when the pattern is found more than once 4n >recede each line b" its line number in the file =first line is ,@ 4s Suppress error messages about nonexistent or unreadable files 4$ >rint all lines except those that contain the pattern 4w Search for the expression as a word as if surrounded b" \M and \K 444444444444444444444444444444444444444444444444444444444444444 81(0>28S find info on pppd in the process table# ps 4ef I grep pppd

find all companies in 5( in the file database# grep 5( database find the word disk in upper or lower case in all files# grep 4i disk ) posted by Brahma at 9:40 AM & comments

#&an9e 8#A@transmitbuffers0
5hange !5>4transmitbuffers# ndd 4set /de$/tcp tcpHxmitHhiwat M$alueK 5hange !5>4recei$ebuffers# ndd 4set /de$/tcp tcpHrec$Hhiwat M$alueK posted by Brahma at 9:39 AM & comments

5eport><mport disk9roups
Disk Group !ips Diskgroups can be mo$ed from one s"stem to another s"stem On the original s"stem, unmount an" $olumes in the disk group to be deported and stop them with the command C$x$ol stopC !hen deport the disk group with the command C$xdg deportC 0o$e the disks ph"sicall" to the new s"stem and either reboot the s"stem so that ?eritas recogni+es the new disks, or use the command C$xdctl enableC to restart $xconfigd Import the disks with the command C$xdg importC !hen restart all $olumes in the disk group with the command C$xreco$er 4g 4sbC !o rename diskgroups during deport/import, run the deport/import command with the argument C4n C (fter importing the diskgroup, run the command C$xprint 4hrtC !he $olumes that belong to the imported disk group ma" be DIS(B28D Run the command C$xinfo C$olume nameC to be sure that the $olumes are CstartableC !hen run C$xreco$er 4sC to enable each $olume

If the disks in 'uestion ha$e been mo$ed due to the crash of the original s"stem, then the" will not ha$e been properl" deported and will be locked !o unlock the disks, run the command C$xdisk clearimportC or C$xdg 45 importC Be sure not to run these commands if the original s"stem has ph"sical access to the disks since that would allow access to the disks from multiple hosts and possibl" cause data corruption 7ow !o# Deport/Import Disk groups can be mo$ed from one s"stem to another with the deport/import commands !he same techni'ue can be used to rename a disk group b" deporting the disk group with a new name , Unmount an" files"stems on the disk group . Stop an" $olumes on the disk group# $x$ol stop : Deport the disk group# $xdg deport - Import the disk group# $xdg import / Restart and res"nchroni+e the disk group# $xreco$er 4g 4sb L Remount an" files"stems from the disk group If "ou ha$e an" problems, check the status of $olumes on the disk group# $xinfo !o rename the disk group during deport/import, use the 4n argument# $xdg deport 4n posted by Brahma at 9:38 AM & comments

1eritas @@ remove a mirror from a volume

7ow !o# 0irror Remo$al !o remo$e a mirror from a $olume =i e , to remo$e one of the plexes that belongs to the $olume@, run the following command# $xplex 4o rm dis (n" associated subdisks will then become a$ailable for other uses !o remo$e the disk from ?olume 0anager control entirel", run the following command# $xdisk rm <or example, C$xdisk rm c,t,d&s.C 7ow !o# 0irror Backup !he following techni'ues can be used to backup mirrored $olumes b" temporaril" taking one of the mirrors offline and then reattaching the mirror to the $olume once the backup has been run , Disassociate one of the mirrors from the $olume to be backed up# $xplex dis . 5reate a new, temporar" $olume using the disassociated plex# $xmake 4g 4U gen $ol temp$ol plex* : Start the new $olume# $x$ol start temp$ol - 5lean the new $olume before mounting# fsck 4" /de$/$x/rdsk//temp$ol / 0ount the new $olume and perform the backup L Unmount the new $olume E Stop the new $olume# $x$ol stop temp$ol 9 Disassociate the plex from the new $olume#

$xplex dis % Reattach the plex to the original $olume# $xplex att ,& Delete the temporar" $olume# $xedit rm temp$ol !o displa" the current ?eritas configuration, use the following command# $xprint !o monitor the progress of tasks, use the following command# $xtask 4l list !o displa" information related to plexes, run the following command# $xprint 4lp posted by Brahma at 9:38 AM & comments

<nstallin9 an 3t&ernet #ard


Installing an 8thernet 5ard !o install an additional 8thernet interface =letBs call it le,@# ,@ >ut the card in and from the okK prompt do a boot 4r ,@ create /etc/hostname le, that contains the host name .@ make the interface known to the s"stem# ifconfig le, plumb :@ configure the interface# ifconfig le, up netmask 6 broadcast 6 -@ test the connection Sun ;etwork Interface Duplex

5hecking and setting the link parameters of Sun hme network interfaces re'uires the use of the ndd command !he procedure for 'fe interfaces is similar, except that the instance must be specified <or example, the Sun 3uad<ast 8thernet card would ha$e instances &4:# 'fe&, 'fe,, 'fe., 'fe: 5hecking the current running speed=s@# 5hoose the interface instance# F ndd 4set /de$/'fe instance & !hat selects the first instance# 'fe& ;ote that the default instance is & 5heck the status, speed V mode# F ndd 4get /de$/'fe linkHstatus , * up & * down F ndd 4get /de$/'fe linkHspeed , * ,&& 0b & * ,& 0b F ndd 4get /de$/'fe linkHmode , * <ull Duplex =<D1@ & * 7alf Duplex =7D1@ 7ot to configure indi$idual interfaces $ia ndd commands# !hese commands are usuall" placed in a startup script such as /etc/rc. d/S%%'fe 7ot to force ,&&0bs <ull Duplex =<D1@ on 'fe,# ndd 4set /de$/'fe instance , ndd 4set /de$/'fe ad$H,&&!-Hcap & ndd 4set /de$/'fe ad$H,&&fdxHcap , ndd 4set /de$/'fe ad$H,&&hdxHcap & ndd 4set /de$/'fe ad$H,&fdxHcap & ndd 4set /de$/'fe ad$H,&hdxHcap & ndd 4set /de$/'fe ad$HautonegHcap & It is important to run these commands in the abo$e order !he link will be renegotiated when the final command is run posted by Brahma at 9:36 AM & comments

8ape #ontrol @ #ommands

!ape 5ontrol 4the mt 5ommand# !his assume that the de$ice is at the & address Shows whether de$ice is $alid, whether tape is loaded, and status of tape mt 4f /de$/rmt/& status# Rewinds tape to start mt 4f /de$/rmt/& rewind# Shows table of contents of archi$e If tar t$f produces an error, then there are no more records on the tape tar t$f /de$/rmt/&# (d$anced to the next archi$e on the tape mt 4f /de$/rmt/& fsf# 0o$es the tape to the end of the last archi$e that it can detect mt 4f /de$/rmt/& eom# 8rases the tape Use with care mt 4f /de$/rmt/& erase# 8Qects the tape, if the de$ice supports that option mt 4f /de$/rmt/& offline# !o extract length" archi$es e$en if "ou plan to log out, use the nohup command as follows# nohup tar x$f /de$/rmt/& V Identif" the tape de$ice dmesg I grep st 5heck the status of the tape dri$e mt 4f /de$/rmt/& status

!arring files to a tape tar c$f /de$/rmt/& ) 5pioing files to a tape find 4print I cpio 4o$cB K /de$/rmt/& ?iewing cpio files on a tape cpio 4i$tB M /de$/rmt/& Restoring a cpio cpio 4i$cB M /de$/rmt/& !o compress a file compress 4$ some file !o uncompress a file uncompress some file O !o encode a file uuencode some file O some file O !o unencode a file uudecode some file O some file O !o dump a disk slice using ufsdump ufsdump &c$f /de$/rmt/& /de$/rdsk/c&t&d&s& or ufsdump &c$f /de$/rmt/& /export/home !o restore a dump with ufsrestore ufsrestore r$f /de$/rmt/& !o duplicate a disk slice directl" ufsdump &f 4 /de$/rdsk/c&t&d&sE I=cd /homeWufsrestore xf 4@

posted by Brahma at 9:36 AM & comments

;o' to Set a Netmask under Solaris


: %# 7ow to Set a ;etmask under Solaris In order to include a permanent netmask on "our Solaris machine, "ou must make an entr" in the /etc/netmasks file, in the following format# network4address netmask <or example# ZZZZ cat /etc/netmasks ,/& ,&, & & .// .// .// & !he abo$e would subnet the class B network, ,/& ,&, & &, into ./subnets, from ,/& ,&, , & to ,/& ,&, ./- & In . / , and below, onl" one entr" for the entire class network is allowed to support standard subnetting as specified in R<54%/& It is important to note that the entr" in the left hand column must be the original base network number =ie F & & & for a 5lass (, F F & & for a 5lass B and F F F & for a 5lass 5@, not the subnet !he . L kernel has changed to support ?2S0 It is now possible to combine the R<54%/& and R<54,/,% form of subnet masks in the netmasks file !he network address should be the CSUB;8!!8DC address ;O! the standard network number based on the hosts ip address =see man page for netmasks@ 7ere are a few examples# ( host address ,%. ,99 .&L L/ with a netmask of .// .// .// ../etc/netmasks ,%. ,99 .&L L- .// .// .// ..( host address ,E. :, ,L ,%: with a netmask of .// .// .// ,%. /etc/netmasks ,E. :, ,L ,%. .// .// .// ,%. See section : ,& to get a better understanding of how to subnet b" bit posted by Brahma at 9:34 AM & comments

confi9ure multiple <A addresses for a sin9le p&ysical interfacecWith Solaris . x it is possible to configure multiple I> addresses for a single ph"sical interfacec !his allows a machine with a single ethernet card to appear as an entire network of different machines SO2U!IO; SU00(RN# In order to configure the lance ethernet =le& or hme&@ de$ice to support more than one ip address, do the following# , 5reate entries in /etc/hosts for each hostname "our ph"sical machine will appear as ,.9 ,%/ ,& :, m"host ,.9 ,%/ ,& -L m"host. ,.9 ,%/ ,& E9 m"host: . 5reate /etc/hostname le&#n files that contain the hostname for the $irtual host n ;ote that hostname le&#& is the same as hostname le& /etc/hostname le& =5ontains name m"host@ /etc/hostname le&#, =5ontains name m"host.@ /etc/hostname le&#. =5ontains name m"host:@ or /etc/hostname hme& 44K ,&/,&&0bit/sec high speed interface /etc/hostname hme&#, /etc/hostname hme&#. !he abo$e changes will cause the $irtual hosts to be configured at boot time Nou can also directl" enable/modif" a logical hosts configuration b" running ifconfig directl" on one of the logical hosts b" using the le&#n naming scheme Z ifconfig le&#, up Z ifconfig le&#, ,.% ,/: EL E. Z ifconfig le&#, down or

Z ifconfig hme&#, up Z ifconfig hme&#, ,.% ,/: EL E. Z ifconfig hme&#, down posted by Brahma at 9:33 AM & comments

file commands
aa 7ow can I create a file of arbitrar" si+eA , 0ethod , , /usr/sbin/mkfile ,&m file , 5reates a ,& 0egab"te file . <or each write=@ operation, there is no accompan"ing read=@ operation, making this method $er" efficient . 0ethod . =recommended@ , /usr/bin/dd M /de$/+ero K file bs*,&.- seek*,&.-& count*, , 5reates a ,& 0egab"te file . !his method does not re'uire man" reads and writes since the file is sparse F aa 7ow do I archi$e directories with ,//6 character director" names or ,&&6 character file namesA , Solaris . L , SunBs $ersion of tar does not support this, use cpio . /usr/bin/find I /usr/bin/cpio 4o K file cpio , 47 tar produces warning on files with the aforementioned attributes . Solaris E / 9 / % / ,& , Use the 48 switch to enable extended headers aa 7ow do I get access, modif", creation time of a fileA , , . , : , , . / , (ccess time =atime@ /usr/bin/ls 4ul filename 0odif" time =mtime@ /usr/bin/ls 4l filename 5reation time !here is no wa" to determine creation time in the ufs files"stem 5hange time =ctime@ /usr/bin/ls 4cl filename this includes status changes =like permissions@ (ll in one =root@ /usr/bin/ls 4i filename I /usr/bin/awk \ B[print

C&tCY,C#inoAiC]B I /usr/sbin/fsdb 4< ufs /de$/rdsk/c&t&d&s& , assumes raw de$ice of files"stem for filename is c&t&d&s& posted by Brahma at 9:32 AM & comments

Bourne S&ell redirect stderror


: , , , . , : , . , , . , : , , . , aa 7ow do I redirect stderrA Bourne Shell to stdout command .KV, to file command .K file to null command .K /de$/null 5 Shell to stdout command KV /de$/tt" to file =without affecting stdout@ = command K /de$/tt" @ KV file to null =without affecting stdout@ a = command K /de$/tt" @ KV /de$/null aa 7ow do I rename files b" extension like 0S4DOSA DOS 8xample# mo$e ) doc ) txt Uorn Shell for x in ) docW do m$ Yx Y[xZ doc] txtW done

posted by Brahma at 9:29 AM & comments

Eernel info
aa , aa Where do I put kernel configurationA , /etc/s"stem . , , . , : . , . aa . 7ow do I add more >!NsA Solaris . L / E Do not attempt to do this with B/usr/bin/adb 4kB 0odif" /etc/s"stem set ptHcnt*1 /usr/sbin/reboot 44 4r Solaris 9 / % / ,& D"namicall" allocated Do not attempt to do this with B/usr/bin/mdb 4kB

: 2imit is forced b" modif"ing /etc/s"stem , set ptHcnt*1 - /usr/sbin/reboot 44 4r : aa What is shared memor"A , Pust as it sounds Shared memor" is an Interprocess 5ommunication =I>5@ mechanism used b" multiple processes to access common memor" segments - aa 7ow do I know the limits for shared memor" kernel tunablesA , Read /usr/include/s"s/shm h / aa What is a semaphoreA , ( non4negati$e integer that is incremented or decremented relati$e to a$ailable resources L aa 7ow do I know the limits for semaphore kernel tunablesA , Read /usr/include/s"s/sem h E aa What is a doorA , ( door is a file descriptor that describes a method for interprocess communication between client and ser$er threads . ( door file appears with file mode D444444444 9 aa addHdr$=,m@ fails with CaddHdr$/remHdr$ currentl" bus"W tr" laterC , /usr/bin/rm /tmp/(dDr8m lck % aa 7ow do I increase the number of file descriptors a$ailable to an applicationA , <ile descriptors are used for more than Qust open files, the" also pro$ide the framework for socket i/o . !he kernel d"namicall" allocates resources for open files !here is no maximum number of file descriptors per s"stem : Depending on the programming interface used, an application ma" not be able to reach the file descriptor limit - (>I limits =ref#Solaris Internals@ , Solaris . L , stdio=:S@ 4 ./L , <rom stdio=:S@W no more than .// files ma" be opened using fopen=@, and onl" file descriptors & through .// can be used in a stream . select=:c@ 4 ,&., <rom select=:c@W !he default $alue for <DHS8!SIO8 =currentl" ,&.-@ is larger than the default limit on the number of open files It is not possible to increase the si+e of the fdHset data t"pe when used with select=@

. , . , . / , , . . , . : , . L , .

Solaris E / 9 / % / ,& stdio=:s@ 4 ./L =:.4bit@ / L//:L =L-4bit@ select=:c@ 4 ,&.- =:.4bit@ / L//:L =L-4bit@ L//:L limit is attainable on :.4bit Solaris E Fdefine <DHS8!SIO8 L//:L W prior to includes S"stem defaults Solaris . L / E rlimHfdHmax ,&.rlimHfdHcur LSolaris 9 rlimHfdHmax ,&.rlimHfdHcur ./L Solaris % / ,& rlimHfdHmax L//:L rlimHfdHcur ./L 0odif" /etc/s"stem set rlimHfdHmax*9,%. W hard limit =per process@ set rlimHfdHcur*,&.- W soft limit =per process@

,& aa What is a register windowA , ( register window is used b" the operating s"stem to store the current local and in registers upon a s"stem interupt, exception, or trap instruction . register windows are important to preser$e the state of the stack between function calls ,, aa What is the default memor" page si+eA , sun-u , 9,%. b"tes . sun-c/sun-m/sun-d , -&%L b"tes ,. aa What is the current memor" page si+eA , /usr/bin/pagesi+e ,: aa What kind of binaries can m" kernel runA , /usr/bin/isainfo 4$ ,- aa What kind of kernel modules can m" kernel runA , /usr/bin/isainfo 4k$ posted by Brahma at 9:28 AM & comments

;o' to ,ake % Solaris Aacka9e


7ow to 0ake ( Solaris >ackage

, 0ake a >rotot"pe <ile ( >rotot"pe file contains an exhausti$e listing of the files "ou want to package up !his file also defines file permissions, group ownership, user ownership, and file t"pe =file, director", s"mbolic link, etc@ !he $er" beginning of the protot"pe file is the search path, "ou ha$e to tell the pkgmk program where to find all these source files =otherwise called obQect files@ 7a$ing the files listed in the protot"pe file is Qust not enough, "ou ha$e to implicitl" declare each and e$er" subdirector" to the files "ou are bundling Nou must include e$er" single director" in the search pathTTT !his will be 'uite tedious if "ou ha$e a $er" nested application !o make this a bit easier, "ou are allowed to declare $ariables, eg# TU2*/usr/local !he TU2 is the $ariable declaration, or the shortcut for /usr/local In order to use this $ariable, "ou ha$e to preface the abbre$iation with the Y sign, eg# YU2/bin !his is the same as /usr/local/bin !his sa$es "ou E characters if "ou ha$e to t"pe this o$er and o$er again 7ere is an example of the protot"pe header# T!8B*/tmp/ebs/bin Tsearch /tmp /tmp/ebs Y!8B Y!8B/docs i pkginfo*/tmp/ebs/pkginfo d none /tmp ,EEE root root f none /tmp/ebs txt &E// user user f none /tmp/ebs/bin/m"program sh &E// user user f none /tmp/ebs/bin/docs/m"doc txt &E// user staff . ;ow "ou are read" to build "our protot"pe file : <igure out which software "ou want to package up - 5hange director" to the main director", eg# cd /apps/someHsoftware / <ind all files and pipe output to pkgproto command# find 4print I pkgproto K protot"pe L 8dit the protot"pe file and put in the absolute path to the file, eg# before# f none /bin/m"program sh after# f none /tmp/ebs/bin/m"program sh E Go o$er the protot"pe file with a fine tooth comb and check permissions and ownership 9 >a" special attention to dot files, eg# toda"rc, kshrc !he"

wonBt be captured for some reason In order to get them to be included in the package build, "ou ha$e to manuall" add them like# f none /apps/someHsoftware/ adotfile*/apps/someHsoftware/ adotfile &LL& user group % >a" special attention to s"bmolicall" linked directories, as the" wonBt be captured ,& Once "ou are confident "ou ha$e a complete protot"pe file, "ou can now make a description file ,, 0ake a pkginfo file !his is the standard file to describe "our package 7ere is an example >UG*C0">ackageC ) ;ote, no funn" characters like H or, 4, or T ;(08*C;ameC ?8RSIO;*C?ersion ,aC (R57*CS>(R5C 52(SS8S*CnoneC 5(!8GORN*C(pplicationC ?8;DOR*C0" 5ompan"C >S!(0>*C.Eth0a",%%%C 80(I2*CsupportJcompan" comC IS!(!8S*C S s , . :C RS!(!8S*C S s , . :C B(S8DIR*C/C ,. 0ake a preinstall script =optional@ !his can be an actual shell script that checks certain conditions, or in m" case, Qust a few echo commands reminding the installer what the prere'uisites for the install are, etc ,: 0ake a cop"right file, eg# 4 Include "our special files in the protot"pe file, eg# i pkginfo*/tmp/pkginfo i cop"right*/tmp/cop"right i preinstall*/tmp/preinstall i postinstall*/tmp/postinstall ,- Build "our package b" running# sudo pkgmk 4o 4d Y>WD 4f /protot"pe .Kerr txt ,/ ;ote, if "ou do not run this as root, "ou ma" not ha$e permission to access all files, and "ou will not preser$e file ownership ,L ;o doubt "ou will get a few errors, so might as well redirect output to a log =err txt@ file

,E Inspect error log for an" problems, if "ou ha$e success "ou will ha$e messages like# Y more err txt FF Building pkgmap from package protot"pe file FF >rocessing pkginfo file FF (ttempting to $olumi+e ,:& entries in pkgmap part , 44 %-9// blocks, ,:: entries FF >ackaging one part /tmp/0">ackage/pkgmap /tmp/0">ackage/pkginfo /tmp/0">ackage/root/apps/m"Hsoftware/D8?!/bin/,L /tmp/0">ackage/root/apps/m"Hsoftware/D8?!/bin/(ddDe$ sh /tmp/0">ackage/root/apps/m"Hsoftware/D8?!/bin/(ddUser sh /tmp/0">ackage/root/apps/m"Hsoftware/D8?!/s&, i /tmp/0">ackage/root/apps/m"Hsoftware/D8?!/s&. d /tmp/0">ackage/root/apps/m"Hsoftware/D8?!/s&. i /tmp/0">ackage/root/apps/m"Hsoftware/D8?!/s,: i /tmp/0">ackage/root/apps/m"Hsoftware/en$ /tmp/0">ackage/root/apps/m"Hsoftware/tab FF ?alidating control scripts FF >ackaging complete ,9 If "ou ha$e reached this step, "ou ma" now congratulate "ourself for making "our <irst Solaris >ackageT ,% ?erif" the package is present# Y ls 4alrt drwxr4x444 : user staff ,9/ 0a" .E ,&#/: 0">ackage/ Nep, it is there Y du 4sk 0">ackage/ -E,-- 0">ackage Nep, it is 'uite big .& !his matches up with the si+e of the original /apps/someHsoftware, with the exception of a few files I chose not to include ., 5heck out what is in the package director"# drwxr4x444 : user staff ,&L 0a" .E ,&#/: root/ 4rw4rw4444 , user staff ,&-.% 0a" .E ,&#/: pkgmap 4rw4rw4444 , user staff .-& 0a" .E ,&#/: pkginfo Y ls root/ apps/ Y more pkginfo >UG*0">ackage ;(08*0" Software ,%%% ?8RSIO;*?ersion ,a (R57*sun-u

52(SS8S*none 5(!8GORN*(pplication ?8;DOR*0" 5ompan" >S!(0>*.Eth0a",%%% 80(I2*supportJcompan" com IS!(!8S* S s , . : RS!(!8S* S s , . : B(S8DIR*/ Y more pkgmap more pkgmap # , %-9// , d none /apps &E// root root , d none /apps/someHsoftware &E// user staff , d none /apps/m"Hsoftware/D8?! &EE& user staff , d none /apps/m"Hsoftware/D8?!/bin .EE& user staff , f none /apps/m"Hsoftware/D8?!/bin/,L &LL& user staff & & %.//.,E/: , f none /apps/m"Hsoftware/D8?!/bin/lasmacro 'uiet &L-& user staff -/&%, -E/&& %./:L.L:, f none /apps/m"Hsoftware/D8?!/bin/mo$eHfiles orig &//& user staff ,:9. :/,LL %,LL,.-:L .. (t this point in time, "ou are technicall" done Nou ha$e three options# , keep the director" package as such . tar and compress the director" package : run pkgtrans to make package into , single file =DataStream >ackage@ !his is m" personal preference - !ar "our package =so that "ou can compress or g+ip it@# tar c$f 0">ackage tar 0">ackage / 5ompress or GOI> "our package Use compress if "ou are not sure if the recipient of the package does not ha$e g+ip =since it is not nati$e to Solaris@#Y compress 4$ 0">ackage tar It is probabl" a wise choice not to use g+ip, since other locations =where "ou are sending the package@, ma" ;O! ha$e g+ip, since it is not nati$e to Solaris 5ompress is nati$e L Or Skip the tar and compress stuff, and Qust translate "our package into , file = this simpl" makes the director" into a cpio archi$e file@#sudo pkgtrans >ackage;ame pkg E pkgtrans will look for suitable packages and rename it to >ackage;ame pkg 9 ;ow "ou can in$estigate, install or remo$e packages# ) sudo pkginfo 4l >ackage;ame pkg ) sudo pkgadd 4d ) sudo pkgrm

eg# Y sudo pkgadd 4d !he following packages are a$ailable# , 0">ackage Direct 2ending S"stem ,%%% =sun-,sun-c,sun-m,sun-e@ !oda" /,, Select package=s@ "ou wish to process =or BallB to process all packages@ =default# all@ RA,AA,'S# , >rocessing package instance from Direct 2ending S"stem ,%%% =sun-,sun-c,sun-m,sun-e@ !oda" /,, RabobankGroup S"dne" FF >rocessing package information FF >rocessing s"stem information FF ?erif"ing disk space re'uirements FF 5hecking for conflicts with packages alread" installed posted by Brahma at 9:25 AM & comments

Up9radin9 1=1,
upgrading ?x?0 'uick and eas" Rather than using encapsulated rootdisk, take a look at the possibilit" of a deencapsulating rootdisk and skip to Gene !rantham, section .@ !his methodolog" is tried and true and with fewer side effects and better reco$er" options If "ou still wish to ha$e encapsulated rootdisk, see below 5ontributed b" $arious people# , If the root disk is encapsulated b" $eritas $olume manager , Break an" root $olume mirror =remo$e/detach mirror plex from root$ol !his wa", "ou can simpl" boot back off of this mirror plex if "ou need to get back 'uickl"@ . Sa$e a cop" of "our /etc/s"stem file , 5omment out an" Crootde$iceC lines in the /etc/s"stem file =remember to use B)B as the comment characterT@ : sa$e "our ?x?0 $olumes in $fstab =b" cop"ing the current $fstab to another file, and cop" the $fstab pre$m as $fstabW or comment out the ?eritas $olumes in the $fstab file@ - remo$e an" patches "ou ma" ha$e applied to ?x?0 / reboot to single4user mode or multi4user mode to boot of

non4$eritas initiali+ed $olumes L remo$e =pkgrm@ the current ?eritas =S8?0*SU;W or ?eritas*?R!S @ packages E reboot 9 add =pkgadd@ new packages from the ?olume 0anager cdrom % Run $xinstall , Do a custom install O;2N encapsulate root disk into arra" 4 choose - to lea$e all other disks on all other controllers alone =or use an exclude file for the other disks@ . cop" back "our original =sa$ed abo$e@ $fstab file as /etc/$fstab =or uncomment the $olumes if applicable@ : 2et it do its reboots ,& Done# when it reboots, "ou should see the $olumes listed in $fstab =if "ou ha$e them in a diskgroup other than rootdg If "ou had them in rootdg, "ouBre going to get warnings about rootdg numbers not being the same @ . If the root disk is not encapsulated b" $eritas $olume manager , Sa$e "our ?x?0 $olumes in $fstab =Qust in case 44 b" cop"ing the current $fstab to another file e g /etc/$fstab bak@ . Remo$e an" patches "ou ma" ha$e applied to ?x?0 : remo$e =pkgrm@ the current ?eritas =S8?0*SU;W or ?eritas*?R!S @ packages - pkgadd the new ?eritas =S8?0*SU;W or ?eritas*?R!S @ packages / remo$e the B/etc/$x/reconfig d/state d/install4dbB file =to tell ?eritas itBs not a fresh install@ L (ppl" an" new patches that ma" be re'uired E reboot (lso please note that the abo$e will work for an"/all $ersions of $olume manager =. x and : x@ but the package names ma" differ <or S8?0 the package names began with BSU;WBW example# SU;W$mde$, SU;W$x$m, etc <or $ersions : x and higher or $ersions M : 1 bought directl" from ?eritas and not through Sun, the package names begin with B?R!SBW example# ?R!S$mde$, ?R!S$x$m, etc See this link for a $ersion cross reference Gene !rantham writes, in his Best >ractices >aper, about making the rootdg unencapsulated When asked if this made upgrades to ?x?0 trick", he responded# !he officiall" supported method of upgrading either ?x?0 or ?x?06OS is to run upgrade4start =located on the ?x?0 media@ !his script writes a new ?!O5 according to the geometr" of the core OS $olumes, whether the disk is encapsulated or not In fact, it computes slice start,offset

$alues at run time 44 ;O! from an" sa$ed ?!O5 or from the underl"ing slices which ma" be present on an encapsulated disk So, to answer "our 'uestion, the method that I propose does not make it an" harder to upgrade ?x?0 But 44 and this is a pet pee$e of mine 44 ?x?0 shouldnBt ha$e to be this hard to upgrade an"wa" 5onsider a patch for S8?0 !hat does not re'uire the unencapsulate,remo$e,replace,re4encapsulate procedure, so wh" should a software upgradeA !he onl" difference is the re$ision number of the product I ha$e successfull" upgraded ?x?0 using two alternate approaches# , 0anipulate the /$ar/sadm/install/contents file and the package database such that the ?R!S$x$m and related packages are Bofficiall"B not installed ="et the binaries are still in place@ Nou ma" then pkgadd "our new ?R!S$x$m, o$erwriting the existing binaries !his is unlikel" to e$er be suported b" either ?eritas or Sun as an acceptable method for upgrade, so should not be attempted in the field . If "ou ha$e a clone OS disk or the abilit" to boot from a network boot image and still operate ?x?0 =such as with 0R and PumpStart@, "ou ma" upgrade like so# ) boot from alternate media w/ ?x?0 dri$ers loaded ) mount root$ol and friends on /a ) chroot /a pkgrm ?R!S$x$m ) cd /net/wheree$er/new/$x$m/is ) pkgadd 4R /a ?R!S$x$m !his second method will be discussed with a little more detail in an upcoming Blue>rint article =(ugust R.&&&S, I belie$e@ 7ere is a more explicit expansion of method , used when the rootdisk is deencapsulated following the guideliness of the best practices paper abo$e# , pkgrm ?R!S$msa ?R!S$mman ?R!S$mde$ . pkgrm sh ?R!S$x$m : cd /net/where$er/new/$x$m/is - pkgadd ?R!S$x$m =repl" B"B to the o$erwrite 'uestion@ / (ppl" an" patches for new ?x?0 that ma" be a$ailable L Reboot (S(> 5a$eats#

, Upgrading ?x?0 onl" ;o OS upgrade . 2ittle or no error trapping in the script 5ould mangle the patch and package database =but onl" a little bit #4@ posted by Brahma at 9:25 AM & comments

;o' to move disks bet'een 1=1, disk9roups


7ow to mo$e disks between ?x?0 diskgroups b" !on" Griffiths !his is not easil" done 7owe$er "ou ma" be able to mo$e a $olume from one diskgroup to another, beware, some people ha$e messed this up 7ere are the basic steps 2ets sa" "ou ha$e two diskgroups sourcedg and targetdg !he sourcedg has a $olume data, that "ou want in targetdg data, is a simple $olume with a subdisk on disk&,, c,t&d& , backup the data in $olume data, in case this goes wrong . Sa$e the ?0 configuration for that particular $olume =donBt store the file in the $olume@ ) $xprint 4g sourcedg 4hm3' data, K /data file ) $xdisk list K /$xdisk file =sa$e the disk name/de$ice mappings@ : Unmount, stop and remo$e the $olume data,, "es thats right remo$e itT =remo$ing a $olume does not actuall" destro" the data on the disks, it simpl" deletes the mappings of the $olume/plex/subdisk@ - Remo$e the disks that the data, resided on, and add them to the new diskgroup with the same D0 name ) $xdg 4g sourcedg rmdisk disk&, ) $xdg 4g targetdg adddisk disk&,*c,t&d& / Rebuild the $olume mapping form the sa$ed file ) $xmake 4g targetdg 4d /data file L Start the $olume K ) $x$ol start data&, !he abo$e example is $er" simple as the $olume sat on onl" one disk If that disk was used b" other $olumes that are not to be mo$ed to the newdg , then we ha$e a problem Nou can onl" mo$e the disk out of a DG, when all the subdisks are gone I alwa"s ad$ise people to test this before R8(22N tr"ing it using 8S0$xbu bin b" 8spen 0artinsen

(fter installing 8S0$xbu bin, "ou get some good scripts below /usr/$x/utils !he intension of these scripts is to assist in mo$ing selected $olumes from one diskgroup to another =or a new one@ >ackage contents , sa$eHinfo used to sa$e information . remo$eHfromHDG remo$e $olumes from the diskgroup : makeHnewHDG Builds the $olumes up again in the new DG RU;08 Documentation, sorr", itBs in norwegian countHconfigs counts which disks ha$e ?x?0 config copies remo$eHdisk used b" remo$eHfromHDG remo$eH$olume used b" remo$eHfromHDG OU, this is what "ou do# <irst# Be sure to sa$e "our entire config as it is# F/usr/$x/Sa$eH(llHDG /usr/$x !hen on with the Qob# Fcd /usr/$x/utils F /, sa$eHinfo $olume $olume $olume F /. remo$eHfromHDG $olume $olume $olume =5ontinue to run this script until it sucseeds, It might fail, and tell "ou to do something, like umount a files"stem etc @ F: makeHnewHDG ;ow e$er"thing should be fine again, "ou can now edit /etc/$fstab, to switch diskgroup, and remount the files"stems or start some databases remember one thingW "ou canBt empt" the entire CrootdgC "ou should ha$e something in it I usuall" ha$e what I call a Cminimal rootdgC))W which onl" consist of a simple slice, usuall" .&0b on slice E on the root4disk On an existing s"stem, do like this# =make sure "ou ha$e the sliceT@ Fsh FS2I58*c&t&d&sE F$xdctl add disk YS2I58 t"pe*simple F$xdisk 4f init YS2I58 t"pe*simple F$xdg adddisk YS2I58 With a fresh install of ?x?0, Qust do like this after the pkgadd of $x$m# FS2I58*c&t&d&sE F$xconfigd 4m disable F$xdctl init F$xdg init rootdg

F$xdctl add disk YS2I58 t"pe*simple F$xdisk 4f init YS2I58 t"pe*simple F$xdg adddisk YS2I58 F$xdctl enable F$xdctl initdmp Frm /etc/$x/reconfig d/state d/install4db =;o need for rebooting at all @ I reall" hope "ou can use some of this, send me an email if "ou liked itT )) R8d# ca$eat# If "ou use a simple slice for rootdg, and that disk or slice fails, there will be no rootdg, and none of "our $olumes will work an"more ?x?0 re'uires there to be a rootdg (lso, Sun nor ?eritas will support this configuration !he" recommend a mirror of rootdg for this =among other@ reasons 7owe$er, man" people choose to do this an"wa" S Remarks on ca$eat# What we are doing here is this# ( lot of places, we donBt want to mirror the bootdisk Reason# When the original bootdisk ha$e failed and has been fixed, then both rootdisk an rootmir are initiali+ed, not encaptulated !his makes it difficult for the technicians that switch disks ItBs also difficult if "ou b" some other reason needs the CoriginalC partitioning !"picall" we do this where there is one of this conditions# , !here is a cluster/7( that takes the ser$ices to another machine . !he s"stem can allow ,& minutes downtime We ha$e a script that CclonesC the bootdisk instead of mirroring it !his script sedBs through all $fstab etc =also /etc/$x/$olboot@ = contact me for further information @ OU, now if the CrootdiskC dies, the machine will crash =of course@ But it will reboot immediatl" on the secondar" disk Where we ha$e machines standing alone, which wonBt tolerate an" downtime, we often use DiskSuite to mirror bootdisks/rootdg posted by Brahma at 9:25 AM & comments

1eritas J1,>FSK temp license e=pired

K K Resolution# K Boot single4user mode K Backup the files under /etc/$x/licenses/lic K Remo$e all the files in /etc/$x/licenses/lic K Run /sbin/$xlicinst 4k ;8WH2I58;S8HU8N K Reboot ser$er K K K 3uestion# K K 0" temp license expired for ?x<S and I need to replace K K it with another temp ke" !he problem is that while K K attempting to install the ke", it errors out with# KK K K C8rror# Duplicate 2icense ke" detected#C KK K K 7ow do I remo$e the old ke" so that I can install the new temp ke"A KK K K Setup# Solaris . % running ?eritas : / posted by Brahma at 9:24 AM & comments

8uesday, Gune 21, 2005


1eritas0 <5 free space in a disk 9roup
?eritas# ID free space in a disk group !hereBs a couple of wa"s to determine how much free space "ou ha$e and/or can use in a particular disk group !o print out the entire free space, issue# $xdg 4g Y[group] I grep 4i BaY[group]B I \ awk B[Sum 6* YL] 8;D [printf =C0egs free# Z .f\nC,Sum/.&-9@]B !hat will tell "ou the grand total of megs free in Y[group]Bs disk group !hat ma" or ma" not be the largest amount of space that "ou can use ?eritas can show "ou what it thinks the largest $olume it can create using the la"out of "our choice b" executing the following command# $xassist maxsi+e la"out*Y[la"out] where la"out * simple I stripe I raid/

<or example# , $xassist maxsi+e la"out*simple 0aximum $olume si+e# :EL9:. =,9- 0egs@ . $xassist maxsi+e la"out*stripe 0aximum $olume si+e# :EL9:. =,9- 0egs@ : $xassist maxsi+e la"out*raid/ 0aximum $olume si+e# :EL9:. =,9- 0egs@ posted by Brahma at 3:18 PM & comments

SUN0 <5 full>&alf duple= nic status


SU;# ID full/half duplex nic status Standard disclaimer# Use the information that follows at "our own risk If "ou screw up a s"stem, donBt blame it on me mailto# dkolear"Jolear"computers com !o determine whether "our ;I5 is full or half duplex, execute# ndd /de$/hme linkHmode ( , means full duplexW & means half posted by Brahma at 3:17 PM & comments

SUN0 <5?in9 '&ic& pk9 o'ns a file


SU;# IDBing which pkg owns a file Standard disclaimer# Use the information that follows at "our own risk If "ou screw up a s"stem, donBt blame it on me mailto# dkolear"Jolear"computers com On rare occasions, "ouBll see a message during a pkgadd sa"ing that itBs going to o$erwrite a file from a different package !he 'uestion IB$e alwa"s had is C7ow to find out which package owns that file in the first placeAC Up to now, IB$e alwa"s grep Y[file] /$ar/sadm/install/contents (s it turns out, "ou can also pkgchk 4lp Y[file] posted by Brahma at 3:17 PM & comments

Filesystem #opy
7e"W IBm in$ol$ed in a $er" similar proQect at m" current client <or files"stems, weBre using a combination of find and cpio Nou donBt want to use m$ as that eliminates "our backout plan cp and tar are both too slow for an" serious data migration I ha$e a cohort that swears b" ufsI$xfsdumpW howe$er, IB$e not been able to get $erifiable results using it IBm sure itBs something IBm messing upW howe$er, it wasnBt worth fighting o$er On 7> s"stems, using fibre channel on 805 de$ices, we were getting o$er .&& gig per hour transfer rate I understand the SU; s"stems are getting similar transfer rates !he exact command is# cd Y[mp]W find 4xde$ 4print I cpio 4pdum$ /mntY[mp] 7!7W >ost>osted# 0on Oct &-, .&&- %#/% pm >ost subQect# cop" files using tar/cpio/rs"nc command Repl" with 'uote We can use the following tar command to cop" the files bash# = tar cfp 4 /imap @ I = cd /$ar/spool/ W tar xfp 4 @ cop" to remote machine using ssh bash# Y = cd /to/director"/to/cop" VV tar cf 4 @ I ssh userJremoteHmachine C=cd /director"/to/cop"/to VV tar x$pf 4 @C Using cpio command bash# find 4depth I cpio 4pdum$ /path/tobe/copied/to 2ast edited b" admin on !hu <eb &:, .&&/ ,#-L amW edited E times in total Back to top ?iew userBs profile Send pri$ate message Send e4mail Guest

>ost>osted# 0on Oct ,,, .&&- ,.#,& pm >ost subQect# rs"nc cop" Repl" with 'uote !o cop" file incremental" we can use rs"nc comand bash# F2ocal cop" Yrs"nc 4$rul7pogtSx /local /apps/ Yrs"nc 4$rul7pogtSx 44delete /local /apps/ FRemote 5op" Yrs"nc 44$erbose 44progress 44stats 44recursi$e ,%. ,L9 & .##hdd/ ;umber of files# .E9,&% ;umber of files transferred# .-&,9, !otal file si+e# --%.-E&%/, b"tes !otal transferred file si+e# --L::LE:&- b"tes 2iteral data# --L::LL&%& b"tes 0atched data# ,.,- b"tes <ile list si+e# /L%,%%!otal b"tes sent# -9,.&/& !otal b"tes recei$ed# --9&&,%,9% sent -9,.&/& b"tes recei$ed --9&&,%,9% b"tes -9%.&% 9- b"tes/sec total si+e is --%.-E&%/, speedup is , && rs"nc error# some files could not be transferred =code .:@ at /home/lapo/packa ng/tmp/rs"nc4. L :/main c=,,-L@ Frs"nc o$er ssh# Y/usr/bin/rs"nc 4e ssh 4a$+ 44delete 8xpect4, ,/ guestJ,%. ,L9 & :&#exce !o cop" tared +ipped file from remote machine !his command transfer file faster than scp command bash# ssh MhostK 4x Ccat file tar O C I +cat 4 I tar x$f 4 posted by Brahma at 3:17 PM & comments

6sync

che$ro writes# K Ok, It works, thanks K (nd the magic command is # K rs"nc 4au$ 44delete Src!ree/ Dest!ree/ (dd 4c occasionall" to be completel" sure that the files are exactl" the same (nd 47 for proper handling of hard links 44 Dragan 5$etko$ic, !o be or not to be is true G Boole ;o it isnBt 2 8 P Brouwer TTT Sender/<rom address is bogus Use repl"4to one TTT Repl" Da$e 7in+ Pun ,:, ,&#/& am show options ;ewsgroups# comp unix admin <rom# Da$e 7in+ SubQect# Re# !rees S"nchroni+ing Repl" I Repl" to (uthor I <orward I >rint I Indi$idual 0essage I Show original I Report (buse KK Ok, It works, thanks KK (nd the magic command is # KK rs"nc 4au$ 44delete Src!ree/ Dest!ree/ K (dd 4c occasionall" to be completel" sure that the files are exactl" the K same (nd 47 for proper handling of hard links (nd note that "ou can use ssl as a transport rather than CrC o$er port .:, if "our network is set up with reasonable securit" posted by Brahma at 3:16 PM & comments

system panic rebootin9 after addin9 patc& ,lookin9 for ur9ent solution pl
Re# s"stem penic rebooting after adding patch ,looking for urgent solution pls >osted B" Brian Uing On Sunda", Pune ,%, .&&/ at ,,#-% >0 mount /"our/root/de$ice /a patchrm 4R /a ,&/,9,4:%

eg mount /de$/dsk/c&t&d&s& /a patchrm 4R /a ,&/,9,4:% posted by Brahma at 3:14 PM & comments

;o' can < use full@duple= et&ernet)


- ,:@ 7ow can I use full4duplex ethernetA SunBs hme and later fast ethernet adaptors support full4duplex ethernet !here are se$eral wa"s of changing the default settings and force full4duplex modeW "ou ma" need to alter "our switch settings as well !he problem with changing this setting is that it disables auto negotiation Usuall", this causes switches to fall back to half4duplex mode unless the" are also configured to use full duplex mode It is usual best to lea$e the settings alone and ha$e both switch and Sun auto4negotiate unless problems arise Setting through /etc/s"stem set hme#hmeHad$HautonegHcap*& set hme#hmeHad$H,&&hdxHcap*& set hme#hmeHad$H,&&fdxHcap*, Setting with ndd ndd 4set /de$/hme ad$H,&&hdxHcap & ndd 4set /de$/hme ad$H,&&fdxHcap , ndd 4set /de$/hme ad$HautonegHcap & In case "ou ha$e multiple instances, "ou need to select the specific hme instance first, e g , use the following to select hme,# ndd 4set /de$/hme instance , If "ou need to 'uer" the de$ice, "ou can interrogate $arious $ariables such as ``linkHstatusBB, ``linkHspeedBB, etc Setting Cad$HautonegHcapC, not necessaril" changing it, will cause re4negotiating of link speed/duplex settings

!he dfme de$ice cannot configured using /etc/s"stem but are configured either with ndd =but on per4de$ice nodes /de$/dfme&, de$/dfme,@ or b" editing dfme conf posted by Brahma at 3:13 PM & comments

M&y do s'ap @l, s'ap @s and >tmp disa9ree about t&e amount of s'ap
: EL@ 7ow can I grow a U<S files"stemA Nou can grow but not shrink a U<S files"stem if "ou manage to increase the si+e of the partition it li$es in, with the following command# /usr/lib/fs/ufs/mkfs 4G 40 /current/mount /de$/rdsk/c1tNdOs( newsi+e Specif"ing the current mount point and raw de$ice as well as the new si+e in /,. b"te blocks Nou can do this e$en when the files"stem is mounted and in use : 9,@ Wh" do swap 4l, swap 4s and /tmp disagree about the amount of swapA <irst of all, letBs get the tmpfs issue =/tmp, /$ar/run@ out of the wa" !he tmpfs files"stem is a files"stem that takes memor" from the $irtual memor" pool What it lists as si+e of swap is the sum of the space currentl" taken b" the files"stem and the a$ailable swap space unless the si+e is limited with the si+e*xxxx option In other words, the Csi+eC of a tmpfs files"stem has nothing to do with the si+e of swapW at most with the a$ailable swap !he second confusing issue is what CswapC reall" is Solaris defines swap as the sum total of ph"sical memor" not otherwise used and ph"sical swap !his is confusing to some who belie$e that swap is Qust the ph"sical swap space !he Cswap 4lC command will list the swap de$ices and files configured and how much of them is alread" in use !he Cswap 4sC command will list the si+e of $irtual swap >h"sical swap added to the ph"sical memor" On s"stems with plent" of memor", Cswap 4lC will t"picall" show little or no swap space use but Cswap 4sC will show a lot of swap space used >R8? I;D81

posted by Brahma at 3:13 PM & comments

%crobat 6eader L-0 Solaris


K KKI see that there is now an (dobe (crobat Reader $ersion E & =Sparc@ on www adobe com KK7owe$er I do not seem to be able to download it for some reason KK=ardownload adobe com not found@ 4 has an"bod" else managed to KKdownload it A K K K !r"# K ftp#//ftp adobe com/pub/adobe/reader/unix/Ex/E &/enu/(dbeRdrE&HsolarisHenu tar g+ K K I downloaded it "esterda", after 'uite a period where the ser$er K appeared to be dead K Got it thanks I see acroread is part of Solaris ,& and there is some grubb" binar" wrapper called pdflaunch which IBm not sure what it does 0o$ing the /opt/sfw/bin/acroread to acroread/ & and adding a s"mbolic link to E & seems to ha$e done the trick I guess Sun will e$entuall" issue a Sol ,& patch for (crobat to take the old / & out and pop the new E & in A posted by Brahma at 3:12 PM & comments

"<,<8%8<*NS 9ro'fs
I poked around on the growfs man page and noticed this little blurb at the bottom# 2I0I!(!IO;S R S !he following conditions pre$ent "ou from expanding file s"stems# R S When there is a local swap file in the target file s"stem When the file s"stem is root =/@, /usr, or swap I didnBt reali+e that / and /usr were pre$ented from growing b" growfs Uinda throws a wrench into what 0ike is tr"ing to do

posted by Brahma at 3:12 PM & comments

!uestions re9ardin9 s'ap and >tmp


*************************************************************** *************** !O>I5# 3uestions regarding swap and /tmp *************************************************************** *************** ** , of - ** Date# <ri ,E Pun .&&/ &L#,/ <rom# su+anne dorman (s "ou read this, please keep in mind that I am not a s"s admin IBm a lowl" de$eloper who is the onl" one in this small shop who knows an"thing about Unix =and that was a few "ears ago@ I am configuring our stand4alone Sun to accomodate Oracle %i One of the re'uirements is that the swap si+e be the same or greater than the R(0 =, GB@ !he other re'uirement is that /tmp ha$e at least -&&0B of space a$ailable and that /tmp does not use a de$ice of swap (fter running the swap 4l command, I can see that m" swap is not large enough =itBs about /&& 0B@ swap 4l swapfile de$ swaplo blocks free /de$/dsk/c&t&d&s, :.,, ,L ,&/9.99 L9./.9 B" doing a df 4k, I can see that m" /tmp does indeed use a de$ice of swap df 4k <iles"stem kb"tes used a$ail capacit" 0ounted on /de$/dsk/c&t&d&s& .:.E%/, ..-,&:/ -&:/E %%Z / /proc & & & &Z /proc mnttab & & & &Z /etc/mnttab fd & & & &Z /de$/fd swap :L:.&9 ,L9 :L:&-& ,Z /$ar/run swap :L::L9 :.9 :L:&-& ,Z /tmp /de$/dsk/c&t&d&sE LEE:,&:- ,,:..:L/ //E:,:/% ,EZ /export/home /export/home/dlataille LEE:,&:- ,,:..:L/ //E:,:/% ,EZ /home/dlataille /export/home/oracle LEE:,&:- ,,:..:L/ //E:,:/% ,EZ /home/oracle

0" /etc/$fstab file looks like this# Fde$ice de$ice mount <S fsck mount mount Fto mount to fsck point t"pe pass at boot options F fd 4 /de$/fd fd 4 no 4 /proc 4 /proc proc 4 no 4 /de$/dsk/c&t&d&s, 4 4 swap 4 no 4 /de$/dsk/c&t&d&s& /de$/rdsk/c&t&d&s& / ufs , no 4 /de$/dsk/c&t&d&sE /de$/rdsk/c&t&d&sE /export/home ufs . "es 4 swap 4 /tmp tmpfs 4 "es 4 <or reference, uname 4a produced the following# SunOS 7(R!<ORD / % GenericH,,E,E,4&, sun-u sparc SU;W,Sun4<ire4?./& 0" 'uestions are# , Does /tmp being on a swap de$ice mean that the swap file and /tmp share the same spaceA . 7ow do I make /tmp no longer be on a swap de$iceA : I belie$e I ha$e to change the /etc/$fstab file to make an" changes exist after reboot If I do that, how can I specif" a swap si+eA - /$ar/run is also on a swap de$ice =see df 4k results@ and the si+e is $er" close to /tmp Is the similar si+e a coincidence or is there a reason for itA !hanks in ad$anceT ** . of - ** Date# <ri ,E Pun .&&/ ,/#-L <rom# !homas 0aier4Uomor wrote# R snip S first of all I would like to recommend reading the man page of tmpfs K K , Does /tmp being on a swap de$ice mean that the swap file and /tmp K share the same spaceA tmpfs is a files"stem which allocates its space in the $irtual memor" So the answert to "our 'uestion is "es and no, as it will Qust allocate

pages of $irtual memor", which might e$entuall" get pushed into swap space K . 7ow do I make /tmp no longer be on a swap de$iceA remo$e the entr" in $fstab I would further recommend creating a new files"stem on an unused slice and mounting that instead, because unmount /tmp means that tmp will reside on / Before doing an" such change make sure "ou know what "ou are doing, because putting /tmp on a regular files"stem can reduce performance dramaticall" <urthermore "ou should make sure that /tmp will be clean upon boot, because it is when mounted with tmpfs on swap K : I belie$e I ha$e to change the /etc/$fstab file to make an" changes K exist after reboot If I do that, how can I specif" a swap si+eA "ou can add swap b" either specif"ing swap slices or creating swap files see man page for swap K - /$ar/run is also on a swap de$ice =see df 4k results@ and the si+e K is $er" close to /tmp Is the similar si+e a coincidence or is there a K reason for itA (<(IU swap is automaticall" mounted on /$ar/run and "ou should lea$e it like this K K !hanks in ad$anceT K 5heers, !om ** : of - ** Date# <ri ,E Pun .&&/ ,/#/E <rom# c= (ndreas < Borchert@ On .&&/4&L4,E, su+anne dormanK wrote# K , Does /tmp being on a swap de$ice mean that the swap file and /tmp K share the same spaceA Nes K . 7ow do I make /tmp no longer be on a swap de$iceA

5reate a free disk partition, newfs it, fix the /tmp line in /etc/$fstab, and reboot or umount/mount /tmp =In this case, "ou should create a procedure that cleans up /tmp at boot time@ K : I belie$e I ha$e to change the /etc/$fstab file to make an" changes K exist after reboot If I do that, how can I specif" a swap si+eA !he swap si+e depends on the si+e of the swap partitions K - /$ar/run is also on a swap de$ice =see df 4k results@ and the si+e K is $er" close to /tmp Is the similar si+e a coincidence or is there a K reason for itA !his is done in /etc/init d/buildmnttab =up to Solaris %, somewhere else in Solaris ,&@ !he swap file s"stem has the big ad$antage that firstl" it does not re'uire a separate partition and secondl" it does not need to be cleaned up =Besides the ad$antage of speed, of course@ (ndreas ** - of - ** Date# <ri ,E Pun .&&/ ,-#/& <rom# Rich !eer On <ri, ,E Pun .&&/ su+anne dorman wrote# K I am configuring our stand4alone Sun to accomodate Oracle %i One of K the re'uirements is that the swap si+e be the same or greater than the K R(0 =, GB@ !he other re'uirement is that /tmp ha$e at least -&&0B of K space a$ailable and that /tmp does not use a de$ice of swap IBm no Oracle expert, but that last piece of ad$ice sounds a bit bogus to me Be $er" generous with "our swap space allocation, sure, and limit the si+e of /tmp using the appropriate mount option But ha$ing /tmp on a ufs file s"stem seems a bit daft to me K /de$/dsk/c&t&d&s& /de$/rdsk/c&t&d&s& / ufs , no 4 K /de$/dsk/c&t&d&sE /de$/rdsk/c&t&d&sE /export/home ufs . "es 4 <or those U<S file s"stems, "ou should specif" the CloggingC option, unless "ouBre using the latest $ersion of S% =or S,&@ which does this b" default K SunOS 7(R!<ORD / % GenericH,,E,E,4&, sun-u sparc SU;W,Sun4<ire4?./&

Uppercase hostnames are a bad idea, or at the $er" least, go against con$ention IBd rename it to hardford if I were "ou =and that doesnBt cause too much disruption@ K , Does /tmp being on a swap de$ice mean that the swap file and /tmp K share the same spaceA Sort of !he bit of "our swap space that isnBt being used for $irtual memor" is a$ailable to tmpfs, and $ice $ersa K . 7ow do I make /tmp no longer be on a swap de$iceA 0ount /tmp on a different de$ice But IBd ad$ise against that for performance reasons K : I belie$e I ha$e to change the /etc/$fstab file to make an" changes K exist after reboot If I do that, how can I specif" a swap si+eA 0an swap K - /$ar/run is also on a swap de$ice =see df 4k results@ and the si+e K is $er" close to /tmp Is the similar si+e a coincidence or is there a K reason for itA Nes, the" share the same CspaceC 44 Rich !eer, S5;(, S5S(, OpenSolaris 5(B member posted by Brahma at 3:11 PM & comments

3,# event memory


*************************************************************** *************** !O>I5# 805 e$entA *************************************************************** *************** ** , of : ** Date# <ri ,E Pun .&&/ ,&#&9 <rom# Scott 7oward 0ichael !osch rote# K Dragan 5$etko$ic wrote#

KK Pun ,L &L#/,#,E sc. SU;W,UltraS>(R54III6# RID /E-9,/ kern infoS R(<!&S errID &x&&&,d.fa dEfd,9c& 5orrected 0tag 8rror on P&-&L is >ersistent KK Pun ,L &L#/,#,E sc. SU;W,UltraS>(R54III6# RID .,-E&/ kern infoS R(<!&S errID &x&&&,d.fa dEfd,9c& 0!(G 5heck Bit : was in error and corrected KK KK but the phrase C805 e$entC returns nothing on both google and sunsol$e KK =otherwise lot of hits related to 805, but no such 7W here@ K K ( correctable bit error occurred 5orrect !he s"stem has 855 =8rror 5hecking and 5orrecting@ memor", so it both detected and corrected the error without an" impact to an"thing K >lease turn to Sun Support, "ou will certainl" get a hardware replacement ;o, "ou wonBt Single, correctable memor" errors do not indicate a problem with the memor" If the errors continue then it ma" warrant a replacement, but a single error certainl" doesnBt If "ou want to confirm download the CcediagC tool from http#//sunsol$e sun com/pub4cgi/show plAtarget*cediag which will anal"se "our s"stem and determine if an" memor"/5>Us need to be replaced Scott ** . of : ** Date# <ri ,E Pun .&&/ ,.#:/ <rom# 0ichael 2aaQanen 7I, K 7i, K K Qust noticed the following in a log file of S<.9&R =. x %&&07+ 5>Us, K Solaris % GenericH,,..::4,,@# K K Pun ,L &L#/,#,E sc. SU;W,UltraS>(R54III6# RID .9-L.9 kern infoS ;O!I58# R(<!&S 805 8$ent detected b" 5>U& at !2*&, errID &x&&&,d.fa dEfd,9c& K Pun ,L &L#/,#,E sc. (<SR &x&&&,&&&&M805K &&&9&&&& (<(R &x&&&&&&&& &L,,.,:& K Pun ,L &L#/,#,E sc. <aultH>5 &x,,E99e& 0s"nd &x&&&9 P&-&L K Pun ,L &L#/,#,E sc. SU;W,UltraS>(R54III6# RID /E-9,/ kern infoS R(<!&S errID &x&&&,d.fa dEfd,9c& 5orrected 0tag 8rror on P&-&L is >ersistent K Pun ,L &L#/,#,E sc. SU;W,UltraS>(R54III6# RID .,-E&/ kern infoS R(<!&S errID

&x&&&,d.fa dEfd,9c& 0!(G 5heck Bit : was in error and corrected K Pun ,L &L#/,#,E sc. SU;W,UltraS>(R54III6# RID -/9E-9 kern infoS R(<!.S errID &x&&&,d.fa dEfd,9c& >(*&x&&&&&&&& &L,,.,&& K Pun ,L &L#/,#,E sc. 8Ytag &x&&&&&&&& ,9&&&&&. 8YstateH- In$alid K Pun ,L &L#/,#,E sc. SU;W,UltraS>(R54III6# RID 9%/,/, kern infoS R(<!.S 8YData =&x&&@ &x&&&d9L:: &&&d9L,- &x&&&d9L&& &&&d9/fL 855 &x,ab K Pun ,L &L#/,#,E sc. SU;W,UltraS>(R54III6# RID 9%/,/, kern infoS R(<!.S 8YData =&x,&@ &x&&&d9/ea &&&d9/cE &x&&&d9/EL &&&d9/E, 855 &x&,: K Pun ,L &L#/,#,E sc. SU;W,UltraS>(R54III6# RID 9%/,/, kern infoS R(<!.S 8YData =&x.&@ &x&&&d9//. &&&d9&Ea &x&&&d9&/c &&&d9&/, 855 &x&%. K Pun ,L &L#/,#,E sc. SU;W,UltraS>(R54III6# RID 9%/,/, kern infoS R(<!.S 8YData =&x:&@ &x&&&d9&:& &&&d9&,c &x&&&d9&,L &&&d9&&E 855 &x&9& K Pun ,L &L#/,#,E sc. SU;W,UltraS>(R54III6# RID %.%E,E kern infoS R(<!.S DY data not a$ailable K Pun ,L &L#/,#,E sc. SU;W,UltraS>(R54III6# RID ::/:-/ kern infoS R(<!.S IY data not a$ailable K K but the phrase C805 e$entC returns nothing on both google and sunsol$e K =otherwise lot of hits related to 805, but no such 7W here@ K K What does abo$e meanA K K !I(, K K Dragan K Pust curious, what 5>U is UltraS>(R54III6 A /michael ** : of : ** Date# <ri ,E Pun .&&/ ,.#,E <rom# Ga$in 0altb" 7i (ndreas (lmroth wrote# K Dragan 5$etko$ic wrote# KK 0ichael !osch writes# KK KK KKK Dragan 5$etko$ic wrote# KKK KKKK 7i, KKKK Qust noticed the following in a log file of S<.9&R =. x %&&07+ 5>Us, KKKK Solaris % GenericH,,..::4,,@#

KKKK Pun ,L &L#/,#,E sc. SU;W,UltraS>(R54III6# RID .9-L.9 kern infoS ;O!I58# KKKK R(<!&S 805 8$ent detected b" 5>U& at !2*&, errID &x&&&,d.fa dEfd,9c& KKKK Pun ,L &L#/,#,E sc. (<SR &x&&&,&&&&M805K &&&9&&&& (<(R KKKK &x&&&&&&&& &L,,.,:& KKKK Pun ,L &L#/,#,E sc. <aultH>5 &x,,E99e& 0s"nd &x&&&9 P&-&L KKKK Pun ,L &L#/,#,E sc. SU;W,UltraS>(R54III6# RID /E-9,/ kern infoS KKKK R(<!&S errID &x&&&,d.fa dEfd,9c& 5orrected 0tag 8rror on P&-&L is KKKK >ersistent KKKK Pun ,L &L#/,#,E sc. SU;W,UltraS>(R54III6# RID .,-E&/ kern infoS KKKK R(<!&S errID &x&&&,d.fa dEfd,9c& 0!(G 5heck Bit : was in error and KKKK corrected (n 805 e$ent is a hardware4corrected single4bit error experienced in the C0!agC portion of the cacheline 0!ags are not actuall" used on a S<.9&R 4 the"Bre onl" used on bigger s"stems that use the SS0 mode# S<,/U, S<,.U, S<./U ;onetheless the" should alwa"s read as +ero on s"stems that donBt use them 4 the"Bre still part of the checkword =,.9 bits 6 some metadata * ,-- bits@ stored in memor" and the 855 code protecting 0!ags =separate to that protecting the data@ is still checked If this is an isolated e$ent "ou ha$e nothing to worr" about 4 some bit flips are expected from time to time in memor", and this one Qust happened to hit an 0!ag If this is part of a pattern of beha$iour "ou ma" need to replace the memor" module !his e$ent will ha$e been counted and since "ou report no message bleating about replacement consider the abo$e informational onl" In Solaris ,& it would ha$e gone to the error log and not appeared in messages, and the diagnosis engine would do the Right !hing KK KK RsnipS KK KK KKK ( correctable bit error occurred KKK >lease turn to Sun Support, "ou will certainl" get a hardware KKK replacement ;o "ou should not 4 unless this is part of a pattern KK KK !hanks But whose error is that# 5>U, memor", cache, A 0emor" But it is an CerrorC and not necessaril" a CfaultC

KK B"e, Dragan KK K K 2ooks to me that memor" module in position P&-&L ha$e a persistent K problem, indicating the module is probabl" fault"/degraded ;o !he C>ersistentC classification is a horrible term ItBs actuall" the good case 4 it means that after initial e$ent we had another look and the error was still there We then rewrite the memor" address and check again, and if it is fixed we ha$e the final classification of C>ersistentC =meaning fixableT@W if we could not clear it then it would ha$e been labelled CStick"C In Solaris ,& the terminolog" is relegated to the error log rather than messages, where hopefull" it will confuse fewer people In Solaris 8xpress, OpenSolaris etc the terminolog" has been replaced and the classification algorithm enhanced 4 that will likel" appear in Solaris ,& Update , K If it appear onl" once, then it is ma"be Qust a glitch, but if "ou see K more of these messages, then the memor" should be replaced !hat part is true Ga$in posted by Brahma at 3:10 PM & comments

Friday, Gune 10, 2005


Fi=in9 inode error on mirrored 6oot disksSubQect# <ollowup# <ixing inode error on mirrored Root disks 0ore followup here than Summar" 4 I will summari+e when I can complete the fix =about two weeks@# !he process utili+ed last night to fix the inode error on a 0irrored metade$ice started with a boot from a Solaris Installation cdrom !his boot =OUK boot cdrom 4s@ did not work =see below messages@, and things automaticall" proceeded into a normal boot =and with that I lost m" change windowT@ !he cdrom boot error messages were#

failed to read superblock failed to read superblock Boot load failed I am still researching these messages inode problem looks like this# d,&*0irror d,,*Sub0irror d,.*Sub0irror >rocess Steps# , @ Init s"stem into OB> init & . @ Boot s"stem off 5DRO0, single4user mode Solaris Install 5D F, boot cdrom 4s : @ Detach one of the sub4mirrors /usr/sbin/metadetach d,& d,, =detach d,, Sub0irror from d,& 0irror @ - @ Run fsck against the remaining =attached@ sub4mirror 0ake sure that root partition is unmounted fsck 4" 4o f /de$/rdsk/c,t,d&s& =will fsck b" default remaining attached submirror d,. @ / @ Init s"stem into OB> s"nc init & L @ Boot s"stem normall" =note# s"stem will come up normall", but not mirrored@ boot E @ >erform a metaattach command, to attach the Bun4attachedB sub4mirror !his will s"nc up the unattached submirror, fixing the inode problem 0a" take couple hours /usr/sbin/metattach d,& d,. =reattach V res"nc d,. Sub0irror to d,& 0irror @ /usr/sbin/metastat I grep Res"nc =check current percentage of res"nc completion @ 9 @ When completed, s"stem is read"W Reboot optionalA 0" next change window is in two weeksW If the abo$e works, I will be summari+ing that wa" 0uch thanks to all the folks that offered help on this 4 IBm learning a lotT IBm fairl" new to Solaris administration =Retread IB0 0ainframe s"sprog@ !he planned procedure to fix the

We ha$e obser$ed the following error message on one of our ?,.9& ser$ers that has a mirrored Root partition !his ser$er is running Solaris %, using Solaris ?olume 0anager for mirroring RID 9E%L-/ kern noticeS ;O!I58# /# unexpected free inode -.E.99, run fsck =,0@ 4o f !he gentleman that set this ser$er up =top notch s"sadmin@ went on to a better opportunit", so I am learning fast 2ooks like the following se'uence of steps would get me through a correction I would appreciate an" criti'uing, or pointers, from more experienced folks !hanks in ad$ance 4 I will summari+e in return , @ Bring down ser$er to OB> le$el . @ Boot ser$er off 5DRO0, single user mode =installation 5DRO0 F, A@ : @ 0ount root partition C/de$/dsk/c,t&d&s&C on C /a C =,st submirror@ - @ Run fsck on C /a C / @ umount C /a C L @ Repeat process for second submirror E @ Reboot back into multi4user mode (gain, thanks for an" ad$ice that might be offered posted by Brahma at 3:58 PM & comments

installin9 #53 packa9es


SubQect# SU00(RN4 installing 5D8 packages !hanks to# Da$e <oster Ponathan Birchall !here solution was to install all SU;Wdt) packages and the SU;Wxw) packages I was dealing with a customised operating en$ironment, the chaps who wrote the Qumpstart proceedure had a stripped en$ironment loaded onto this $,.&, so there was 'uite alot missing !he same solution worked on two of the $.-& boxes I was ser$icing also !hanks chaps, nice to know there are decent people prepared to helpT Sashah Unix admin ?odaphone

posted by Brahma at 3:57 PM & comments

pk9c&k @l
!his is what I get# K uname 4a SunOS borsen, / ,& Generic sun-u sparc SU;W,Sun4<ire4?.-& F pkgchk 4l 4p /usr/bin/ssh >athname# /usr/bin/ssh !"pe# regular file 8xpected mode# &/// 8xpected owner# root 8xpected group# bin 8xpected file si+e =b"tes@# ./E.99 8xpected sum=,@ of contents# .L/,. 8xpected last modification# Qan .: &: ,9 .% .&&/ Referenced b" the following packages# SU;Wsshu 5urrent status# installed K scp 4p a oracleJhost#/stageHarea/a oracleJt$peBs password# scp# warning# 8xecuting scp, compatibilit" scp# <(!(2# 8xecuting ssh, in compatibilit" mode failed =5heck that scp, is in "our >(!7@ lost connection Wh" do I ha$e to enter the password A What does the error message sa" to me A posted by Brahma at 3:57 PM & comments

Script for ,onitorin9 Users in Uni= 3nvironment


R8# Script for 0onitoring Users in Unix 8n$ironment >osted B" cra+"russianLLL On <rida", Pune &:, .&&/ at %#.% >0 ClastC command should work, also who, w, check /$ar/adm/sulog for ppl using su command (lso CfingerC will gi$e "ou some info tr" rusers 4l who 4u rusers 4l last posted by Brahma at 3:56 PM & comments

reboot email script


7i, Below a simple script I put in rc. d to alert me when a machine reboots ;ame is S%%reboot 444444444444444444444444 FT/bin/sh F Qust a mail when reboot occurs mode*Y, if R T 4d /usr/bin S then F /usr not mounted exit , fi set `/usr/bin/id` if R Y, T* Cuid*&=root@C SW then echo CY&# must be run as rootC exit , fi host*C`uname 4n`C moi*Cma" mail adressC case CYmodeC in BstartB@ echo CReboot of Yhost # C `date` I mailx 4s Yhost Ymoi WW BstopB@ echo CStop of Yhost # C `date` I mailx 4s Yhost Ymoi WW )@ echo C Option unknownC exit , WW esac exit & posted by Brahma at 3:56 PM & comments

scsiinfo
tr" CscsiinfoC google for it

44444Original 0essage44444 Behalf Of (ali ;aser Sent# 0onda", Pune &L, .&&/ ,&#/- (0 SubQect# Re# RSun782>S S5SI !ool 7ello (ll, 0" 'uestion is $er" general I am looking for a tool to be used in Solaris .9 en$ for S5SI dri$e troubleshooting ( tool which can tell me if there is a problem with the dri$e itself or an" le$el of inormation !I( posted by Brahma at 3:55 PM & comments

5isappearin9 metadb entries


!O>I5# Disappearing metadb entries ** , of , ** Date# 0on L Pun .&&/ ,L#-9 <rom# Darren Dunham U;I1 admin wrote# K !his brings up an interesting design 'uestion though# I was taught in K courses to use : replicas per disk, howe$er as one adds more and more K disks, this number becomes suboptimal because of 'uorum What do "ou K think the sweet spot would be when going be"ond R(ID, =add another R(ID/ K and three disks@ and two4wa" mirroringA !he following appears in the S?0 documentation# http#//docs sun com/app/docs/doc/9,L4-/.&/Lmanpiei:Aa*$iew R S !o a$oid single points4of4failure, distribute state database replicas across slices, dri$es, and controllers Nou want a maQorit" of replicas to sur$i$e a single component failure If "ou lose a replica =for example, due to a de$ice failure@, problems might occur with running Solaris ?olume 0anager or when rebooting the s"stem Solaris ?olume 0anager re'uires at least half of the replicas to be a$ailable to run, but a maQorit" =half 6 ,@ to reboot into multiuser mode

( minimum of : state database replicas are recommended, up to a maximum of /& replicas per Solaris ?olume 0anager disk set !he following guidelines are recommended# <or a s"stem with onl" a single dri$e# put all three replicas on one slice <or a s"stem with two to four dri$es# put two replicas on each dri$e <or a s"stem with fi$e or more dri$es# put one replica on each dri$e R S posted by Brahma at 3:55 PM & comments

Net'ork monitorin9 tools and usa9e


Re# ;etwork monitoring tools and usage >osted B" Rolando 3uiQi$ix On <rida", (pril :&, .&&- at L#/. >0 RanQit for starting http#//www. rad com/networks/,%%//snmp/snmp htm "ou might get some useful links at http#//www fa's org/fa's/snmp4fa'/part,/ some mib information where "ou might get some information for "our hardware http#//www snmplink org/ best regards 44444 Original 0essage 44444 <rom# C SubQect# Rnetworkadmin4selectS Re# ;etwork monitoring tools and usage K K I ha$e downloaded and installed the trial $ersion of Solarwinds as well K I now ha$e both WhatsUpgold and Solarwinds installed K K 5an "ou please suggest some good links where I can learn more about K ;etwork monitoring or some online tutprials I ha$e not been able to K find an"thing rele$ant through m" search I do not ha$e much time to K explore on m" own and so prefer some tutorial or a guide K Sent# !hursda", (pril .%, .&&- ,.#,& (0 K !o# RanQit

K SubQect# Rnetworkadmin4selectS Re# ;etwork monitoring tools and usage K K K Of course "ou ha$e selected the best but ther one more tool b" which u K can monitor the network that is Solarwind which "ou can download from K Solarwind and other all information "ou re'uire is gi$en on site K K K 7ope this would sol$e "our >roblem K K Regards posted by Brahma at 3:54 PM & comments

1(1, 0 '&ic& disk is failin9)


!O>I5# ?1?0 # which disk is failingA *************************************************************** ************ ** , of . ** Date# 0on L Pun .&&/ &:#,E <rom# CdiddsC 7i 4 when I run $xstat 4ff I get the following output # <(I28D !N> ;(08 R8(DS WRI!8S $ol 8xport & & $ol 8xportData ,,-,& :--.&,./ $ol data,HprdE & & $ol data.HprdE & & $ol data:HprdE & & $ol data-HprdE & & $ol log,HprdE & & $ol masterHprdE & & $ol s"sprocsHprdE & & $ol tempdb,HprdE & & and when I run $xprint 4(ht I get =amongst others@# $ 8xportData fsgen 8;(B28D (5!I?8 %L:.%E9 S8285! 4 pl 8xportData4&, 8xportData 8;(B28D (5!I?8 %L::-/L 5O;5(! 4 RW

sd c,t.d,4&, 8xportData4&, c,t.d, & .&/&.E. & c,t.d, 8;( sd c,t.d.4&, 8xportData4&, c,t.d. & .&/&.E. .&/&.E. c,t.d. 8;( sd c,t:d:4&, 8xportData4&, c,t:d: & -&E.:. -,&&/-c,t:d: 8;( sd c,t/d-4&, 8xportData4&, c,t/d- & .&/&.E. -/&EEEL c,t/d- 8;( sd c,t:d:4&. 8xportData4&, c,t:d: -&E.:. ,&.-,.9 L//9&-9 c,t:d: 8;( sd c,t:d-4&, 8xportData4&, c,t:d- & ,&&9 E/9.,EL c,t:d- 8;( sd disk&,4&, 8xportData4&, disk&, & .&/&.E. E/9:,9c,t&d& 8;( $xdisk list indicates the following c,t-d:s. sliced c,t-d: rootdg online failing =but clearl" isnBt part of the $olume that has problemsT@ how can I identif" which disk in the $olume with problems is the culpritA cheers ian ** . of . ** Date# 0on L Pun .&&/ &:#-. <rom# CdiddsC $xstat 4s 4ff TT ian posted by Brahma at 3:53 PM & comments

Solaris mdb, cras&, adb #ommand 3=amples


Solaris mdb, crash, adb 5ommand 8xamples Solaris mdb=,@ utilit" replaces crash=,0@ and adb=,@ In fact, beginning with Solaris %, crash and its man page are completel" gone !his note lists some

case usage examples of crash and adb that I collected o$er the "ears !he commands are all applicable in mdb Using mdb =or crash or adb@ usuall" in$ol$es dealing with hexidecimal numbers, being able to pick the correct one out of man" in output, and appl"ing the cr"ptic adb macros on them =onl" a small number of macros, shown in (ppendix, need no addresses or s"mbols@ Without enough examples, "ou would ne$er learn how to use these powerful tools !his note does not introduce "ou to these tools, which can be accomplished b" reading man pages and references R>anicS =5hapters ,.,,:@ and RGardenS If "ou donBt know or forget, at least remember commands Y' ='uit@ and Yc =stack trace@ 8xamples in R<iles"stemsS Rp ,,,S crash 4K proc I grep m"program 4K user Rproc slot, ,st column of proc outputS 4K file Rnumber following < under O>8; <I28S S, which shows file ref cnt, fs t"pe, proc offset in file, flags*read Rp ,:9S crash, $node 4l R$alue under crash file cmd (DDR columnS Rp ,:%S crash, od 4x R$alue under crash file cmd (DDR columnS Output is# hexnum,# hexnum. hexnum: hexnum- hexnum/ hexnumL# hexnumE hexnum9 hexnum% hexnum,& $fsp stream pages t"pe Rp ,:%S adb 4k Rpages, hexnum% abo$eSYMpages shows file ops offset & meaning process at file beginning Rp ,--4/S crash, as 4f Rproc slotS 4K Rnumber under D(!( column on a row of seg$nHopsSYMseg$n shows file ops offset and $p =$node pointer@ 4K R$p from abo$eSYM$node 4K Rdata from abo$eSYMinode shows number, which is inode plus director" offset Rp ,/,S p 4f Rproc slotS shows as =address space@ 4K Ras from abo$eSYMas 4K Rsegs from abo$eSYMseglist 4K Rdata from abo$eSYMseg$n 4K R$p from abo$eSYM$node 4K Rdata from abo$eSYMinode shows inode number 8xamples in R>anicS Rp :%4-&S adb 4k 4w /de$/ks"ms /de$/mem 4K rootdir/W & 4K ls / ;e$er do that unless "ou need a s"stem panicT Rp //S adb, YMthreadlist Rp 9,S adb, YMutsname, hwHpro$ider/s, architecture/s, srpcHdomain/s

Rp 9:S adb 4k /de$/ks"ms /de$/mem, time/N, lbolt/1 4K Rtime outputS4=Rlbolt outputSZ&t,&&@*N shows the boot time 5an also do# time/D, lbolt/D 4K &tRtime outputS4&tRlbolt outputS*N Rp 9-S adb, )panicstr/s Rp 9/S adb, YMmsgbuf Rp ,,.S adb, rootfsYMbootobQ, swapfileYMbootobQ, dumpfileYMbootobQ Rp ,:E,,-.S adb, YMproconcpu =a macro written b" authors showing which process on which 5>U@ Rp .E,S adb, R(DDR from ps 4lSYMproc 4K Rpidp =used to be a t"po pipd@ from abo$eSYMpid Rp .E.4LS adb, R(DDR from ps 4lSYMproc.u shows u area (t least on Solaris ,& x9L, it doesnBt show ofile =open files@ 4K Rofile from abo$eS YMfile 4K R$node from abo$eSYM$node 4K Rstram from abo$eSYMstdata 4K Rwr' from abo$eSYM'ueue 4K Rnext from abo$eSYM'ueue, R'info from abo$eSYM'init Rp .E%S R'info from abo$eS/1 shows struct for ldterm Rp .9&S Rfirst from abo$e YM'ueue outputSYMmblk, Rrptr from abo$eS,Rwptr4rptrS/5 shows streams module output Rp :,ES R.nd arg of Htrap=@ if shown in YcSYMregs 4K Rpc from abo$eSAi =/i if not from core file@ Rp :-LS adb, YMtraceall =;eed to $erif"@ Rp :/.S adb, MspYMstacktrace =;eed to $erif"@ Rp :%&S adb, YMmodules shows more module info than modinfo=,0@ Rp -&.S adb, YMcpus Rp -.:4-S adb, Rowner of addrYMinodeSYMproc 4K Ruarea from abo$eSYMu 8xamples in RGardenS Rp /LLS crash, dis RIBll update this section later S Other 8xamples

adb, YMcpus 4K Rlwp from abo$eSYMlwp, Rthread from abo$eSYMthread RRodne",http#//groups google com/groupsA selm*:E-..8:E <-.L&&.9Z-&microworld comS ps 4elp, adb 4k /de$/ks"ms /de$/mem 4K R(DDR from abo$eSYMproc 4K Rtlist from abo$eSYMthread 4K Rsp from abo$eSYc, RW57(; from ps outputSYMmutex R8<8R8;58S R>anicS 5hris Drake, Uimberl" Brown, C>anicT U;I1 S"stem 5rash Dump (nal"sisC, ,%%/, >!R4>7 RGardenS Bern" Goodheart, Pames 5ox, C!he 0agic Garden 8xplained# the Internals of U;I1 S"stem ? Release -C, ,%%-, >rentice 7all R<iles"stemsS Ste$e >ate, CU;I1 <iles"stemsC, .&&:, Wile" (>>8;DI1 Y cat noaddrmacros ksh FT/usr/dt/bin/dtksh Fnoaddrmacros# prints names of all adb macro that donBt need an address, i e call b" YMmacro instead of addrYMmacro cnttotal*& cntnoaddr*& cd /usr/lib/adb for i in )W do if RR Y=file Yi I awk BY.^/ascii/[print CismacroC]B@ ** CismacroC SSW then cnttotal*Y==cnttotal 6 ,@@ if RR Y=head 4, Yi I awk BY,T^/a\ / [print CnoaddrC]B@ ** CnoaddrC SSW then cntnoaddr*Y==cntnoaddr 6 ,@@ echo Yi fi fi done print 4r C!otal macros# YcnttotalW ;o4address macros# YcntnoaddrC Y /noaddrmacros ksh FOn Solaris ,& x9L audiotrace buflist buflist nxt buflistiter nxt callouts ceHrxbufhist nxt ceHrxcomphist nxt ceHtxhist nxt ceHtxhist nxt, cglist

cglist nxt cglistchk nxt cglistiter nxt cpuHdptbl nxt cpus disp'trace list disp'trace nxt illHgHheads inodelist inodelist nxt inodelistiter nxt kmastat maQor.snode nxt modules modules brief modules brief nxt modules nxt mount msgbuf ncaHconntrace ncaHdoortrace ncaHnodetrace panicbuf ph"intHlist setproc nop sleep' nxt slp'trace slp'trace list slp'trace nxt s$cpoolHlist s"stemdump threadlist traceall nxt u si+eof utsname $ $Hcall $fslist $Hproc !otal macros# %,,W ;o4address macros# -% So %/Z of macros need an address or s"mbol as starting address R>anic p ,,&4,S tells us a trick to find the s"mbol Suppose "ouBre debugging kernel and want to use the bootobQ macro Since this macro needs a starting address or s"mbol, letBs find the s"mbol in kernel# nm /de$/ks"ms I grep 4i boot I grep OBP!

!hat doesnBt find the obQect named )boot) !hen cd /usr/include/s"s find 4exec grep 4i bootobQ [] /de$/null \W !hat finds the definition of bootobQ struct in bootconf h, which also sa"s rootfs, dumpfile and swapfile are of this t"pe !hese three $ariables also exist in `nm /de$/ks"ms` So "ou can use them as s"mbols for bootobQ macro, e g rootfsYMbootobQ, dumpfileYMbootobQ !he /Z macros that donBt need an address wonBt necessaril" work on core files <or example, YMthreadlist works on a s"stem crash dump or li$e s"stem =adb 4k /de$/ks"ms /de$/mem@, but it doesnBt work on a process core =adb Rpath/executableS core@ posted by Brahma at 3:52 PM & comments

strin9s command
S!RI;GS 4 O2D BU! ( GOODI8 !o check content of an obQect file=binar" file @ we canBt use $i or cat command, for that use strings command Z strings Rname of binar" fileS It will print all the printable strings present in obQect file Basicall" strings command looks for (S5II strings in executable file and print it Great for core files and other binar" error files posted by Brahma at 3:51 PM & comments

disksuite metadb
Be aware that the optimal replica configuration ma" be different from the one presented here, in the case that the data disks are also under control of Solaris ?olume 0anager software and can contain state database replicas Replica creation for the two4disk configuration =and disabling the 'uorum rule@

metadb 4a 4f 4c . c&t&d&sE metadb 4a 4c . c&t,d&sE echo set md#mirroredHrootHflag*, KK /etc/s"stem If one of the disks is broken, Solstice DiskSuite software stops the boot process !his reason for this is that, to successfull" boot after a failure, the maQorit" of State Replica Databases must Csur$i$e C On our two4disk mirror onl" three out of the six replicas would ha$e sur$i$ed Ser$ers with more than two disks should alwa"s ha$e a third disk configured with State Database Replicas !wodisk workstations ha$e to be fixed manuall", as described in the following example# C State Database Replicas are configured on c&t&d&sE and c&t,d&sE, disk c&t&d& fails C !he boot process stops with a Solstice DiskSuite error message and switches to Single User mode C ;ow the State Database Replicas on the failed disk ha$e to be unconfigured# metadb 4d 4f c&t&d&sE C (fter the next reboot, partition the replacement disk exactl" as in the sur$i$ing disk C 7a$ing done that, "ou now can create new State Database Replicas on the replacement disk# metadb 4a 4c : c&t&d&sE C Upon the next reboot, the mirror will be res"nchroni+ed 7int# If "ou ha$e a two4disk s"stem, create three State Database Replicas on one disk, and four on the other one Statisticall" there is a /& percent chance to successfull" reboot after a failure without manuall" using metadb If "ou can tolerate unattended reboots after a disk failure in a two4disk configuration, create the same number of State Database Replicas on both disks and create this /etc/s"stem entr"# set md#mirroredHrootHflag*, 0ore information on this topic can be found in the Sun Blue>rintsC publication C5onfiguring Boot Disks With Solaris ?olume 0anager Software,C =see# http#//www sun com/blueprints/,&&./9,E4&-&E4,& pdf@ posted by Brahma at 3:51 PM & comments

pk9c&k

Dragan 5$etko$ic wrote# K K pkgchk is "our friend K K pkgchk 4$ Mpackage nameK lists all files in that package K K pkgchk 4l 4p Mfile nameK shows the package name for a file etc etc K Is there a wa" to check for deps while installing or remo$ing packagesA posted by Brahma at 3:50 PM & comments

addin9 disks under solaris


(dding Disks under Solaris Once the disk has been ph"sicall" installed, the s"stem should recogni+e a new de$ice on the S5SI bus (fter powering up the s"stem, hold down the Stop ke" =on some Suns, this is labeled 2,@, and hit the ( ke" to enter the boot monitor (t the boot monitor, probe4scsi can be used to list the S5SI de$ices the s"stem recogni+es# !"pe BgoB to resume !"pe help for more information ok probe4scsi !arget / Unit & Disk 7> 5:E.-/ /,/:

;ote# on some older Suns, it ma" be necessar" to enter CnC at the boot monitor to enter the newer command mode before probing for disks (fter $erif"ing that the new disk is recogni+ed b" the s"stem, reboot the machine b" issuing Cboot 4rC from the boot monitor !he 4r option tells the s"stem to reconfigure for the new de$ice During the boot process, the new disk should be recogni+ed and a message should be printed to the console =On some Suns, it ma" not be printed to the screen, but will be written to the s"stem log 44 in

this case, the dmesg command should be used to re$iew the boot messages@ !he messages should be similar to this# sd/ at esp&# target / lun & sd/ is /iommuJf,e&&&&&&&/sbusJf,e&&&,&&&/espdmaJf,-&&&&&/espJf,9&&&&&/sdJ/,& W(R;I;G# /iommuJf,e&&&&&&&/sbusJf,e&&&,&&&/espdmaJf,-&&&&&/espJf,9&&&&&/sdJ/,& =sd/@# corrupt label 4 wrong magic number ?endor B7>B, product B5:E.-SB, .:/-LL& /,. b"te blocks In this example, the disk is located on controller &, S5SI ID / !he Ccorrupt labelC warning means that the disk doesnBt ha$e a Solaris label on it "et De$ice nodes !he correct de$ice nodes for the disk are automaticall" added when a Cboot 4rC is issued If the s"stem hasnBt been rebooted using the 4r option, here is a script that will configure the s"stem for the new disk <ormatting, >artitioning and 2abeling !he format utilit" is used to format, partition, and label disks It is menu dri$en !he raw disk de$ice is gi$en as an argumentW if no argument is gi$en, format will print a list of a$ailable disks and ask the user to pick one F format /de$/rdsk/c&t/d&s. selecting /de$/rdsk/c&t/d&s. Rdisk formattedS <OR0(! 08;U# disk 4 select a disk t"pe 4 select =define@ a disk t"pe partition 4 select =define@ a partition table current 4 describe the current disk format 4 format and anal"+e the disk repair 4 repair a defecti$e sector label 4 write label to the disk anal"+e 4 surface anal"sis defect 4 defect list management backup 4 search for backup labels $erif" 4 read and displa" labels sa$e 4 sa$e new disk/partition definitions in'uir" 4 show $endor, product and re$ision

$olname 4 set 94character $olume name 'uit !"ping format at the prompt will perform a low4le$el format on the disk !his is usuall" not necessar" with a new disk, since the" generall" come pre4formatted, but ma" help to map out an" additional defects the dri$e ma" ha$e de$eloped !he next step is to partition the dri$e !"pe partition at the prompt to switch to the partition menu# formatK partition >(R!I!IO; 08;U# & 4 change `&B partition , 4 change `,B partition . 4 change `.B partition : 4 change `:B partition - 4 change `-B partition / 4 change `/B partition L 4 change `LB partition E 4 change `EB partition select 4 select a predefined table modif" 4 modif" a predefined partition table name 4 name the current table print 4 displa" the current table label 4 write partition map and label to the disk 'uit !"pe in print to get a listing of the current partition table ;ote that the second partition represents the entire disk# partitionK print 5urrent partition table =original@# !otal disk c"linders a$ailable# ::L, 6 . =reser$ed c"linders@ >art !ag <lag 5"linders Si+e Blocks & unassigned wm & & =&/&/&@ & , unassigned wm & & =&/&/&@ & . backup wu &4::L& , ,.GB =::L,/&/&@ .:/.E&& : unassigned wm & & =&/&/&@ & - unassigned wm & & =&/&/&@ & / unassigned wm & & =&/&/&@ & L unassigned wm & & =&/&/&@ & E unassigned wm & & =&/&/&@ &

We will be splitting the disk up into two e'ual partitions, numbers : and - !he first partition will span c"linders & through ,L9&, the second will span c"linders ,L9, through ::L& !he partition si+e can be specified in blocks, c"linders, or megab"tes b" using the b, c, and mb suffixes when entering the si+e partitionK : >art !ag <lag 5"linders Si+e Blocks : unassigned wm & & =&/&/&@ & 8nter partition id tagRunassignedS# 8nter partition permission flagsRwmS# 8nter new starting c"lR&S# & 8nter partition si+eR&b, &c, & &&mbS# ,L9&c partitionK 8nter partition id tagRunassignedS# 8nter partition permission flagsRwmS# 8nter new starting c"lR&S# ,L9, 8nter partition si+eR&b, &c, & &&mbS# ,L9&c Once the disk has been partitioned, the label should be written to the disk# partitionK label Read" to label disk, continueA " !he new partition table can be printed from the format utilit", or ma" be $iewed using the prt$toc command# F prt$toc /de$/rdsk/s&t/d&s. ) /de$/rdsk/c&t/d&s. partition map ) ) Dimensions# ) /,. b"tes/sector ) ,-& sectors/track ) / tracks/c"linder ) E&& sectors/c"linder ) ::L: c"linders ) ::L, accessible c"linders ) ) <lags# ) ,# unmountable ) ,&# read4onl" ) ) Unallocated space# ) <irst Sector 2ast ) Sector 5ount Sector

) ,,EL&&& E&& ,,ELL%% ) ) <irst Sector 2ast ) >artition !ag <lags Sector 5ount Sector 0ount Director" . / &, & .:/.E&& .:/.L%% : & && & ,,EL&&& ,,E/%%% - & && ,,ELE&& ,,EL&&& .:/.L%% 5reating new files"stems <inall", new files"stems can be created on the disk using the newfs command, and each files"stem is checked for integrit" using fsck# F newfs /de$/rdsk/c&t/d&s: newfs# construct a new file s"stem /de$/rdsk/c&t/d&s:# ="/n@A " /de$/rdsk/c&t/d&s:# ,,EL&&& sectors in ,L9& c"linders of / tracks, ,-& sectors /E- .0B in ,&/ c"l groups =,L c/g, / -E0B/g, .L.- i/g@ super4block backups =for fsck 4< ufs 4o b*F@ at# :., ,,:EL, ..E.&, :-&L-, -/-&9, /LE/., L9&%L, E%--&, 9%L:., ,&&%EL, ,,.:.&, ,.:LL-, ,:/&&9, ,-L:/., ,/EL%L, ,L%&-&, ,E%.:., ,%&/EL, .&,%.&, .,:.L-, ..-L&9, .:/%/., .-E.%L, ./9L-&, .L99:., .9&,EL, .%,/.&, :&.9L-, :,-.&9, :.///., ::L9%L, :-9.-&, :/9-:., :L%EEL, :9,,.&, :%.-L-, -&:9&9, -,/,/., -.L-%L, -:E9-&, --9&:., -/%:EL, -E&E.&, -9.&L-, -%:-&9, /&-E/., /,L&%L, /.E--&, /:EL:., /-9%EL, /L&:.&, /E,LL-, /9:&&9, /%-:/., L&/L%L, L,E&-&, L.E.:., L:9/EL, L-%%.&, LL,.L-, LE.L&9, L9:%/., L%/.%L, E&LL-&, E,L9:., E.9,EL, E:%/.&, E/&9L-, EL..&9, EE://., E9-9%L, E%L.-&, 9&L-:., 9,EEEL, 9.%,.&, 9-&-L-, 9/,9&9, 9L:,/., 9E--%L, 99/9-&, 9%L&:., %&E:EL, %,9E.&, %:&&L-, %-,-&9, %/.E/., %L-&%L, %E/--&, %9/L:., %%L%EL, ,&&9:.&, ,&,%LL-, ,&:,&&9, ,&-.:/., ,&/:L%L, ,&L/&-&, ,&E/.:., ,&9L/EL, ,&%E%.&, ,,&%.L-, ,,.&L&9, ,,:,%/., ,,-:.%L, ,,/-L-&, ,,L-9:., F fsck 4" /de$/rdsk/c&t/d&s: )) /de$/rdsk/c&t/d&s: )) 2ast 0ounted on )) >hase , 4 5heck Blocks and Si+es )) >hase . 4 5heck >athnames )) >hase : 4 5heck 5onnecti$it" )) >hase - 4 5heck Reference 5ounts )) >hase / 4 5heck 5"l groups . files, % used, //,9/: free =,: frags, L9%9& blocks, & &Z fragmentation@ posted by Brahma at 3:50 PM & comments

"5f"a9s

K When I compile Samba for Solaris, I alwa"s ha$e to link K /usr/local/lib/libicon$ so . to /usr/lib/ first, otherwise I get a K dreaded swat error in m" web browser griping about not finding K libicon$ so . Nour en$ironment re'uires 2D<2(GS so that proper configure scripts can set up the 0akefiles correctl" <or libraries in /usr/local/lib onl"# export 2D<2(GS*B42/usr/local/lib 4R/usr/local/libB >lease read the man pages for ld and ld so , !he purpose of the 4R argument is well described there I Qust looked into this issue, with a different application In Solaris % and ,&, and likel" earlier Solaris $ersions, the icon$ functions are in libc !hereBs no need for a separate libicon$ !he configure script ma" be confused if "ou ha$e libicon$ installed IBd recommend remo$ing it Nou ma" also be able to tell configure not to use it !his is on Solaris %# Y nm /usr/lib/libc so I grep icon$ R-EL%S I .E--99I /LI<U;5 IG2OB I& I% IHicon$ R:99LS I .E--&&I 99I<U;5 IG2OB I& I% IHicon$Hclose R:/,ES I .E.E.-I ,9&I<U;5 IG2OB I& I% IHicon$Hopen R-:&ES I .E--99I /LI<U;5 IW8(U I& I% Iicon$ R,,9/S I &I &I<I28 I2O52 I& I(BS Iicon$ c R-LE.S I .E--&&I 99I<U;5 IW8(U I& I% Iicon$Hclose R-%/%S I .E.E.-I ,9&I<U;5 IW8(U I& I% Iicon$Hopen R,,%:S I .E:L-&I .&&I<U;5 I2O52 I& I% Iicon$HopenHall R,,%ES I .E-&-&I :L&I<U;5 I2O52 I& I% Iicon$HopenHpri$ate R,,%-S I .E:9-&I .&&I<U;5 I2O52 I& I% Iicon$HsearchHalias 44 posted by Brahma at 3:49 PM & comments

loss of fiber c&annel veritas


B!5 wrote# K 7i, K

K One of m" ser$ers briefl" lost its fiber channel connection to its :/,& K arra" =donBt ask@T K K !he connection was restored 'uickl", but not before $x$m got itself in a K knot =See the output of $xdisk and $xprint below@ K K IBm not sure how to reco$er from this I ha$e been through the ?eritas K doco but that doesnBt seem to co$er a situation like this K K I ha$e seen a few references to using C$xdctl enableC, but I am K concerned that this might make matters worse 5onsidering I ha$e a few K terab"tes of data on these disks IBm not keen on ha$ing to restore from K tape So will C$xdctl enableC do an"thing CbadC like dropping the K configs for m" $olumesA K K (n" assistance would be greatl" appreciated K K 5heers, K K B!5 K K F $xdisk list K D8?I58 !N>8 DISU GROU> S!(!US K c,t&d&s. sliced rootdisk rootdg online K c,t,d&s. sliced nsr&& nsr online K c,t.d&s. sliced rootdg&& rootdg online K c,t:d&s. sliced nsr&, nsr online K c,t-d&s. sliced datadg&& datadg online K c,t/d&s. sliced datadg&, datadg online K fabricH& sliced 4 4 online K fabricH, sliced 4 4 online K fabricH. sliced 4 4 online K fabricH: sliced 4 4 online K fabricH- sliced 4 4 online K fabricH/ sliced 4 4 online K fabricHL sliced 4 4 online K fabricHE sliced 4 4 online K fabricH9 sliced 4 4 online K fabricH% sliced 4 4 online K fabricH,& sliced 4 4 online K fabricH,, sliced 4 4 online K 4 4 datadg&. datadg failed was#fabricH& K 4 4 datadg&: datadg failed was#fabricH, K 4 4 datadg&- datadg failed was#fabricH. K 4 4 datadg&/ datadg failed was#fabricH: K 4 4 datadg&L datadg failed was#fabricH-

K 4 4 datadg&E datadg failed was#fabricH/ K 4 4 datadg&9 datadg failed was#fabricHL K 4 4 datadg&% datadg failed was#fabricHE K 4 4 datadg,& datadg failed was#fabricH9 K 4 4 datadg,, datadg failed was#fabricH% K 4 4 datadg,. datadg failed was#fabricH,& K 4 4 datadg,: datadg failed was#fabricH,, K K K F $xprint 4g datadg K !N ;(08 (SSO5 US!(!8 28;G!7 >2O<<S S!(!8 !U!I2& K >U!I2& K dg datadg datadg 4 4 4 4 4 K4 K K dm datadg&& c,t-d&s. 4 ,-::.9%L& 4 4 4 K4 K dm datadg&, c,t/d&s. 4 ,-::.9%L& 4 4 4 K4 K dm datadg&. 4 4 4 4 ;OD8?I58 4 K4 K dm datadg&: 4 4 4 4 ;OD8?I58 4 K4 K dm datadg&- 4 4 4 4 ;OD8?I58 4 K4 K dm datadg&/ 4 4 4 4 ;OD8?I58 4 K4 K dm datadg&L 4 4 4 4 ;OD8?I58 4 K4 K dm datadg&E 4 4 4 4 ;OD8?I58 4 K4 K dm datadg&9 4 4 4 4 ;OD8?I58 4 K4 K dm datadg&% 4 4 4 4 ;OD8?I58 4 K4 K dm datadg,& 4 4 4 4 ;OD8?I58 4 K4 K dm datadg,, 4 4 4 4 ;OD8?I58 4 K4 K dm datadg,. 4 4 4 4 ;OD8?I58 4 K4 K dm datadg,: 4 4 4 4 ;OD8?I58 4 K4 K K $ (dmin fsgen DIS(B28D :EE-9E:L 4 (5!I?8 4 K4

K pl (dmin4&, (dmin DIS(B28D :EE///.& 4 ;OD8?I58 4 K4 K sd datadg&.4&. (dmin4&, DIS(B28D :EE///.& & ;OD8?I58 4 K4 K K $ 5DBurning fsgen 8;(B28D ,-.L&L::L 4 (5!I?8 4 K4 K pl 5DBurning4&, 5DBurning 8;(B28D ,-.L&L-L- 4 (5!I?8 4 K4 K sd datadg&&4&, 5DBurning4&, 8;(B28D ,-.L&L-L- & 4 4 K4 K K $ 5omputing fsgen DIS(B28D .&%E,/.&& 4 80>!N 4 K4 K pl 5omputing4&, 5omputing DIS(B28D .&%E,/.L- 4 ;OD8?I58 4 K4 K sd datadg&,4&, 5omputing4&, 8;(B28D ,-.L&L-L- & 4 4 K4 K sd datadg&.4&E 5omputing4&, DIS(B28D LE,&99&& ,-.L&L-L- ;OD8?I58 4 K4 K K $ Dump fsgen DIS(B28D .&%E,/. 4 80>!N 4 K4 K pl Dump4&, Dump DIS(B28D .,,L%.9 4 ;OD8?I58 4 K4 K sd datadg&.4&L Dump4&, DIS(B28D .,,L%.9 & ;OD8?I58 4 K4 K K $ <inance fsgen DIS(B28D -9.:--%L 4 (5!I?8 4 K4 K pl <inance4&, <inance DIS(B28D -9.:E/L9 4 ;OD8?I58 4 K4 K sd datadg,.4&, <inance4&, DIS(B28D -9.:E/L9 & ;OD8?I58 4 K4 $xdctl enable can be run e$en if the $xconfigd is running in enabled mode It looks for new de$ices that are added since $xconfigd was last started Nou can use /etc/$x/bin/$xreattach 4c cAtAdA If it displa"s the diskgroup and disk name "ou can then use /etc/$x/bin/$xreattach 4r cAtAdA snip from man $xreattach

/etc/$x/bin/$xreattach 4c c,t.d& If reattachment is possible, $xreattach returns with an exit status of & and displa"s the disk group name and disk media name If reattachment is not possible, $xreattach returns an exit status of . and displa"s an error (ttempt to reattach the disk in the foreground and tr" to reco$er stale plexes of an" $olumes on the disk# /etc/$x/bin/$xreattach 4r c,t.d& If the reattachment is successful, $xreattach returns an exit status of & Otherwise, if an error occurs, $xreattach returns a non4+ero exit code as defined on $xintro=,0@ 7!7 S posted by Brahma at 3:48 PM & comments

<nterpretation of patc&add @p output


7i 0artin# pca is a great toolT I downloaded the patchdiag xref =because of wget and prox" do not work well@ and ran /pca 4i K installed txt or /pca 4u K uninstalled txt and checked the patch number 0uch better than patchadd 4p #@ !hank "ou $er" much 0ike 0artin >aul wrote# K 0ike7! wrote# K K Does patch ,,,,EE4&L need to be added or is the ser$er uptodate with K K the patch on SunOS / 9A !hank "ou in ad$ance K K patch ,,,,EE4&L has been obsoleted b" patch ,&99.E4,/, which in K turn has been obsoleted b" ,&9%%:4,9 Nou ha$e ,&9%%:4:% installed, K so "ou do not need to install ,,,,EE4&L K K ( tool like pca = http#//www par uni$ie ac at/solaris/pca/ @ can K help "ou anal"+e such issues !r"# K K wget http#//www par uni$ie ac at/solaris/pca/pca K chmod 6x pca K /pca 4x

K K If the report of missing patches doesnBt show ,,,,EE, "ou donBt need it K K mp K 44 posted by Brahma at 3:48 PM & comments

"istin9 suspended and back9round processe


2isting suspended and background processes When a process is running, backgrounded or suspended, it will be entered onto a list along with a Qob number !o examine this list, t"pe Z Qobs (n example of a Qob list could be R,S Suspended sleep ,&& R.S Running netscape R:S Running nedit !o restart =foreground@ a suspended processes, t"pe Z fg ZQobnumber <or example, to restart sleep ,&&, t"pe Z fg Z, !"ping fg with no Qob number foregrounds the last suspended process posted by Brahma at 3:47 PM & comments

&istory
histor" !he 5 shell keeps an ordered list of all the commands that "ou ha$e entered 8ach command is gi$en a number according to the order it was entered Z histor" =show command histor" list@

If "ou are using the 5 shell, "ou can use the exclamation character =T@ to recall commands easil" Z TT =recall last command@ Z T4: =recall third most recent command@ Z T/ =recall /th command in list@ Z Tgrep =recall last command starting with grep@ Nou can increase the si+e of the histor" buffer b" t"ping Z set histor"*,&& >re$ious posted by Brahma at 3:46 PM & comments

runnin9 soft'are
Running the software Nou are now read" to run the software =assuming e$er"thing worked@ Z cd ^/units,EIf "ou list the contents of the units director", "ou will see a number of subdirectories bin !he binar" executables info G;U info formatted documentation man 0an pages share Shared data files !o run the program, change to the bin director" and t"pe Z /units (s an example, con$ert L feet to metres Nou ha$e# L feet Nou want# metres ) , 9.99

If "ou get the answer , 9.99, congratulations, it worked !o $iew what units it can con$ert between, $iew the data file in the share director" =the list is 'uite comprehensi$e@ !o read the full documentation, change into the info director" and t"pe Z info 44file*units info E E Stripping unnecessar" code When a piece of software is being de$eloped, it is useful for the programmer to include debugging information into the resulting executable !his wa", if there are problems encountered when running the executable, the programmer can load the executable into a debugging software package and track down an" software bugs !his is useful for the programmer, but unnecessar" for the user We can assume that the package, once finished and a$ailable for download has alread" been tested and debugged 7owe$er, when we compiled the software abo$e, debugging information was still compiled into the final executable Since it is unlike" that we are going to need this debugging information, we can strip it out of the final executable One of the ad$antages of this is a much smaller executable, which should run slightl" faster What we are going to do is look at the before and after si+e of the binar" file <irst change into the bin director" of the units installation director" Z cd ^/units,E-/bin Z ls 4l (s "ou can see, the file is o$er ,&& kb"tes in si+e Nou can get more information on the t"pe of file b" using the file command Z file units units# 82< :.4bit 2SB executable, Intel 9&:9L, $ersion ,, d"namicall" linked =uses shared libs@, not stripped !o strip all the debug and line numbering information out of the binar" file, use the strip command Z strip units

Z ls 4l (s "ou can see, the file is now :L kb"tes 4 a third of its original si+e !wo thirds of the binar" file was debug code TTT 5heck the file information again Z file units units# 82< :.4bit 2SB executable, Intel 9&:9L, $ersion ,, d"namicall" linked =uses shared libs@, stripped 7I;!# Nou can use the make command to install pre4stripped copies of all the binar" files when "ou install the package Instead of t"ping make install, simpl" t"pe make install4strip posted by Brahma at 3:45 PM & comments

Friday, Gune 0F, 2005


disk <*
7a$e "ou tried Ciostat/sarC to see on which disk huge number of I/O operation are executed Ciostat 4>C can e$en gi$e report for each disk partition !hen "ou ma" decide which application program causes that based on "our knowledge of applications on "our ser$er Use Cser$C =ser$ice time, in fact itBs response time@ in their report as an indicator of disk I/O performance, if it keeps great than :& =ms@, "ou ma" think about to distribute I/O operations on different disk, use disk mirror and etc If a thread =or process@ is waiting for one or more outstanding i/oBs to complete, it is not using =Coccup"ingC to use "our term@ an" 5>U It is suspended Iowait means precisel" that the 5>U is a$ailable posted by Brahma at 3:50 PM & comments

<*Mait
I wrote a doc on this a bit o$er a "ear ago, ha$e a read of

http#//sunsol$e sun com/search/document doAassetke"*,4%4E/L/%4, Because of all of the misunderstanding associated with IOwait, it is defined to be & in Solaris ,& !he reall" important thing to take awa" from that document is that IOWait is a subset of idle Nou onl" get IOwait time if there is nothing else read" to run from the dispatch 'ueues alan posted by Brahma at 3:49 PM & comments

'atc& command monitorin9


0onitoring s"stem e$ents in real4time is essential for troubleshooting and debugging 0ost Unix and 2inux admins are alread" familiar with ps and top (dd the watch command to "our toolkit as well watch lets "ou obser$e the results of running a single command repeatedl", with all of "our chosen options <or example, to obser$e acti$it" on an ;I5 in real time# Y watch 4d /sbin/ifconfig eth& 5trl6c stops it !he 4d flag highlights the changes !he default is to rerun the command e$er" two seconds !his can be changed with the 4n flag, which in this example is set for e$er" second# Y watch 4n , 4d /sbin/ifconfig eth& !o monitor memor" usage# Y watch 4d free Ueep an e"e on the printer 'ueue with# Y watch lp' (nd monitor 5>U temperature# Y watch cat /proc/acpi/thermalH+one/!7R0/temperature

In other words, "ou ma" watch an" command in real4time 5onsult the watch man page to lean more posted by Brahma at 3:48 PM & comments

8uesday, ,ay 2 , 2005


#&eckin9 <>o process
Dan MdanHsou+aJhotmail comK wrote# K 7i, in the wa" that unix keeps a running total of the amount of 5>U K time a process has used, does it also keep track of i/o throughputA K I ha$e a ser$er that is bus" with i/o, and i need to work out with >ID K is using all the i/o I know i can work it back with which disks are K bus", and which processes are accessing those disks, but that does not K show which of the processes is actuall" doing the reads K So, looking for top or prstat, but for i/o http#//users tpg com au/bdgc$b/psio html http#//www stormloader com/"onghuang/freeware/pio html posted by Brahma at 3:18 PM & comments

kill sunray session


#ZIs there a wa" to cleanl" kick off a sun ra" user when his session #Zis disconnected, as root A #ZOn a workstation, I usuall" broke the screen sa$er with the root #Zpassword and logged the user out manuall" #ZOn the Sun Ra" ser$er =with ;S50@, there are no screen locks #ZIt would be nice if root was able to connect to an" Sun Ra" #Zsession b" e g logging in with the userBs login and rootBs password #Zinstead #ZI know I can kill the users 1session process, but this was alwa"s #Zthe last resort, as a user might ha$e open windows with unsa$ed #Zchanges We are going to put an R<8 in for this such that there will be an option that the root password will allow the user to connect to an arbitrar" users session 7opefull", one that is disconnected

5urrentl", the cleanest wa" to kill a Sun Ra" session is with utsession 4k posted by Brahma at 3:17 PM & comments

Firefo= on #53 control Aanel


7iW !o make a default browser, 5laude 5harest suggested the following =at sunman mail list@# cd /usr/dt/bin ln 4s /whereHisHtheHnewHbrowserHprg =ln 4s /appl/firefox/firefox@ (;D 0ODI<N sdtwebclient like this# 1K sunF diff sdtwebclient orig sdtwebclient 1K /c/ 1K M D8<(U2!HBROWS8RH2IS!*Cnetscape mo+illa sunHnetscape netscapeLC 1K 444 1K K D8<(U2!HBROWS8RH2IS!*Cfirefox netscape mo+illa sunHnetscape netscapeLC 5hristopher Singleton wrote# KGreetings, K K K IBm running a full" patched Solaris % on a SB ,/& I Qust Kdownloaded <irefox and set it up in m" /opt director", and would like Kto use the browser icon to launch firefox and not the default netscape K=IBm using 5D8, which is needed for one of m" apps@ IB$e tooled Karound a bit in /etc/dt and usr/dt, but canBt find exactl" what I Kneed to modif" to get it to launch firefox when I click on the 5D8 Kbrowser icon (n" help is greatl" appreciated !hanks, K posted by Brahma at 3:17 PM & comments

solaris root s&ell no s&ell


Back when I was working with some Solaris ser$ers about : "ears ago, we had some problems which were traced back to one of the administrators setting the default root shell to ksh US7 was the default shell in (I1 and 7>U1, of course 2inux default shell was bash

!here there was undesirable boot beha$ior when "ou set root D8<(U2! shell to an"thing but borne shell What we ended up ha$ing to do was the last two lines on the profile were sleep L& /usr/bin/ksh if "ou dont run into an" trouble Great, if "ou run into particularl" strange boot beha$ior change ROO! default shell to bourne shell and see if that fixes it !hree administrators and I worked this issue, finall" took it up with a senior Sun engineer !he senior Sun engineer at that time who explained that "ou DO;B! set default shell for root to an"thing but borne shell because bootup re'uires borne shell posted by Brahma at 3:16 PM & comments

8&ursday, ,ay 1:, 2005


#an?t "o9in %s 6oot From % 6emote 8erminal ) 8elnet > F8A
5anBt 2ogin (s Root <rom ( Remote !erminal A When tr"ing to login to the Solaris ser$er b" Super4user account $ia the networking, getting# C;ot on s"stem consoleC and C5onnection closed b" foreign hostC messages, then was expelled from the s"stem 0odif" the login file, must be logged on as root# F $i /etc/default/login 5omment out the /de$/console line# 2ooks like# ^ 5O;SO28*/de$/console Should look like# ^F 5O;SO28*/de$/console 8xit $i and sa$e the file# #w'T

!op I 5an !elnet !o ( Box (s Root, But ;ot ftp (s Root !he following error message is returned# B/:& 2ogin incorrect 2ogin failed B <tp for users other than root work Qust fine (n automatic securit" auditing program created a /etc/ftpusers file, with root as the single entr" Remo$ing root from /etc/ftpusers sol$es the problem 0odif" the /etc/ftpusers file, must be logged on as root# F $i /etc/ftpusers 5omment out the root entr"# 2ooks like# root Should look like# F root 8xit $i and sa$e the file# #w'T !op posted by Brahma at 10:18 AM & comments

No S&ell For 6oot


One of the most common problems users re'uest assistance for is the loss of root access shortl" after making changes to the roots default shell Users like to manuall" change the shell of account root to their shell of choice !he easiest mistake to make is to change the default shell C/sbin/shC to C/sbin/kshC !he next time "ou tr" to login in as root "ou will out that "ou are unable to log on as root because there is C;o shellC !he onl" wa" to fix the problem is to change root shell from /sbin/ksh to /usr/bin/ksh in /etc/passwd Since

the /etc/passwd is owned b" root and "ou can not log on as root an" more, how do "ou sol$e the problem A !he problem is caused because the user does not know there are no other shells but Bourne Shell in /sbin !herefore the s"stem can not find /sbin/ksh and "ou fail to log on the root because of C;o shellC /sbin/sh is a hard cop" under root =/@ file s"stem to make the s"stem usable e$en before the file s"stem /usr is mounted Boot the S"stem using the Solaris 5D and Installation Boot Disk# Insert the Solaris x9L 5DRO0 in the dri$e Boot with the installation diskette =or correct Dri$er Update Boot diskettes@ Boot from 5DRO0# Select the cdrom to boot when presented with the a$ailable de$ices R S Disk# !arget & RxS 5D # !arget & >ress the M<.K ke" to continue Boot to Single user mode from 5D# When asked to select Interacti$e or Pumpstart installation t"pe the following# Select t"pe of installation# boot 4s >ress the MenterK ke" to continue ;ote# Nou ha$e approxiamatel" :& seconds to make this decision before the s"stem boots into interacti$e installation 0ount the root dri$e# F mount /de$/dsk/cxdxsx /a F for ID8 dri$es, replace x with $alue that reflects "our dri$e or F mount /de$/cxtxdxsx /a F for S5SI dri$es, replace x with $alue that reflects "our dri$e

Set "our terminal mode for editing# F !8R0*at:9LWexport !8R0 8dit the passwd file and correct the path to the shell account# F $i /a/etc/passwd 2ine looks like# root#x#&#,#Super4User#/#/sbin/ksh When completed should look like# root#x#&#,#Super4User#/#/usr/bin/ksh 8xit $i and sa$e the passwd file# #w'T Un4mount the partition and reboot s"stem# F cd / F umount /a F init L posted by Brahma at 10:17 AM & comments

#reatin9 a Solaris 10 =8Q /umpstart server on a Netra t1 runnin9 Solaris :


0essage# / Date# Wed, ,9 0a" .&&/ ,/#:/#., 6&,&& <rom# 2oris Serena 5ontent4!"pe# text/plainW charset*Cus4asciiC !hank "ou $er" much to 5had 0"nhier Dana Sparling Bill Williams whose replies =below@ ha$e shed a good technical light on the issue !he wa" I got this working though is slightl" different and not as elegant, IBm afraid =or, in plain 8nglish, a 'uick and dirt" trickT@

(s far as I could see, on the Solaris ,& x9L cd ,of- there is no Boot information, either as a director" or as a ufs files"stem F prt$toc /de$/rdsk/c,t.d&s. ) /de$/rdsk/c,t.d&s. partition map ) ) Dimensions# ) /,. b"tes/sector ) :/L:. sectors/track ) , tracks/c"linder ) :/L:. sectors/c"linder ) , c"linders ) , accessible c"linders ) ) <lags# ) ,# unmountable ) ,&# read4onl" ) ) Unallocated space# ) <irst Sector 2ast ) Sector 5ount Sector ) ,.,/.9& ,9--LE--&E:E&9::L::L ,9--LE--&E:E&%//,L,/ ) ) <irst Sector 2ast ) >artition !ag <lags Sector 5ount Sector 0ount Director" & & && & ,.,/.9& ,.,/.E% . & && & ,.,/.9& ,.,/.E% /cdrom F So, I put the Solaris ,& x9L D?D into m" wintel laptop, g+ipped the Boot director", scp4ed Boot +ip across onto m" ;etra t, and un+ipped it into /Qsboot !hen on the ;etra, mounted the Solaris ,& x9L cd ,of-, cd into /cdrom/SolarisH,&/!ools and ran /setupHinstallHser$er 4t /Qsboot/Boot /export/install/sol,&x9L 8t $oil`, Qob doneT W4@ =plus running the addHtoHinstallHser$er from cd ./:/- of course@ 5heers 2oris 444444 5hadBs email 4444444444444444444444

!he first cd =, of -@ contains two files"stems, an hsfs files"stem and a ufs files"stem, this latter being the /cdrom/SolarisH,&/!ools/Boot subtree Nou canBt mount an x9L ufs files"stem on S>(R5 and $ice $ersa because of b"te4endian issues !he onl" real solution is to install Solaris x9L onto an x9L ser$er directl" from 5D, set up Qumpstart on the x9L ser$er, and then use rs"nc to cop" the Qumpstart setup to the ;etra ;ote# When cop"ing the Qumpstart setup, rs"nc is the tool to use Using a simple tar pipe or e$en rdist wonBt work, "ou wonBt be able to boot off this image Rs"nc will do the right thing with all of the special files 5had 0"nhier 444444444444444444444444444444444444444444 444444 DanaBs email 4444444444444444444444 I had a similar problem when I setup m" Solaris % Qumpstart box I belie$e the information "ou need is on slice ,, so "ou need to mount it and use the 4t option to point to it !his is what I did# 0ount the cd F mount 4r 4< hsfs /de$/dsk/c&tLd&s& /mnt 0ake slice, mountable and mount it# F lofiadm 4a /de$/dsk/c&tLd&s, /de$/lofi/, F mkdir /s, F mount 4o ro /de$/lofi/, /s, F cd /mnt/SolarisH%/!ools F /setupHinstallHser$er 4t /mnt/export/install/sparc% Unmount and delete /de$/lofi/, when "ou are finished# F umount /s, F lofiadm 4d /de$/lofi/l F rmdir s, Nour mileage ma" $ar", or solaris ,& might be completel" different Ba"l" 8le" has written an interesting document on Qumpstart, and it can be found at# http#//www giac org/certifiedHprofessionals/practicals/gcux/&.L: php I hope this helps 444444444444444444444444444444444444444444 444444 BillBs email 4444444444444444444444 7i 2oris, I donBt ha$e a ;etra, but IBm guessing itBs a sparc platform rather than an x9L (ssuming that to be true

I donBt ha$e Solaris,&, but do run Solaris% and ha$e been pla"ing around with the cross4platform Qumpstart 0" remarks are all based on Solaris% =-/&:@ S>(R5 and 19LW howe$er, I suspect that the re'uirement holds true for Solaris,& In the case of Solaris% =and prior releases I think@ It seems that the trick is that "ou must mount the ,st installation 5D on its ;(!I?8 platform In m" case I ha$e an Sol% x9L that I want to use to Qumpstart Sun<ire =S>(R5@ machines I had to do this# S>(R5# =weBll call it S>(R5SNS!80@ F Insert the Sol% 5D, =of .@ and let it mount =$olcheck@ share 4< nfs 4o ro,anon*& /cdrom/cdrom&/s& share 4< nfs 4o ro,anon*& /cdrom/cdrom&/s, 19L# mkdir /tmp/s& /tmp/s, mount S>(R5SNS!80#/cdrom/cdrom&/s& /tmp/s& mount S>(R5SNS!80#/cdrom/cdrom&/s, /tmp/s, cd /tmp/s&/SolarisH%/!ools F Pust like it sa"s in the book# /setupHinstallHser$er 4t /tmp/s, /export/sparc%install F <inishes cd /tmp umount /tmp/s& umount /tmp/s, S>(R5# unshare /cdrom/cdrom&/s& unshare /cdrom/cdrom&/s, eQect (ll this is prett" much right out of the Solaris % Installation Guide =IG@ !he IG then goes on to describe mounting =Sol%, remember@ the S>(R5 5D. of . directl" on the x9L s"stem and finishing up b" adding the rest of the installation software right there on the x9L# /addHtoHinstallHser$er /export/sparc%install 0r >aranoid, here, did it 44 S>(R5 mount, install from ;<S 44 Qust like 5D, I ha$e read $arious remarks =opinionsA@ about )wh") "ou ha$e to mount/run the 5D, from the nati$e platformW suffice it to sa" that the consistant

opinion seems to be that "ou DO ha$e to mount the Sol% 5D, on itBs ;(!I?8 architecture One more thing =Sol%@# Nou WI22 ha$e to mount the 5D, and export it from S>(R5, then mount and run setupHinstallHser$er from x9L I =foolishl"@ tried to export the x9L install area =sparc%install@ and do the mount and setupHinstallHser$er on the S>(R5 Guess what# setupHinstallHser$er will not accept an ;<S as the installation target 7ope some of this helps 444444444444444444444444444444444444444444444 44444Original 0essage44444 <rom# 2oris Serena Sent# ,9 0a" .&&/ ,,#.9 SubQect# 5reating a Solaris ,& x9L Qumpstart ser$er on a ;etra t, running Solaris % Sunmanagers, I ha$e a ;etra t, =with a cdrom, not a d$d@ running Solaris % which IB$e been tasked to build as a Qumpstart ser$er for Solaris ,& x9L IB$e mounted Solaris ,& x9L cd ,of-, cd into /cdrom/SolarisH,&/!ools and run the following# F /setupHinstallHser$er /export/install/sol,&x9L 8RROR# Install boot image /cdrom/SolarisH,&/!ools/Boot does not exist 5heck that boot image exists, or use R4tS to specif" a $alid boot image elsewhere F 7as an"one found a wa" around this or can point me to the right directionA !hanks in ad$ance 2oris posted by Brahma at 10:16 AM & comments

*pen files df @k pfiles lsof

Date# Wed,0a" ,9 .&&/ .#-:pm <rom# (de <ewings B2 wrote# K 7i all, K 0" solaris % box running $eritas $olume manager - & K ( file s"stem displa" wrong Cdf 4kC although I ha$e deleted lots of big K files K !he usage of that file s"stem is incorrect !hat means, suppose I onl" used K ,&Z space, but K the Cdf 4kC shows that the file s"stem has used L&Z (fter reboot, the K problem seems sol$ed K WhatBs the reasonA and, what command I can fix the problem if I donBt want K to rebootA K !hanks K K >robabl" some processes still running that ha$e open file handles to stuff "ou belie$e has been deleted It wonBt go until the file handles all go, which happens at a reboot BlsofB and BpfilesB ma" help "ou out (de posted by Brahma at 10:14 AM & comments

only root can print


*************************************************************** *************** !O>I5# onl" root can print http#//groups4 beta google com/group/comp unix solaris/browseHthread/thread/eac.-e%f&Lb,ff&, *************************************************************** *************** ** , of , ** Date# Wed,0a" ,9 .&&/ ,.#:/pm <rom# sheila I saw this once about a decade ago >ermissions on de$/null were goofed up b" the install of the Qetdirect software I think de$/null is supposed to be root#s"s LLL 0ake sure "ouBre looking at the perms of the actual file de$/null points to on "our s"stem and not must the permissions on the link

I also recall that the lpsched log file needed to be writable b" the user tr"ing to print or thereBd be no printout V no error message 0a"be "er not e$en using lpsched these da"s 2ike I said, this was a reall" long time ago on an older OS 7ope this helps SW wolfgang mair wrote# K 7i all, K K IBm experiencing a weird problem here K K IBm on solaris % and the print Qobs are spooled local and then send to a K hp Qetdirect box K K K If I tr" to print as a normal user# K K Y banner hallo I lp 4d hp/mis K re'uest id is hp/mis4EL:. =standard input@ K K !he print Qob turns up in the lpstat 4t command for a few seconds and K then $anishes I also can see the Qob in the /$ar/lp/logs/re'uests It K looks reall" like it was sent to the printer, but it wasnBt =5anBt see K an"thing with snoop@ K (lso couldnBt find an"thing in the /$ar/adm/messages K K K (nd, if I do the same as root, e$er"thing looks the same, but it works K K (n" ideasA K K !hank "ou K K Wolfgang posted by Brahma at 10:13 AM & comments

S1, mirrorin9 tec&niDue volume mana9er

Dan <oster wrote# K On our ?.&O with .xE: GB dri$es, a S?0 res"nc after replacing a failed K disk takes about E/ minutes on fast disks K K We are curious wh" this is so, e$en though there is onl" /&& 0B K allocated for the files"stems and , GB swap K K So weBre wondering if S?0 res"nc touches e$er" single ph"sical block K of the metade$ice, regardless of allocated to data =in use@ or notA K K 4Dan "es it s"ncs e$er" block of a partition it dont care if itBs data or non data /Qorgen posted by Brahma at 10:12 AM & comments

Mednesday, ,ay 18, 2005


Aerformance 8estin9
!ried the dd with block si+es of up to -&%Lk and there was not much difference eg time dd bs*L-k if*/disk,/abigfile of*/de$/null ,&&&.6, records in ,&&&.6, records out real .m/. ,:s user &m& &-s s"s &m,- 9Es time dd bs*.&L9k if*/oraback,&&n&/backup/DB,D?/R0(;/7OK :&%6, records in :&%6, records out real :m-9 &,s user &m& &&s s"s &m9 .&s (nd the performance makefiles is a bundle of fun 7a$e a look at these# time mkfile ,&&m grunt real &m.. 9%s user &m& &:s s"s &m- &&s

time mkfile L/&0 grunt real :m,E 9.s user &m& .,s s"s &m./ L-s With the results of -0B/s itBs good enough to sa" that something is wrong #@ It would be better if "ou add Bbs*,&-9/ELB to "our BddB command (nd, if "ou can afford it, test the de$ice =/de$/dsk/cAtAdAsA@ instead of the files"stem Nou might tr" running Biostat 4xtcn ,B when "ou do the test, to see how fast the de$ices are reall" accessed at a gi$en time posted by Brahma at 3:36 PM & comments

;ard'are dia9nostics
I guess this is the one "ou are looking for# /usr/sbin/prtdiag But these might also be interesting /usr/sbin/prtconf /usr/sbin/prtpicl /usr/sbin/prtfru /usr/sbin/de$fsadm !r", /usr/platform/`uname 4m`/sbin/prtdiag ok test4all /opt/SU;W$ts/bin/sun$ts posted by Brahma at 3:35 PM & comments

#&eck open files


>robabl" some processes still running that ha$e open file handles to stuff "ou belie$e has been deleted It wonBt go until the file handles all go, which happens at a reboot BlsofB and BpfilesB ma" help "ou out posted by Brahma at 3:34 PM & comments

8uesday, ,ay 1L, 2005


S, ne' &ost net'ork setup static
7i all IB$e Qust got m" hands on an Ultra/ and ha$e installed Solaris ,& on it IBm $er" new to sparcs V Solaris, though I am familiar with linux ;etworking seems to be configured partiall", except the box doesnBt seem to be seeing our nameser$ers I can ping I> addresses, but names are not getting resol$ed, and I get Cunknown hostC IB$e amended the /etc/resol$ conf file, but no Qo" 5an an"one gi$e me a couple of hints of where I need to lookA Or failing that, an" reall" good online resources for SolarisA >erhaps tr"# F cp /etc/nsswitch conf /etc/nsswitch conf orig F cp /etc/nsswitch dns /etc/nsswitch conf K 5an an"one gi$e me a couple of hints of where I need to lookA Or K failing that, an" reall" good online resources for SolarisA !hereBs also http#//docs sun com Something funn" is going on because if I do an ifconfig hme&, it reports m" I> as being ,/. /E :, .:& and m" broadcast addr as being ,/. /E .// .// !his is wrong, the" should be ,/. E, :E .:& V ,/. E, .// .// Chostname hme&C has the correct I> in ifconfig hme& ,/. E, :E .:& route add default ,/. E, & LL Is this a static I> or D75>Bd assignmentA If static, then double check the settings of# /etc/hosts /etc/hostname hme& /etc/inet/netmasks /etc/defaultrouter 5ould it be "ou ha$e C&E,C instead CE,C in hostname hme&A E, in octal is /E in decimal

Static I> 7ereBs the contents of ChostsC 4 F F Internet host table F ,.E & & , localhost ,/. E, :E .:& "ultra4&, loghost ,/. E, & LL 7ereBs contents of CdefaultrouterC ,/. E, & LL 7ereBs contents of Chostname hme&C "ultra4&, 7ereBs contents of CnetmasksC F F !he netmasks file associates Internet >rotocol =I>@ address F masks with I> network numbers F F network4number netmask F F !he term network4number refers to a number obtained from the Internet ;etwork F Information 5enter F F Both the network4number and the netmasks are specified in F Cdecimal dotC notation, e g# F F ,.9 :. & & .// .// .// & F ,/. E, & & .// .// &&& &&& KF K F Internet host table KF K ,.E & & , localhost K ,/. E, :E .:& "ultra4&, loghost K ,/. E, & LL 7mm, that last line should ha$e a hostname attached to it Other than that if "ouBre still stuck after fixing /etc/hosts#

F find /etc 4t"pe fIxargs ls 4lIgrep a4Iawk B[print Y;<]BIxargs grep B,/.\ B See if an"thing mentions unexpected ,/. x I>s or subnets If none of that pans out, "ou )could) run s"s4unconfig from the console but thatBs as a )final) resort and is almost ne$er needed =!hat command undoes a lot of things, mostl" relating to networking configuration but also includes root password +eroing and a few other non4networking4related stuff @ ItBs probabl" better to not do s"s4unconfig and see if "ou can figure it out b" fixing /etc/hosts or doing the BfindB, or tr" other suggestions that others ma" ha$e

You might also like