<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss'><id>tag:blogger.com,1999:blog-714742118606354868</id><updated>2009-09-24T02:05:40.412-07:00</updated><title type='text'>Unix Tech Tips &amp; Tricks</title><subtitle type='html'>A Technology Repository</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://unixtechtips.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/714742118606354868/posts/default'/><link rel='alternate' type='text/html' href='http://unixtechtips.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/714742118606354868/posts/default?start-index=26&amp;max-results=25'/><author><name>HuggyPuggy</name><uri>http://www.blogger.com/profile/04602550959022896368</uri><email>noreply@blogger.com</email></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>42</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-714742118606354868.post-6163237087139976278</id><published>2007-06-05T00:31:00.001-07:00</published><updated>2007-06-05T00:31:17.113-07:00</updated><title type='text'>Small tutorial on SCCS</title><content type='html'>&lt;DIV&gt; &lt;CENTER&gt; &lt;H2&gt;Small tutorial on SCCS&lt;/H2&gt;&lt;/CENTER&gt; &lt;H3&gt;The Basics&lt;/H3&gt;SCCS is a software versioning and revision control system. It  works by maintaining information about files in a main directory (called SCCS).  Each person working on the code creates a symbolic link to this directory in  his/her own workspace. There is an SCCS directory for each project.  &lt;H3&gt;Setup&lt;/H3&gt;Decide on a central repository to store the code. This can be  something like &lt;CODE&gt;/usr/src/projectName&lt;/CODE&gt;.&lt;BR&gt;Create the SCCS directory  there: &lt;CODE&gt;&lt;B&gt;mkdir&lt;/B&gt; /usr/src/projectName/SCCS&lt;/CODE&gt;. Put the original  files into the SCCS system using&lt;BR&gt;&lt;CODE&gt;&lt;B&gt;sccs create&lt;/B&gt;  filename&lt;/CODE&gt;&lt;BR&gt;where &lt;CODE&gt;filename&lt;/CODE&gt; is the name of the file.  &lt;P&gt; &lt;H3&gt;Usage&lt;/H3&gt; &lt;UL&gt;   &lt;LI&gt;&lt;B&gt;Creating a file and putting it into sccs&lt;/B&gt;:&lt;BR&gt;&lt;CODE&gt;&lt;B&gt;sccs    create&lt;/B&gt; filename&lt;/CODE&gt;&lt;BR&gt;   &lt;LI&gt;&lt;B&gt;checking files out for editing&lt;/B&gt;:&lt;BR&gt;&lt;CODE&gt;&lt;B&gt;sccs edit&lt;/B&gt;    filename&lt;/CODE&gt;&lt;BR&gt;   &lt;LI&gt;&lt;B&gt;checking files in after editing&lt;/B&gt;:&lt;BR&gt;&lt;CODE&gt;&lt;B&gt;sccs delget&lt;/B&gt;    filename&lt;/CODE&gt;&lt;BR&gt;   &lt;LI&gt;&lt;B&gt;getting a particular version of a file&lt;/B&gt;:&lt;BR&gt;&lt;CODE&gt;&lt;B&gt;sccs get&lt;/B&gt;    filename&lt;/CODE&gt; gets the latest version of the file&lt;BR&gt;&lt;CODE&gt;&lt;B&gt;sccs get    -r&lt;/B&gt;xx filename&lt;/CODE&gt; gets version xx of the file    &lt;LI&gt;&lt;B&gt;getting the latest version of all files&lt;/B&gt;:&lt;BR&gt;&lt;CODE&gt;&lt;B&gt;sccs get&lt;/B&gt;    SCCS/s.*&lt;/CODE&gt;    &lt;LI&gt;&lt;B&gt;getting information about which files are checked    out&lt;/B&gt;:&lt;BR&gt;&lt;CODE&gt;&lt;B&gt;sccs info&lt;/B&gt;&lt;/CODE&gt;    &lt;LI&gt;&lt;B&gt;getting information about a particular file&lt;/B&gt;:&lt;BR&gt;&lt;CODE&gt;&lt;B&gt;sccs    prt&lt;/B&gt; filename&lt;/CODE&gt;    &lt;LI&gt;&lt;B&gt;Diff between current file and checked in version&lt;/B&gt;:&lt;BR&gt;&lt;CODE&gt;&lt;B&gt;sccs    diffs&lt;/B&gt; filename&lt;/CODE&gt; &lt;/LI&gt;&lt;/UL&gt; &lt;P&gt;To modify a file, check it out for editing (edit), make the modifications,  and then check it back in (delget).&lt;BR&gt; &lt;H3&gt;Version info in the source code&lt;/H3&gt;SCCS provides the ability to mark your  source files with the sccs information, such as the date of the last  modification. To enable this, include the string &lt;CODE&gt;&lt;B&gt;%W% %G%&lt;/B&gt;&lt;/CODE&gt; in  your source code. Generally this would be placed inside a comment. Once a file  is checked in, the string gets replaced by the name of the file and the date of  last modification. &lt;/DIV&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/714742118606354868-6163237087139976278?l=unixtechtips.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unixtechtips.blogspot.com/feeds/6163237087139976278/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=714742118606354868&amp;postID=6163237087139976278&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/714742118606354868/posts/default/6163237087139976278'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/714742118606354868/posts/default/6163237087139976278'/><link rel='alternate' type='text/html' href='http://unixtechtips.blogspot.com/2007/06/small-tutorial-on-sccs.html' title='Small tutorial on SCCS'/><author><name>HuggyPuggy</name><uri>http://www.blogger.com/profile/04602550959022896368</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='10800658094938042256'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-714742118606354868.post-3990806091560179443</id><published>2007-06-04T22:14:00.001-07:00</published><updated>2007-06-04T22:14:43.747-07:00</updated><title type='text'>Basic Source Control Using RCS</title><content type='html'>&lt;DIV&gt; &lt;TABLE cellSpacing=0 cellPadding=0 width="90%" border=0&gt;   &lt;TBODY&gt;   &lt;TR&gt;     &lt;TD colSpan=2&gt;&amp;nbsp;&lt;MAP name=catalog_header_buttons&gt;&lt;AREA shape=RECT          coords=407,17,512,32 href="/catalog/search.html"&gt;&lt;AREA shape=RECT          coords=431,3,512,18 href="/catalog/prdindex.html"&gt;&lt;/MAP&gt;&lt;/TD&gt;&lt;/TR&gt;   &lt;TR&gt;     &lt;TD vAlign=top width="25%"&gt;&lt;A        href="http://www.oreilly.com/catalog/rcs/"&gt;&lt;IMG        alt="Applying RCS and SCCS: From Source Control to Project Control"        hspace=10 src="http://www.oreilly.com/catalog/covers/rcs.s.gif" align=left        vspace=10 border=0 valign="top"&gt; &lt;/A&gt;&lt;/TD&gt;     &lt;TD vAlign=top height=105&gt;&lt;BR&gt;       &lt;H2&gt;Applying RCS and SCCS&lt;/H2&gt;       &lt;H3&gt;From Source Control to Project Control&lt;/H3&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt; &lt;HR noShade SIZE=1&gt; &lt;!--sample chapter begins --&gt; &lt;BLOCKQUOTE&gt;   &lt;H2&gt;&lt;BR&gt;Basic Source Control Using RCS&lt;/H2&gt;   &lt;P&gt;The &lt;B class=emphasis.bold&gt;Revision Control System&lt;/B&gt;, or RCS, was    developed by Walter F. Tichy at Purdue University in the early 1980s.    Implemented later than SCCS, and with full knowledge of it, RCS is a more    user-friendly system, and in most ways a more powerful one. In this chapter we    present the most basic capabilities of RCS, by showing how you can apply it to    the source file modification cycle.&lt;/P&gt;   &lt;H2 class=sect1&gt;&lt;A class=title name=AUTOID-1262&gt;Background&lt;/A&gt;&lt;/H2&gt;   &lt;P class=para&gt;Traditionally, RCS has been included in BSD UNIX distributions;    currently, it is also distributed by the Free Software Foundation [Egg91]. RCS    has &lt;EM class=emphasis&gt;not&lt;/EM&gt; traditionally been included in    AT&amp;amp;T-derived UNIX distributions. Despite the technical merits of RCS, its    absence from System V and earlier AT&amp;amp;T systems can present practical and    political obstacles to those who would like to use it.&lt;/P&gt;   &lt;P class=para&gt;If RCS is of interest to you, make sure your system provides it.    If not, you'll be obliged to obtain it from another source, such as the FSF.    (We provide instructions for doing so in Appendix H, &lt;EM    class=emphasis&gt;References&lt;/EM&gt;.)[&lt;A class=footnote title=Footnote    href="http://www.oreilly.com/catalog/rcs/chapter/ch03.html#footnote-1"&gt;1&lt;/A&gt;]    The FSF, of course, distributes RCS in source form only. Though it's normally    trivial to configure and build RCS for a UNIX-like ("POSIX-compliant")    platform, this is still something you would have to do yourself if you    obtained the system in this way.&lt;/P&gt;   &lt;BLOCKQUOTE class=footnote&gt;     &lt;P class=para&gt;&lt;A class=footnote title=Footnote name=footnote-1&gt;[1]&lt;/A&gt; A      successor to RCS called RCE (for Revision Control Engine) has recently been      announced by a group working in Germany with Walter Tichy [XCC95]. RCE is      built atop a difference generator that works between arbitrary files, and is      implemented as a library, permitting source control operations to be      integrated with existing applications. A "stand-alone" command-line      interface that is compatible with RCS is provided, as well as a graphical      interface. We have not evaluated RCE; if it's of interest to you, see      Appendix H for information on finding out more about it.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;   &lt;P class=para&gt;In this book we describe RCS version 5.6.0.1, the most recent    one available as this book was being written.[&lt;A class=footnote title=Footnote    href="http://www.oreilly.com/catalog/rcs/chapter/ch03.html#footnote-2"&gt;2&lt;/A&gt;]    This version of RCS contains the commands listed in &lt;A class=xref    href="http://www.oreilly.com/catalog/rcs/chapter/ch03.html#RCS-CHP-3-TAB-1"&gt;Table    3.1&lt;/A&gt;.[&lt;A class=footnote title=Footnote    href="http://www.oreilly.com/catalog/rcs/chapter/ch03.html#footnote-3"&gt;3&lt;/A&gt;]&lt;/P&gt;   &lt;BLOCKQUOTE class=footnote&gt;     &lt;P class=para&gt;&lt;A class=footnote title=Footnote name=footnote-2&gt;[2]&lt;/A&gt; Note      that RCS 5.6.0.1 differs from 5.6 only in that it provides partial support      for a new form of conflict output in doing three-way merges. (See Chapter 5,      &lt;EM class=emphasis&gt;Extending Source Control to Multiple Releases&lt;/EM&gt;, for a      discussion of of such merges.) Since the new support is incomplete, it's      disabled, making 5.6.0.1 effectively identical to 5.6. Version 5.7 of RCS      was released just after this book went into production. Though it changes      nothing fundamental, 5.7 does introduce a few new features. We flag the most      important or visible of these in footnotes at the relevant points in our      presentation. Appendix G, &lt;EM class=emphasis&gt;Changes in RCS Version      5.7&lt;/EM&gt;, gives a more complete summary of what changed.&lt;/P&gt;     &lt;P class=para&gt;&lt;A class=footnote title=Footnote name=footnote-3&gt;[3]&lt;/A&gt; We      include in Table 3-1 the &lt;EM class=emphasis&gt;rcsclean&lt;/EM&gt;(1) command, which      in older RCS releases was a useful but limited shell script. In the current      release, the command is implemented in C and uses much of the same internal      code as the other RCS commands. Though the RCS sources still flag &lt;EM      class=emphasis&gt;rcsclean&lt;/EM&gt; as experimental, we think it's "grown up"      enough to warrant inclusion as part of the standard system.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;   &lt;TABLE class=table cellPadding=3 border=1&gt;     &lt;CAPTION class=table&gt;&lt;A class=title name=RCS-CHP-3-TAB-1&gt;Table 3.1: The RCS      Command Set&lt;/A&gt;&lt;/CAPTION&gt;     &lt;THEAD class=thead&gt;     &lt;TR class=row vAlign=top&gt;       &lt;TH class=entry align=left&gt;Command&lt;/TH&gt;       &lt;TH class=entry align=left&gt;Description&lt;/TH&gt;&lt;/TR&gt;&lt;/THEAD&gt;     &lt;TBODY class=tbody&gt;     &lt;TR class=row vAlign=top&gt;       &lt;TD class=entry&gt;&lt;EM class=emphasis&gt;ci&lt;/EM&gt;&lt;/TD&gt;       &lt;TD class=entry&gt;Check in RCS revisions&lt;/TD&gt;&lt;/TR&gt;     &lt;TR class=row vAlign=top&gt;       &lt;TD class=entry&gt;&lt;EM class=emphasis&gt;co&lt;/EM&gt;&lt;/TD&gt;       &lt;TD class=entry&gt;Check out RCS revisions&lt;/TD&gt;&lt;/TR&gt;     &lt;TR class=row vAlign=top&gt;       &lt;TD class=entry&gt;&lt;EM class=emphasis&gt;ident&lt;/EM&gt;&lt;/TD&gt;       &lt;TD class=entry&gt;Identify files&lt;/TD&gt;&lt;/TR&gt;     &lt;TR class=row vAlign=top&gt;       &lt;TD class=entry&gt;&lt;EM class=emphasis&gt;merge&lt;/EM&gt;&lt;/TD&gt;       &lt;TD class=entry&gt;Three-way file merge&lt;/TD&gt;&lt;/TR&gt;     &lt;TR class=row vAlign=top&gt;       &lt;TD class=entry&gt;&lt;EM class=emphasis&gt;rcs&lt;/EM&gt;&lt;/TD&gt;       &lt;TD class=entry&gt;Change RCS file attributes&lt;/TD&gt;&lt;/TR&gt;     &lt;TR class=row vAlign=top&gt;       &lt;TD class=entry&gt;&lt;EM class=emphasis&gt;rcsclean&lt;/EM&gt;&lt;/TD&gt;       &lt;TD class=entry&gt;Clean up working files&lt;/TD&gt;&lt;/TR&gt;     &lt;TR class=row vAlign=top&gt;       &lt;TD class=entry&gt;&lt;EM class=emphasis&gt;rcsdiff&lt;/EM&gt;&lt;/TD&gt;       &lt;TD class=entry&gt;Compare RCS revisions&lt;/TD&gt;&lt;/TR&gt;     &lt;TR class=row vAlign=top&gt;       &lt;TD class=entry&gt;&lt;EM class=emphasis&gt;rcsmerge&lt;/EM&gt;&lt;/TD&gt;       &lt;TD class=entry&gt;Merge RCS revisions&lt;/TD&gt;&lt;/TR&gt;     &lt;TR class=row vAlign=top&gt;       &lt;TD class=entry&gt;&lt;EM class=emphasis&gt;rlog&lt;/EM&gt;&lt;/TD&gt;       &lt;TD class=entry&gt;Print log messages and other info on RCS      files&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;   &lt;P&gt;&lt;/P&gt;   &lt;H2 class=sect1&gt;&lt;A class=title name=AUTOID-1355&gt;Conventions&lt;/A&gt;&lt;/H2&gt;   &lt;P class=para&gt;Before describing the basic RCS commands, let's define some    terms and take a look at command-line conventions, especially how you specify    files to the system.&lt;/P&gt;   &lt;H3 class=sect2&gt;&lt;A class=title name=AUTOID-1362&gt;Nomenclature&lt;/A&gt;&lt;/H3&gt;   &lt;P class=para&gt;When RCS creates an archive file, the name of the archive file    is the source file name with &lt;EM class=emphasis&gt;,v&lt;/EM&gt; appended to it. Thus    if you created an archive for the file &lt;EM class=emphasis&gt;xform.c&lt;/EM&gt;, &lt;EM    class=emphasis&gt;xform.c,v&lt;/EM&gt; would become the archive's name. The "&lt;EM    class=emphasis&gt;,v&lt;/EM&gt;" nominally refers to the multiple "versions" of the    source file stored in the archive file. Naturally enough, RCS calls its    archive files "RCS files."&lt;/P&gt;   &lt;P class=para&gt;All of the terms that we introduced in prior chapters to talk    about source control in fact come from RCS. Thus RCS uses the term "revision"    to refer to each stored version of the source file. It also uses the term    "check-in" to refer to the addition of a new revision to an RCS file and    "check-out" to refer to the retrieval of an existing revision from an RCS    file. And a source file that's been retrieved from an RCS file is known as a    "working file."&lt;/P&gt;   &lt;H3 class=sect2&gt;&lt;A class=title name=AUTOID-1392&gt;RCS Command Lines&lt;/A&gt;&lt;/H3&gt;   &lt;P class=para&gt;Like most programs with a UNIX heritage, all RCS commands expect    a command line that consists of a command name followed by one or more file    names. The file names may be (but don't have to be) preceded by one or more    options. If given, options change how the command works. So to summarize, a    command line looks like&lt;/P&gt;   &lt;BLOCKQUOTE class=literallayout&gt;     &lt;P class=literallayout&gt;&lt;EM class=emphasis&gt;command-name &lt;/EM&gt;[&lt;EM      class=emphasis&gt;options&lt;/EM&gt;]&lt;EM class=emphasis&gt; files&lt;/EM&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;   &lt;P class=para&gt;Each &lt;EM class=emphasis&gt;option&lt;/EM&gt; begins with a hyphen, which    is what distinguishes it from a filename. After the hyphen comes a single    letter that identifies the option; then (for some options) comes a string that    serves as a value for the option. Never insert whitespace between an option    letter and its value--let them appear as one argument on the command line.    (The first argument not starting with a hyphen is assumed to begin the    filename arguments for the command.) Each file named on a command line can be    either a source file or an RCS file, as we explain below.&lt;/P&gt;   &lt;P class=para&gt;Thus a typical command might be&lt;/P&gt;   &lt;BLOCKQUOTE class=screen&gt;&lt;PRE class=screen&gt;% &lt;CODE class=userinput&gt;&lt;B&gt;rcsdiff -r1.2 xform.c&lt;/B&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;   &lt;P class=para&gt;This invocation of the &lt;KBD class=command&gt;rcsdiff&lt;/KBD&gt;(1)    command specifies one option (&lt;EM class=emphasis&gt;-r&lt;/EM&gt;, which has &lt;B    class=emphasis.bold&gt;1.2&lt;/B&gt; as its value) and specifies one file, &lt;EM    class=emphasis&gt;xform.c&lt;/EM&gt;.&lt;/P&gt;   &lt;P class=para&gt;One final note is really not related to RCS, but to entering    quoted strings on a shell command line. As we'll see, you sometimes have the    choice of entering a description of an operation either at a prompt from the    program you're running or directly on the program's command line. If you want    to give the description on the command line, you'll need to enter it as a    quoted string (because it will contain whitespace). And if you want to    continue the description over more than one line, you'll have to use whatever    convention your shell supports for continuing a command line.&lt;/P&gt;   &lt;P class=para&gt;For example, the &lt;EM class=emphasis&gt;-m&lt;/EM&gt; option to the &lt;KBD    class=command&gt;ci&lt;/KBD&gt; program specifies comments for a check-in operation. If    you want to give a multiline comment and you're using &lt;EM    class=emphasis&gt;csh&lt;/EM&gt;(1) (or derivatives) as your shell, you need to precede    each carriage return in the commentary with a backslash:&lt;/P&gt;   &lt;BLOCKQUOTE class=screen&gt;&lt;PRE class=screen&gt;% &lt;CODE class=userinput&gt;&lt;B&gt;ci -m"Fix CR 604: vary conditioning algorithm according to\&lt;/B&gt;&lt;/CODE&gt;&lt;BR&gt;? &lt;CODE class=userinput&gt;&lt;B&gt;range data supplied by caller." filter.sh&lt;/B&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;   &lt;P class=para&gt;However, under the Bourne shell (or &lt;EM    class=emphasis&gt;ksh&lt;/EM&gt;(1) or &lt;EM class=emphasis&gt;bash(1)&lt;/EM&gt;), as long as the    value for &lt;EM class=emphasis&gt;-m&lt;/EM&gt; is quoted, you don't need to do anything    special to continue the comments onto a second line:&lt;/P&gt;   &lt;BLOCKQUOTE class=screen&gt;&lt;PRE class=screen&gt;$ &lt;CODE class=userinput&gt;&lt;B&gt;ci -m"Fix CR 604: vary conditioning algorithm according to&lt;/B&gt;&lt;/CODE&gt;&lt;BR&gt;&amp;gt; &lt;CODE class=userinput&gt;&lt;B&gt;range data supplied by caller." filter.sh&lt;/B&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;   &lt;H3 class=sect2&gt;&lt;A class=title name=AUTOID-1436&gt;Naming Files&lt;/A&gt;&lt;/H3&gt;   &lt;P class=para&gt;In running an RCS command, you can name either a working file or    the corresponding RCS file on the command line; the command will automatically    derive the other file name from the one you provide. This means, for instance,    that these two command lines are equivalent:&lt;/P&gt;   &lt;BLOCKQUOTE class=screen&gt;&lt;PRE class=screen&gt;% rcsdiff -r1.2 xform.c,v % rcsdiff -r1.2 xform.c&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;   &lt;P class=para&gt;Another feature provided by RCS is the automatic use of an &lt;EM    class=emphasis&gt;RCS&lt;/EM&gt; subdirectory for RCS files. If you create such a    subdirectory beneath the directory where you're working, RCS will try to use    it before trying to use the current directory. RCS will not, however, create a    subdirectory if one doesn't already exist.&lt;/P&gt;   &lt;P class=para&gt;Let's examine naming in more detail. Say that your working file    has the name &lt;EM class=emphasis&gt;workfile&lt;/EM&gt; and that &lt;EM    class=emphasis&gt;path1&lt;/EM&gt; and &lt;EM class=emphasis&gt;path2&lt;/EM&gt; are UNIX    pathnames. Then the full set of rules for specifying names to an RCS command    looks like this:    &lt;UL class=itemizedlist&gt;     &lt;LI class=listitem&gt;     &lt;P class=para&gt;If you name only a working file (such as, say, &lt;EM      class=emphasis&gt;path1/workfile&lt;/EM&gt;), the command tries to use an RCS file      with the name &lt;EM class=emphasis&gt;path1/RCS/workfile,v&lt;/EM&gt; or &lt;EM      class=emphasis&gt;path1/workfile,v&lt;/EM&gt; (in that order). Naturally, this is      also what happens in the simple case in which &lt;EM class=emphasis&gt;path1&lt;/EM&gt;      is not present.&lt;/P&gt;     &lt;P&gt;&lt;/P&gt;     &lt;LI class=listitem&gt;     &lt;P class=para&gt;If you name only an RCS file without a pathname prefix (such      as &lt;EM class=emphasis&gt;workfile,v&lt;/EM&gt;), the command tries to use &lt;EM      class=emphasis&gt;workfile,v&lt;/EM&gt; first in any &lt;EM class=emphasis&gt;RCS&lt;/EM&gt;      subdirectory beneath the current directory, then in the current directory      itself. If it can use an RCS file with one of those names, it tries to use a      working file named &lt;EM class=emphasis&gt;workfile&lt;/EM&gt; in the current      directory.&lt;/P&gt;     &lt;P&gt;&lt;/P&gt;     &lt;LI class=listitem&gt;     &lt;P class=para&gt;If you name an RCS file with a pathname prefix (such as &lt;EM      class=emphasis&gt;path2/workfile,v&lt;/EM&gt;), the command expects to be able to use      an RCS file with exactly that name. Then it tries to use a working file      named &lt;EM class=emphasis&gt;workfile&lt;/EM&gt; in the current directory.&lt;/P&gt;     &lt;P&gt;&lt;/P&gt;     &lt;LI class=listitem&gt;     &lt;P class=para&gt;If you name both a working file and an RCS file, then the      command uses files with exactly those names during its execution. In this      case the two files can be specified in either order, and can come from      completely unrelated directories.&lt;/P&gt;     &lt;P&gt;&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;   &lt;P&gt;&lt;/P&gt;   &lt;P class=para&gt;Suppose, for instance, that in your current directory you had a    source file &lt;EM class=emphasis&gt;xform.c&lt;/EM&gt;, as well as an &lt;EM    class=emphasis&gt;RCS&lt;/EM&gt; subdirectory. Then any of these command lines would    create an archive file named &lt;EM class=emphasis&gt;RCS/xform.c&lt;/EM&gt; from the &lt;EM    class=emphasis&gt;xform.c&lt;/EM&gt; source file. (The command here is the "check-in"    command we describe below.)&lt;/P&gt;   &lt;BLOCKQUOTE class=screen&gt;&lt;PRE class=screen&gt;% &lt;CODE class=userinput&gt;&lt;B&gt;ci xform.c&lt;/B&gt;&lt;/CODE&gt;&lt;BR&gt;% &lt;CODE class=userinput&gt;&lt;B&gt;ci xform.c,v&lt;/B&gt;&lt;/CODE&gt;&lt;BR&gt;% &lt;CODE class=userinput&gt;&lt;B&gt;ci RCS/xform.c,v&lt;/B&gt;&lt;/CODE&gt;&lt;BR&gt;% &lt;CODE class=userinput&gt;&lt;B&gt;ci RCS/xform.c,v xform.c&lt;/B&gt;&lt;/CODE&gt;&lt;BR&gt;% &lt;CODE class=userinput&gt;&lt;B&gt;ci xform.c RCS/xform.c,v&lt;/B&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;   &lt;P class=para&gt;When the source file and the RCS file are in the same directory    (or when the RCS file is in an &lt;EM class=emphasis&gt;RCS&lt;/EM&gt; subdirectory),    there's no need to give both file names on the command line. This becomes    useful only if the two files are in unrelated directories. For example, if &lt;EM    class=emphasis&gt;xform.c&lt;/EM&gt; were in the directory &lt;EM    class=emphasis&gt;/home/cullen/current/src/mathlib&lt;/EM&gt;, but you wanted to create    the RCS file in the directory &lt;EM    class=emphasis&gt;/project/archive/mathlib&lt;/EM&gt;, either of these command lines    would do the trick:&lt;/P&gt;   &lt;BLOCKQUOTE class=screen&gt;&lt;PRE class=screen&gt;% &lt;CODE class=userinput&gt;&lt;B&gt;ci /home/cullen/current/src/mathlib/xform.c /project/archive/mathlib/xform.c,v&lt;/B&gt;&lt;/CODE&gt;&lt;BR&gt;% &lt;CODE class=userinput&gt;&lt;B&gt;ci /project/archive/mathlib/xform.c,v /home/cullen/current/src/mathlib/xform.c&lt;/B&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;   &lt;P class=para&gt;Command lines like this one become useful when you put files    into separate trees according to their type. (We mentioned this possibility at    the end of Chapter 2, &lt;EM class=emphasis&gt;The Basics of Source Control&lt;/EM&gt;.)    This is one of the key concepts behind project control, as we'll see time and    again in later chapters. If you take this approach, though, you won't want to    be typing horrendously long command lines all the time. It's far better to    create some kind of "tree mapper" to manage the filenames for you. Such a    mapper is fundamental to systems like TCCS.&lt;/P&gt;   &lt;P class=para&gt;Naturally, for any RCS command, you can specify more than one    file, and the command will process each file in turn. For your own sake, if    you frequently process more than one file at a time, you'll probably want to    use an &lt;EM class=emphasis&gt;RCS&lt;/EM&gt; subdirectory to hold RCS files. This helps    you avoid naming RCS files by mistake when you use wildcards to name groups of    working files.&lt;/P&gt;   &lt;P class=para&gt;Note that RCS &lt;EM class=emphasis&gt;will&lt;/EM&gt; take a command line    of intermixed working filenames and RCS filenames and match them up using the    rules we outlined earlier in this chapter. Though this may work all right for    simple cases, however, the potential for ambiguity or erroneous file inclusion    is great enough that you should avoid the situation altogether and just    segregate your RCS files in an &lt;EM class=emphasis&gt;RCS&lt;/EM&gt; subdirectory.&lt;/P&gt;   &lt;P class=para&gt;This is desirable for more general administrative reasons as    well. Working files and RCS files are innately different, and it only makes    sense to keep them in distinct places to make it easy to administer them    appropriately. In particular, by segregating your RCS files, you make it    harder to access them accidentally in any way other than through the RCS    command set. An &lt;B class=emphasis.bold&gt;rm -rf&lt;/B&gt; will still remove them, of    course, but the added safety of an &lt;EM class=emphasis&gt;RCS&lt;/EM&gt; subdirectory    shouldn't be neglected.&lt;/P&gt;   &lt;P&gt;   &lt;H2 class=sect1&gt;&lt;A class=title name=AUTOID-1535&gt;Basic RCS Commands&lt;/A&gt;&lt;/H2&gt;   &lt;P class=para&gt;Now we present one iteration of the source file modification    cycle, using RCS commands to implement each operation. We also cover a few    other basic commands that are not strictly part of the cycle. All of this    involves only some of the RCS commands and few (if any) of their many options.    Later chapters explore more of the potential of the full RCS command set.&lt;/P&gt;   &lt;P class=para&gt;&lt;A class=xref    href="http://www.oreilly.com/catalog/rcs/chapter/ch03.html#RCS-CHP-3-FIG-1"&gt;Figure    3.1&lt;/A&gt; depicts the basic source control operations. This is the same picture    we presented as Figure 2-1, but with the "bubbles" annotated to show which RCS    command actually implements each operation. So once again, the central part of    the figure shows the modification cycle.&lt;/P&gt;   &lt;H4 class=figure&gt;&lt;A class=title name=RCS-CHP-3-FIG-1&gt;Figure 3.1: Basic source    control operations in RCS&lt;/A&gt;&lt;/H4&gt;&lt;IMG class=graphic alt="Figure 3.1"    src="http://www.oreilly.com/catalog/rcs/chapter/RCS.03.01.gif"&gt;    &lt;P class=para&gt;Let's cover each of the operations in more depth. Roughly    speaking, we'll describe them in the order in which they appear in the figure,    working from top to bottom.&lt;/P&gt;   &lt;H3 class=sect2&gt;&lt;A class=title name=AUTOID-1551&gt;Creating an RCS File&lt;/A&gt;&lt;/H3&gt;   &lt;P class=para&gt;You create an RCS file with the command &lt;EM    class=emphasis&gt;ci&lt;/EM&gt;(1) (for "check-in"). The command line need not specify    anything but the name of the source file you're checking in. So a simple    example of creating an RCS file is&lt;/P&gt;   &lt;BLOCKQUOTE class=screen&gt;&lt;PRE class=screen&gt;% &lt;CODE class=userinput&gt;&lt;B&gt;ci xform.c&lt;/B&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;   &lt;P class=para&gt;which will create the file &lt;EM class=emphasis&gt;xform.c,v&lt;/EM&gt;. If    you've already made an &lt;EM class=emphasis&gt;RCS&lt;/EM&gt; subdirectory, then the file    will be created there. Otherwise, it will be created in the current    directory.&lt;/P&gt;   &lt;P class=para&gt;By default, when you create an RCS file, you're prompted for a    short description of the file you're putting under source control. You may    enter as much text as you like in response, ending your input with a line    containing a period by itself. The interaction looks like this:&lt;/P&gt;   &lt;BLOCKQUOTE class=screen&gt;&lt;PRE class=screen&gt;% &lt;CODE class=userinput&gt;&lt;B&gt;ci xform.c&lt;/B&gt;&lt;/CODE&gt;&lt;BR&gt;xform.c,v  &amp;lt;--  xform.c initial revision: 1.1 enter description, terminated with ^D or '.': NOTE: This is NOT the log message! &amp;gt;&amp;gt; &lt;CODE class=userinput&gt;&lt;B&gt;Matrix transform routines, for single-precision data.&lt;/B&gt;&lt;/CODE&gt;&lt;BR&gt;&amp;gt;&amp;gt; &lt;CODE class=userinput&gt;&lt;B&gt;.&lt;/B&gt;&lt;/CODE&gt;&lt;BR&gt;done&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;   &lt;P class=para&gt;Once the RCS file is created, your source file is immediately    deleted. It is, of course, now safely stored in the RCS file and can be    extracted as a working file whenever you want it.&lt;/P&gt;   &lt;BLOCKQUOTE&gt;     &lt;TABLE width="85%" border=1&gt;       &lt;TBODY&gt;       &lt;TR&gt;         &lt;TD&gt;           &lt;P class=para&gt;As the warning "NOTE: This is NOT the log message!"            implies, you really create two descriptions when you check in the            initial revision of an archive file. The first description, which is            what &lt;EM class=emphasis&gt;ci&lt;/EM&gt; prompts for by default, is for the            file itself--this message is meant to describe the role of the file in            your project. In addition, &lt;EM class=emphasis&gt;ci&lt;/EM&gt; also creates a            log message (a term we'll come back to later), to describe the first            revision of the archive file--you can use this description to trace            the origins of the source file you're checking in.&lt;/P&gt;           &lt;P class=para&gt;By default, &lt;EM class=emphasis&gt;ci&lt;/EM&gt; creates a log            message with the value "Initial revision". If you want to use the            message actually to capture some useful data, you can use the &lt;EM            class=emphasis&gt;-m&lt;/EM&gt; option on the &lt;KBD class=command&gt;ci&lt;/KBD&gt;            command line to specify it, like this:&lt;/P&gt;           &lt;BLOCKQUOTE class=screen&gt;&lt;PRE class=screen&gt;% &lt;CODE class=userinput&gt;&lt;B&gt;ci -m"As ported from 9000 engineering group sources,\&lt;/B&gt;&lt;/CODE&gt;&lt;BR&gt;? &lt;CODE class=userinput&gt;&lt;B&gt;version 4.13.&lt;/B&gt;&lt;/CODE&gt;" xform.c&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;           &lt;P class=para&gt;Of course, this message has to be quoted, and the usual            rules apply if it extends across multiple lines.&lt;/P&gt;           &lt;P class=para&gt;The &lt;KBD class=command&gt;ci&lt;/KBD&gt; command also lets you            specify the archive file description on the command line, instead of            being prompted for it, via the &lt;EM class=emphasis&gt;-t&lt;/EM&gt; flag. In            fact, you can use &lt;EM class=emphasis&gt;-t&lt;/EM&gt; on any check-in, not just            the first one, to change an archive's description. You can give a            description either as the value to &lt;EM class=emphasis&gt;-t&lt;/EM&gt; or in a            file, which you name using &lt;EM class=emphasis&gt;-t&lt;/EM&gt;.&lt;/P&gt;           &lt;P class=para&gt;If the value of the option starts with a hyphen, it's            taken to be the literal text of the description; otherwise, it's taken            to be the name of a file containing the description. So either of            these command sequences would be equivalent to the original &lt;KBD            class=command&gt;ci&lt;/KBD&gt; command we showed above:&lt;/P&gt;           &lt;BLOCKQUOTE class=screen&gt;&lt;PRE class=screen&gt;% &lt;CODE class=userinput&gt;&lt;B&gt;cat &amp;gt; xform.desc&lt;/B&gt;&lt;/CODE&gt;&lt;BR&gt;&lt;CODE class=userinput&gt;&lt;B&gt;Matrix transform routines, for single-precision data.&lt;/B&gt;&lt;/CODE&gt;&lt;BR&gt;&lt;CODE class=userinput&gt;&lt;B&gt;^D&lt;/B&gt;&lt;/CODE&gt;&lt;BR&gt;% &lt;CODE class=userinput&gt;&lt;B&gt;ci -txform.desc xform.c&lt;/B&gt;&lt;/CODE&gt;&lt;BR&gt;% &lt;CODE class=userinput&gt;&lt;B&gt;ci -t-"Matrix transform routines, for single-precision data." xform.c&lt;/B&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;   &lt;H3 class=sect2&gt;&lt;A class=title name=AUTOID-1638&gt;Getting a Working File for    Reading&lt;/A&gt;&lt;/H3&gt;   &lt;P class=para&gt;You extract a working file from an existing RCS file with the    command &lt;EM class=emphasis&gt;co&lt;/EM&gt; (for "check-out"). The &lt;KBD    class=command&gt;co&lt;/KBD&gt;(1) command is designed to be the mirror-image of &lt;EM    class=emphasis&gt;ci&lt;/EM&gt;(1). So, once again, in the simplest case you specify    nothing but a filename when you run the command. A simple example of creating    a working file is&lt;/P&gt;   &lt;BLOCKQUOTE class=screen&gt;&lt;PRE class=screen&gt;% &lt;CODE class=userinput&gt;&lt;B&gt;co xform.c&lt;/B&gt;&lt;/CODE&gt;&lt;BR&gt;xform.c,v  --&amp;gt;  xform.c revision 1.1 done&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;   &lt;P class=para&gt;This command will look for an RCS file with the name &lt;EM    class=emphasis&gt;RCS/xform.c,v&lt;/EM&gt; or &lt;EM class=emphasis&gt;xform.c,v&lt;/EM&gt; and    create a working file from it named &lt;EM class=emphasis&gt;xform.c&lt;/EM&gt;. Here, the    output from the command confirms that revision 1.1 of &lt;EM    class=emphasis&gt;xform.c&lt;/EM&gt; was extracted from the RCS file &lt;EM    class=emphasis&gt;xform.c,v&lt;/EM&gt;.&lt;/P&gt;   &lt;P class=para&gt;Since the command line doesn't explicitly say that you want to    modify &lt;EM class=emphasis&gt;xform.c&lt;/EM&gt;, the file is created read-only. This is    a reminder that you shouldn't change it unless you coordinate your change with    the RCS file (by locking the revision of &lt;EM class=emphasis&gt;xform.c&lt;/EM&gt; that    you want to modify).&lt;/P&gt;   &lt;P class=para&gt;If a writable file already exists with the same name as the    working file that &lt;EM class=emphasis&gt;co&lt;/EM&gt; is trying to create, the command    will warn you of the file's presence and ask you whether you want to overwrite    it. If a writable copy of &lt;EM class=emphasis&gt;xform.c&lt;/EM&gt; existed, for    instance, the exchange would look like this:&lt;/P&gt;   &lt;BLOCKQUOTE class=screen&gt;&lt;PRE class=screen&gt;% &lt;CODE class=userinput&gt;&lt;B&gt;co xform.c&lt;/B&gt;&lt;/CODE&gt;&lt;BR&gt;RCS/xform.c,v  --&amp;gt;  xform.c revision 1.1 writable xform.c exists; remove it? [ny](n):&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;   &lt;P class=para&gt;At this point, &lt;EM class=emphasis&gt;co&lt;/EM&gt; expects a response    from you that starts with &lt;B class=emphasis.bold&gt;y&lt;/B&gt; or &lt;B    class=emphasis.bold&gt;n&lt;/B&gt;--responding with &lt;B class=emphasis.bold&gt;n&lt;/B&gt;, or    with anything other than a word beginning with &lt;B class=emphasis.bold&gt;y&lt;/B&gt;,    will cause &lt;EM class=emphasis&gt;co&lt;/EM&gt; to abort the check-out. If you abort the    check-out, &lt;EM class=emphasis&gt;co&lt;/EM&gt; confirms that with the additional    message&lt;/P&gt;   &lt;BLOCKQUOTE class=screen&gt;&lt;PRE class=screen&gt;co error: checkout aborted&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;   &lt;P class=para&gt;This message, of course, doesn't really indicate an    "error"--just that the check-out was aborted as you requested.&lt;/P&gt;   &lt;BLOCKQUOTE class=caution&gt;     &lt;P class=para&gt;&lt;STRONG&gt;CAUTION:&lt;/STRONG&gt; As we said in Chapter 2, &lt;EM      class=emphasis&gt;co&lt;/EM&gt; will silently overwrite any read-only copy of a file      that already exists with the same name as a working file it wants to check      out, on the assumption that the existing file is the result of a previous      &lt;EM class=emphasis&gt;co&lt;/EM&gt; for reading. So if a file is under source      control, &lt;EM class=emphasis&gt;do not&lt;/EM&gt; try to maintain changed copies of it      manually (i.e., outside source control). If you do, then sooner or later      you're likely to delete a file you wanted to save.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;   &lt;P class=para&gt;You can change the way &lt;EM class=emphasis&gt;co&lt;/EM&gt; checks out a    file if for some reason the usual safeguards it provides against overwriting a    working file aren't appropriate. First of all, you can use the &lt;EM    class=emphasis&gt;-f&lt;/EM&gt; option to "force" &lt;EM class=emphasis&gt;co&lt;/EM&gt; to create    a working file even if a writable file of the same name already exists. You    might use &lt;EM class=emphasis&gt;-f&lt;/EM&gt; if you had copied some outdated copy of    the file into your work area but now wanted to overwrite it with a current    copy from the archive file.&lt;/P&gt;   &lt;P class=para&gt;At the other extreme, you can check out a revision without    affecting any file that already exists with the same name, by using the &lt;EM    class=emphasis&gt;-p&lt;/EM&gt; option. With &lt;EM class=emphasis&gt;-p&lt;/EM&gt;, &lt;EM    class=emphasis&gt;co&lt;/EM&gt; will "print" the checked-out revision to its standard    output, rather than putting it into a working file. You can then redirect    standard output to capture the file in whatever way is appropriate. You might    use &lt;EM class=emphasis&gt;-p&lt;/EM&gt; if you wanted to have more than one revision of    a file checked out simultaneously--you could check out all but one revision    with &lt;EM class=emphasis&gt;-p&lt;/EM&gt; into files with special names. (Of course, &lt;EM    class=emphasis&gt;-p&lt;/EM&gt; is purely a convenience. You can always avoid using it    by doing regular check-outs and renaming the working files afterward.)&lt;/P&gt;   &lt;H3 class=sect2&gt;&lt;A class=title name=AUTOID-1727&gt;Getting a Working File for    Modification&lt;/A&gt;&lt;/H3&gt;   &lt;P class=para&gt;If you want to change a source file for which you've created an    RCS file, you need to get a writable working copy by adding the &lt;EM    class=emphasis&gt;-l&lt;/EM&gt; option to the &lt;KBD class=command&gt;co&lt;/KBD&gt; command line.    To check out &lt;EM class=emphasis&gt;xform.c&lt;/EM&gt; for modification, you use the    command line:&lt;/P&gt;   &lt;BLOCKQUOTE class=screen&gt;&lt;PRE class=screen&gt;% &lt;CODE class=userinput&gt;&lt;B&gt;co -l xform.c&lt;/B&gt;&lt;/CODE&gt;&lt;BR&gt;xform.c,v  --&amp;gt;  xform.c revision 1.1 (locked) done&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;   &lt;P class=para&gt;Compare the output from this command to that from the last &lt;EM    class=emphasis&gt;co&lt;/EM&gt; we looked at. As you can see, the current output    confirms that a lock has been set on the revision of &lt;EM    class=emphasis&gt;xform.c&lt;/EM&gt; you've checked out. Now that you have the lock,    you have the exclusive right to change this revision (revision 1.1) of the    file and eventually to check in your working file as the next revision of the    RCS file.&lt;/P&gt;   &lt;P class=para&gt;If someone else already held the lock to revision 1.1, you would    not be able to lock it yourself. However, even when you can't lock a given    revision, you can still check it out for reading only (that is, without the    &lt;EM class=emphasis&gt;-l&lt;/EM&gt; option). The assumption here is that you won't    modify the file when you obtain it for reading only. If, for example, you    requested the lock for revision 1.1 of &lt;EM class=emphasis&gt;xform.c&lt;/EM&gt; but    couldn't get it, &lt;EM class=emphasis&gt;co&lt;/EM&gt; would inform you with an error    message like this one:&lt;/P&gt;   &lt;BLOCKQUOTE class=screen&gt;&lt;PRE class=screen&gt;% &lt;CODE class=userinput&gt;&lt;B&gt;co -l xform.c&lt;/B&gt;&lt;/CODE&gt;&lt;BR&gt;RCS/xform.c,v  --&amp;gt;  xform.c co error: revision 1.1 already locked by cullen&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;   &lt;P class=para&gt;In this case you don't have the option of forcing the check-out    to proceed, so &lt;EM class=emphasis&gt;co&lt;/EM&gt; doesn't ask whether you want to. The    check-out is aborted unconditionally. The error message points out what user    owns the lock, which lets you contact him if you absolutely need to modify the    file now. Perhaps he can check it back in. Even if he can't, waiting is better    than circumventing RCS.&lt;/P&gt;   &lt;P class=para&gt;Occasionally, you may need to set a lock in an archive file    without checking out a working file. Say, for instance, you're archiving    sources distributed from outside your group, you've moved a new distribution    into place, and now you want to check in the new version of each file.    Checking out working files would overwrite the new sources with the older    ones. To set a lock without creating a working file, use the command &lt;B    class=emphasis.bold&gt;rcs -l&lt;/B&gt;.&lt;/P&gt;   &lt;P class=para&gt;Having a lock set in each archive file will enable you to check    in the corresponding newly imported source file as a successor to the existing    revision you locked.&lt;/P&gt;   &lt;H3 class=sect2&gt;&lt;A class=title name=AUTOID-1787&gt;Comparing a Working File to    Its RCS File&lt;/A&gt;&lt;/H3&gt;   &lt;P class=para&gt;To compare a working file against the RCS file it came from, use    the &lt;KBD class=command&gt;rcsdiff&lt;/KBD&gt;(1) program. If, for instance, you want to    compare the current contents of the working file against the original revision    you checked out of the RCS file, just give the command with no options, as    in&lt;/P&gt;   &lt;BLOCKQUOTE class=screen&gt;&lt;PRE class=screen&gt;% &lt;CODE class=userinput&gt;&lt;B&gt;rcsdiff xform.c&lt;/B&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;   &lt;P class=para&gt;The &lt;KBD class=command&gt;rcsdiff&lt;/KBD&gt; command will output a line    indicating what revision it is reading from the RCS file, then it will run the    &lt;EM class=emphasis&gt;diff&lt;/EM&gt;(1) program, comparing the revision it read    against the current working file. The &lt;EM class=emphasis&gt;diff&lt;/EM&gt; output will    show the original revision as the "old" file being compared and the current    working file as the "new" file being compared. Typical output might look like    this:&lt;/P&gt;   &lt;BLOCKQUOTE class=screen&gt;&lt;PRE class=screen&gt;% &lt;CODE class=userinput&gt;&lt;B&gt;rcsdiff xform.c&lt;/B&gt;&lt;/CODE&gt;&lt;BR&gt;=================================================================== RCS file: xform.c,v retrieving revision 1.1 diff -r1.1 xform.c 4a5 &amp;gt; j_coord = i_coord - x; 11,12c12,13 &amp;lt;       for (j = j_coord; j &amp;lt; j_max; ++j) &amp;lt;               if (a[j] &amp;lt; b[j]) { --- &amp;gt;       for (j = j_coord + 1; j &amp;lt;= j_max; ++j) &amp;gt;               if (a[j - 1] &amp;lt; b[j]) { 20d20 &amp;lt; j_coord = i_coord - x;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;   &lt;P class=para&gt;In other words, in the working file (the new file in the &lt;EM    class=emphasis&gt;diff&lt;/EM&gt; listing), an assignment to &lt;B    class=emphasis.bold&gt;j_coord&lt;/B&gt; has moved from line 20 to line 4, and the    first two lines of the &lt;EM class=emphasis&gt;for&lt;/EM&gt; loop currently at line 12    have been changed.&lt;/P&gt;   &lt;P class=para&gt;You can also use &lt;EM class=emphasis&gt;rcsdiff&lt;/EM&gt; to compare a    working file against some revision other than the one it started from or to    compare two different RCS file revisions to each other. To compare your    working file against any revision of the RCS file, add a &lt;EM    class=emphasis&gt;-r&lt;/EM&gt; option to the &lt;KBD class=command&gt;rcsdiff&lt;/KBD&gt; command    line, naming the revision you're interested in. For instance, to compare the    current contents of &lt;EM class=emphasis&gt;xform.c&lt;/EM&gt; against revision 1.3 of    its RCS file, you use the command&lt;/P&gt;   &lt;BLOCKQUOTE class=screen&gt;&lt;PRE class=screen&gt;% &lt;CODE class=userinput&gt;&lt;B&gt;rcsdiff -r1.3 xform.c&lt;/B&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;   &lt;P class=para&gt;To compare two different revisions already checked in to the RCS    file, just give two &lt;EM class=emphasis&gt;-r&lt;/EM&gt; options, as in&lt;/P&gt;   &lt;BLOCKQUOTE class=screen&gt;&lt;PRE class=screen&gt;% &lt;CODE class=userinput&gt;&lt;B&gt;rcsdiff -r1.1 -r1.2 xform.c&lt;/B&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;   &lt;P class=para&gt;This command produces a &lt;EM class=emphasis&gt;diff&lt;/EM&gt; listing    with revision 1.1 as the "old" file and revision 1.2 as the "new" file. This    form of &lt;EM class=emphasis&gt;rcsdiff&lt;/EM&gt; can be particularly useful for    debugging, since it lets you see recent changes to the file other than your    own.&lt;/P&gt;   &lt;H3 class=sect2&gt;&lt;A class=title name=AUTOID-1863&gt;Adding a Working File to Its    RCS File&lt;/A&gt;&lt;/H3&gt;   &lt;P class=para&gt;When you're satisfied with the current state of your working    file and want to save it for future reference, use the &lt;KBD    class=command&gt;ci&lt;/KBD&gt; command to add it to the corresponding RCS file. This    is, of course, the same command you used to create the RCS file in the first    place; ordinarily, to check in a working file, you give the same simple    command line as you did then. For instance,&lt;/P&gt;   &lt;BLOCKQUOTE class=screen&gt;&lt;PRE class=screen&gt;% &lt;CODE class=userinput&gt;&lt;B&gt;ci xform.c&lt;/B&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;   &lt;P class=para&gt;This command would check in the current contents of &lt;EM    class=emphasis&gt;xform.c&lt;/EM&gt; as a new revision in the corresponding RCS file,    then delete the working file. When you run &lt;EM class=emphasis&gt;ci&lt;/EM&gt;, you'll    be prompted for a description of your changes to the working file, in the same    way as &lt;EM class=emphasis&gt;ci&lt;/EM&gt; originally asked you to describe the file    itself. A typical interaction might be&lt;/P&gt;   &lt;BLOCKQUOTE class=screen&gt;&lt;PRE class=screen&gt;% &lt;CODE class=userinput&gt;&lt;B&gt;ci xform.c&lt;/B&gt;&lt;/CODE&gt;&lt;BR&gt;xform.c,v  &amp;lt;--  xform.c new revision: 1.2; previous revision: 1.1 enter log message: (terminate with ^D or single '.') &amp;gt;&amp;gt; &lt;CODE class=userinput&gt;&lt;B&gt;In function ff1():  move declaration of j_coord; fix&lt;/B&gt;&lt;/CODE&gt;&lt;BR&gt;&amp;gt;&amp;gt; &lt;CODE class=userinput&gt;&lt;B&gt;off-by-one error in traversal loop.&lt;/B&gt;&lt;/CODE&gt;&lt;BR&gt;&amp;gt;&amp;gt; &lt;CODE class=userinput&gt;&lt;B&gt;.&lt;/B&gt;&lt;/CODE&gt;&lt;BR&gt;done&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;   &lt;P class=para&gt;Again, you can enter as much text as you like, and you terminate    your entry with a period on a line by itself.&lt;/P&gt;   &lt;P class=para&gt;Sometimes, you may prefer to give revision commentary directly    on the &lt;KBD class=command&gt;ci&lt;/KBD&gt; command line. This can be handy when you're    checking in more than one file and want all of the files to have the same    commentary. You do this using the &lt;EM class=emphasis&gt;-m&lt;/EM&gt; option to &lt;EM    class=emphasis&gt;ci&lt;/EM&gt; (as we've mentioned a few times in other contexts). For    instance, the last check-in that we showed could be phrased as&lt;/P&gt;   &lt;BLOCKQUOTE class=screen&gt;&lt;PRE class=screen&gt;% &lt;CODE class=userinput&gt;&lt;B&gt;ci -m"In function ff1():  move declaration of j_coord; fix\&lt;/B&gt;&lt;/CODE&gt;&lt;BR&gt;? &lt;CODE class=userinput&gt;&lt;B&gt;off-by-one error in traversal loop." xform.c&lt;/B&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;   &lt;P class=para&gt;Notice that we gave the comments as a quoted string, as they    contain white space. Since in this example we're using a &lt;EM    class=emphasis&gt;csh&lt;/EM&gt;(1)-style shell, we had to type a backslash to extend    the comments onto a second line.&lt;/P&gt;   &lt;P class=para&gt;Ordinarily, &lt;EM class=emphasis&gt;ci&lt;/EM&gt; expects a newly    checked-in revision to be different from its ancestor and will not complete    the check-in if the two are identical. You can use the &lt;EM    class=emphasis&gt;-f&lt;/EM&gt; option to "force" a check-in to complete anyway in this    case. By default, &lt;EM class=emphasis&gt;ci&lt;/EM&gt; deletes your working file when    the check-in is complete. Often, you'll still want a copy of the file to exist    afterward. To make &lt;EM class=emphasis&gt;ci&lt;/EM&gt; do an immediate check-out of the    working file after checking it in, you can add either of two options to the    command line. The &lt;EM class=emphasis&gt;-u&lt;/EM&gt; option will check out your    working file unlocked, suitable for read-only use. The &lt;EM    class=emphasis&gt;-l&lt;/EM&gt; option will set a new lock on the revision that you    just checked in and check out the working file for modification. Both of these    options are simply shorthand for doing a separate &lt;EM class=emphasis&gt;co&lt;/EM&gt;    following the check-in.&lt;/P&gt;   &lt;H3 class=sect2&gt;&lt;A class=title name=AUTOID-1945&gt;Discarding a Working    File&lt;/A&gt;&lt;/H3&gt;   &lt;P class=para&gt;If you decide that you don't want to keep the changes that    you've made, you can use the &lt;KBD class=command&gt;rcs&lt;/KBD&gt;(1) command to    discard your changes by unlocking the RCS file revision you started with. Run    &lt;EM class=emphasis&gt;rcs&lt;/EM&gt; just by naming the file you want to discard,    preceded by the option &lt;EM class=emphasis&gt;-u&lt;/EM&gt; (for "unlock"):&lt;/P&gt;   &lt;BLOCKQUOTE class=screen&gt;&lt;PRE class=screen&gt;% &lt;CODE class=userinput&gt;&lt;B&gt;rcs -u xform.c&lt;/B&gt;&lt;/CODE&gt;&lt;BR&gt;RCS file: xform.c,v 1.1 unlocked done&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;   &lt;P class=para&gt;This command will remove any lock you currently have set in the    RCS file. However, it doesn't do anything to the working file you name and    doesn't even require that the file exist. If you want to remove the working    file, you have to do that yourself with &lt;EM class=emphasis&gt;rm&lt;/EM&gt;(1).&lt;/P&gt;   &lt;P class=para&gt;If you've set more than one lock in a file under the same    username, you need to tell &lt;EM class=emphasis&gt;rcs&lt;/EM&gt; the revision you wish    to unlock, by adding a revision ID to the &lt;EM class=emphasis&gt;-u&lt;/EM&gt; option.    Without it, the command can't tell which pending update to the archive file    you want to cancel. This command, for instance, would unlock revision 1.1 of    &lt;EM class=emphasis&gt;xform.c,v&lt;/EM&gt; even if you had another revision locked:&lt;/P&gt;   &lt;BLOCKQUOTE class=screen&gt;&lt;PRE class=screen&gt;% &lt;CODE class=userinput&gt;&lt;B&gt;rcs -u1.1 xform.c&lt;/B&gt;&lt;/CODE&gt;&lt;BR&gt;RCS file: xform.c,v 1.1 unlocked done&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;   &lt;P class=para&gt;If you want to discard a working file and replace it with the    original revision it came from, it may be more convenient to use the command    &lt;B class=emphasis.bold&gt;co -f -u&lt;/B&gt;. The &lt;EM class=emphasis&gt;-u&lt;/EM&gt; option    causes &lt;EM class=emphasis&gt;co&lt;/EM&gt; to unlock the checked-out revision if it was    locked by you, while &lt;EM class=emphasis&gt;-f&lt;/EM&gt; forces &lt;EM    class=emphasis&gt;co&lt;/EM&gt; to overwrite your writable working file with the    original revision from the archive file.&lt;/P&gt;   &lt;H3 class=sect2&gt;&lt;A class=title name=AUTOID-1995&gt;Viewing the History of an RCS    File&lt;/A&gt;&lt;/H3&gt;   &lt;P class=para&gt;As we've seen, the &lt;KBD class=command&gt;ci&lt;/KBD&gt; command asks you    for a description when you create an RCS file, as well as when you add a    revision to one. Together, these descriptions form a history, or log, of all    that's happened to the RCS file since its creation. The descriptions can be    displayed by using the &lt;KBD class=command&gt;rlog&lt;/KBD&gt;(1) command.&lt;/P&gt;   &lt;P class=para&gt;As usual, you simply give on the command line the name of the    file you want to examine. Here's an example:&lt;/P&gt;   &lt;BLOCKQUOTE class=screen&gt;&lt;PRE class=screen&gt;&lt;B class=emphasis.bold&gt;% rlog xform.c&lt;/B&gt; RCS file:        xform.c,v;   Working file:    xform.c head:            1.2 branch: locks:           ;  strict access list: symbolic names: comment leader:  " * " total revisions: 2;    selected revisions: 2 description: Matrix transform routines, for single-precision data. ---------------------------- revision 1.2 date: 95/05/10 14:34:02;  author: rully;  state: Exp;  lines added/del: 3/3 In function ff1():  move declaration of j_coord; fix off-by-one error in traversal loop. ---------------------------- revision 1.1 date: 95/04/23 14:32:31;  author: rully;  state: Exp; As ported from 9000 engineering group sources, version 4.13. =============================================================================&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;   &lt;P class=para&gt;The output of &lt;EM class=emphasis&gt;rlog&lt;/EM&gt; can be divided into    three parts. First appears a summary of various characteristics of the RCS    file, which is unrelated to what we've discussed in this chapter. Next,    following the &lt;EM class=emphasis&gt;description:&lt;/EM&gt; line, we find the text    entered when the RCS file was first created. Last, a list of revision entries    appears, one for each revision in the RCS file. These entries are output with    the most recent first. Each one contains the description that was originally    entered for that revision.&lt;/P&gt;   &lt;H3 class=sect2&gt;&lt;A class=title name=AUTOID-2020&gt;Cleaning Up an RCS Source    Directory&lt;/A&gt;&lt;/H3&gt;   &lt;P class=para&gt;To help you tidy up a source directory when you're done working    there, RCS provides a program called &lt;EM class=emphasis&gt;rcsclean&lt;/EM&gt;. This    program compares working files in the current directory against their archive    files and removes working files that were checked out but never modified. More    specifically:    &lt;UL class=itemizedlist&gt;     &lt;LI class=listitem&gt;     &lt;P class=para&gt;A working file that was checked out for reading is removed      only if it still matches the head revision on the default branch of the      archive file.[&lt;A class=footnote title=Footnote      href="http://www.oreilly.com/catalog/rcs/chapter/ch03.html#footnote-4"&gt;4&lt;/A&gt;]&lt;/P&gt;     &lt;BLOCKQUOTE class=footnote&gt;       &lt;P class=para&gt;&lt;A class=footnote title=Footnote name=footnote-4&gt;[4]&lt;/A&gt; See        Chapter 6, &lt;EM class=emphasis&gt;Applying RCS to Multiple Releases&lt;/EM&gt;, for        a discussion of RCS archive file branches.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;     &lt;P&gt;&lt;/P&gt;     &lt;LI class=listitem&gt;     &lt;P class=para&gt;If &lt;EM class=emphasis&gt;-u&lt;/EM&gt; is given, a working file that      was checked out for modification is removed if it still matches the original      revision (that is, the one checked out locked by the user).&lt;/P&gt;     &lt;P&gt;&lt;/P&gt;     &lt;LI class=listitem&gt;     &lt;P class=para&gt;If a working file does not match the revision noted in the      last two cases, then &lt;EM class=emphasis&gt;rcsclean&lt;/EM&gt; will never remove      it.&lt;/P&gt;     &lt;P&gt;&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;   &lt;P&gt;&lt;/P&gt;   &lt;P class=para&gt;When &lt;EM class=emphasis&gt;-u&lt;/EM&gt; is given, if &lt;EM    class=emphasis&gt;rcsclean&lt;/EM&gt; removes a working file, it also removes any lock    corresponding to it. Any commands &lt;EM class=emphasis&gt;rcsclean&lt;/EM&gt; executes    are echoed to its standard output so you can see what's going on.&lt;/P&gt;   &lt;P class=para&gt;If you invoke &lt;EM class=emphasis&gt;rcsclean&lt;/EM&gt; with no    arguments, it will process all of the working files in the current directory.    If you provide arguments, then only the working files you name will be    processed. Needless to say, &lt;EM class=emphasis&gt;rcsclean&lt;/EM&gt; has no effect on    files other than working files checked out from an RCS file.&lt;/P&gt;   &lt;P class=para&gt;If you want to see what commands &lt;EM    class=emphasis&gt;rcsclean&lt;/EM&gt; would execute, if given a certain command line,    you can use the &lt;EM class=emphasis&gt;-n&lt;/EM&gt; flag. Then &lt;EM    class=emphasis&gt;rcsclean&lt;/EM&gt; will echo the commands it normally would run but    will not actually execute them. Note that the output from &lt;B    class=emphasis.bold&gt;rcsclean -n&lt;/B&gt; looks exactly like the normal output, so    be careful not to confuse a &lt;EM class=emphasis&gt;-n&lt;/EM&gt; run with the real    McCoy.&lt;/P&gt;   &lt;P&gt;   &lt;H2 class=sect1&gt;&lt;A class=title name=AUTOID-2070&gt;Summary&lt;/A&gt;&lt;/H2&gt;   &lt;P class=para&gt;You can put and keep files under source control with RCS by    using only two commands, &lt;EM class=emphasis&gt;ci&lt;/EM&gt; and &lt;EM    class=emphasis&gt;co&lt;/EM&gt;. This simplicity is a strong point of the system. We've    also introduced the &lt;KBD class=command&gt;rcs&lt;/KBD&gt; command to abort a pending    modification to an RCS file and informational commands &lt;EM    class=emphasis&gt;rcsdiff&lt;/EM&gt; and &lt;EM class=emphasis&gt;rlog&lt;/EM&gt;, which give you    detailed information about the contents of an RCS file. Finally, we presented    &lt;EM class=emphasis&gt;rcsclean&lt;/EM&gt; to remove unmodified working files.&lt;/P&gt;   &lt;P class=para&gt;&lt;A class=xref    href="http://www.oreilly.com/catalog/rcs/chapter/ch03.html#RCS-CHP-3-TAB-2"&gt;Table    3.2&lt;/A&gt; summarizes our presentation so far, by relating each operation in the    source file modification cycle (plus a few other basic ones) to the RCS    command that implements it.&lt;/P&gt;   &lt;TABLE class=table cellPadding=3 border=1&gt;     &lt;CAPTION class=table&gt;&lt;A class=title name=RCS-CHP-3-TAB-2&gt;Table 3.2: Basic      RCS Commands&lt;/A&gt;&lt;/CAPTION&gt;     &lt;THEAD class=thead&gt;     &lt;TR class=row vAlign=top&gt;       &lt;TH class=entry align=left&gt;Command&lt;/TH&gt;       &lt;TH class=entry align=left&gt;Basic Operation&lt;/TH&gt;&lt;/TR&gt;&lt;/THEAD&gt;     &lt;TBODY class=tbody&gt;     &lt;TR class=row vAlign=top&gt;       &lt;TD class=entry&gt;&lt;B class=emphasis.bold&gt;ci&lt;/B&gt;&lt;/TD&gt;       &lt;TD class=entry&gt;Creating an archive file&lt;/TD&gt;&lt;/TR&gt;     &lt;TR class=row vAlign=top&gt;       &lt;TD class=entry&gt;&lt;B class=emphasis.bold&gt;co&lt;/B&gt;&lt;/TD&gt;       &lt;TD class=entry&gt;Getting a working file for reading&lt;/TD&gt;&lt;/TR&gt;     &lt;TR class=row vAlign=top&gt;       &lt;TD class=entry&gt;&lt;B class=emphasis.bold&gt;co -l&lt;/B&gt;&lt;/TD&gt;       &lt;TD class=entry&gt;Getting a working file for modification&lt;/TD&gt;&lt;/TR&gt;     &lt;TR class=row vAlign=top&gt;       &lt;TD class=entry&gt;&lt;B class=emphasis.bold&gt;rcsdiff&lt;/B&gt;&lt;/TD&gt;       &lt;TD class=entry&gt;Comparing a working file to its RCS file&lt;/TD&gt;&lt;/TR&gt;     &lt;TR class=row vAlign=top&gt;       &lt;TD class=entry&gt;&lt;B class=emphasis.bold&gt;ci&lt;/B&gt;&lt;/TD&gt;       &lt;TD class=entry&gt;Adding a working file to an RCS file&lt;/TD&gt;&lt;/TR&gt;     &lt;TR class=row vAlign=top&gt;       &lt;TD class=entry&gt;&lt;B class=emphasis.bold&gt;rcs -u&lt;/B&gt; plus &lt;B          class=emphasis.bold&gt;rm&lt;/B&gt;&lt;/TD&gt;       &lt;TD class=entry&gt;Discarding a working file&lt;/TD&gt;&lt;/TR&gt;     &lt;TR class=row vAlign=top&gt;       &lt;TD class=entry&gt;&lt;B class=emphasis.bold&gt;rlog&lt;/B&gt;&lt;/TD&gt;       &lt;TD class=entry&gt;Viewing the history of an RCS file&lt;/TD&gt;&lt;/TR&gt;     &lt;TR class=row vAlign=top&gt;       &lt;TD class=entry&gt;&lt;B class=emphasis.bold&gt;rcsclean&lt;/B&gt;&lt;/TD&gt;       &lt;TD class=entry&gt;Cleaning up a source directory&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;   &lt;P class=para&gt;Remember, too, that all of these commands employ an intelligent    command-line interface that fairly well balances simplicity and flexibility    and can provide an advantage over SCCS. That said, let's see what SCCS has to    offer. &lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;!-- End of sample chapter --&gt; &lt;P&gt; &lt;CENTER&gt;&lt;FONT face="Verdana, Arial, Helvetica" size=1&gt;&lt;/FONT&gt;&lt;/CENTER&gt;&lt;!-- O'Reilly Footer Ends Here --&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/714742118606354868-3990806091560179443?l=unixtechtips.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unixtechtips.blogspot.com/feeds/3990806091560179443/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=714742118606354868&amp;postID=3990806091560179443&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/714742118606354868/posts/default/3990806091560179443'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/714742118606354868/posts/default/3990806091560179443'/><link rel='alternate' type='text/html' href='http://unixtechtips.blogspot.com/2007/06/basic-source-control-using-rcs.html' title='Basic Source Control Using RCS'/><author><name>HuggyPuggy</name><uri>http://www.blogger.com/profile/04602550959022896368</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='10800658094938042256'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-714742118606354868.post-5625220278710312650</id><published>2007-04-02T02:28:00.001-07:00</published><updated>2007-04-02T02:28:25.880-07:00</updated><title type='text'>Understanding Virtual Memory -Linux</title><content type='html'>&lt;H1&gt;Understanding Virtual Memory&lt;/H1&gt; &lt;H4 class=byline&gt;by Norm Murray and Neil Horman&lt;/H4&gt; &lt;UL id=articleMenu&gt;   &lt;LI&gt;&lt;SPAN class=sect1&gt;&lt;A    href="http://www.redhat.com/magazine/001nov04/features/vm/#intro"&gt;Introduction&lt;/A&gt;    &lt;/SPAN&gt;   &lt;LI&gt;&lt;SPAN class=sect1&gt;&lt;A    href="http://www.redhat.com/magazine/001nov04/features/vm/#definitions"&gt;Definitions&lt;/A&gt;    &lt;/SPAN&gt;   &lt;LI&gt;&lt;SPAN class=sect1&gt;&lt;A    href="http://www.redhat.com/magazine/001nov04/features/vm/#life-page"&gt;The Life    of a Page&lt;/A&gt; &lt;/SPAN&gt;   &lt;LI&gt;&lt;SPAN class=sect1&gt;&lt;A    href="http://www.redhat.com/magazine/001nov04/features/vm/#tuning-vm"&gt;Tuning    the VM&lt;/A&gt; &lt;/SPAN&gt;   &lt;LI&gt;&lt;SPAN class=sect1&gt;&lt;A    href="http://www.redhat.com/magazine/001nov04/features/vm/#example-scenarios"&gt;Example    Scenarios&lt;/A&gt; &lt;/SPAN&gt;   &lt;LI&gt;&lt;SPAN class=sect1&gt;&lt;A    href="http://www.redhat.com/magazine/001nov04/features/vm/#further-reading"&gt;Further    Reading&lt;/A&gt; &lt;/SPAN&gt;   &lt;LI&gt;&lt;SPAN class=sect1&gt;&lt;A    href="http://www.redhat.com/magazine/001nov04/features/vm/#author"&gt;About the    Author&lt;/A&gt; &lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt; &lt;H2 id=intro&gt;Introduction&lt;/H2&gt; &lt;P&gt;One of the most important aspects of an operating system is the Virtual  Memory Management system. Virtual Memory (VM) allows an operating system to  perform many of its advanced functions, such as process isolation, file caching,  and swapping. As such, it is imperative that an administrator understand the  functions and tunable parameters of an operating system's Virtual Memory Manager  so that optimal performance for a given workload may be achieved. After reading  this article, the reader should have a rudimentary understanding of the data the  Red Hat Enterprise Linux (RHEL3) VM controls and the algorithms it uses.  Further, the reader should have a fairly good understanding of general Linux VM  tuning techniques. It is important to note that Linux as an operating system has  a proud legacy of overhaul. Items which no longer serve useful purposes or which  have better implementations as technology advances are phased out. This implies  that the tuning parameters described in this article may be out of date if you  are using a newer or older kernel. Fear not however! With a well grounded  understanding of the general mechanics of a VM, it is fairly easy to convert  knowledge of VM tuning to another VM. The same general principles apply, and  documentation for a given kernel (including its specific tunable parameters) can  be found in the corresponding kernel source tree under the file &lt;CODE  class=filename&gt;Documentation/sysctl/vm.txt&lt;/CODE&gt;.&lt;/P&gt; &lt;H2 id=definitions&gt;Definitions&lt;/H2&gt; &lt;P&gt;To properly understand how a Virtual Memory Manager does its job, it helps to  understand what components comprise a VM. While the low level view of a VM are  overwhelming for most, a high level view is necessary to understand how a VM  works and how it can be optimized for workloads.&lt;/P&gt; &lt;H3 id=what-comprises&gt;What Comprises a VM&lt;/H3&gt;&lt;A id=fig-vm-toplevel  name=fig-vm-toplevel&gt;&lt;/A&gt; &lt;DIV class=mediaobject&gt;&lt;IMG alt="High Level Overview of VM Subsystem"  src="http://www.redhat.com/magazine/001nov04/features/vm/figs/vm-toplevel.png"&gt;  &lt;/DIV&gt; &lt;DIV class=caption&gt;Figure 1. High Level Overview of VM Subsystem&lt;/DIV&gt; &lt;P&gt;The inner workings of the Linux virtual memory subsystem are quite complex,  but it can be defined at a high level with the following components:&lt;/P&gt; &lt;H4 id=mmu&gt;MMU&lt;/H4&gt; &lt;P&gt;The Memory Management Unit (MMU) is the hardware base that makes a VM system  possible. The MMU allows software to reference physical memory by aliased  addresses, quite often more than one. It accomplishes this through the use of  pages and page tables. The MMU uses a section of memory to translate virtual  addresses into physical addresses via a series of table lookups.&lt;/P&gt; &lt;H4 id=zoned-buddy-allocator&gt;Zoned Buddy Allocator&lt;/H4&gt; &lt;P&gt;The Zoned Buddy Allocator is responsible for the management of page  allocations to the entire system. This code manages lists of physically  contiguous pages and maps them into the MMU page tables, so as to provide other  kernel subsystems with valid physical address ranges when the kernel requests  them (Physical to Virtual Address mapping is handled by a higher layer of the  VM). The name Buddy Allocator is derived from the algorithm this subsystem uses  to maintain it free page lists. All physical pages in RAM are cataloged by the  Buddy Allocator and grouped into lists. Each list represents clusters of 2n  pages, where n is incremented in each list. If no entries exist on the requested  list, an entry from the next list up is broken into two separate clusters and is  returned to the caller while the other is added to the next list down. When an  allocation is returned to the buddy allocator, the reverse process happens. Note  that the Buddy Allocator also manages memory zones, which define pools of memory  which have different purposes. Currently there are three memory pools which the  Buddy Allocator manages accesses for:&lt;/P&gt; &lt;UL&gt;   &lt;LI&gt;   &lt;P&gt;DMA &amp;#8212; This zone consists of the first 16 MB of RAM, from which legacy    devices allocate to perform direct memory operations.&lt;/P&gt;   &lt;LI&gt;   &lt;P&gt;NORMAL &amp;#8212; This zone encompasses memory addresses from 16 MB to 1 GB and is    used by the kernel for internal data structures as well as other system and    user space allocations.&lt;/P&gt;   &lt;LI&gt;   &lt;P&gt;HIGHMEM &amp;#8212; This zone includes all memory above 1 GB and is used exclusively    for system allocations (file system buffers, user space allocations,    etc).&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt; &lt;H4 id=slab-allocator&gt;Slab Allocator&lt;/H4&gt; &lt;P&gt;The Slab Allocator provides a more usable front end to the Buddy Allocator  for those sections of the kernel which require memory in sizes that are more  flexible than the standard 4 KB page. The Slab Allocator allows other kernel  components to create caches of memory objects of a given size. The Slab  Allocator is responsible for placing as many of the cache's objects on a page as  possible and monitoring which objects are free and which are allocated. When  allocations are requested and no more are available, the Slab Allocator requests  more pages from the Buddy Allocator to satisfy the request. This allows kernel  components to use memory in a much simpler way. This way components which make  use of many small portions of memory are not required to individually implement  memory management code so that too many pages are not wasted. The Slab Allocator  may only allocate from the DMA and NORMAL zones.&lt;/P&gt; &lt;H3 id=kernel-threads&gt;Kernel Threads&lt;/H3&gt; &lt;P&gt;The last component in the VM subsystem are the kernel threads: &lt;CODE  class=filename&gt;kscand&lt;/CODE&gt;, &lt;CODE class=filename&gt;kswapd&lt;/CODE&gt;, &lt;CODE  class=filename&gt;kupdated&lt;/CODE&gt;, and &lt;CODE class=filename&gt;bdflush&lt;/CODE&gt;. These  tasks are responsible for the recovery and management of in use memory. All  pages of memory have an associated state (for more information on the memory  state machine, refer to &lt;A title="The Life of a Page"  href="http://www.redhat.com/magazine/001nov04/features/vm/#life-page"&gt;the  section called &amp;#8220;The Life of a Page&amp;#8221;&lt;/A&gt; section. In general, the active tasks in  the kernel related to VM usage are responsible for attempting to move pages out  of RAM. Periodically they examine RAM, trying to identify and free inactive  memory so that it can be put to other uses in the system.&lt;/P&gt; &lt;H2 id=life-page&gt;The Life of a Page&lt;/H2&gt; &lt;P&gt;All of the memory managed by the VM is labeled by a state. These states help  let the VM know what to do with a given page under various circumstances.  Dependent on the current needs of the system, the VM may transfer pages from one  state to the next, according to the state machine in &lt;A  title="Figure 2. VM Page State Machine"  href="http://www.redhat.com/magazine/001nov04/features/vm/#vm-page-state-machine"&gt;Figure  2. &amp;#8220;VM Page State Machine&amp;#8221;&lt;/A&gt;. Using these states, the VM can determine what is  being done with a page by the system at a given time and what actions the VM may  take on the page. The states that have particular meanings are as follows: &lt;/P&gt; &lt;OL&gt;   &lt;LI&gt;   &lt;P&gt;FREE &amp;#8212; All pages available for allocation begin in this state. This    indicates to the VM that the page is not being used for any purpose and is    available for allocation.&lt;/P&gt;   &lt;LI&gt;   &lt;P&gt;ACTIVE &amp;#8212; Pages which have been allocated from the Buddy Allocator enter    this state. It indicates to the VM that the page has been allocated and is    actively in use by the kernel or a user process. &lt;/P&gt;   &lt;LI&gt;   &lt;P&gt;INACTIVE DIRTY &amp;#8212; This state indicates that the page has fallen into disuse    by the entity which allocated it and thus is a candidate for removal from main    memory. The &lt;CODE class=filename&gt;kscand&lt;/CODE&gt; task periodically sweeps    through all the pages in memory, taking note of the amount of time the page    has been in memory since it was last accessed. If &lt;CODE    class=filename&gt;kscand&lt;/CODE&gt; finds that a page has been accessed since it last    visited the page, it increments the page's age counter; otherwise, it    decrements that counter. If &lt;CODE class=filename&gt;kscand&lt;/CODE&gt; finds a page    with its age counter at zero, it moves the page to the inactive dirty state.    Pages in the inactive dirty state are kept in a list of pages to be    laundered.&lt;/P&gt;   &lt;LI&gt;   &lt;P&gt;INACTIVE LAUNDERED &amp;#8212; This is an interim state in which those pages which    have been selected for removal from main memory enter while their contents are    being moved to disk. Only pages which were in the inactive dirty state can    enter this state. When the disk I/O operation is complete, the page is moved    to the inactive clean state, where it may be deallocated or overwritten for    another purpose. If, during the disk operation, the page is accessed, the page    is moved back into the active state.&lt;/P&gt;   &lt;LI&gt;   &lt;P&gt;INACTIVE CLEAN &amp;#8212; Pages in this state have been laundered. This means that    the contents of the page are in sync with the backed up data on disk. Thus,    they may be deallocated by the VM or overwritten for other  purposes.&lt;/P&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;A id=vm-page-state-machine  name=vm-page-state-machine&gt;&lt;/A&gt; &lt;DIV class=mediaobject&gt;&lt;IMG alt="VM Page State Machine"  src="http://www.redhat.com/magazine/001nov04/features/vm/figs/vm-state-machine.png"&gt;  &lt;/DIV&gt; &lt;DIV class=caption&gt;Figure 2. VM Page State Machine&lt;/DIV&gt; &lt;H2 id=tuning-vm&gt;Tuning the VM&lt;/H2&gt; &lt;P&gt;Now that the picture of the VM mechanism is sufficiently illustrated, how is  it adjusted to fit certain workloads? There are two methods for changing tunable  parameters in the Linux VM. The first is the sysctl interface. The sysctl  interface is a programming oriented interface, which allows software programs to  modify various tunable parameters directly. It is exported to system  administrators via the sysctl utility, which allows an administrator to specify  a value for any of the tunable VM parameters via the command line. For example:  &lt;/P&gt;&lt;PRE&gt;&lt;CODE class=command&gt;sysctl -w vm.max map count=65535&lt;/CODE&gt; &lt;/PRE&gt; &lt;P&gt;The sysctl utility also supports the use of a configuration file (&lt;CODE  class=filename&gt;/etc/sysctl.conf&lt;/CODE&gt;), in which all the desirable changes to a  VM can be recorded for a system and restored after a restart of the operating  system, making this access method suitable for long term changes to a system VM.  The file is straightforward in its layout, using simple key-value pairs with  comments for clarity. For example:&lt;/P&gt;&lt;PRE&gt;&lt;TT class=computeroutput&gt; #Adjust the min and max read-ahead for files vm.max-readahead=64 vm.min-readahead=32 #turn on memory over-commit  vm.overcommit_memory=2 #bump up the percentage of memory in use to activate bdflush vm.bdflush="40 500 0 0 500 3000 60 20 0" &lt;/TT&gt; &lt;/PRE&gt; &lt;P&gt;The second method of modifying VM tunable parameters is via the proc file  system. This method exports every group of VM tunables as a virtual file,  accessible via all the common Linux utilities used for modifying file contents.  The VM tunables are available in the directory &lt;CODE  class=filename&gt;/proc/sys/vm/&lt;/CODE&gt; and are most commonly read and modified  using the &lt;CODE class=command&gt;cat&lt;/CODE&gt; and &lt;CODE class=command&gt;echo&lt;/CODE&gt;  commands. For example, use the command &lt;CODE class=command&gt;cat  /proc/sys/vm/kswapd&lt;/CODE&gt; to view the current value of the &lt;CODE  class=filename&gt;kswapd&lt;/CODE&gt; tunable. The output should be similar to:&lt;/P&gt;&lt;PRE&gt;&lt;TT class=computeroutput&gt; 512 32 8 &lt;/TT&gt; &lt;/PRE&gt; &lt;P&gt;Then, use the following command to modify the value of the tunable: &lt;/P&gt;&lt;PRE&gt;&lt;CODE class=command&gt;echo 511 31 7 &amp;gt; /proc/sys/vm/kswapd&lt;/CODE&gt; &lt;/PRE&gt; &lt;P&gt;Use the &lt;CODE class=command&gt;cat /proc/sys/vm/kswapd&lt;/CODE&gt; command again to  verify that the value was modified. The output should be:&lt;/P&gt;&lt;PRE&gt;&lt;TT class=computeroutput&gt; 511 31 7 &lt;/TT&gt; &lt;/PRE&gt; &lt;P&gt;The proc file system interface is a convenient method for making adjustments  to the VM while attempting to isolate the peak performance of a system. For  convenience, the following sections list the VM tunable parameters as the  filenames they are exported to in the &lt;CODE class=filename&gt;/proc/sys/vm/&lt;/CODE&gt;  directory. Unless otherwise noted, these tunables apply to the RHEL3 2.4.21-4  kernel.&lt;/P&gt; &lt;H3 id=bdflush&gt;bdflush&lt;/H3&gt; &lt;P&gt;The &lt;CODE class=filename&gt;bdflush&lt;/CODE&gt; file contains 9 parameters, of which  6 are tunable. These parameters affect the rate at which pages in the buffer  cache (the subset of pagecache which stores files in memory) are freed and  returned to disk. By adjusting the various values in this file, a system can be  tuned to achieve better performance in environments where large amounts of file  I/O are performed. &lt;A title="Table 1. bdflush Parameters"  href="http://www.redhat.com/magazine/001nov04/features/vm/#bdflush-params"&gt;Table  1. &amp;#8220;bdflush Parameters&amp;#8221;&lt;/A&gt; defines the parameters for &lt;CODE  class=filename&gt;bdflush&lt;/CODE&gt; in the order they appear in the file.&lt;/P&gt;&lt;A  id=bdflush-params name=bdflush-params&gt;&lt;/A&gt; &lt;TABLE class=basic4 cellSpacing=0 summary="bdflush Parameters"&gt;   &lt;COLGROUP&gt;   &lt;COL&gt;   &lt;COL&gt;&lt;/COLGROUP&gt;   &lt;THEAD&gt;   &lt;TR&gt;     &lt;TH&gt;Parameter&lt;/TH&gt;     &lt;TH&gt;Description&lt;/TH&gt;&lt;/TR&gt;&lt;/THEAD&gt;   &lt;TBODY&gt;   &lt;TR&gt;     &lt;TD&gt;&lt;CODE class=filename&gt;nfract&lt;/CODE&gt; &lt;/TD&gt;     &lt;TD&gt;The percentage of dirty pages in the buffer cache required to activate        the &lt;CODE class=filename&gt;bdflush&lt;/CODE&gt; task&lt;/TD&gt;&lt;/TR&gt;   &lt;TR&gt;     &lt;TD&gt;&lt;CODE class=filename&gt;ndirty&lt;/CODE&gt; &lt;/TD&gt;     &lt;TD&gt;The maximum number of dirty pages in the buffer cache to write to disk        in each &lt;CODE class=filename&gt;bdflush&lt;/CODE&gt; execution&lt;/TD&gt;&lt;/TR&gt;   &lt;TR&gt;     &lt;TD&gt;&lt;CODE class=filename&gt;reserved1&lt;/CODE&gt; &lt;/TD&gt;     &lt;TD&gt;Reserved for future use&lt;/TD&gt;&lt;/TR&gt;   &lt;TR&gt;     &lt;TD&gt;&lt;CODE class=filename&gt;reserved2&lt;/CODE&gt; &lt;/TD&gt;     &lt;TD&gt;Reserved for future&lt;/TD&gt;&lt;/TR&gt;   &lt;TR&gt;     &lt;TD&gt;&lt;CODE class=filename&gt;interval&lt;/CODE&gt; &lt;/TD&gt;     &lt;TD&gt;The number of jiffies (10ms periods) to delay between &lt;CODE        class=filename&gt;bdflush&lt;/CODE&gt; iterations&lt;/TD&gt;&lt;/TR&gt;   &lt;TR&gt;     &lt;TD&gt;&lt;CODE class=filename&gt;age_buffer&lt;/CODE&gt; &lt;/TD&gt;     &lt;TD&gt;The time for a normal buffer to age before it is considered for        flushing back to disk &lt;/TD&gt;&lt;/TR&gt;   &lt;TR&gt;     &lt;TD&gt;&lt;CODE class=filename&gt;nfract_sync&lt;/CODE&gt; &lt;/TD&gt;     &lt;TD&gt;The percentage of dirty pages in the buffer cache required to cause        the tasks which are writing pages of memory to begin writing those pages        to disk instead&lt;/TD&gt;&lt;/TR&gt;   &lt;TR&gt;     &lt;TD&gt;&lt;CODE class=filename&gt;nfract_stop_bdflush&lt;/CODE&gt; &lt;/TD&gt;     &lt;TD&gt;The percentage of dirty pages in buffer cache required to allow &lt;CODE        class=filename&gt;bdflush&lt;/CODE&gt; to return to idle state&lt;/TD&gt;&lt;/TR&gt;   &lt;TR&gt;     &lt;TD&gt;&lt;CODE class=filename&gt;reserved3&lt;/CODE&gt; &lt;/TD&gt;     &lt;TD&gt;Reserved for future use&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt; &lt;DIV class=caption&gt;Table 1. &lt;CODE class=filename&gt;bdflush&lt;/CODE&gt; Parameters&lt;/DIV&gt; &lt;P&gt;Generally, systems that require more free memory for application allocation  want to set the &lt;CODE class=filename&gt;bdflush&lt;/CODE&gt; values higher (except for  the &lt;CODE class=filename&gt;age_buffer&lt;/CODE&gt;, which would be moved lower), so that  file data is sent to disk more frequently and in greater volume, thus freeing up  pages of RAM for application use. This, of course, comes at the expense of CPU  cycles because the system processor spends more time moving data to disk and  less time running applications. Conversely, systems which are required to  perform large amounts of I/O would want to do the opposite to these values,  allowing more RAM to be used to cache disk file so that file access is faster.  &lt;/P&gt; &lt;H3 id=dcache-priority&gt;dcache_priority&lt;/H3&gt; &lt;P&gt;This file controls the bias of the priority for caching directory contents.  When the system is under stress, it selectively reduces the size of various file  system caches in an effort to reclaim memory. By increasing this value, memory  reclamation bias is shifted away from the dirent cache. By reducing this amount,  the bias is shifted towards reclaiming dirent memory. This is not a particularly  useful tuning parameter, but it can be helpful in maintaining the interactive  response time on an otherwise heavily loaded system. If you experience  intolerable delays in communicating with your system when it is busy performing  other work, increasing this parameter may help.&lt;/P&gt; &lt;H3 id=hugetlb&gt;hugetlb_pool&lt;/H3&gt; &lt;P&gt;The &lt;CODE class=filename&gt;hugetlb_pool&lt;/CODE&gt; file is responsible for  recording the number of megabytes used for huge pages. Huge pages are just like  regular pages in the VM, only they are an order of magnitude larger. Note also  that huge pages are not swappable. Huge pages are both beneficial and  detrimental to a system. They are helpful in that each huge page takes only one  set of entries in the VM page tables, which allows for a higher degree of  virtual address caching in the TLB (Translation Look-aside Buffer: A device  which caches virtual address translations for faster lookups) and a requisite  performance improvement. On the downside, they are very large and can be  wasteful of memory resources for those applications which do not need large  amounts of memory. Some applications, however, do require large amounts of  memory and can make good use of huge pages if they are written to be aware of  them. If a system is running applications which require large amounts of memory  and is aware of this feature, then it is advantageous to increase this value to  an amount satisfactory to that application or set of applications.&lt;/P&gt; &lt;H3 id=inactive-clean-percent&gt;inactive_clean_percent&lt;/H3&gt; &lt;P&gt;This control specifies the minimum percentage of pages in each page zone that  must be in the clean or laundered state. If any zone drops below this threshold,  and the system is under pressure for more memory, then that zone will begin  having its inactive dirty pages laundered. Note that this control is only  available on the 2.4.21-5EL kernels forward. Raising the value for the  corresponding zone which is memory starved causes pages to be paged out more  quickly, eliminating memory starvation at the expense of CPU clock cycles.  Lowering this number allows more data to remain in RAM, increasing the system  performance but at the risk of memory starvation.&lt;/P&gt; &lt;H3 id=kswapd&gt;kswapd&lt;/H3&gt; &lt;P&gt;While this set of parameters previously defined how frequently and in what  volume a system moved non-buffer cache pages to disk, in Red Hat Enterprise  Linux 3, these controls are unused.&lt;/P&gt; &lt;H3 id=max-map-count&gt;max_map_count&lt;/H3&gt; &lt;P&gt;The &lt;CODE class=filename&gt;max_map_count&lt;/CODE&gt; file allows for the restriction  of the number of VMAs (Virtual Memory Areas) that a particular process can own.  A Virtual Memory Area is a contiguous area of virtual address space. These areas  are created during the life of the process when the program attempts to memory  map a file, links to a shared memory segment, or allocates heap space. Tuning  this value limits the amount of these VMAs that a process can own. Limiting the  amount of VMAs a process can own can lead to problematic application behavior  because the system will return out of memory errors when a process reaches its  VMA limit but can free up lowmem for other kernel uses. If your system is  running low on memory in the NORMAL zone, then lowering this value will help  free up memory for kernel use.&lt;/P&gt; &lt;H3 id=max-readahead&gt;max-readahead&lt;/H3&gt; &lt;P&gt;The &lt;CODE class=filename&gt;max-readahead&lt;/CODE&gt; tunable affects how early the  Linux VFS (Virtual File System) fetches the next block of a file from memory.  File readahead values are determined on a per file basis in the VFS and are  adjusted based on the behavior of the application accessing the file. Anytime  the current position being read in a file plus the current read ahead value  results in the file pointer pointing to the next block in the file, that block  is fetched from disk. By raising this value, the Linux kernel allows the  readahead value to grow larger, resulting in more blocks being prefetched from  disks which predictably access files in uniform linear fashion. This can result  in performance improvements but can also result in excess (and often  unnecessary) memory usage. Lowering this value has the opposite affect. By  forcing readaheads to be less aggressive, memory may be conserved at a potential  performance impact.&lt;/P&gt; &lt;H3 id=min-readahead&gt;min-readahead&lt;/H3&gt; &lt;P&gt;Like &lt;CODE class=filename&gt;max-readahead&lt;/CODE&gt;, &lt;CODE  class=filename&gt;min-readahead&lt;/CODE&gt; places a floor on the readahead value.  Raising this number forces a file's readahead value to be unconditionally  higher, which can bring about performance improvements provided that all file  access in the system is predictably linear from the start to the end of a file.  This, of course, results in higher memory usage from the pagecache. Conversely,  lowering this value, allows the kernel to conserve pagecache memory at a  potential performance cost.&lt;/P&gt; &lt;H3 id=overcommit-memory&gt;overcommit_memory&lt;/H3&gt; &lt;P&gt;&lt;CODE class=filename&gt;overcommit_memory&lt;/CODE&gt; is a value which sets the  general kernel policy toward granting memory allocations. If the value is 0,  then the kernel checks to determine if there is enough memory free to grant a  memory request to a malloc call from an application. If there is enough memory,  then the request is granted. Otherwise, it is denied and an error code is  returned to the application. If the setting in this file is 1, the kernel allows  all memory allocations, regardless of the current memory allocation state. If  the value is set to 2, then the kernel grants allocations above the amount of  physical RAM and swap in the system as defined by the &lt;CODE  class=filename&gt;overcommit_ratio&lt;/CODE&gt; value. Enabling this feature can be  somewhat helpful in environments which allocate large amounts of memory  expecting worst case scenarios but do not use it all.&lt;/P&gt; &lt;H3 id=overcommit-ratio&gt;overcommit_ratio&lt;/H3&gt; &lt;P&gt;The &lt;CODE class=filename&gt;overcommit_ratio&lt;/CODE&gt; tunable defines the amount  by which the kernel overextends its memory resources in the event that &lt;CODE  class=filename&gt;overcommit_memory&lt;/CODE&gt; is set to the value of 2. The value in  this file represents a percentage added to the amount of actual RAM in a system  when considering whether to grant a particular memory request. For instance, if  this value is set to 50, then the kernel would treat a system with 1 GB of RAM  and 1 GB of swap as a system with 2.5 GB of allocatable memory when considering  whether to grant a malloc request from an application. The general formula for  this tunable is:&lt;/P&gt;&lt;PRE&gt;allocatable memory=(swap size + (RAM size * overcommit ratio)) &lt;/PRE&gt; &lt;P&gt;Use these previous two parameters with caution. Enabling &lt;CODE  class=filename&gt;overcommit_memory&lt;/CODE&gt; can create significant performance gains  at little cost but only if your applications are suited to its use. If your  applications use all of the memory they allocate, memory overcommit can lead to  short performance gains followed by long latencies as your applications are  swapped out to disk frequently when they must compete for oversubscribed RAM.  Also, ensure that you have at least enough swap space to cover the  overallocation of RAM (meaning that your swap space should be at least big  enough to handle the percentage if overcommit in addition to the regular 50  percent of RAM that is normally recommended).&lt;/P&gt; &lt;H3 id=pagecache&gt;pagecache&lt;/H3&gt; &lt;P&gt;The &lt;CODE class=filename&gt;pagecache&lt;/CODE&gt; file adjusts the amount of RAM  which can be used by the page cache. The page cache holds various pieces of  data, such as open files from disk, memory mapped files, and pages of executable  programs. Modifying the values in this file dictates how much of memory is used  for this purpose. &lt;A title="Table 2. pagecache Parameters"  href="http://www.redhat.com/magazine/001nov04/features/vm/#pagecache-parameters"&gt;Table  2. &amp;#8220;pagecache Parameters&amp;#8221;&lt;/A&gt; defines the parameters for pagecache in the order  they appear in the file.&lt;/P&gt;&lt;A id=pagecache-parameters  name=pagecache-parameters&gt;&lt;/A&gt; &lt;TABLE class=basic4 cellSpacing=0 summary="pagecache Parameters"&gt;   &lt;COLGROUP&gt;   &lt;COL&gt;   &lt;COL&gt;&lt;/COLGROUP&gt;   &lt;THEAD&gt;   &lt;TR&gt;     &lt;TH&gt;Parameter&lt;/TH&gt;     &lt;TH&gt;Description&lt;/TH&gt;&lt;/TR&gt;&lt;/THEAD&gt;   &lt;TBODY&gt;   &lt;TR&gt;     &lt;TD&gt;&lt;CODE class=filename&gt;min&lt;/CODE&gt; &lt;/TD&gt;     &lt;TD&gt;The minimum amount of memory to reserve for pagecache use.&lt;/TD&gt;&lt;/TR&gt;   &lt;TR&gt;     &lt;TD&gt;&lt;CODE class=filename&gt;borrow&lt;/CODE&gt; &lt;/TD&gt;     &lt;TD&gt;The percentage of pagecache pages &lt;CODE class=filename&gt;kswapd&lt;/CODE&gt;        uses to balance the reclaiming of pagecache pages and process  memory.&lt;/TD&gt;&lt;/TR&gt;   &lt;TR&gt;     &lt;TD&gt;&lt;CODE class=filename&gt;max&lt;/CODE&gt; &lt;/TD&gt;     &lt;TD&gt;If more memory than this percentage is used by pagecache, &lt;CODE        class=filename&gt;kswapd&lt;/CODE&gt; only evicts pages from the pagecache. Once        the amount of memory in pagecache is below this threshold, &lt;CODE        class=filename&gt;kswapd&lt;/CODE&gt; begins moving process pages to swap    again.&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt; &lt;DIV class=caption&gt;Table 2. &lt;CODE class=filename&gt;pagecache&lt;/CODE&gt;  Parameters&lt;/DIV&gt; &lt;P&gt;Increasing these values allows more programs and cached files to stay in  memory longer, thereby allowing applications to execute more quickly. On memory  starved systems, however, this may lead to application delays as processes must  wait for memory to become available. Moving these values downward swaps  processes and other disk-backed data out more quickly, allowing for other  processes to obtain memory more easily and increasing execution speed. For most  workloads the automatic tuning is sufficient. However, if your workload suffers  from excessive swapping and a large cache, you may want to reduce the values  until the swapping problem goes away.&lt;/P&gt; &lt;H3 id=page-cluster&gt;page-cluster&lt;/H3&gt; &lt;P&gt;The kernel attempts to read multiple pages from disk on a page fault to avoid  excessive seeks on the hard drive. This parameter defines the number of pages  the kernel tries to read from memory during each page fault. The value is  interpreted as 2&lt;SUP&gt;page-cluster&lt;/SUP&gt; pages for each page fault. A page fault  is encountered every time a virtual memory address is accessed for which there  is not yet a corresponding physical page assigned or for which the corresponding  physical page has been swapped to disk. If the memory address has been requested  in a valid way (for example, the application contains the address in its virtual  memory map), then the kernel associates a page of RAM with the address or  retrieves the page from disk and places it back in RAM. Then the kernel restarts  the application from where it left off. By increasing the &lt;CODE  class=filename&gt;page-cluster&lt;/CODE&gt; value, pages subsequent to the requested page  are also retrieved, meaning that if the workload of a particular system accesses  data in RAM in a linear fashion, increasing this parameter can provide  significant performance gains (much like the file readahead parameters described  earlier). Of course if your workload accesses data discreetly in many separate  areas of memory, then this can just as easily cause performance degradation.&lt;/P&gt; &lt;H2 id=example-scenarios&gt;Example Scenarios&lt;/H2&gt; &lt;P&gt;Now that we have covered the details of kernel tuning, let us look at some  example workloads and the various tuning parameters that may improve system  performance.&lt;/P&gt; &lt;H3 id=file-server&gt;File (IMAP, Web, etc.) Server&lt;/H3&gt; &lt;P&gt;This workload is geared towards performing a large amount of I/O to and from  the local disk, thus benefiting from an adjustment allowing more files to be  maintained in RAM. This speeds up I/O by caching more files in RAM and  eliminating the need to wait for disk I/O to complete. A simple change to &lt;CODE  class=filename&gt;sysctl.conf&lt;/CODE&gt; as follows usually benefits this workload:  &lt;/P&gt;&lt;PRE&gt;&lt;TT class=computeroutput&gt; #increase the amount of RAM pagecache is allowed to use  #before we start moving it back to disk  vm.pagecache="10 40 100" &lt;/TT&gt; &lt;/PRE&gt; &lt;H3 id=general-compute-server&gt;General Compute Server With Many Active Users&lt;/H3&gt; &lt;P&gt;This workload is a very general type of configuration. It involves many  active users who likely run many processes, all of which may or may not be CPU  intensive or I/O intensive or a combination thereof. As the default VM  configuration attempts to find a balance between I/O and process memory usage,  it may be best to leave most configuration settings alone in this case. However,  this environment likely contains many small processes which, regardless of  workload, consume memory resources, particularly lowmem. It may help, therefore,  to tune the VM to conserve low memory resources when possible:&lt;/P&gt;&lt;PRE&gt;&lt;TT class=computeroutput&gt; #lower the pagecache max to keep from eating all memory up with cache  vm.pagecache=10 25 50  #lower max-readahead to reduce the amount of unneeded IO  vm.max-readahead=16 &lt;/TT&gt; &lt;/PRE&gt; &lt;H3 id=batch-computing-server&gt;Non interactive (Batch) Computing Server&lt;/H3&gt; &lt;P&gt;A batch computing server is usually the exact opposite of a file server.  Applications run without human interaction, and they commonly perform with  little I/O. The number of processes running on controlled. Consequently this  system should allow maximum throughput:&lt;/P&gt;&lt;PRE&gt;&lt;TT class=computeroutput&gt; #Reduce the amount of pagecache normally allowed vm.pagecache="1 10 100" #do not worry about conserving lowmem, not that many processes vm.max_map_count=128000 14 #crank up overcommit, processes can sleep as they are not interactive vm.overcommit=2  vm.overcommit_ratio=75 &lt;/TT&gt; &lt;/PRE&gt; &lt;H2 id=further-reading&gt;Further Reading&lt;/H2&gt; &lt;OL&gt;   &lt;LI&gt;   &lt;P&gt;&lt;I class=citetitle&gt;Understanding the Linux Kernel&lt;/I&gt; by Daniel Bovet and    Marco Cesati (O'Reilly &amp;amp; Associates)&lt;/P&gt;   &lt;LI&gt;   &lt;P&gt;&lt;I class=citetitle&gt;&lt;A    href="http://people.redhat.com/nmurray/RHEL-2.1-VM-whitepaper.pdf"&gt;Virtual    Memory Behavior in Red Hat Enterprise Linux AS 2.1&lt;/A&gt;&lt;/I&gt; by Bob Matthews and    Norm Murray&lt;/P&gt;   &lt;LI&gt;   &lt;P&gt;&lt;I class=citetitle&gt;&lt;A href="http://surriel.com/lectures/ols2003/"&gt;Towards    an O(1) VM&lt;/A&gt;&lt;/I&gt; by Rik Van Riel&lt;/P&gt;   &lt;LI&gt;   &lt;P&gt;&lt;I class=citetitle&gt;&lt;A    href="http://www.kernel.org/pub/linux/kernel/v2.4/linux-2.4.21.tar.bz2"&gt;The    Linux Kernel Source Tree, versions 2.4.21-4EL &amp;amp; 2.4.21-5EL&lt;/A&gt;    &lt;/I&gt;&lt;/P&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/714742118606354868-5625220278710312650?l=unixtechtips.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unixtechtips.blogspot.com/feeds/5625220278710312650/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=714742118606354868&amp;postID=5625220278710312650&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/714742118606354868/posts/default/5625220278710312650'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/714742118606354868/posts/default/5625220278710312650'/><link rel='alternate' type='text/html' href='http://unixtechtips.blogspot.com/2007/04/understanding-virtual-memory-linux.html' title='Understanding Virtual Memory -Linux'/><author><name>HuggyPuggy</name><uri>http://www.blogger.com/profile/04602550959022896368</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='10800658094938042256'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-714742118606354868.post-7389753422341055790</id><published>2007-03-07T01:35:00.001-08:00</published><updated>2007-03-07T01:35:42.129-08:00</updated><title type='text'>Cool Unix Commands </title><content type='html'>&lt;H1&gt;Cool Commands &lt;/H1&gt;&lt;I&gt;  &lt;P&gt;Peter Baer Galvin &lt;/P&gt;&lt;/I&gt;  &lt;P&gt;There are so many commands in Solaris that it is difficult to separate the   cool ones from the mundane. For example, there are commands to report how much   time a program spends in each system call, and commands to dynamically show   system activities, and most of these commands are included with Solaris 8 as   well as Solaris 9. This month, Iâ€™m highlighting some of the commands that you   might find particularly useful. &lt;/P&gt;  &lt;P&gt;Systems administrators are tool users. Through experience, we have learned   that the more tools we have, the better able we are to diagnose problems and   implement solutions. The commands included in this column are gleaned from   experience, friends, acquaintances, and from attendance at the SunNetwork 2002   conference in September. â€œThe /procodile Hunterâ€ talk by Solaris kernel   developers Brian Cantrill and Mike Shapiro was especially enlightening and   frightening because Cantrill wrote code to illustrate a point faster than   Shapiro could explain the point they were trying to illustrate! &lt;/P&gt;&lt;B&gt;  &lt;P&gt;Useful Solaris Commands &lt;/P&gt;  &lt;P&gt;truss -c&lt;/B&gt; (Solaris &amp;gt;= 8): This astounding option to truss provides a   profile summary of the command being trussed: &lt;/P&gt;&lt;PRE&gt;$ truss -c grep asdf work.doc  syscall              seconds   calls  errors  _exit                    .00       1  read                     .01      24  open                     .00       8      4  close                    .00       5  brk                      .00      15  stat                     .00       1  fstat                    .00       4  execve                   .00       1  mmap                     .00      10  munmap                   .01       3  memcntl                  .00       2  llseek                   .00       1  open64                   .00       1                          ----     ---    ---  sys totals:              .02      76      4  usr time:                .00  elapsed:                 .05&lt;/PRE&gt;  &lt;P&gt;It can also show profile data on a running process. In this case, the data   shows what the process did between when &lt;B&gt;truss&lt;/B&gt; was started and when   &lt;B&gt;truss&lt;/B&gt; execution was terminated with a control-c. Itâ€™s ideal for   determining why a process is hung without having to wade through the pages of   &lt;B&gt;truss&lt;/B&gt; output. &lt;/P&gt;&lt;B&gt;  &lt;P&gt;truss -d&lt;/B&gt; and &lt;B&gt;truss -D&lt;/B&gt; (Solaris &amp;gt;= 8): These &lt;B&gt;truss&lt;/B&gt;   options show the time associated with each system call being shown by truss and   is excellent for finding performance problems in custom or commercial code. For   example: &lt;/P&gt;&lt;PRE&gt;$ truss -d who  Base time stamp:  1035385727.3460  [ Wed Oct 23 11:08:47 EDT 2002 ]   0.0000 execve(â€œ/usr/bin/whoâ€, 0xFFBEFD5C, 0xFFBEFD64)  argc = 1   0.0032 stat(â€œ/usr/bin/whoâ€, 0xFFBEFA98)                = 0   0.0037 open(â€œ/var/ld/ld.configâ€, O_RDONLY)             Err#2 ENOENT   0.0042 open(â€œ/usr/local/lib/libc.so.1â€, O_RDONLY)      Err#2 ENOENT   0.0047 open(â€œ/usr/lib/libc.so.1â€, O_RDONLY)            = 3   0.0051 fstat(3, 0xFFBEF42C)                            = 0  . . .&lt;/PRE&gt;&lt;B&gt;  &lt;P&gt;truss -D&lt;/B&gt; is even more useful, showing the time delta between system   calls: &lt;/P&gt;&lt;PRE&gt;Dilbert&amp;gt; truss -D who   0.0000 execve(â€œ/usr/bin/whoâ€, 0xFFBEFD5C, 0xFFBEFD64)  argc = 1   0.0028 stat(â€œ/usr/bin/whoâ€, 0xFFBEFA98)                = 0   0.0005 open(â€œ/var/ld/ld.configâ€, O_RDONLY)             Err#2 ENOENT   0.0006 open(â€œ/usr/local/lib/libc.so.1â€, O_RDONLY)      Err#2 ENOENT   0.0005 open(â€œ/usr/lib/libc.so.1â€, O_RDONLY)            = 3   0.0004 fstat(3, 0xFFBEF42C)                            = 0&lt;/PRE&gt;  &lt;P&gt;In this example, the &lt;B&gt;stat&lt;/B&gt; system call took a lot longer than the   others. &lt;/P&gt;&lt;B&gt;  &lt;P&gt;truss -T&lt;/B&gt;: This is a great debugging help. It will stop a process at the   execution of a specified system call. (â€œ-Uâ€ does the same, but with   user-level function calls.) A core could then be taken for further analysis, or   any of the /proc tools could be used to determine many aspects of the status of   the process. &lt;/P&gt;&lt;B&gt;  &lt;P&gt;truss -l&lt;/B&gt; (improved in Solaris 9): Shows the thread number of each call in   a multi-threaded processes. Solaris 9 &lt;B&gt;truss -l&lt;/B&gt; finally makes it possible   to watch the execution of a multi-threaded application. &lt;/P&gt;  &lt;P&gt;Truss is truly a powerful tool. It can be used on core files to analyze what   caused the problem, for example. It can also show details on user-level library   calls (either system libraries or programmer libraries) via the â€œ-uâ€ option.   &lt;/P&gt;&lt;B&gt;  &lt;P&gt;pkg-get&lt;/B&gt;: This is a nice tool (&lt;B&gt;http://www.bolthole.com/solaris&lt;/B&gt;) for   automatically getting freeware packages. It is configured via   &lt;B&gt;/etc/pkg-get.conf&lt;/B&gt;. Once itâ€™s up and running, execute &lt;B&gt;pkg-get -a&lt;/B&gt;   to get a list of available packages, and &lt;B&gt;pkg-get -i&lt;/B&gt; to get and install a   given package. &lt;/P&gt;&lt;B&gt;  &lt;P&gt;plimit&lt;/B&gt; (Solaris &amp;gt;= 8): This command displays and sets the per-process   limits on a running process. This is handy if a long-running process is running   up against a limit (for example, number of open files). Rather than using   &lt;B&gt;limit&lt;/B&gt; and restarting the command, &lt;B&gt;plimit&lt;/B&gt; can modify the running   process. &lt;/P&gt;&lt;B&gt;  &lt;P&gt;coreadm&lt;/B&gt; (Solaris &amp;gt;= 8): In the â€œoldâ€ days (before &lt;B&gt;coreadm&lt;/B&gt;),   core dumps were placed in the processâ€™s working directory. Core files would   also overwrite each other. All this and more has been addressed by   &lt;B&gt;coreadm&lt;/B&gt;, a tool to manage core file creation. With it, you can specify   whether to save cores, where cores should be stored, how many versions should be   retained, and more. Settings can be retained between reboots by &lt;B&gt;coreadm&lt;/B&gt;   modifying &lt;B&gt;/etc/coreadm.conf&lt;/B&gt;. &lt;/P&gt;&lt;B&gt;  &lt;P&gt;pgrep&lt;/B&gt; (Solaris &amp;gt;= 8): &lt;B&gt;pgrep&lt;/B&gt; searches through /proc for   processes matching the given criteria, and returns their process-ids. A great   option is â€œ-nâ€, which returns the newest process that matches. &lt;/P&gt;&lt;B&gt;  &lt;P&gt;preap&lt;/B&gt; (Solaris &amp;gt;= 9): Reaps zombie processes. Any processes stuck in   the â€œzâ€ state (as shown by &lt;B&gt;ps&lt;/B&gt;), can be removed from the system with   this command. &lt;/P&gt;&lt;B&gt;  &lt;P&gt;pargs&lt;/B&gt; (Solaris &amp;gt;= 9): Shows the arguments and environment variables of   a process. &lt;/P&gt;&lt;B&gt;  &lt;P&gt;nohup -p&lt;/B&gt; (Solaris &amp;gt;= 9): The &lt;B&gt;nohup&lt;/B&gt; command can be used to start   a process, so that if the shell that started the process closes (i.e., the   process gets a â€œSIGHUPâ€ signal), the process will keep running. This is   useful for backgrounding a task that should continue running no matter what   happens around it. But what happens if you start a process and later want to   HUP-proof it? With Solaris 9, &lt;B&gt;nohup -p&lt;/B&gt; takes a process-id and causes   SIGHUP to be ignored. &lt;/P&gt;&lt;B&gt;  &lt;P&gt;prstat&lt;/B&gt; (Solaris &amp;gt;= 8): &lt;B&gt;prstat&lt;/B&gt; is &lt;B&gt;top&lt;/B&gt; and a lot more.   Both commands provide a screenâ€™s worth of process and other information and   update it frequently, for a nice window on system performance. &lt;B&gt;prstat&lt;/B&gt; has   much better accuracy than &lt;B&gt;top&lt;/B&gt;. It also has some nice options. â€œ-aâ€   shows process and user information concurrently (sorted by CPU hog, by default).   â€œ-câ€ causes it to act like &lt;B&gt;vmstat&lt;/B&gt; (new reports printed below old   ones). â€œ-Câ€ shows processes in a processor set. â€œ-jâ€ shows processes in   a â€œprojectâ€. â€œ-Lâ€ shows per-thread information as well as per-process.   â€œ-mâ€ and â€œ-vâ€ show quite a bit of per-process performance detail   (including pages, traps, lock wait, and CPU wait). The output data can also be   sorted by resident-set (real memory) size, virtual memory size, execute time,   and so on. &lt;B&gt;prstat&lt;/B&gt; is very useful on systems without &lt;B&gt;top&lt;/B&gt;, and   should probably be used instead of &lt;B&gt;top&lt;/B&gt; because of its accuracy (and some   sites care that it is a supported program). &lt;/P&gt;&lt;B&gt;  &lt;P&gt;trapstat&lt;/B&gt; (Solaris &amp;gt;= 9): &lt;B&gt;trapstat&lt;/B&gt; joins &lt;B&gt;lockstat&lt;/B&gt; and   &lt;B&gt;kstat&lt;/B&gt; as the most inscrutable commands on Solaris. Each shows gory   details about the innards of the running operating system. Each is indispensable   in solving strange happenings on a Solaris system. Best of all, their output is   good to send along with bug reports, but further study can reveal useful   information for general use as well. &lt;/P&gt;&lt;B&gt;  &lt;P&gt;vmstat -p&lt;/B&gt; (Solaris &amp;gt;= 8): Until this option became available, it was   almost impossible (see the â€œse toolkitâ€) to determine what kind of memory   demand was causing a system to page. &lt;B&gt;vmstat -p&lt;/B&gt; is key because it not only   shows whether your system is under memory stress (via the â€œsrâ€ column), it   also shows whether that stress is from application code, application data, or   I/O. â€œ-pâ€ can really help pinpoint the cause of any mysterious memory issues   on Solaris. &lt;/P&gt;&lt;B&gt;  &lt;P&gt;pmap -x&lt;/B&gt; (Solaris &amp;gt;= 8, bugs fixed in Solaris &amp;gt;= 9): If the process   with memory problems is known, and more details on its memory use are needed,   check out &lt;B&gt;pmap -x&lt;/B&gt;. The target process-id has its memory map fully   explained, as in: &lt;/P&gt;&lt;PRE&gt;# pmap -x 1779  1779:   -ksh   Address  Kbytes     RSS    Anon  Locked Mode   Mapped File  00010000     192     192       -       - r-x--  ksh  00040000       8       8       8       - rwx--  ksh  00042000      32      32       8       - rwx--    [ heap ]  FF180000     680     664       -       - r-x--  libc.so.1  FF23A000      24      24       -       - rwx--  libc.so.1  FF240000       8       8       -       - rwx--  libc.so.1  FF280000     568     472       -       - r-x--  libnsl.so.1  FF31E000      32      32       -       - rwx--  libnsl.so.1  FF326000      32      24       -       - rwx--  libnsl.so.1  FF340000      16      16       -       - r-x--  libc_psr.so.1  FF350000      16      16       -       - r-x--  libmp.so.2  FF364000       8       8       -       - rwx--  libmp.so.2  FF380000      40      40       -       - r-x--  libsocket.so.1  FF39A000       8       8       -       - rwx--  libsocket.so.1  FF3A0000       8       8       -       - r-x--  libdl.so.1  FF3B0000       8       8       8       - rwx--    [ anon ]  FF3C0000     152     152       -       - r-x--  ld.so.1  FF3F6000       8       8       8       - rwx--  ld.so.1  FFBFE000       8       8       8       - rw---    [ stack ]  -------- ------- ------- ------- -------  total Kb    1848    1728      40       -&lt;/PRE&gt;  &lt;P&gt;Here we see each chunk of memory, what it is being used for, how much space   it is taking (virtual and real), and mode information. &lt;/P&gt;&lt;B&gt;  &lt;P&gt;df -h&lt;/B&gt; (Solaris &amp;gt;= 9): This command is popular on Linux, and just made   its way into Solaris. &lt;B&gt;df -h&lt;/B&gt; displays summary information about file   systems in human-readable form: &lt;/P&gt;&lt;PRE&gt;$ df -h  Filesystem             size   used  avail capacity  Mounted on  /dev/dsk/c0t0d0s0      4.8G   1.7G   3.0G    37%    /  /proc                    0K     0K     0K     0%    /proc  mnttab                   0K     0K     0K     0%    /etc/mnttab  fd                       0K     0K     0K     0%    /dev/fd  swap                   848M    40K   848M     1%    /var/run  swap                   849M   1.0M   848M     1%    /tmp  /dev/dsk/c0t0d0s7       13G    78K    13G     1%    /export/home&lt;/PRE&gt;&lt;B&gt;  &lt;P&gt;Conclusion &lt;/P&gt;&lt;/B&gt;  &lt;P&gt;Each administrator has a set of tools used daily, and another set of tools to   help in a pinch. This column included a wide variety of commands and options   that are lesser known, but can be very useful. Do you have favorite tools that   have saved you in a bind? If so, please send them to me so I can expand my tool   set as well. Alternately, send along any tools that you hate or that you feel   are dangerous, which could also turn into a useful column! &lt;/P&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/714742118606354868-7389753422341055790?l=unixtechtips.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unixtechtips.blogspot.com/feeds/7389753422341055790/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=714742118606354868&amp;postID=7389753422341055790&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/714742118606354868/posts/default/7389753422341055790'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/714742118606354868/posts/default/7389753422341055790'/><link rel='alternate' type='text/html' href='http://unixtechtips.blogspot.com/2007/03/cool-unix-commands.html' title='Cool Unix Commands '/><author><name>HuggyPuggy</name><uri>http://www.blogger.com/profile/04602550959022896368</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='10800658094938042256'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-714742118606354868.post-9067154952715442012</id><published>2007-03-06T03:34:00.001-08:00</published><updated>2007-03-15T23:58:16.249-07:00</updated><title type='text'>HOWTO: Mirrored root disk on Solaris</title><content type='html'>&lt;span style="font-family:Verdana;font-size:85%;color:#000080;"&gt;&lt;p&gt; &lt;/p&gt;&lt;table cellspacing="0" width="624" border="0"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td valign="top" colspan="2"&gt;&lt;p align="left"&gt;&lt;span style="font-size:85%;color:#000080;"&gt;&lt;/span&gt; &lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td valign="top" colspan="2"&gt;&lt;p&gt;&lt;span style="font-size:85%;color:#000080;"&gt;&lt;/span&gt; &lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td valign="top" colspan="2"&gt;&lt;dir&gt;&lt;dir&gt;&lt;p&gt;&lt;a href="http://www.brandonhutchinson.com/Mirroring_disks_with_DiskSuite.html"&gt;http://www.brandonhutchinson.com/Mirroring_disks_with_DiskSuite.html&lt;/a&gt; &lt;/p&gt;&lt;/dir&gt;&lt;/dir&gt;&lt;p&gt;&lt;br /&gt;&lt;strong&gt;0. Partition the first disk&lt;/p&gt;&lt;/strong&gt;&lt;pre&gt;# format c0t0d0&lt;/pre&gt;&lt;p&gt;Use the partition tool (=&amp;gt; "p &amp;lt;enter&amp;gt;, p &amp;lt;enter&amp;gt;"!) to setup the slices. We assume the following slice setup afterwards:&lt;/p&gt;&lt;pre&gt;#  Tag         Flag  Cylinders      Size      Blocks&lt;br /&gt; -  ----------  ----  -------------  --------  --------------------&lt;br /&gt; 0  root        wm        0 -   812  400.15MB  (813/0/0)     819504&lt;br /&gt; 1  swap        wu      813 -  1333  256.43MB  (521/0/0)     525168&lt;br /&gt; 2  backup      wm        0 - 17659    8.49GB  (17660/0/0) 17801280&lt;br /&gt; 3  unassigned  wm     1334 -  1354   10.34MB  (21/0/0)       21168&lt;br /&gt; 4  var         wm     1355 -  8522    3.45GB  (7168/0/0)   7225344&lt;br /&gt; 5  usr         wm     8523 - 14764    3.00GB  (6242/0/0)   6291936&lt;br /&gt; 6  unassigned  wm    14765 - 16845    1.00GB  (2081/0/0)   2097648&lt;br /&gt; 7  home        wm    16846 - 17659  400.15MB  (813/0/0)     819504&lt;/pre&gt;&lt;strong&gt;&lt;p&gt;1. Copy the partition table of the first disk to its future mirror disk&lt;/p&gt;&lt;/strong&gt;&lt;pre&gt;# prtvtoc /dev/rdsk/c0t0d0s2  fmthard -s - /dev/rdsk/c0t1d0s2&lt;/pre&gt;&lt;strong&gt;&lt;p&gt;2. Create at least two state database replicas on each disk&lt;/strong&gt; &lt;/p&gt;&lt;pre&gt;# metadb -a -f -c 2 c0t0d0s3 c0t1d0s3&lt;/pre&gt;&lt;p&gt;Check the state of all replicas with &lt;em&gt;metadb&lt;/em&gt;: &lt;/p&gt;&lt;pre&gt;# metadb&lt;/pre&gt;&lt;p&gt;Notes:&lt;/p&gt;&lt;dir&gt;&lt;dir&gt;&lt;p&gt;A state database replica contains configuration and state information about the meta devices. Make sure that always at least 50% of the replicas are active! &lt;/p&gt;&lt;/dir&gt;&lt;/dir&gt;&lt;p&gt;&lt;br /&gt;&lt;strong&gt;3. Create the &lt;/strong&gt;&lt;b&gt;&lt;em&gt;root&lt;/b&gt;&lt;/em&gt;&lt;strong&gt; slice mirror and its first submirror&lt;/p&gt;&lt;/strong&gt;&lt;pre&gt;# metainit -f d10 1 1 c0t0d0s0&lt;br /&gt; # metainit -f d20 1 1 c0t1d0s0&lt;br /&gt; # metainit d30 -m d10&lt;/pre&gt;&lt;p&gt;Run &lt;em&gt;metaroot&lt;/em&gt; to prepare /etc/vfstab and /etc/system (do this &lt;u&gt;only&lt;/u&gt; for the root slice!): &lt;/p&gt;&lt;pre&gt;# metaroot d30&lt;/pre&gt;&lt;strong&gt;&lt;p&gt;4. Create the &lt;/strong&gt;&lt;b&gt;&lt;em&gt;swap&lt;/b&gt;&lt;/em&gt;&lt;strong&gt; slice mirror and its first submirror&lt;/p&gt;&lt;/strong&gt;&lt;pre&gt;# metainit -f d11 1 1 c0t0d0s1&lt;br /&gt; # metainit -f d21 1 1 c0t1d0s1&lt;br /&gt; # metainit d31 -m d11&lt;/pre&gt;&lt;strong&gt;&lt;p&gt;5. Create the &lt;/strong&gt;&lt;b&gt;&lt;em&gt;var&lt;/b&gt;&lt;/em&gt;&lt;strong&gt; slice mirror and its first submirror&lt;/p&gt;&lt;/strong&gt;&lt;pre&gt;# metainit -f d14 1 1 c0t0d0s4&lt;br /&gt; # metainit -f d24 1 1 c0t1d0s4&lt;br /&gt; # metainit d34 -m d14&lt;/pre&gt;&lt;strong&gt;&lt;p&gt;6. Create the &lt;/strong&gt;&lt;b&gt;&lt;em&gt;usr&lt;/b&gt;&lt;/em&gt;&lt;strong&gt; slice mirror and its first submirror&lt;/p&gt;&lt;/strong&gt;&lt;pre&gt;# metainit -f d15 1 1 c0t0d0s5&lt;br /&gt; # metainit -f d25 1 1 c0t1d0s5&lt;br /&gt; # metainit d35 -m d15&lt;/pre&gt;&lt;strong&gt;&lt;p&gt;7. Create the&lt;/strong&gt;&lt;b&gt;&lt;em&gt; unassigned&lt;/b&gt;&lt;/em&gt;&lt;strong&gt; slice mirror and its first submirror&lt;/p&gt;&lt;/strong&gt;&lt;pre&gt;# metainit -f d16 1 1 c0t0d0s6&lt;br /&gt; # metainit -f d26 1 1 c0t1d0s6&lt;br /&gt; # metainit d36 -m d16&lt;/pre&gt;&lt;strong&gt;&lt;p&gt;8. Create the &lt;/strong&gt;&lt;b&gt;&lt;em&gt;home&lt;/b&gt;&lt;/em&gt;&lt;strong&gt; slice mirror and its first submirror&lt;/p&gt;&lt;/strong&gt;&lt;pre&gt;# metainit -f d17 1 1 c0t0d0s7&lt;br /&gt; # metainit -f d27 1 1 c0t1d0s7&lt;br /&gt; # metainit d37 -m d17&lt;/pre&gt;&lt;strong&gt;&lt;p&gt;9. Edit &lt;/strong&gt;&lt;b&gt;&lt;em&gt;/etc/vfstab&lt;/b&gt;&lt;/em&gt;&lt;strong&gt; to mount all mirrors after boot, including mirrored swap&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;em&gt;/etc/vfstab&lt;/em&gt; &lt;u&gt;before&lt;/u&gt; changes:&lt;/p&gt;&lt;pre&gt;fd                 -                   /dev/fd  fd     -  no   -&lt;br /&gt; /proc              -                   /proc    proc   -  no   -&lt;br /&gt; /dev/dsk/c0t0d0s1  -                   -        swap   -  no   -&lt;br /&gt; /dev/md/dsk/d30    /dev/md/rdsk/d30    /        ufs    1  no   logging&lt;br /&gt; /dev/dsk/c0t0d0s5  /dev/rdsk/c0t0d0s5  /usr     ufs    1  no   ro,logging&lt;br /&gt; /dev/dsk/c0t0d0s4  /dev/rdsk/c0t0d0s4  /var     ufs    1  no   nosuid,logging&lt;br /&gt; /dev/dsk/c0t0d0s7  /dev/rdsk/c0t0d0s7  /home    ufs    2  yes  nosuid,logging&lt;br /&gt; /dev/dsk/c0t0d0s6  /dev/rdsk/c0t0d0s6  /opt     ufs    2  yes  nosuid,logging&lt;br /&gt; swap               -                   /tmp     tmpfs  -  yes  -&lt;/pre&gt;&lt;em&gt;&lt;p&gt;/etc/vfstab&lt;/em&gt; &lt;u&gt;after&lt;/u&gt; changes:&lt;/p&gt;&lt;pre&gt;fd                 -                   /dev/fd  fd     -  no   -&lt;br /&gt; /proc              -                   /proc    proc   -  no   -&lt;br /&gt; /dev/md/dsk/d31    -                   -        swap   -  no   -&lt;br /&gt; /dev/md/dsk/d30    /dev/md/rdsk/d30    /        ufs    1  no   logging&lt;br /&gt; /dev/md/dsk/d35    /dev/md/rdsk/d35    /usr     ufs    1  no   ro,logging&lt;br /&gt; /dev/md/dsk/d34    /dev/md/rdsk/d34    /var     ufs    1  no   nosuid,logging&lt;br /&gt; /dev/md/dsk/d37    /dev/md/rdsk/d37    /home    ufs    2  yes  nosuid,logging&lt;br /&gt; /dev/md/dsk/d36    /dev/md/rdsk/d36    /opt     ufs    2  yes  nosuid,logging&lt;br /&gt; swap               -                   /tmp     tmpfs  -  yes  -&lt;/pre&gt;&lt;p&gt;Notes:&lt;/p&gt;&lt;dir&gt;&lt;dir&gt;&lt;p&gt;The entry for the root device (/) has already been altered by the &lt;em&gt;metaroot &lt;/em&gt;command we executed before. &lt;/p&gt;&lt;/dir&gt;&lt;/dir&gt;&lt;p&gt;&lt;br /&gt;&lt;strong&gt;10. Reboot the system&lt;/p&gt;&lt;/strong&gt;&lt;pre&gt;# lockfs -fa &amp;amp;&amp; init 6&lt;/pre&gt;&lt;strong&gt;&lt;p&gt;11. Attach the second submirrors to all mirrors&lt;/strong&gt; &lt;/p&gt;&lt;pre&gt;# metattach d30 d20&lt;br /&gt; # metattach d31 d21&lt;br /&gt; # metattach d34 d24&lt;br /&gt; # metattach d35 d25&lt;br /&gt; # metattach d36 d26&lt;br /&gt; # metattach d37 d27&lt;/pre&gt;&lt;p&gt;Notes: &lt;/p&gt;&lt;dir&gt;&lt;dir&gt;&lt;p&gt;This will finally cause the data from the boot disk to be synchronized with the mirror drive. &lt;/p&gt;&lt;p&gt;You can use &lt;em&gt;metastat&lt;/em&gt; to track the mirroring progress. &lt;/p&gt;&lt;/dir&gt;&lt;/dir&gt;&lt;p&gt;&lt;br /&gt;&lt;strong&gt;12. Change the crash dump device to the swap metadevice&lt;/p&gt;&lt;/strong&gt;&lt;pre&gt;# dumpadm -d `swap -l  tail -1  awk '{print $1}'&lt;/pre&gt;&lt;strong&gt;&lt;p&gt;13. Make the mirror disk bootable&lt;/p&gt;&lt;/strong&gt;&lt;pre&gt;# installboot /usr/platform/`uname -i`/lib/fs/ufs/bootblk /dev/rdsk/c0t1d0s0&lt;/pre&gt;&lt;p&gt;Notes:&lt;/p&gt;&lt;dir&gt;&lt;dir&gt;&lt;p&gt;This will install a boot block to the second disk. &lt;/p&gt;&lt;/dir&gt;&lt;/dir&gt;&lt;p&gt;&lt;br /&gt;&lt;strong&gt;14. Determine the physical device path of the mirror disk&lt;/p&gt;&lt;/strong&gt;&lt;pre&gt;# ls -l /dev/dsk/c0t1d0s0&lt;br /&gt; ... /dev/dsk/c0t1d0s0 -&amp;gt; ../../devices/pci@1f,4000/scsi@3/sd@1,0:a&lt;/pre&gt;&lt;strong&gt;&lt;p&gt;15. Create a device alias for the mirror disk&lt;/p&gt;&lt;/strong&gt;&lt;pre&gt;# eeprom "nvramrc=devalias mirror /pci@1f,4000/scsi@3/disk@1,0"&lt;br /&gt; # eeprom "use-nvramrc?=true"&lt;/pre&gt;&lt;p&gt;Add the &lt;em&gt;mirror&lt;/em&gt; device alias to the Open Boot parameter boot-device to prepare the case of a problem with the primary boot device. &lt;/p&gt;&lt;pre&gt;# eeprom "boot-device=disk mirror cdrom net"&lt;/pre&gt;&lt;p&gt;You can also configure the device alias and boot-device list from the &lt;em&gt;Open Boot Prompt&lt;/em&gt; (OBP a.k.a. &lt;em&gt;ok prompt&lt;/em&gt;): &lt;/p&gt;&lt;pre&gt;ok nvalias mirror /pci@1f,4000/scsi@3/disk@1,0&lt;br /&gt; ok use-nvramrc?=true&lt;br /&gt; ok boot-device=disk mirror cdrom net&lt;/pre&gt;&lt;p&gt;Notes:&lt;/p&gt;&lt;dir&gt;&lt;dir&gt;&lt;p&gt;From the OBP, you can use &lt;em&gt;boot mirror&lt;/em&gt; to boot from the mirror disk. &lt;/p&gt;&lt;p&gt;On my test system, I had to replace &lt;em&gt;sd@1,0:a&lt;/em&gt; with &lt;em&gt;disk@1,0&lt;/em&gt;. Use &lt;em&gt;devalias&lt;/em&gt; on the OBP prompt to determine the correct device path. &lt;/p&gt;&lt;/dir&gt;&lt;/dir&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div align="left"&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;"&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;"&gt; &lt;/div&gt;&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/714742118606354868-9067154952715442012?l=unixtechtips.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unixtechtips.blogspot.com/feeds/9067154952715442012/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=714742118606354868&amp;postID=9067154952715442012&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/714742118606354868/posts/default/9067154952715442012'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/714742118606354868/posts/default/9067154952715442012'/><link rel='alternate' type='text/html' href='http://unixtechtips.blogspot.com/2007/03/howto-mirrored-root-disk-on-solaris.html' title='HOWTO: Mirrored root disk on Solaris'/><author><name>HuggyPuggy</name><uri>http://www.blogger.com/profile/04602550959022896368</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='10800658094938042256'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-714742118606354868.post-8023916738494584768</id><published>2007-02-15T02:27:00.000-08:00</published><updated>2007-02-22T18:19:32.483-08:00</updated><title type='text'>Active FTP vs. Passive FTP, a Definitive Explanation</title><content type='html'>Active FTP vs. Passive FTP, a Definitive Explanation&lt;p&gt;&lt;br&gt;&lt;a href="http://slacksite.com/other/ftp.html"&gt;http://slacksite.com/other/ftp.html&lt;/a&gt;&lt;p&gt;&lt;br&gt;Introduction&lt;p&gt;&lt;br&gt;One of the most commonly seen questions when dealing with firewalls and&lt;br&gt;other Internet connectivity issues is the difference between active and&lt;br&gt;passive FTP and how best to support either or both of them. Hopefully&lt;br&gt;the following text will help to clear up some of the confusion over how&lt;br&gt;to support FTP in a firewalled environment. &lt;p&gt;This may not be the definitive explanation, as the title claims,&lt;br&gt;however, I&amp;#39;ve heard enough good feedback and seen this document linked&lt;br&gt;in enough places to know that quite a few people have found it to be&lt;br&gt;useful. I am always looking for ways to improve things though, and if&lt;br&gt;you find something that is not quite clear or needs more explanation,&lt;br&gt;please let me know! Recent additions to this document include the&lt;br&gt;examples of both active and passive command line FTP sessions. These&lt;br&gt;session examples should help make things a bit clearer. They also&lt;br&gt;provide a nice picture into what goes on behind the scenes during an FTP&lt;br&gt;session. Now, on to the information... &lt;p&gt;&lt;br&gt;The Basics&lt;p&gt;&lt;br&gt;FTP is a TCP based service exclusively. There is no UDP component to&lt;br&gt;FTP. FTP is an unusual service in that it utilizes two ports, a &amp;#39;data&amp;#39;&lt;br&gt;port and a &amp;#39;command&amp;#39; port (also known as the control port).&lt;br&gt;Traditionally these are port 21 for the command port and port 20 for the&lt;br&gt;data port. The confusion begins however, when we find that depending on&lt;br&gt;the mode, the data port is not always on port 20. &lt;p&gt;&lt;br&gt;Active FTP&lt;p&gt;&lt;br&gt;In active mode FTP the client connects from a random unprivileged port&lt;br&gt;(N &amp;gt; 1023) to the FTP server&amp;#39;s command port, port 21. Then, the client&lt;br&gt;starts listening to port N+1 and sends the FTP command PORT N+1 to the&lt;br&gt;FTP server. The server will then connect back to the client&amp;#39;s specified&lt;br&gt;data port from its local data port, which is port 20. &lt;p&gt;&amp;gt;From the server-side firewall&amp;#39;s standpoint, to support active mode FTP&lt;br&gt;the following communication channels need to be opened: &lt;p&gt;		FTP server&amp;#39;s port 21 from anywhere (Client initiates&lt;br&gt;connection) &lt;p&gt;		FTP server&amp;#39;s port 21 to ports &amp;gt; 1023 (Server responds to&lt;br&gt;client&amp;#39;s control port) &lt;p&gt;		FTP server&amp;#39;s port 20 to ports &amp;gt; 1023 (Server initiates&lt;br&gt;data connection to client&amp;#39;s data port) &lt;p&gt;		FTP server&amp;#39;s port 20 from ports &amp;gt; 1023 (Client sends&lt;br&gt;ACKs to server&amp;#39;s data port) &lt;p&gt;When drawn out, the connection appears as follows: &lt;p&gt; &amp;lt;outbind://235/images/ftp/active&lt;a href="ftp://ftp.gif"&gt;ftp.gif&lt;/a&gt;&amp;gt; &lt;p&gt;In step 1, the client&amp;#39;s command port contacts the server&amp;#39;s command port&lt;br&gt;and sends the command PORT 1027. The server then sends an ACK back to&lt;br&gt;the client&amp;#39;s command port in step 2. In step 3 the server initiates a&lt;br&gt;connection on its local data port to the data port the client specified&lt;br&gt;earlier. Finally, the client sends an ACK back as shown in step 4. &lt;p&gt;The main problem with active mode FTP actually falls on the client side.&lt;br&gt;The FTP client doesn&amp;#39;t make the actual connection to the data port of&lt;br&gt;the server--it simply tells the server what port it is listening on and&lt;br&gt;the server connects back to the specified port on the client. From the&lt;br&gt;client side firewall this appears to be an outside system initiating a&lt;br&gt;connection to an internal client--something that is usually blocked. &lt;p&gt;&lt;br&gt;Active FTP Example&lt;p&gt;&lt;br&gt;Below is an actual example of an active FTP session. The only things&lt;br&gt;that have been changed are the server names, IP addresses, and user&lt;br&gt;names. In this example an FTP session is initiated from&lt;br&gt;testbox1.slacksite.com (192.168.150.80), a linux box running the&lt;br&gt;standard FTP command line client, to testbox2.slacksite.com&lt;br&gt;(192.168.150.90), a linux box running ProFTPd 1.2.2RC2. The debugging&lt;br&gt;(-d) flag is used with the FTP client to show what is going on behind&lt;br&gt;the scenes. Everything in red is the debugging output which shows the&lt;br&gt;actual FTP commands being sent to the server and the responses generated&lt;br&gt;from those commands. Normal server output is shown in black, and user&lt;br&gt;input is in bold. &lt;p&gt;There are a few interesting things to consider about this dialog. Notice&lt;br&gt;that when the PORT command is issued, it specifies a port on the client&lt;br&gt;(192.168.150.80) system, rather than the server. We will see the&lt;br&gt;opposite behavior when we use passive FTP. While we are on the subject,&lt;br&gt;a quick note about the format of the PORT command. As you can see in the&lt;br&gt;example below it is formatted as a series of six numbers separated by&lt;br&gt;commas. The first four octets are the IP address while the last two&lt;br&gt;octets comprise the port that will be used for the data connection. To&lt;br&gt;find the actual port multiply the fifth octet by 256 and then add the&lt;br&gt;sixth octet to the total. Thus in the example below the port number is (&lt;br&gt;(14*256) + 178), or 3762. A quick check with netstat should confirm this&lt;br&gt;information. &lt;p&gt;testbox1: {/home/p-t/slacker/public_html} % ftp -d testbox2&lt;br&gt;Connected to testbox2.slacksite.com.&lt;br&gt;220 testbox2.slacksite.com FTP server ready.&lt;br&gt;Name (testbox2:slacker): slacker&lt;br&gt;---&amp;gt; USER slacker&lt;br&gt;331 Password required for slacker.&lt;br&gt;Password: TmpPass&lt;br&gt;---&amp;gt; PASS XXXX&lt;br&gt;230 User slacker logged in.&lt;br&gt;---&amp;gt; SYST&lt;br&gt;215 UNIX Type: L8&lt;br&gt;Remote system type is UNIX.&lt;br&gt;Using binary mode to transfer files.&lt;br&gt;ftp&amp;gt; ls&lt;br&gt;ftp: setsockopt (ignored): Permission denied&lt;br&gt;---&amp;gt; PORT 192,168,150,80,14,178&lt;br&gt;200 PORT command successful.&lt;br&gt;---&amp;gt; LIST&lt;br&gt;150 Opening ASCII mode data connection for file list.&lt;br&gt;drwx------   3 slacker    users         104 Jul 27 01:45 public_html&lt;br&gt;226 Transfer complete.&lt;br&gt;ftp&amp;gt; quit&lt;br&gt;---&amp;gt; QUIT&lt;br&gt;221 Goodbye.&lt;p&gt;Passive FTP&lt;p&gt;&lt;br&gt;In order to resolve the issue of the server initiating the connection to&lt;br&gt;the client a different method for FTP connections was developed. This&lt;br&gt;was known as passive mode, or PASV, after the command used by the client&lt;br&gt;to tell the server it is in passive mode. &lt;p&gt;In passive mode FTP the client initiates both connections to the server,&lt;br&gt;solving the problem of firewalls filtering the incoming data port&lt;br&gt;connection to the client from the server. When opening an FTP&lt;br&gt;connection, the client opens two random unprivileged ports locally (N &amp;gt;&lt;br&gt;1023 and N+1). The first port contacts the server on port 21, but&lt;br&gt;instead of then issuing a PORT command and allowing the server to&lt;br&gt;connect back to its data port, the client will issue the PASV command.&lt;br&gt;The result of this is that the server then opens a random unprivileged&lt;br&gt;port (P &amp;gt; 1023) and sends the PORT P command back to the client. The&lt;br&gt;client then initiates the connection from port N+1 to port P on the&lt;br&gt;server to transfer data. &lt;p&gt;&amp;gt;From the server-side firewall&amp;#39;s standpoint, to support passive mode FTP&lt;br&gt;the following communication channels need to be opened: &lt;p&gt;		FTP server&amp;#39;s port 21 from anywhere (Client initiates&lt;br&gt;connection) &lt;p&gt;		FTP server&amp;#39;s port 21 to ports &amp;gt; 1023 (Server responds to&lt;br&gt;client&amp;#39;s control port) &lt;p&gt;		FTP server&amp;#39;s ports &amp;gt; 1023 from anywhere (Client&lt;br&gt;initiates data connection to random port specified by server) &lt;p&gt;		FTP server&amp;#39;s ports &amp;gt; 1023 to remote ports &amp;gt; 1023 (Server&lt;br&gt;sends ACKs (and data) to client&amp;#39;s data port) &lt;p&gt;When drawn, a passive mode FTP connection looks like this: &lt;p&gt; &amp;lt;outbind://235/images/ftp/passive&lt;a href="ftp://ftp.gif"&gt;ftp.gif&lt;/a&gt;&amp;gt; &lt;p&gt;In step 1, the client contacts the server on the command port and issues&lt;br&gt;the PASV command. The server then replies in step 2 with PORT 2024,&lt;br&gt;telling the client which port it is listening to for the data&lt;br&gt;connection. In step 3 the client then initiates the data connection from&lt;br&gt;its data port to the specified server data port. Finally, the server&lt;br&gt;sends back an ACK in step 4 to the client&amp;#39;s data port. &lt;p&gt;While passive mode FTP solves many of the problems from the client side,&lt;br&gt;it opens up a whole range of problems on the server side. The biggest&lt;br&gt;issue is the need to allow any remote connection to high numbered ports&lt;br&gt;on the server. Fortunately, many FTP daemons, including the popular&lt;br&gt;WU-FTPD allow the administrator to specify a range of ports which the&lt;br&gt;FTP server will use. See Appendix 1 &amp;lt;outbind://235/ftp-appendix1.html&amp;gt;&lt;br&gt;for more information. &lt;p&gt;The second issue involves supporting and troubleshooting clients which&lt;br&gt;do (or do not) support passive mode. As an example, the command line FTP&lt;br&gt;utility provided with Solaris does not support passive mode,&lt;br&gt;necessitating a third-party FTP client, such as ncftp. &lt;p&gt;With the massive popularity of the World Wide Web, many people prefer to&lt;br&gt;use their web browser as an FTP client. Most browsers only support&lt;br&gt;passive mode when accessing ftp:// URLs. This can either be good or bad&lt;br&gt;depending on what the servers and firewalls are configured to support. &lt;p&gt;&lt;br&gt;Passive FTP Example&lt;p&gt;&lt;br&gt;Below is an actual example of a passive FTP session. The only things&lt;br&gt;that have been changed are the server names, IP addresses, and user&lt;br&gt;names. In this example an FTP session is initiated from&lt;br&gt;testbox1.slacksite.com (192.168.150.80), a linux box running the&lt;br&gt;standard FTP command line client, to testbox2.slacksite.com&lt;br&gt;(192.168.150.90), a linux box running ProFTPd 1.2.2RC2. The debugging&lt;br&gt;(-d) flag is used with the FTP client to show what is going on behind&lt;br&gt;the scenes. Everything in red is the debugging output which shows the&lt;br&gt;actual FTP commands being sent to the server and the responses generated&lt;br&gt;from those commands. Normal server output is shown in black, and user&lt;br&gt;input is in bold. &lt;p&gt;Notice the difference in the PORT command in this example as opposed to&lt;br&gt;the active FTP example. Here, we see a port being opened on the server&lt;br&gt;(192.168.150.90) system, rather than the client. See the discussion&lt;br&gt;about the format of the PORT command above, in the Active FTP Example&lt;br&gt;section &amp;lt;outbind://235/actexample&amp;gt; . &lt;p&gt;testbox1: {/home/p-t/slacker/public_html} % ftp -d testbox2&lt;br&gt;Connected to testbox2.slacksite.com.&lt;br&gt;220 testbox2.slacksite.com FTP server ready.&lt;br&gt;Name (testbox2:slacker): slacker&lt;br&gt;---&amp;gt; USER slacker&lt;br&gt;331 Password required for slacker.&lt;br&gt;Password: TmpPass&lt;br&gt;---&amp;gt; PASS XXXX&lt;br&gt;230 User slacker logged in.&lt;br&gt;---&amp;gt; SYST&lt;br&gt;215 UNIX Type: L8&lt;br&gt;Remote system type is UNIX.&lt;br&gt;Using binary mode to transfer files.&lt;br&gt;ftp&amp;gt; passive&lt;br&gt;Passive mode on.&lt;br&gt;ftp&amp;gt; ls&lt;br&gt;ftp: setsockopt (ignored): Permission denied&lt;br&gt;---&amp;gt; PASV&lt;br&gt;227 Entering Passive Mode (192,168,150,90,195,149).&lt;br&gt;---&amp;gt; LIST&lt;br&gt;150 Opening ASCII mode data connection for file list&lt;br&gt;drwx------   3 slacker    users         104 Jul 27 01:45 public_html&lt;br&gt;226 Transfer complete.&lt;br&gt;ftp&amp;gt; quit&lt;br&gt;---&amp;gt; QUIT&lt;br&gt;221 Goodbye.&lt;p&gt;Other Notes&lt;p&gt;&lt;br&gt;A reader, Maarten Sjouw, pointed out that active FTP will not function&lt;br&gt;when used in conjunction with a client-side NAT (Network Address&lt;br&gt;Translation) device which is not smart enough to alter the IP address&lt;br&gt;info in FTP packets. &lt;p&gt;&lt;br&gt;Summary&lt;p&gt;&lt;br&gt;The following chart should help admins remember how each FTP mode works:&lt;p&gt;&lt;br&gt; Active FTP :&lt;br&gt;     command : client &amp;gt;1023 -&amp;gt; server 21&lt;br&gt;     data    : client &amp;gt;1023 &amp;lt;- server 20&lt;p&gt; Passive FTP :&lt;br&gt;     command : client &amp;gt;1023 -&amp;gt; server 21&lt;br&gt;     data    : client &amp;gt;1023 -&amp;gt; server &amp;gt;1023&lt;p&gt;A quick summary of the pros and cons of active vs. passive FTP is also&lt;br&gt;in order: &lt;p&gt;Active FTP is beneficial to the FTP server admin, but detrimental to the&lt;br&gt;client side admin. The FTP server attempts to make connections to random&lt;br&gt;high ports on the client, which would almost certainly be blocked by a&lt;br&gt;firewall on the client side. Passive FTP is beneficial to the client,&lt;br&gt;but detrimental to the FTP server admin. The client will make both&lt;br&gt;connections to the server, but one of them will be to a random high&lt;br&gt;port, which would almost certainly be blocked by a firewall on the&lt;br&gt;server side. &lt;p&gt;Luckily, there is somewhat of a compromise. Since admins running FTP&lt;br&gt;servers will need to make their servers accessible to the greatest&lt;br&gt;number of clients, they will almost certainly need to support passive&lt;br&gt;FTP. The exposure of high level ports on the server can be minimized by&lt;br&gt;specifying a limited port range for the FTP server to use. Thus,&lt;br&gt;everything except for this range of ports can be firewalled on the&lt;br&gt;server side. While this doesn&amp;#39;t eliminate all risk to the server, it&lt;br&gt;decreases it tremendously. See Appendix 1&lt;br&gt;&amp;lt;outbind://235/ftp-appendix1.html&amp;gt;  for more information. &lt;p&gt;&lt;br&gt;References&lt;p&gt;&lt;br&gt;An excellent reference on how various internet protocols work and the&lt;br&gt;issues involved in firewalling them can be found in the O&amp;#39;Reilly and&lt;br&gt;Associates book, Building Internet Firewalls, 2nd Ed, by Brent Chapman&lt;br&gt;and Elizabeth Zwicky. &lt;p&gt;Finally, the definitive reference on FTP would be RFC 959, which sets&lt;br&gt;forth the official specifications of the FTP protocol. RFCs can be&lt;br&gt;downloaded from numerous locations, including&lt;br&gt;&lt;a href="http://www.faqs.org/rfcs/rfc959.html"&gt;http://www.faqs.org/rfcs/rfc959.html&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/714742118606354868-8023916738494584768?l=unixtechtips.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unixtechtips.blogspot.com/feeds/8023916738494584768/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=714742118606354868&amp;postID=8023916738494584768&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/714742118606354868/posts/default/8023916738494584768'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/714742118606354868/posts/default/8023916738494584768'/><link rel='alternate' type='text/html' href='http://unixtechtips.blogspot.com/2007/02/active-ftp-vs-passive-ftp-definitive.html' title='Active FTP vs. Passive FTP, a Definitive Explanation'/><author><name>HuggyPuggy</name><uri>http://www.blogger.com/profile/04602550959022896368</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='10800658094938042256'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-714742118606354868.post-4539212106920593801</id><published>2007-01-10T21:22:00.001-08:00</published><updated>2007-01-10T21:22:25.333-08:00</updated><title type='text'>Configuring TCP/IP on Solaris - Overview of the Booting Processes </title><content type='html'>&lt;B&gt;&lt;FONT color=#000080&gt; &lt;P&gt;The Boot Process&lt;/B&gt;&lt;/FONT&gt; &lt;/P&gt; &lt;BLOCKQUOTE&gt;The following information is provided for your reference. It is a    brief overview of the network booting processes to help you better visualize    what is happening during configuration. &lt;/BLOCKQUOTE&gt;&lt;B&gt;&lt;FONT color=#800000&gt; &lt;BLOCKQUOTE&gt;Note&lt;/B&gt;&lt;/FONT&gt; - The names of startup scripts might change from    one release to another. &lt;/BLOCKQUOTE&gt; &lt;OL&gt;   &lt;OL&gt;     &lt;BLOCKQUOTE&gt;       &lt;LI&gt;You start the operating system on a host. &lt;/LI&gt;&lt;/BLOCKQUOTE&gt;     &lt;BLOCKQUOTE&gt;       &lt;LI&gt;The kernel runs &lt;TT&gt;/sbin/init&lt;/TT&gt;, as part of the booting process.        &lt;/LI&gt;&lt;/BLOCKQUOTE&gt;&lt;TT&gt;     &lt;BLOCKQUOTE&gt;       &lt;LI&gt;/sbin/init&lt;/TT&gt; runs the &lt;TT&gt;/etc/rcS.d/S30rootusr.sh&lt;/TT&gt;. startup        script. &lt;/LI&gt;&lt;/BLOCKQUOTE&gt;     &lt;BLOCKQUOTE&gt;       &lt;LI&gt;The script runs a number of system startup tasks, including        establishing the minimum host and network configurations for diskless and        dataless operations. &lt;TT&gt;/etc/rcS.d/S30rootusr.sh&lt;/TT&gt; also mounts the        &lt;TT&gt;/usr&lt;/TT&gt; file system. &lt;/LI&gt;&lt;/BLOCKQUOTE&gt;     &lt;OL&gt;       &lt;BLOCKQUOTE&gt;         &lt;LI&gt;If the local database files contain the required configuration          information (host name and IP address), the script uses it.        &lt;/LI&gt;&lt;/BLOCKQUOTE&gt;       &lt;BLOCKQUOTE&gt;         &lt;LI&gt;If the information is not available in local host configuration          files, &lt;TT&gt;/etc/rcS.d/S30rootusr.sh&lt;/TT&gt; uses RARP to acquire the host's          IP address. &lt;/LI&gt;&lt;/BLOCKQUOTE&gt;&lt;/OL&gt;     &lt;BLOCKQUOTE&gt;       &lt;LI&gt;If the local files contain domain name, host name, and default router        address, the machine uses them. If the configuration information is not in        local files, then the system uses the Bootparams protocol to acquire the        host name, domain name, and default router address. Note that the required        information must be available on a network configuration server that is        located on the same network as the host. This is necessary because no        internetwork communications exist at this point. &lt;/LI&gt;&lt;/BLOCKQUOTE&gt;     &lt;BLOCKQUOTE&gt;       &lt;LI&gt;After &lt;TT&gt;/etc/rcS/S30rootusr.sh&lt;/TT&gt; completes its tasks and several        other boot procedures have executed, &lt;TT&gt;/etc/rc2.d/S69inet&lt;/TT&gt; runs.        This script executes startup tasks that must be completed before the name        services (NIS, NIS+, or DNS) can start. These tasks include configuring        the IP routing and setting the domain name. &lt;/LI&gt;&lt;/BLOCKQUOTE&gt;     &lt;BLOCKQUOTE&gt;       &lt;LI&gt;At completion of the S69inet tasks, &lt;TT&gt;/etc/rc2.d/S71rpc&lt;/TT&gt; runs.        This script starts the NIS, NIS+, or DNS name service. &lt;/LI&gt;&lt;/BLOCKQUOTE&gt;     &lt;BLOCKQUOTE&gt;       &lt;LI&gt;After &lt;TT&gt;/etc/rc2.d/S71&lt;/TT&gt; runs, &lt;TT&gt;/etc/rc2.d/S72inetsvc&lt;/TT&gt;        runs. This script starts up services that depend on the presence of the        name services. S72inetsvc also starts the daemon inetd, which manages user        services such as telnet. &lt;/LI&gt;&lt;/BLOCKQUOTE&gt;&lt;/OL&gt;&lt;/OL&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/714742118606354868-4539212106920593801?l=unixtechtips.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unixtechtips.blogspot.com/feeds/4539212106920593801/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=714742118606354868&amp;postID=4539212106920593801&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/714742118606354868/posts/default/4539212106920593801'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/714742118606354868/posts/default/4539212106920593801'/><link rel='alternate' type='text/html' href='http://unixtechtips.blogspot.com/2007/01/configuring-tcpip-on-solaris-overview.html' title='Configuring TCP/IP on Solaris - Overview of the Booting Processes '/><author><name>HuggyPuggy</name><uri>http://www.blogger.com/profile/04602550959022896368</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='10800658094938042256'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-714742118606354868.post-866900488371729268</id><published>2007-01-10T21:21:00.001-08:00</published><updated>2007-01-10T21:21:44.717-08:00</updated><title type='text'>Configuring TCP/IP on Solaris - Network Configuration Procedures </title><content type='html'>&lt;B&gt;&lt;FONT color=#000080&gt;  &lt;P&gt;Introduction&lt;/B&gt;&lt;/FONT&gt; &lt;/P&gt;  &lt;BLOCKQUOTE&gt;Network software installation takes place along with the     installation of the operating system software. At that time, certain IP     configuration parameters must be stored in appropriate files so they can be     read at boot time. &lt;/BLOCKQUOTE&gt;  &lt;BLOCKQUOTE&gt;The procedure is simply a matter of creating or editing the     network- configuration files. How configuration information is made available     to a machine's kernel depends on whether these files are stored locally (local     files mode) or acquired from the network configuration server (network client     mode). Parameters supplied during network configuration are: &lt;/BLOCKQUOTE&gt;  &lt;DIR&gt;  &lt;DIR&gt;  &lt;BLOCKQUOTE&gt;IP address of each network interface on every machine &lt;/BLOCKQUOTE&gt;  &lt;BLOCKQUOTE&gt;Host names of each machine on the network. You can type the host     name in a local file or a name service database. &lt;/BLOCKQUOTE&gt;  &lt;BLOCKQUOTE&gt;NIS, NIS+, or DNS domain name in which the machine resides, if     applicable &lt;/BLOCKQUOTE&gt;  &lt;BLOCKQUOTE&gt;Default router addresses. You supply this only if you have a     simple network topology with only one router attached to each network, or your     routers donâ€™t run routing protocols such as the Router Discovery Server     Protocol (RDISC) or the Router Information Protocol (RIP). (See Chapter 5 for     more information about these protocols.) &lt;/BLOCKQUOTE&gt;  &lt;BLOCKQUOTE&gt;Subnet mask (required only for networks with subnets)   &lt;/BLOCKQUOTE&gt;&lt;/DIR&gt;  &lt;BLOCKQUOTE&gt;This section contains complete information on creating and editing     local configuration files. &lt;/BLOCKQUOTE&gt;&lt;/DIR&gt;&lt;B&gt;&lt;FONT color=#000080&gt;  &lt;P&gt;How to Configure a Host for Local Files Mode&lt;/B&gt;&lt;/FONT&gt; &lt;/P&gt;  &lt;BLOCKQUOTE&gt;Use this procedure for configuring TCP/IP on a machine that run in     local files mode. &lt;/BLOCKQUOTE&gt;  &lt;OL&gt;    &lt;OL&gt;      &lt;BLOCKQUOTE&gt;        &lt;LI&gt;Become superuser and change to the &lt;TT&gt;/etc&lt;/TT&gt; directory.       &lt;/LI&gt;&lt;/BLOCKQUOTE&gt;      &lt;BLOCKQUOTE&gt;        &lt;LI&gt;Type the host name of the machine in the file &lt;TT&gt;/etc/nodename&lt;/TT&gt;.         For example, if the name of the host is tenere, type tenere in the file.         &lt;/LI&gt;&lt;/BLOCKQUOTE&gt;      &lt;BLOCKQUOTE&gt;        &lt;LI&gt;Create a file named &lt;TT&gt;/etc/hostname.interface&lt;/TT&gt; for each network         interface. (The Solaris installation program automatically creates this         file for the primary network interface.) &lt;/LI&gt;&lt;/BLOCKQUOTE&gt;      &lt;BLOCKQUOTE&gt;        &lt;LI&gt;Type either the interface IP address or the interface name in each         &lt;TT&gt;/etc/hostname.interface&lt;/TT&gt; file. For example, create a file named         hostname.ie1, and type either the IP address of the host's interface or         the host's name. &lt;/LI&gt;&lt;/BLOCKQUOTE&gt;      &lt;BLOCKQUOTE&gt;        &lt;LI&gt;Edit the &lt;TT&gt;/etc/inet/hosts&lt;/TT&gt; file to add: &lt;/LI&gt;&lt;/BLOCKQUOTE&gt;      &lt;BLOCKQUOTE&gt;IP addresses that you have assigned to any additional network         interfaces in the local machine, along with the corresponding host name         for each interface. The Solaris installation program will already have         created entries for the primary network interface and loopback address.       &lt;/BLOCKQUOTE&gt;      &lt;BLOCKQUOTE&gt;IP address or addresses of the file server, if the         &lt;TT&gt;/usr&lt;/TT&gt; file system is NFS mounted. &lt;/BLOCKQUOTE&gt;      &lt;BLOCKQUOTE&gt;        &lt;LI&gt;Type the host's fully qualified domain name in the         &lt;TT&gt;/etc/defaultdomain&lt;/TT&gt; file. For example, suppose host tenere was         part of the domain &lt;TT&gt;deserts.worldwide.com&lt;/TT&gt;. Therefore, you would         type: &lt;TT&gt;deserts.worldwide.com&lt;/TT&gt; in &lt;TT&gt;/etc/defaultdomain&lt;/TT&gt;.       &lt;/LI&gt;&lt;/BLOCKQUOTE&gt;      &lt;BLOCKQUOTE&gt;        &lt;LI&gt;Type the router's name in &lt;TT&gt;/etc/defaultrouter&lt;/TT&gt;.   &lt;/LI&gt;&lt;/BLOCKQUOTE&gt;      &lt;BLOCKQUOTE&gt;        &lt;LI&gt;Type the name of the default router and its IP addresses in         &lt;TT&gt;/etc/inet/hosts&lt;/TT&gt;. Additional routing options are available. You         can apply these options to a local files mode configuration.       &lt;/LI&gt;&lt;/BLOCKQUOTE&gt;      &lt;BLOCKQUOTE&gt;        &lt;LI&gt;If your network is subnetted, type the network number and the netmask         in the file &lt;TT&gt;/etc/inet/netmasks&lt;/TT&gt;. If you have set up a NIS or NIS+         server, you can type netmask information in the appropriate database on         the server as long as server and clients are on the same network.       &lt;/LI&gt;&lt;/BLOCKQUOTE&gt;      &lt;BLOCKQUOTE&gt;        &lt;LI&gt;Reboot each machine on the network. &lt;/LI&gt;&lt;/BLOCKQUOTE&gt;&lt;/OL&gt;&lt;/OL&gt;&lt;B&gt;&lt;FONT   color=#000080&gt;  &lt;P&gt;Setting Up a Network Configuration Server&lt;/B&gt;&lt;/FONT&gt; &lt;/P&gt;  &lt;BLOCKQUOTE&gt;If you plan to configure certain hosts as network clients, you     must configure at least one machine on your network as a network configuration     server. (Refer to â€œNetwork Configuration Serversâ€ on page 45 for an     introduction.) Setting up a network configuration server involves: &lt;/BLOCKQUOTE&gt;  &lt;OL&gt;    &lt;OL&gt;      &lt;BLOCKQUOTE&gt;        &lt;LI&gt;Turning on the network configuration daemons:&lt;BR&gt;- in.tftpd&lt;BR&gt;-         in.rarpd&lt;BR&gt;- rpc.bootparamd&lt;/LI&gt;&lt;/BLOCKQUOTE&gt;      &lt;BLOCKQUOTE&gt;        &lt;LI&gt;Editing and maintaining the network configuration files on the         configuration server. &lt;/LI&gt;&lt;/BLOCKQUOTE&gt;&lt;/OL&gt;&lt;/OL&gt;&lt;B&gt;&lt;FONT color=#000080&gt;  &lt;P&gt;How to Set Up a Network Configuration Server&lt;/B&gt;&lt;/FONT&gt; &lt;/P&gt;  &lt;OL&gt;    &lt;OL&gt;      &lt;BLOCKQUOTE&gt;        &lt;LI&gt;Become superuser and change to the root directory of the prospective         network configuration server. &lt;/LI&gt;&lt;/BLOCKQUOTE&gt;      &lt;BLOCKQUOTE&gt;        &lt;LI&gt;Turn on the in.tftpd daemon by creating the directory         &lt;TT&gt;/tftpboot&lt;/TT&gt;: &lt;/LI&gt;&lt;/BLOCKQUOTE&gt;&lt;TT&gt;      &lt;BLOCKQUOTE&gt;# mkdir /tftpboot&lt;/TT&gt; &lt;/BLOCKQUOTE&gt;      &lt;BLOCKQUOTE&gt;This configures the machine as a TFTP, bootparams, and RARP         server. &lt;/BLOCKQUOTE&gt;      &lt;BLOCKQUOTE&gt;        &lt;LI&gt;Create a symbolic link to the directory. &lt;/LI&gt;&lt;/BLOCKQUOTE&gt;&lt;TT&gt;      &lt;BLOCKQUOTE&gt;# ln -s /tftpboot/. /tftpboot/tftpboot&lt;/TT&gt; &lt;/BLOCKQUOTE&gt;      &lt;BLOCKQUOTE&gt;        &lt;LI&gt;Enable the tftp line in intetd.conf. Check that the         &lt;TT&gt;/etc/inetd.conf&lt;/TT&gt; entry reads: &lt;/LI&gt;&lt;/BLOCKQUOTE&gt;&lt;TT&gt;      &lt;BLOCKQUOTE&gt;tftp dgram udp wait root /usr/sbin/in.tftpd in.tftpd -s         /tftpboot&lt;/TT&gt; &lt;/BLOCKQUOTE&gt;      &lt;BLOCKQUOTE&gt;This prevents inettftpd() from retrieving any file other than         one located in &lt;TT&gt;/tftpboot&lt;/TT&gt;. &lt;/BLOCKQUOTE&gt;      &lt;BLOCKQUOTE&gt;        &lt;LI&gt;Edit the hosts database, and add the host names and IP addresses for         every client on the network. &lt;/LI&gt;&lt;/BLOCKQUOTE&gt;      &lt;BLOCKQUOTE&gt;        &lt;LI&gt;Edit the ethers database, and create entries for every host on the         network to run in network client mode. &lt;/LI&gt;&lt;/BLOCKQUOTE&gt;      &lt;BLOCKQUOTE&gt;        &lt;LI&gt;Edit the bootparams database. Use the wildcard entry or create an         entry for every host that run in network client mode. &lt;/LI&gt;&lt;/BLOCKQUOTE&gt;      &lt;BLOCKQUOTE&gt;        &lt;LI&gt;Reboot the server. &lt;/LI&gt;&lt;/BLOCKQUOTE&gt;&lt;/OL&gt;&lt;/OL&gt;&lt;B&gt;&lt;FONT color=#000080&gt;  &lt;P&gt;Configuring Network Clients&lt;/B&gt;&lt;/FONT&gt; &lt;/P&gt;  &lt;BLOCKQUOTE&gt;Network clients receive their configuration information from     network configuration servers. Therefore, before you configure a host as a     network client you must ensure that at least one network configuration server     is set up for the network. &lt;/BLOCKQUOTE&gt;&lt;B&gt;&lt;FONT color=#000080&gt;  &lt;P&gt;How to Configure Hosts for Network Client Mode&lt;/B&gt;&lt;/FONT&gt; &lt;/P&gt;  &lt;BLOCKQUOTE&gt;Do the following on each host to be configured in network client     mode: &lt;/BLOCKQUOTE&gt;  &lt;OL&gt;    &lt;OL&gt;      &lt;BLOCKQUOTE&gt;        &lt;LI&gt;Become superuser. &lt;/LI&gt;&lt;/BLOCKQUOTE&gt;      &lt;BLOCKQUOTE&gt;        &lt;LI&gt;Check the directory for the existence of an &lt;TT&gt;/etc/nodename&lt;/TT&gt;         file. If one exists, delete it. &lt;/LI&gt;&lt;/BLOCKQUOTE&gt;      &lt;BLOCKQUOTE&gt;Eliminating &lt;TT&gt;/etc/nodename&lt;/TT&gt; causes the system to use         the hostconfig program to obtain the host name, domain name, and router         addresses from the network configuration server. &lt;/BLOCKQUOTE&gt;      &lt;BLOCKQUOTE&gt;        &lt;LI&gt;Create the file &lt;TT&gt;/etc/hostname.interface&lt;/TT&gt;, if it does not         exist. Make sure that the file is empty. An empty         &lt;TT&gt;/etc/hostname.interface&lt;/TT&gt; file causes the system to acquire the IP         address from the network configuration server. &lt;/LI&gt;&lt;/BLOCKQUOTE&gt;      &lt;BLOCKQUOTE&gt;        &lt;LI&gt;Ensure that the &lt;TT&gt;/etc/inet/hosts&lt;/TT&gt; file contains only the host         name and IP address of the loopback network interface. The file should not         contain the IP address and host name for the local machine (primary         network interface). EXCEPTION: For a diskless client (a machine with an         NFS-mounted root file system), type the name and IP address of the server         that provides the client's root file system (usually, but not always, the         network configuration server). &lt;/LI&gt;&lt;/BLOCKQUOTE&gt;      &lt;BLOCKQUOTE&gt;        &lt;LI&gt;Check for the existence of an &lt;TT&gt;/etc/defaultdomain file&lt;/TT&gt;. If one         exists, delete it. &lt;/LI&gt;&lt;/BLOCKQUOTE&gt;      &lt;BLOCKQUOTE&gt;The hostconfig program sets the domain name automatically. If         you want to override the domain name set by hostconfig, type the         substitute domain name in the file &lt;TT&gt;/etc/defaultdomain&lt;/TT&gt;.   &lt;/BLOCKQUOTE&gt;      &lt;BLOCKQUOTE&gt;        &lt;LI&gt;Ensure that the search paths in the client's         &lt;TT&gt;/etc/nsswitch.conf&lt;/TT&gt; reflects the name service requirements for         your network. &lt;/LI&gt;&lt;/BLOCKQUOTE&gt;&lt;/OL&gt;&lt;/OL&gt;&lt;B&gt;&lt;FONT color=#000080&gt;  &lt;P&gt;How to Specify a Router for the Network Client&lt;/B&gt;&lt;/FONT&gt; &lt;/P&gt;  &lt;OL&gt;    &lt;OL&gt;      &lt;BLOCKQUOTE&gt;        &lt;LI&gt;If you have only one router on the network and you want the network         configuration server to specify its name automatically, ensure that the         network client does not have a &lt;TT&gt;/etc/defaultrouter&lt;/TT&gt; file.       &lt;/LI&gt;&lt;/BLOCKQUOTE&gt;      &lt;BLOCKQUOTE&gt;        &lt;LI&gt;To override the name of the default router provided by the network         configuration server: &lt;/LI&gt;&lt;/BLOCKQUOTE&gt;      &lt;BLOCKQUOTE&gt;Create &lt;TT&gt;/etc/defaultrouter&lt;/TT&gt; on the network client.       &lt;/BLOCKQUOTE&gt;      &lt;BLOCKQUOTE&gt;Type the host name and IP address of the machine you have         designated as the default router. &lt;/BLOCKQUOTE&gt;      &lt;BLOCKQUOTE&gt;Add the host name and IP address of the designated default         router to the network client's &lt;TT&gt;/etc/inet/hosts&lt;/TT&gt;. &lt;/BLOCKQUOTE&gt;      &lt;BLOCKQUOTE&gt;        &lt;LI&gt;If you have multiple routers on the network, create         &lt;TT&gt;/etc/defaultrouter&lt;/TT&gt; on the network client, but leave it empty.         &lt;/LI&gt;&lt;/BLOCKQUOTE&gt;&lt;/OL&gt;&lt;/OL&gt;  &lt;BLOCKQUOTE&gt;Creating &lt;TT&gt;/etc/defaultrouter&lt;/TT&gt; and leaving it empty causes     one of the two dynamic routing protocols to run: ICMP Router Discovery     protocol (RDISC), or Routing Information Protocol (RIP). The system first runs     the program in.rdisc, which looks for routers that are running the router     discovery protocol. If it finds one such router, in.rdisc continues to run and     keeps track of the routers that are running the RDISC protocol. &lt;/BLOCKQUOTE&gt;  &lt;BLOCKQUOTE&gt;If the system discovers that routers are not responding to the     RDISC protocol, it uses RIP and runs the daemon in.routed to keep track of     them. &lt;/BLOCKQUOTE&gt;&lt;U&gt;  &lt;BLOCKQUOTE&gt;After Installing a Network Client&lt;/U&gt; &lt;/BLOCKQUOTE&gt;  &lt;BLOCKQUOTE&gt;After you have finished editing the files on each network client     machine, do the following on the network configuration server. &lt;/BLOCKQUOTE&gt;  &lt;OL&gt;    &lt;OL&gt;      &lt;BLOCKQUOTE&gt;        &lt;LI&gt;Add entries for the hosts in the ethers and hosts databases.       &lt;/LI&gt;&lt;/BLOCKQUOTE&gt;      &lt;BLOCKQUOTE&gt;        &lt;LI&gt;Add entries for the hosts to the bootparams database. To simplify         matters, you can type a wild card in the bootparams database in place of         individual entries for each host. &lt;/LI&gt;&lt;/BLOCKQUOTE&gt;      &lt;BLOCKQUOTE&gt;        &lt;LI&gt;Reboot the server. &lt;/LI&gt;&lt;/BLOCKQUOTE&gt;&lt;/OL&gt;&lt;/OL&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/714742118606354868-866900488371729268?l=unixtechtips.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unixtechtips.blogspot.com/feeds/866900488371729268/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=714742118606354868&amp;postID=866900488371729268&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/714742118606354868/posts/default/866900488371729268'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/714742118606354868/posts/default/866900488371729268'/><link rel='alternate' type='text/html' href='http://unixtechtips.blogspot.com/2007/01/configuring-tcpip-on-solaris-network_10.html' title='Configuring TCP/IP on Solaris - Network Configuration Procedures '/><author><name>HuggyPuggy</name><uri>http://www.blogger.com/profile/04602550959022896368</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='10800658094938042256'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-714742118606354868.post-5037085224924531839</id><published>2007-01-10T21:20:00.001-08:00</published><updated>2007-01-10T21:20:52.695-08:00</updated><title type='text'>Configuring TCP/IP on Solaris - Network Databases and nsswitch.conf File </title><content type='html'>&lt;B&gt;&lt;FONT color=#000080&gt; &lt;P&gt;Introduction&lt;/B&gt;&lt;/FONT&gt; &lt;/P&gt; &lt;BLOCKQUOTE&gt;The network databases are files that provide information needed to    configure the network. The network databases are: &lt;/BLOCKQUOTE&gt; &lt;DIR&gt; &lt;DIR&gt; &lt;BLOCKQUOTE&gt;hosts &lt;/BLOCKQUOTE&gt; &lt;BLOCKQUOTE&gt;netmasks &lt;/BLOCKQUOTE&gt; &lt;BLOCKQUOTE&gt;ethers &lt;/BLOCKQUOTE&gt; &lt;BLOCKQUOTE&gt;bootparams &lt;/BLOCKQUOTE&gt; &lt;BLOCKQUOTE&gt;protocols &lt;/BLOCKQUOTE&gt; &lt;BLOCKQUOTE&gt;services &lt;/BLOCKQUOTE&gt; &lt;BLOCKQUOTE&gt;networks &lt;/BLOCKQUOTE&gt;&lt;/DIR&gt; &lt;BLOCKQUOTE&gt;As part of the configuration process, you edit the hosts database    and the netmasks database, if your network is subnetted. Two network    databases, bootparams and ethers, are used to configure machines as network    clients. The remaining databases are used by the operating system and seldom    require editing. &lt;/BLOCKQUOTE&gt; &lt;BLOCKQUOTE&gt;Although it is not a network database, the nsswitch.conf file    needs to be configured along with the relevant network databases.    nsswitch.conf specifies which name service to use for a particular machine:    NIS, NIS+, DNS, or local files. &lt;/BLOCKQUOTE&gt;&lt;/DIR&gt;&lt;B&gt;&lt;FONT color=#000080&gt; &lt;P&gt;How Name Services Affect Network Databases&lt;/B&gt;&lt;/FONT&gt; &lt;/P&gt; &lt;BLOCKQUOTE&gt;Your network database takes a form that depends on the type of    name service you select for your network. For example, the hosts database    contains, at minimum, the host name and IP address of the local machine and    any network interfaces directly connected to the local machine. However, the    hosts database could contain other IP addresses and host names, depending on    the type of name service on your network. &lt;/BLOCKQUOTE&gt; &lt;BLOCKQUOTE&gt;The network databases are used as follows: &lt;/BLOCKQUOTE&gt; &lt;DIR&gt; &lt;DIR&gt; &lt;BLOCKQUOTE&gt;Networks that use local files for their name service rely on files    in the /etc/inet and /etc directories &lt;/BLOCKQUOTE&gt; &lt;BLOCKQUOTE&gt;NIS+ uses databases called NIS+ tables &lt;/BLOCKQUOTE&gt; &lt;BLOCKQUOTE&gt;NIS uses databases called NIS maps &lt;/BLOCKQUOTE&gt; &lt;BLOCKQUOTE&gt;DNS uses records with host information &lt;/BLOCKQUOTE&gt;&lt;/DIR&gt;&lt;B&gt;&lt;FONT  color=#800000&gt; &lt;BLOCKQUOTE&gt;Note&lt;/B&gt;&lt;/FONT&gt; - DNS boot and data files do not correspond    directly to the network databases. &lt;/BLOCKQUOTE&gt;&lt;/DIR&gt; &lt;TABLE cellSpacing=1 cellPadding=2 width=623 border=1&gt;   &lt;TBODY&gt;   &lt;TR&gt;     &lt;TD vAlign=center width="23%"&gt;&lt;B&gt;       &lt;P&gt;Network Database&lt;/B&gt;&lt;/P&gt;&lt;/TD&gt;     &lt;TD vAlign=center width="27%"&gt;&lt;B&gt;       &lt;P&gt;Local Files&lt;/B&gt;&lt;/P&gt;&lt;/TD&gt;     &lt;TD vAlign=center width="25%"&gt;&lt;B&gt;       &lt;P&gt;NIS+ Tables&lt;/B&gt;&lt;/P&gt;&lt;/TD&gt;     &lt;TD vAlign=center width="25%"&gt;&lt;B&gt;       &lt;P&gt;NIS Maps&lt;/B&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;   &lt;TR&gt;     &lt;TD vAlign=center width="23%"&gt;       &lt;P&gt;hosts&lt;/P&gt;&lt;/TD&gt;     &lt;TD vAlign=center width="27%"&gt;       &lt;P&gt;/etc/inet/hosts&lt;/P&gt;&lt;/TD&gt;     &lt;TD vAlign=center width="25%"&gt;       &lt;P&gt;hosts.ord_dir&lt;/P&gt;&lt;/TD&gt;     &lt;TD vAlign=center width="25%"&gt;       &lt;P&gt;hosts.byaddr&lt;BR&gt;hosts.byname&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;   &lt;TR&gt;     &lt;TD vAlign=center width="23%"&gt;       &lt;P&gt;netmasks&lt;/P&gt;&lt;/TD&gt;     &lt;TD vAlign=center width="27%"&gt;       &lt;P&gt;/etc/inet/netmasks&lt;/P&gt;&lt;/TD&gt;     &lt;TD vAlign=center width="25%"&gt;       &lt;P&gt;netmasks.ord_dir&lt;/P&gt;&lt;/TD&gt;     &lt;TD vAlign=center width="25%"&gt;       &lt;P&gt;netmasks.byaddr&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;   &lt;TR&gt;     &lt;TD vAlign=center width="23%"&gt;       &lt;P&gt;ethers&lt;/P&gt;&lt;/TD&gt;     &lt;TD vAlign=center width="27%"&gt;       &lt;P&gt;/etc/ethers&lt;/P&gt;&lt;/TD&gt;     &lt;TD vAlign=center width="25%"&gt;       &lt;P&gt;ethers.ord_dir&lt;/P&gt;&lt;/TD&gt;     &lt;TD vAlign=center width="25%"&gt;       &lt;P&gt;ethers.byname&lt;BR&gt;ethers.byaddr&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;   &lt;TR&gt;     &lt;TD vAlign=center width="23%"&gt;       &lt;P&gt;bootparams&lt;/P&gt;&lt;/TD&gt;     &lt;TD vAlign=center width="27%"&gt;       &lt;P&gt;/etc/bootparams&lt;/P&gt;&lt;/TD&gt;     &lt;TD vAlign=center width="25%"&gt;       &lt;P&gt;bootparams.ord_dir&lt;/P&gt;&lt;/TD&gt;     &lt;TD vAlign=center width="25%"&gt;       &lt;P&gt;bootparams&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;   &lt;TR&gt;     &lt;TD vAlign=center width="23%"&gt;       &lt;P&gt;protocols&lt;/P&gt;&lt;/TD&gt;     &lt;TD vAlign=center width="27%"&gt;       &lt;P&gt;/etc/inet/protocols&lt;/P&gt;&lt;/TD&gt;     &lt;TD vAlign=center width="25%"&gt;       &lt;P&gt;protocols.ord_dir&lt;/P&gt;&lt;/TD&gt;     &lt;TD vAlign=center width="25%"&gt;       &lt;P&gt;protocols.byname&lt;BR&gt;protocols.bynumber&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;   &lt;TR&gt;     &lt;TD vAlign=center width="23%"&gt;       &lt;P&gt;services&lt;/P&gt;&lt;/TD&gt;     &lt;TD vAlign=center width="27%"&gt;       &lt;P&gt;/etc/inet/services&lt;/P&gt;&lt;/TD&gt;     &lt;TD vAlign=center width="25%"&gt;       &lt;P&gt;services.ord_dir&lt;/P&gt;&lt;/TD&gt;     &lt;TD vAlign=center width="25%"&gt;       &lt;P&gt;services.byname&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;   &lt;TR&gt;     &lt;TD vAlign=center width="23%"&gt;       &lt;P&gt;networks&lt;/P&gt;&lt;/TD&gt;     &lt;TD vAlign=center width="27%"&gt;       &lt;P&gt;/etc/inet/networks&lt;/P&gt;&lt;/TD&gt;     &lt;TD vAlign=center width="25%"&gt;       &lt;P&gt;networks.ord_dir&lt;/P&gt;&lt;/TD&gt;     &lt;TD vAlign=center width="25%"&gt;       &lt;P&gt;networks.byaddr&lt;BR&gt;networks.byname&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;B&gt;&lt;FONT  color=#000080&gt;&lt;TT&gt; &lt;P&gt;nsswitch.conf&lt;/TT&gt; File - Specifying Which Name Service to Use&lt;/B&gt;&lt;/FONT&gt;  &lt;/P&gt; &lt;BLOCKQUOTE&gt;The &lt;TT&gt;/etc/nsswitch.conf&lt;/TT&gt; file defines the search order of    the network databases. The Solaris installation program creates a default    &lt;TT&gt;/etc/nsswitch.conf&lt;/TT&gt; file for the local machine, based on the name    service you indicate during the installation process. If you selected the    'None' option, indicating local files for name service, the resulting    nsswitch.conf file resembles the following example: &lt;/BLOCKQUOTE&gt; &lt;TABLE cellSpacing=1 cellPadding=2 width=624 border=1&gt;   &lt;TBODY&gt;   &lt;TR&gt;     &lt;TD vAlign=center&gt;&lt;B&gt;       &lt;P&gt;nsswitch.conf for Networks Using Files for Name Service&lt;/B&gt; &lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;   &lt;TR&gt;     &lt;TD vAlign=center&gt;&lt;PRE&gt;# /etc/nsswitch.files: # # An example file that could be copied over to /etc/nsswitch.conf; # it does not use any naming service. # # "hosts:" and "services:" in this file are used only if the # /etc/netconfig file contains "switch.so" as a # nametoaddr library for "inet" transports. passwd: files group: files hosts: files networks: files protocols: files rpc: files ethers: files netmasks: files bootparams: files publickey: files # At present there isn't a 'files' backend for netgroup; the # system will figure it out pretty quickly, # and won't use netgroups at all. netgroup: files automount: files aliases: files services: files sendmailvars: files&lt;/PRE&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt; &lt;BLOCKQUOTE&gt;The nsswitch.conf(4) man page describes the file in detail. Its    basic syntax is: &lt;/BLOCKQUOTE&gt;&lt;TT&gt; &lt;BLOCKQUOTE&gt;database name-service-to-search&lt;/TT&gt; &lt;/BLOCKQUOTE&gt; &lt;BLOCKQUOTE&gt;The database field can list one of many types of databases    searched by the operating system. For example, it could indicate a database    affecting users, such as passwd or aliases, or a network database. The    parameter name-service-to-search can have the values files, nis, or nis+ for    the network databases. (The hosts database can also have dns as a name service    to search.) You can also list more than one name service, such as nis+ and    files. &lt;/BLOCKQUOTE&gt; &lt;BLOCKQUOTE&gt;In the above example, the only search option indicated is files.    Therefore, the local machine gets security and automounting information, in    addition to network database information, from files located in its    &lt;TT&gt;/etc&lt;/TT&gt; and &lt;TT&gt;/etc/inet&lt;/TT&gt; directories. &lt;/BLOCKQUOTE&gt;&lt;B&gt;&lt;FONT  color=#000080&gt; &lt;P&gt;Changing &lt;TT&gt;nsswitch.conf&lt;/B&gt;&lt;/FONT&gt;&lt;/TT&gt; &lt;/P&gt; &lt;BLOCKQUOTE&gt;The &lt;TT&gt;/etc&lt;/TT&gt; directory contains the nsswitch.conf file    created by the Solaris installation program. It also contains template files    for the following name services: &lt;/BLOCKQUOTE&gt; &lt;DIR&gt; &lt;DIR&gt; &lt;BLOCKQUOTE&gt;nsswitch.files &lt;/BLOCKQUOTE&gt; &lt;BLOCKQUOTE&gt;nsswitch.nis &lt;/BLOCKQUOTE&gt; &lt;BLOCKQUOTE&gt;nsswitch.nis+ &lt;/BLOCKQUOTE&gt;&lt;/DIR&gt; &lt;BLOCKQUOTE&gt;If you want to change from one name service to another, you can    copy the appropriate template to nsswitch.conf. You can also selectively edit    the nsswitch.conf file, and change the default name service to search for    individual databases. &lt;/BLOCKQUOTE&gt; &lt;BLOCKQUOTE&gt;For example, on a network running NIS, you might have to change    the &lt;TT&gt;nsswitch.conf&lt;/TT&gt; file on diskless clients. The search path for the    bootparams and ethers databases must list files as the first option, and nis.    The example below shows the correct search paths. &lt;/BLOCKQUOTE&gt;&lt;/DIR&gt; &lt;TABLE cellSpacing=1 cellPadding=1 width=450 border=1&gt;   &lt;TBODY&gt;   &lt;TR&gt;     &lt;TD vAlign=center&gt;&lt;B&gt;       &lt;P&gt;nsswitch.conf for a Diskless Client on a Network Running    NIS&lt;/B&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;   &lt;TR&gt;     &lt;TD vAlign=center&gt;&lt;PRE&gt;## /etc/nsswitch.conf:# . . passwd: files nis group: file nis # consult /etc "files" only if nis is down. hosts: nis [NOTFOUND=return] files networks: nis [NOTFOUND=return] files protocols: nis [NOTFOUND=return] files rpc: nis [NOTFOUND=return] files ethers: files [NOTFOUND=return] nis netmasks: nis [NOTFOUND=return] files bootparams: files [NOTFOUND=return] nis publickey: nis netgroup: nis automount: files nis aliases: files nis # for efficient getservbyname() avoid nis services: files nis sendmailvars: files&lt;/PRE&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;B&gt;&lt;FONT color=#000080&gt;&lt;TT&gt; &lt;P&gt;bootparams&lt;/TT&gt; Database&lt;/B&gt;&lt;/FONT&gt; &lt;/P&gt; &lt;BLOCKQUOTE&gt;The bootparams database contains information used by diskless    clients and machines configured to boot in the network client mode. You need    to edit it if your network will have network clients. The database is built    from information entered into the &lt;TT&gt;/etc/bootparams&lt;/TT&gt; file. &lt;/BLOCKQUOTE&gt; &lt;BLOCKQUOTE&gt;The bootparams(4) man page contains complete syntax for this    database. Its basic syntax is: &lt;/BLOCKQUOTE&gt; &lt;DIR&gt;&lt;PRE&gt;    machine-name file-key-server-name:pathname&lt;/PRE&gt; &lt;BLOCKQUOTE&gt;For each diskless or network client machine, the entry might    contain the following information: the name of the client, a list of keys, the    names of servers, and path names. &lt;/BLOCKQUOTE&gt; &lt;BLOCKQUOTE&gt;The first item of each entry is the name of the client machine.    Next is a list of keys, names of servers, and path names, separated by tab    characters. All items but the first are optional. The database can contain a    wildcard entry that will be matched by all clients. Here is an example:  &lt;/BLOCKQUOTE&gt;&lt;/DIR&gt; &lt;TABLE cellSpacing=1 cellPadding=1 width=450 border=1&gt;   &lt;TBODY&gt;   &lt;TR&gt;     &lt;TD vAlign=center&gt;&lt;B&gt;       &lt;P&gt;bootparams Database&lt;/B&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;   &lt;TR&gt;     &lt;TD vAlign=center&gt;&lt;PRE&gt;myclient root=myserver : /nfsroot/myclient \ swap=myserver : /nfsswap//myclient \ dump=myserver : /nfsdump/myclient&lt;/PRE&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt; &lt;BLOCKQUOTE&gt;In this example the term &lt;TT&gt;dump=:&lt;/TT&gt; tells diskless hosts not    to look for a dump file. &lt;/BLOCKQUOTE&gt;&lt;B&gt;&lt;U&gt; &lt;BLOCKQUOTE&gt;Wildcard Entry for bootparams&lt;/B&gt;&lt;/U&gt; &lt;BR&gt;In most cases, you will    want to use the wildcard entry when editing the bootparams database to support    diskless clients. This entry is: &lt;/BLOCKQUOTE&gt; &lt;DIR&gt;&lt;PRE&gt;    * root=server:/path dump=:&lt;/PRE&gt; &lt;BLOCKQUOTE&gt;The asterisk (*) wildcard indicates that this entry applies to all    clients not specifically named within the bootparams database.  &lt;/BLOCKQUOTE&gt;&lt;/DIR&gt;&lt;B&gt;&lt;FONT color=#000080&gt;&lt;TT&gt; &lt;P&gt;ethers&lt;/TT&gt; Database&lt;/B&gt;&lt;/FONT&gt; &lt;/P&gt; &lt;BLOCKQUOTE&gt;The ethers database is built from information entered into the    &lt;TT&gt;/etc/ethers&lt;/TT&gt; file. It associates host names to their Ethernet    addresses. You need to create an ethers database only if you are running the    RARP daemon; that is, if you are configuring network clients or diskless    machines. &lt;/BLOCKQUOTE&gt; &lt;BLOCKQUOTE&gt;RARP uses the file to map Ethernet addresses to IP addresses. If    you are running the RARP daemon in.rarpd, you need to set up the ethers file    and maintain it on all hosts running the daemon to reflect changes to the    network. &lt;/BLOCKQUOTE&gt; &lt;BLOCKQUOTE&gt;The ethers(4) man page contains complete syntax information for    this database. Its basic format is: &lt;/BLOCKQUOTE&gt;&lt;TT&gt; &lt;BLOCKQUOTE&gt;Ethernet-address hostname #comment&lt;BR&gt;Ethernet-address is the    Ethernet address of the host.&lt;BR&gt;hostname is the official name of the    host.&lt;BR&gt;#comment is any kind of note you want to append to an entry in the    file.&lt;/BLOCKQUOTE&gt;&lt;/TT&gt; &lt;BLOCKQUOTE&gt;The equipment manufacturer provides the Ethernet address. If a    machine does not display the Ethernet address when you power up, see your    hardware manuals for assistance. &lt;/BLOCKQUOTE&gt; &lt;BLOCKQUOTE&gt;When adding entries to the ethers database, make sure that host    names correspond to the primary names in the hosts database, not to the    nicknames, as shown in the following example: &lt;/BLOCKQUOTE&gt; &lt;TABLE cellSpacing=1 cellPadding=1 width=450 border=1&gt;   &lt;TBODY&gt;   &lt;TR&gt;     &lt;TD vAlign=center&gt;&lt;B&gt;       &lt;P&gt;Entries in the ethers Database&lt;/B&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;   &lt;TR&gt;     &lt;TD vAlign=center&gt;&lt;PRE&gt;8:0:20:1:40:16 fayoum 8:0:20:1:40:15 nubian 8:0:20:1:40:7 sahara # This is a comment 8:0:20:1:40:14 tenere&lt;/PRE&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;B&gt;&lt;FONT color=#000080&gt; &lt;P&gt;Other Network Databases&lt;/B&gt;&lt;/FONT&gt; &lt;/P&gt; &lt;BLOCKQUOTE&gt;The remaining network databases seldom need to be edited.  &lt;/BLOCKQUOTE&gt;&lt;B&gt;&lt;FONT color=#000080&gt;&lt;TT&gt; &lt;BLOCKQUOTE&gt;networks database&lt;/TT&gt; Database&lt;/B&gt;&lt;/FONT&gt; &lt;/BLOCKQUOTE&gt; &lt;DIR&gt; &lt;BLOCKQUOTE&gt;The networks database associates network names with network    numbers, enabling some applications to use and display names rather than    numbers. The networks database is based on information in the    /etc/inet/networks file. It contains the names of all networks to which your    network connects via routers. &lt;/BLOCKQUOTE&gt; &lt;BLOCKQUOTE&gt;The Solaris installation program sets up the initial networks    database. The only time you need to update it is when you add a new network to    your existing network topology. &lt;/BLOCKQUOTE&gt; &lt;BLOCKQUOTE&gt;The networks(4) man page contains full syntax information for    /etc/inet/networks. Here is its basic format: &lt;/BLOCKQUOTE&gt; &lt;DIR&gt;&lt;PRE&gt;  network-name network-number nickname(s) # comment   network-name is the official name for the network.   network-number is the number assigned by the InterNIC.   nickname is any other name by which the network is known.   #comment is any kind of note you want to append to an entry in the file.&lt;/PRE&gt; &lt;BLOCKQUOTE&gt;It is particularly important that you maintain the networks file.    The netstat program uses the information in this database to produce status    tables. The example shows a sample &lt;TT&gt;/etc/networks&lt;/TT&gt; file:  &lt;/BLOCKQUOTE&gt;&lt;/DIR&gt;&lt;/DIR&gt; &lt;TABLE cellSpacing=1 cellPadding=1 width=450 border=1&gt;   &lt;TBODY&gt;   &lt;TR&gt;     &lt;TD vAlign=center&gt;&lt;B&gt;       &lt;P&gt;/etc/networks File&lt;/B&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;   &lt;TR&gt;     &lt;TD vAlign=center&gt;&lt;PRE&gt;#ident "@(#)networks 1.4 92/07/14 SMI" /* SVr4.0 1.1 */ # # The networks file associates Internet Protocol (IP) network numbers with network names. The format of this file is: # # network-name network-number nicnames . . . # The loopback network is used only for intra-machine communication #loopback 127 # Internet networks # arpanet 10 arpa # Historical ucb-ether 46 ucbether # # local networks eng 193.9.0 #engineering acc 193.9.1 #accounting prog 193.9.2 #programming&lt;/PRE&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;B&gt;&lt;FONT  color=#000080&gt;&lt;TT&gt; &lt;BLOCKQUOTE&gt;protocols&lt;/TT&gt; Database&lt;/B&gt;&lt;/FONT&gt; &lt;/BLOCKQUOTE&gt; &lt;DIR&gt; &lt;BLOCKQUOTE&gt;The protocols database lists the TCP/IP protocols installed on    your system and their numbers; the Solaris installation program automatically    creates it. It is rare when this file requires administrative handling.  &lt;/BLOCKQUOTE&gt; &lt;BLOCKQUOTE&gt;The protocols database contains the names of the TCP/IP protocols    installed on the system. Its syntax is completely described in the    protocols(4) man page. The example below shows an example of the    &lt;TT&gt;/etc/inet/protocols&lt;/TT&gt; file: &lt;/BLOCKQUOTE&gt;&lt;/DIR&gt; &lt;TABLE cellSpacing=1 cellPadding=1 width=450 border=1&gt;   &lt;TBODY&gt;   &lt;TR&gt;     &lt;TD vAlign=center&gt;&lt;B&gt;       &lt;P&gt;/etc/inet/protocols File&lt;/B&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;   &lt;TR&gt;     &lt;TD vAlign=center&gt;&lt;PRE&gt;# # Internet (IP) protocols # ip 0 IP # internet protocol, pseudo protocol number icmp 1 ICMP # internet control message protocol tcp 6 TCP # transmission control protocol udp 17 UDP # user datagram protocol&lt;/PRE&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;B&gt;&lt;FONT  color=#000080&gt;&lt;TT&gt; &lt;BLOCKQUOTE&gt;services&lt;/TT&gt; Database&lt;/B&gt;&lt;/FONT&gt; &lt;/BLOCKQUOTE&gt; &lt;DIR&gt; &lt;BLOCKQUOTE&gt;The services database lists the names of TCP and UDP services and    their well known port numbers; it is used by programs that call network    services. The Solaris installation automatically creates the services    database; it generally requires no administrative handling. &lt;/BLOCKQUOTE&gt; &lt;BLOCKQUOTE&gt;The services(4) man page contains complete syntax information. The    example below shows an excerpt from a typical &lt;TT&gt;/etc/inet/services&lt;/TT&gt;    file: &lt;/BLOCKQUOTE&gt;&lt;/DIR&gt; &lt;TABLE cellSpacing=1 cellPadding=1 width=450 border=1&gt;   &lt;TBODY&gt;   &lt;TR&gt;     &lt;TD vAlign=center&gt;&lt;B&gt;       &lt;P&gt;/etc/inet/services File&lt;/B&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;   &lt;TR&gt;     &lt;TD vAlign=center&gt;&lt;PRE&gt;# # Network services # echo 7/udp echo 7/tcp discard 9/udp sink null discard 11/tcp daytime 13/udp daytime 13/tcp netstat 15/tcp ftp-data 20/tcp ftp 21/tcp telnet 23/tcp time 37/tcp timeserver time 37/udp timeserver name 42/udp nameserver whois 43/tcp nickname&lt;/PRE&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/714742118606354868-5037085224924531839?l=unixtechtips.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unixtechtips.blogspot.com/feeds/5037085224924531839/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=714742118606354868&amp;postID=5037085224924531839&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/714742118606354868/posts/default/5037085224924531839'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/714742118606354868/posts/default/5037085224924531839'/><link rel='alternate' type='text/html' href='http://unixtechtips.blogspot.com/2007/01/configuring-tcpip-on-solaris-network.html' title='Configuring TCP/IP on Solaris - Network Databases and nsswitch.conf File '/><author><name>HuggyPuggy</name><uri>http://www.blogger.com/profile/04602550959022896368</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='10800658094938042256'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-714742118606354868.post-5829006668072137055</id><published>2007-01-10T21:19:00.001-08:00</published><updated>2007-01-10T21:19:26.710-08:00</updated><title type='text'>Networking -- Solaris</title><content type='html'>&lt;B&gt;&lt;FONT color=#000080&gt; &lt;P&gt;Introduction&lt;/B&gt;&lt;/FONT&gt; &lt;/P&gt; &lt;BLOCKQUOTE&gt;In order to configure networking after installing Solaris, several    files will need to be created and/or modified. This document provides a quick    overview of those files along with example configuration data. &lt;/BLOCKQUOTE&gt; &lt;BLOCKQUOTE&gt;In most cases, the installation process performs all necessary    configuration tasks. One of the tasks generally not performed by the installer    is updating the Solaris networking files. &lt;/BLOCKQUOTE&gt; &lt;BLOCKQUOTE&gt;I have not found an easy way to force the installation program to    configure all local networking files if the "Naming Services" section fails.    For example, if you select the DNS naming service and the machine you are    configuring is not entered in DNS, the installation process will skip this    section. In cases like this, it will be necessary to update several of the    files that pertain to networking. The following is a list of those files and    the content that should be provided. Keep in mind that the system will need to    be rebooted after making changes (and creating) these files.  &lt;/BLOCKQUOTE&gt;&lt;B&gt;&lt;FONT color=#000080&gt;&lt;TT&gt; &lt;P&gt;/etc/resolv.conf&lt;/B&gt;&lt;/FONT&gt;&lt;/TT&gt; &lt;/P&gt; &lt;BLOCKQUOTE&gt;During the Solaris installation program, you are prompted for    Naming Configuration information. In most cases, we use DNS. But during the    installation process, if the installer is unable to communicate with and/or    resolve your newly configured host with DNS, the Naming Configuration will    fail, and none of the configuration files (i.e. &lt;TT&gt;/etc/resolv.conf&lt;/TT&gt;)    will not be updated. I often find it necessary to manually create the    &lt;TT&gt;/etc/resolv.conf&lt;/TT&gt; with any name service information. &lt;/BLOCKQUOTE&gt; &lt;TABLE cellSpacing=1 width=550 border=1&gt;   &lt;TBODY&gt;   &lt;TR&gt;     &lt;TD vAlign=center bgColor=#ffffff&gt;&lt;PRE&gt;nameserver 63.67.120.18 nameserver 63.67.120.23&lt;/PRE&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;B&gt;&lt;I&gt; &lt;BLOCKQUOTE&gt;/etc/resolv.conf&lt;/B&gt;&lt;/I&gt; &lt;/BLOCKQUOTE&gt;&lt;B&gt;&lt;FONT color=#000080&gt;&lt;TT&gt; &lt;P&gt;/etc/hostname.&lt;I&gt;interface&lt;/B&gt;&lt;/I&gt;&lt;/FONT&gt;&lt;/TT&gt; &lt;/P&gt; &lt;BLOCKQUOTE&gt;The Solaris installation program creates this file for you. The    file contains only one entry: the host name or IP address associated with the    network interface. For example, suppose &lt;TT&gt;eri0&lt;/TT&gt; is the primary network    interface for a machine called &lt;TT&gt;alexprod&lt;/TT&gt;. Its    &lt;TT&gt;/etc/hostname.&lt;/TT&gt;&lt;I&gt;interface&lt;/I&gt; file would have the name    &lt;TT&gt;/etc/hostname.eri0&lt;/TT&gt;; the file would contain the single entry    &lt;TT&gt;alexprod&lt;/TT&gt;. &lt;/BLOCKQUOTE&gt; &lt;TABLE cellSpacing=1 width=550 border=1&gt;   &lt;TBODY&gt;   &lt;TR&gt;     &lt;TD vAlign=center bgColor=#ffffff&gt;&lt;PRE&gt;alexprod&lt;/PRE&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;B&gt;&lt;I&gt; &lt;BLOCKQUOTE&gt;/etc/hostname.eri0&lt;/B&gt;&lt;/I&gt; &lt;/BLOCKQUOTE&gt;&lt;B&gt;&lt;FONT color=#000080&gt;&lt;TT&gt; &lt;P&gt;/etc/nodename&lt;/B&gt;&lt;/FONT&gt;&lt;/TT&gt; &lt;/P&gt; &lt;BLOCKQUOTE&gt;This file should contain one entry; the host name of the local    machine. For example, on machine &lt;TT&gt;alexprod&lt;/TT&gt;, the file    &lt;TT&gt;/etc/nodename&lt;/TT&gt; would contain the entry &lt;TT&gt;alexprod&lt;/TT&gt;. &lt;/BLOCKQUOTE&gt; &lt;TABLE cellSpacing=1 width=550 border=1&gt;   &lt;TBODY&gt;   &lt;TR&gt;     &lt;TD vAlign=center bgColor=#ffffff&gt;&lt;PRE&gt;alexprod&lt;/PRE&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;B&gt;&lt;I&gt; &lt;BLOCKQUOTE&gt;/etc/nodename&lt;/B&gt;&lt;/I&gt; &lt;/BLOCKQUOTE&gt;&lt;B&gt;&lt;FONT color=#000080&gt;&lt;TT&gt; &lt;P&gt;/etc/defaultdomain&lt;/B&gt;&lt;/FONT&gt;&lt;/TT&gt; &lt;/P&gt; &lt;BLOCKQUOTE&gt;This file should contain one entry, the full qualified domain name    of the administrative domain to which the local host's network belongs. You    can supply this name to the Solaris installation program or edit the file at a    later date. &lt;/BLOCKQUOTE&gt; &lt;BLOCKQUOTE&gt;Take for example the domain &lt;TT&gt;iDevelopment&lt;/TT&gt; which was    classified as a &lt;TT&gt;.info&lt;/TT&gt; domain. In this example,    &lt;TT&gt;/etc/defaultdomain&lt;/TT&gt; should contain the entry    &lt;TT&gt;iDevelopment.info&lt;/TT&gt;. &lt;/BLOCKQUOTE&gt; &lt;TABLE cellSpacing=1 width=550 border=1&gt;   &lt;TBODY&gt;   &lt;TR&gt;     &lt;TD vAlign=center bgColor=#ffffff&gt;&lt;PRE&gt;idevelopment.info&lt;/PRE&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;B&gt;&lt;I&gt; &lt;BLOCKQUOTE&gt;/etc/defaultdomain&lt;/B&gt;&lt;/I&gt; &lt;/BLOCKQUOTE&gt;&lt;B&gt;&lt;FONT color=#000080&gt;&lt;TT&gt; &lt;P&gt;/etc/defaultrouter&lt;/B&gt;&lt;/FONT&gt;&lt;/TT&gt; &lt;/P&gt; &lt;BLOCKQUOTE&gt;This file should contain an entry for each router directly    connected to the network. The entry should be the name for the network    interface that functions as a router between networks. &lt;/BLOCKQUOTE&gt; &lt;BLOCKQUOTE&gt;If the default router for a machine will be 192.168.1.1, then this    is the entry that should be put into the file &lt;TT&gt;/etc/defaultrouter&lt;/TT&gt;.  &lt;/BLOCKQUOTE&gt; &lt;TABLE cellSpacing=1 width=550 border=1&gt;   &lt;TBODY&gt;   &lt;TR&gt;     &lt;TD vAlign=center bgColor=#ffffff&gt;&lt;PRE&gt;192.168.1.1&lt;/PRE&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;B&gt;&lt;I&gt; &lt;BLOCKQUOTE&gt;/etc/defaultrouter&lt;/B&gt;&lt;/I&gt; &lt;/BLOCKQUOTE&gt;&lt;B&gt;&lt;FONT color=#000080&gt;&lt;TT&gt; &lt;P&gt;/etc/hosts&lt;/B&gt;&lt;/FONT&gt;&lt;/TT&gt; &lt;/P&gt; &lt;BLOCKQUOTE&gt;The hosts database contains the IP addresses and host names of    machines on your network. &lt;/BLOCKQUOTE&gt; &lt;BLOCKQUOTE&gt;If you use local files for name service, the hosts database is    maintained in the &lt;TT&gt;/etc/inet/hosts&lt;/TT&gt; file. This file contains the host    names and IP addresses of the primary network interface, other network    interfaces attached to the machine, and any other network addresses that the    machine must know about. &lt;/BLOCKQUOTE&gt; &lt;DIR&gt;&lt;B&gt;&lt;FONT color=#800000&gt; &lt;BLOCKQUOTE&gt;NOTE&lt;/FONT&gt;:&lt;/B&gt; For compatibility with BSD-based operating    systems, the file &lt;TT&gt;/etc/hosts&lt;/TT&gt; is a symbolic link to    &lt;TT&gt;/etc/inet/hosts&lt;/TT&gt;. &lt;/BLOCKQUOTE&gt;&lt;/DIR&gt; &lt;TABLE cellSpacing=1 width=550 border=1&gt;   &lt;TBODY&gt;   &lt;TR&gt;     &lt;TD vAlign=center bgColor=#ffffff&gt;&lt;PRE&gt;# # Internet host table # 127.0.0.1       localhost 192.168.1.102    alexprod alexprod.idevelopment.info    loghost&lt;/PRE&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;B&gt;&lt;I&gt; &lt;BLOCKQUOTE&gt;/etc/hosts&lt;/B&gt;&lt;/I&gt; &lt;/BLOCKQUOTE&gt;&lt;B&gt;&lt;FONT color=#000080&gt;&lt;TT&gt; &lt;P&gt;/etc/inet/netmasks&lt;/B&gt;&lt;/FONT&gt;&lt;/TT&gt; &lt;/P&gt; &lt;BLOCKQUOTE&gt;You need to edit the netmasks database as part of network    configuration only if you have set up subnetting on your network. The netmasks    database consists of a list of networks and their associated subnet masks.  &lt;/BLOCKQUOTE&gt; &lt;TABLE cellSpacing=1 width=550 border=1&gt;   &lt;TBODY&gt;   &lt;TR&gt;     &lt;TD vAlign=center bgColor=#ffffff&gt;&lt;PRE&gt;# # The netmasks file associates Internet Protocol (IP) address # masks with IP network numbers. # #       network-number  netmask # # The term network-number refers to a number obtained from the Internet Network # Information Center.  Currently this number is restricted to being a class # A, B, or C network number.  In the future we should be able to support # arbitrary network numbers per the Classless Internet Domain Routing # guidelines. # # Both the network-number and the netmasks are specified in # "decimal dot" notation, e.g: # #               128.32.0.0 255.255.255.0 # 192.168.1.0      255.255.255.0&lt;/PRE&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;B&gt;&lt;I&gt; &lt;BLOCKQUOTE&gt;/etc/inet/netmasks&lt;/B&gt;&lt;/I&gt; &lt;/BLOCKQUOTE&gt;&lt;B&gt;&lt;FONT color=#000080&gt;&lt;TT&gt; &lt;P&gt;/etc/nsswitch.conf&lt;/B&gt;&lt;/FONT&gt;&lt;/TT&gt; &lt;/P&gt; &lt;BLOCKQUOTE&gt;The &lt;TT&gt;/etc/nsswitch.conf&lt;/TT&gt; file defines the search order of    the network databases (hosts, netmasks, ethers, bootparams, protocols,    services, networks). &lt;/BLOCKQUOTE&gt; &lt;BLOCKQUOTE&gt;The Solaris installation program creates a default    &lt;TT&gt;/etc/nsswitch.conf&lt;/TT&gt; file for the local machine, based on the name    service you indicate during the installation process. The installation process    also creates 5 template files that can be copied over to    &lt;TT&gt;/etc/nsswitch.conf&lt;/TT&gt;: &lt;/BLOCKQUOTE&gt; &lt;DIR&gt; &lt;DIR&gt;&lt;TT&gt; &lt;BLOCKQUOTE&gt;nsswitch.files&lt;/TT&gt; &lt;/BLOCKQUOTE&gt;&lt;TT&gt; &lt;BLOCKQUOTE&gt;nsswitch.nis&lt;/TT&gt; &lt;/BLOCKQUOTE&gt;&lt;TT&gt; &lt;BLOCKQUOTE&gt;nsswitch.dns&lt;/TT&gt; &lt;/BLOCKQUOTE&gt;&lt;TT&gt; &lt;BLOCKQUOTE&gt;nsswitch.ldap&lt;/TT&gt; &lt;/BLOCKQUOTE&gt;&lt;TT&gt; &lt;BLOCKQUOTE&gt;nsswitch.nisplus&lt;/TT&gt; &lt;/BLOCKQUOTE&gt;&lt;/DIR&gt; &lt;BLOCKQUOTE&gt;If you selected the 'None' option, indicating local files for name    service, the resulting &lt;TT&gt;/etc/nsswitch.conf&lt;/TT&gt; file resembles the    following example: &lt;/BLOCKQUOTE&gt;&lt;/DIR&gt; &lt;TABLE cellSpacing=1 width=550 border=1&gt;   &lt;TBODY&gt;   &lt;TR&gt;     &lt;TD vAlign=center bgColor=#ffffff&gt;&lt;PRE&gt;# # /etc/nsswitch.files: # # An example file that could be copied over to /etc/nsswitch.conf; it # does not use any naming service. # # "hosts:" and "services:" in this file are used only if the # /etc/netconfig file has a "-" for nametoaddr_libs of "inet" transports.  passwd:     files group:      files hosts:      files ipnodes:    files networks:   files protocols:  files rpc:        files ethers:     files netmasks:   files bootparams: files publickey:  files # At present there isn't a 'files' backend for netgroup;  the system will #   figure it out pretty quickly, and won't use netgroups at all. netgroup:   files automount:  files aliases:    files services:   files sendmailvars:   files printers:       user files  auth_attr:  files prof_attr:  files project:    files&lt;/PRE&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;B&gt;&lt;I&gt; &lt;BLOCKQUOTE&gt;/etc/nsswitch.conf - Default if you are using local files&lt;/B&gt;&lt;/I&gt;  &lt;/BLOCKQUOTE&gt; &lt;BLOCKQUOTE&gt;Here is another &lt;TT&gt;/etc/nsswitch.conf&lt;/TT&gt; file that adds a dns    entry for hosts:: &lt;/BLOCKQUOTE&gt; &lt;TABLE cellSpacing=1 width=550 border=1&gt;   &lt;TBODY&gt;   &lt;TR&gt;     &lt;TD vAlign=center bgColor=#ffffff&gt;&lt;PRE&gt;# # /etc/nsswitch.dns: # # An example file that could be copied over to /etc/nsswitch.conf; it uses # DNS for hosts lookups, otherwise it does not use any other naming service. # # "hosts:" and "services:" in this file are used only if the # /etc/netconfig file has a "-" for nametoaddr_libs of "inet" transports.  passwd:     files group:      files  # You must also set up the /etc/resolv.conf file for DNS name # server lookup.  See resolv.conf(4). hosts:      files &lt;B&gt;dns &lt;/B&gt;ipnodes:    files # Uncomment the following line and comment out the above to resolve # both IPv4 and IPv6 addresses from the ipnodes databases. Note that # IPv4 addresses are searched in all of the ipnodes databases before # searching the hosts databases. Before turning this option on, consult # the Network Administration Guide for more details on using IPv6. #ipnodes:   files dns  networks:   files protocols:  files rpc:        files ethers:     files netmasks:   files bootparams: files publickey:  files # At present there isn't a 'files' backend for netgroup;  the system will #   figure it out pretty quickly, and won't use netgroups at all. netgroup:   files automount:  files aliases:    files services:   files sendmailvars:   files printers:       user files  auth_attr:  files prof_attr:  files project:    files&lt;/PRE&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;B&gt;&lt;I&gt; &lt;BLOCKQUOTE&gt;/etc/nsswitch.conf - Adding a dns database for the hosts:    element&lt;/B&gt;&lt;/I&gt; &lt;/BLOCKQUOTE&gt; &lt;BLOCKQUOTE&gt;Here is another &lt;TT&gt;/etc/nsswitch.conf&lt;/TT&gt; file that uses a    combination of &lt;I&gt;files&lt;/I&gt;, &lt;I&gt;nis&lt;/I&gt;, and &lt;I&gt;dns&lt;/I&gt; entries: &lt;/BLOCKQUOTE&gt; &lt;TABLE cellSpacing=1 width=550 border=1&gt;   &lt;TBODY&gt;   &lt;TR&gt;     &lt;TD vAlign=center bgColor=#ffffff&gt;&lt;PRE&gt;# /etc/nsswitch.nis: # # An example file that could be copied over to /etc/nsswitch.conf; it # uses NIS (YP) in conjunction with files. # # "hosts:" and "services:" in this file are used only if the # /etc/netconfig file has a "-" for nametoaddr_libs of "inet" transports.  # the following two lines obviate the "+" entry in /etc/passwd and /etc/group. passwd:     files nis group:      files nis  # consult /etc "files" only if nis is down. hosts:      files dns nis ipnodes:    files # Uncomment the following line and comment out the above to resolve # both IPv4 and IPv6 addresses from the ipnodes databases. Note that # IPv4 addresses are searched in all of the ipnodes databases before # searching the hosts databases. Before turning this option on, consult # the Network Administration Guide for more details on using IPv6. #ipnodes:    nis [NOTFOUND=return] files  networks:   nis [NOTFOUND=return] files protocols:  nis [NOTFOUND=return] files rpc:        nis [NOTFOUND=return] files ethers:     nis [NOTFOUND=return] files netmasks:   nis [NOTFOUND=return] files bootparams: nis [NOTFOUND=return] files publickey:  nis [NOTFOUND=return] files  netgroup:   nis  automount:  files nis aliases:    files nis  # for efficient getservbyname() avoid nis services:   files nis sendmailvars:   files printers:       user files nis  auth_attr:  files nis prof_attr:  files nis project:    files nis&lt;/PRE&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;B&gt;&lt;I&gt; &lt;BLOCKQUOTE&gt;/etc/nsswitch.conf - Using a combination of files, nis, and dns    databases&lt;/B&gt;&lt;/I&gt; &lt;/BLOCKQUOTE&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/714742118606354868-5829006668072137055?l=unixtechtips.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unixtechtips.blogspot.com/feeds/5829006668072137055/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=714742118606354868&amp;postID=5829006668072137055&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/714742118606354868/posts/default/5829006668072137055'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/714742118606354868/posts/default/5829006668072137055'/><link rel='alternate' type='text/html' href='http://unixtechtips.blogspot.com/2007/01/networking-solaris.html' title='Networking -- Solaris'/><author><name>HuggyPuggy</name><uri>http://www.blogger.com/profile/04602550959022896368</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='10800658094938042256'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-714742118606354868.post-8280514969608067793</id><published>2007-01-10T21:17:00.001-08:00</published><updated>2007-01-10T21:17:47.047-08:00</updated><title type='text'>Removing Invalid Disk Device Files (/dev/dsk and /dev/rdsk) </title><content type='html'>&lt;U&gt;&lt;FONT color=#000080 size=5&gt; &lt;P&gt;Removing Invalid Disk Device Files (&lt;/FONT&gt;&lt;FONT  color=#000080&gt;&lt;TT&gt;/dev/dsk&lt;/FONT&gt;&lt;/TT&gt;&lt;FONT color=#000080 size=5&gt; and  &lt;/FONT&gt;&lt;FONT color=#000080&gt;&lt;TT&gt;/dev/rdsk&lt;/FONT&gt;&lt;/TT&gt;&lt;FONT color=#000080  size=5&gt;)&lt;/U&gt;&lt;/FONT&gt; &lt;/P&gt;&lt;I&gt; &lt;P&gt;by Jeff Hunter, Sr. Database Administrator&lt;/I&gt; &lt;/P&gt;&lt;B&gt;&lt;U&gt;&lt;FONT color=#000080&gt; &lt;P&gt;Overview&lt;/B&gt;&lt;/U&gt;&lt;/FONT&gt; &lt;/P&gt; &lt;BLOCKQUOTE&gt;Whether installing a SCSI controller or even an additional IDE    disk to a Sun Solaris machine, the Solaris O/S will: &lt;/BLOCKQUOTE&gt; &lt;DIR&gt; &lt;DIR&gt; &lt;BLOCKQUOTE&gt;Create &lt;I&gt;Disk Device Files&lt;/I&gt; under the &lt;I&gt;Hardware Device    Tree&lt;/I&gt; (&lt;TT&gt;/devices&lt;/TT&gt;). &lt;/BLOCKQUOTE&gt; &lt;BLOCKQUOTE&gt;Create symbolic links in &lt;TT&gt;/dev/dsk&lt;/TT&gt;, &lt;TT&gt;/dev/rdsk&lt;/TT&gt;,    and &lt;TT&gt;/dev/cfg&lt;/TT&gt; that point to the devices in the &lt;TT&gt;/devices&lt;/TT&gt;    directory. &lt;/BLOCKQUOTE&gt; &lt;BLOCKQUOTE&gt;Make entries in the &lt;TT&gt;/etc/path_to_inst&lt;/TT&gt; file.  &lt;/BLOCKQUOTE&gt;&lt;/DIR&gt; &lt;BLOCKQUOTE&gt;Things will generally work fine until you decide to remove or move    a device in the system. I have had situations where I have run out of devices    on a host because of Sun's poor ability to remove invalid (hanging) disk    device files after removing a device. This is one area where Sun could really    improve. It looks like they are trying new things with the &lt;B&gt;&lt;TT&gt;boot    -p&lt;/B&gt;&lt;/TT&gt; option but I've only ever seen it remove things once. &lt;/BLOCKQUOTE&gt; &lt;BLOCKQUOTE&gt;There are other times when I simply wanted to replace a certain    type of SCSI controller and wanted to reuse the controller ID's from a    previously removed card. For example, I have a host (an E450) which had 2    internal controllers (0 and 1) and a dual differential SCSI card installed    (controllers 2 and 3). I removed the dual differential SCSI host adapter and    decided to replace it with a Single-Ended SCSI host adapter but Solaris would    always assign them controller numbers 4 and 5. I wanted the system to reassign    controller numbers 2 and 3 for the new host adapter but links still existed    for the original dual differential SCSI host adapter. &lt;/BLOCKQUOTE&gt; &lt;BLOCKQUOTE&gt;My intention in this article is to provide several solutions for    either renumbering disk device files (SCSI controllers, SCSI disks, IDE    controllers, IDE disks, etc.) or simply removing old ones from replaced or    removed devices. Please keep in mind that this article has been put together    from notes I found during many searches for answers on the Internet. If anyone    reading this has other solutions, please &lt;A    href="mailto:jhunter@iDevelopment.info"&gt;email me&lt;/A&gt; and I would be happy to    post them for others going through this procedure.  &lt;/BLOCKQUOTE&gt;&lt;/DIR&gt;&lt;B&gt;&lt;U&gt;&lt;FONT color=#000080&gt; &lt;P&gt;Using the &lt;TT&gt;devfsadm&lt;/TT&gt; Command&lt;/B&gt;&lt;/U&gt;&lt;/FONT&gt; &lt;/P&gt; &lt;BLOCKQUOTE&gt;The &lt;B&gt;&lt;TT&gt;devfsadm&lt;/B&gt;&lt;/TT&gt; command was introduced with Solaris 7    and can be found in &lt;TT&gt;/usr/sbin/devfsadm&lt;/TT&gt;. This command is used to    maintain the &lt;TT&gt;/dev&lt;/TT&gt; and &lt;TT&gt;/devices&lt;/TT&gt; namespaces. The    &lt;B&gt;&lt;TT&gt;devfsadm&lt;/B&gt;&lt;/TT&gt; command replaces the previous suite of &lt;I&gt;devfs    administration tools&lt;/I&gt; including &lt;B&gt;&lt;TT&gt;drvconfig(1M)&lt;/B&gt;&lt;/TT&gt;,    &lt;B&gt;&lt;TT&gt;disks(1M)&lt;/B&gt;&lt;/TT&gt;, &lt;B&gt;&lt;TT&gt;tapes(1M)&lt;/B&gt;&lt;/TT&gt;,    &lt;B&gt;&lt;TT&gt;ports(1M)&lt;/B&gt;&lt;/TT&gt;, &lt;B&gt;&lt;TT&gt;audlinks(1M)&lt;/B&gt;&lt;/TT&gt;, and    d&lt;B&gt;&lt;TT&gt;evlinks(1M)&lt;/B&gt;&lt;/TT&gt;. To maintain backwards compatibility, all    previous devfs commands are hard links to &lt;B&gt;&lt;TT&gt;devfsadm&lt;/B&gt;&lt;/TT&gt;.  &lt;/BLOCKQUOTE&gt; &lt;BLOCKQUOTE&gt;In many cases, you only need run the command: &lt;/BLOCKQUOTE&gt; &lt;DIR&gt;&lt;PRE&gt;  # &lt;B&gt;devfsadm -C&lt;/PRE&gt;&lt;/B&gt; &lt;BLOCKQUOTE&gt;to invoke the cleanup routines that are not normally invoked to    remove dangling logical links. &lt;/BLOCKQUOTE&gt;&lt;/DIR&gt;&lt;B&gt;&lt;U&gt;&lt;FONT color=#000080&gt; &lt;P&gt;Manual Methods&lt;/B&gt;&lt;/U&gt;&lt;/FONT&gt; &lt;/P&gt; &lt;BLOCKQUOTE&gt;The &lt;B&gt;&lt;TT&gt;devfsadm&lt;/B&gt;&lt;/TT&gt; command was introduced with Solaris    7. For those running older versions of Solaris (i.e. Solaris 2.6) or simply    want to perform all manual steps, this section describes the procedures to do    just that. &lt;/BLOCKQUOTE&gt; &lt;OL&gt;   &lt;OL&gt;     &lt;BLOCKQUOTE&gt;       &lt;LI&gt;Make a backup of your &lt;TT&gt;/etc/path_to_inst&lt;/TT&gt; file and then modify        the file so that all that exists is the SCSI / IDE reference for the boot        drive. Remove all of the "pcipsy" and "glm" entries except for the one        that is used by the controller that has the boot drive. &lt;I&gt;Take note of        the physical path of the controller you want to renumber.&lt;/I&gt;      &lt;/LI&gt;&lt;/BLOCKQUOTE&gt;     &lt;BLOCKQUOTE&gt;       &lt;LI&gt;Remove all &lt;TT&gt;/dev/dsk/cX*&lt;/TT&gt; and &lt;TT&gt;/dev/rdsk/cX*&lt;/TT&gt; files        where &lt;TT&gt;X&lt;/TT&gt; is the controller number(s) you want to remove and even        those that no longer exist. &lt;I&gt;(In the case of the example I provided on        the E450, that would be 2, 3, 4, and 5.)&lt;/I&gt; &lt;/LI&gt;&lt;/BLOCKQUOTE&gt;     &lt;BLOCKQUOTE&gt;       &lt;LI&gt;Remove all &lt;TT&gt;/dev/cfg/cX&lt;/TT&gt; symbolic links where X is the        controller(s) you want to remove. Make sure to not remove the controller        with the boot drive. &lt;I&gt;(Again, in the case of the example I provided on        the E450, that would be 2, 3, 4, and 5.)&lt;/I&gt; It turns out this was one of        the crucial steps that needed to be complete in order for Solaris to reuse        controller numbers 2 and 3. The O/S was not able to reassign both of these        controller numbers while the links (&lt;TT&gt;/dev/cfg/2&lt;/TT&gt; and        &lt;TT&gt;/dev/cfg/3&lt;/TT&gt;) still existed. &lt;/LI&gt;&lt;/BLOCKQUOTE&gt;     &lt;BLOCKQUOTE&gt;       &lt;LI&gt;Remove all files under &lt;TT&gt;/devices/*&lt;/TT&gt; for the controller you want        to remove or renumber as indicated in Step #1. &lt;/LI&gt;&lt;/BLOCKQUOTE&gt;     &lt;BLOCKQUOTE&gt;       &lt;LI&gt;Remove all files in &lt;TT&gt;/dev/sdXX*&lt;/TT&gt; that symbolically link to        controller(s) you do not want anymore. This may not be completely        necessary, but it does clean things up. &lt;/LI&gt;&lt;/BLOCKQUOTE&gt;     &lt;BLOCKQUOTE&gt;       &lt;LI&gt;Reboot the server with the "-srv" option: &lt;/LI&gt;&lt;/BLOCKQUOTE&gt;&lt;/OL&gt;&lt;/OL&gt; &lt;DIR&gt; &lt;DIR&gt; &lt;DIR&gt;&lt;PRE&gt;ok &lt;B&gt;boot -srv&lt;/PRE&gt;&lt;/DIR&gt;&lt;/DIR&gt;&lt;/DIR&gt;&lt;/B&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/714742118606354868-8280514969608067793?l=unixtechtips.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unixtechtips.blogspot.com/feeds/8280514969608067793/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=714742118606354868&amp;postID=8280514969608067793&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/714742118606354868/posts/default/8280514969608067793'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/714742118606354868/posts/default/8280514969608067793'/><link rel='alternate' type='text/html' href='http://unixtechtips.blogspot.com/2007/01/removing-invalid-disk-device-files.html' title='Removing Invalid Disk Device Files (/dev/dsk and /dev/rdsk) '/><author><name>HuggyPuggy</name><uri>http://www.blogger.com/profile/04602550959022896368</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='10800658094938042256'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-714742118606354868.post-5167029173645473761</id><published>2007-01-10T21:16:00.001-08:00</published><updated>2007-01-10T21:16:45.403-08:00</updated><title type='text'>Understanding Disk Device Files (i.e. breaking down c0t2d0s7) </title><content type='html'>&lt;U&gt;&lt;FONT color=#000080 size=5&gt; &lt;P&gt;Understanding Disk Device Files (i.e. breaking down &lt;/FONT&gt;&lt;FONT  color=#000080&gt;&lt;TT&gt;c0t2d0s7&lt;/FONT&gt;&lt;/TT&gt;&lt;FONT color=#000080 size=5&gt;)&lt;/U&gt;&lt;/FONT&gt;  &lt;/P&gt;&lt;I&gt; &lt;P&gt;by Jeff Hunter, Sr. Database Administrator&lt;/I&gt; &lt;/P&gt;&lt;B&gt;&lt;U&gt;&lt;FONT color=#000080&gt; &lt;P&gt;Overview&lt;/B&gt;&lt;/U&gt;&lt;/FONT&gt; &lt;/P&gt; &lt;BLOCKQUOTE&gt;Under Solaris, one of the most involved UNIX devices to understand    is the &lt;I&gt;disk device file&lt;/I&gt;. Here are several key points that may help:  &lt;/BLOCKQUOTE&gt; &lt;DIR&gt; &lt;DIR&gt; &lt;BLOCKQUOTE&gt;In many cases, a &lt;I&gt;disk device file&lt;/I&gt; (i.e.    &lt;TT&gt;/dev/dsk/c0t2d0s7&lt;/TT&gt;) refers to a particular partition (aka "slice") of    a disk, and not the entire physical device. There are several device files    which refer to the entire physical device, but are rarely used. &lt;/BLOCKQUOTE&gt; &lt;BLOCKQUOTE&gt;For every disk device, there are usually two device files - the    &lt;I&gt;block device&lt;/I&gt; and the &lt;I&gt;character ("raw") device&lt;/I&gt;. In general:  &lt;/BLOCKQUOTE&gt; &lt;DIR&gt; &lt;DIR&gt;&lt;I&gt;&lt;U&gt; &lt;BLOCKQUOTE&gt;block devices&lt;/I&gt;&lt;/U&gt; are generally stored under &lt;TT&gt;/dev/dsk&lt;/TT&gt;    and used for filesystem type access (e.g &lt;B&gt;&lt;TT&gt;mount&lt;/B&gt;&lt;/TT&gt;)  &lt;/BLOCKQUOTE&gt;&lt;I&gt;&lt;U&gt; &lt;BLOCKQUOTE&gt;character devices&lt;/I&gt;&lt;/U&gt; are generally stored under    &lt;TT&gt;/dev/rdsk&lt;/TT&gt; used for everything else (e.g. &lt;B&gt;&lt;TT&gt;fsck&lt;/B&gt;&lt;/TT&gt;,    &lt;B&gt;&lt;TT&gt;newfs&lt;/B&gt;&lt;/TT&gt;, etc..) &lt;/BLOCKQUOTE&gt;&lt;/DIR&gt; &lt;BLOCKQUOTE&gt;Discs are generally attached to a controller (or a bus) which can    handle multiple devices. IDE and SCSI are both common attach methods. This    tends to make &lt;I&gt;disk device filename&lt;/I&gt; more complex than other types of    devices. &lt;/BLOCKQUOTE&gt;&lt;/DIR&gt;&lt;/DIR&gt;&lt;/DIR&gt;&lt;B&gt;&lt;U&gt;&lt;FONT color=#000080&gt; &lt;P&gt;/etc/vfstab&lt;/B&gt;&lt;/U&gt;&lt;/FONT&gt; &lt;/P&gt; &lt;BLOCKQUOTE&gt;To see the difference between the &lt;I&gt;block device&lt;/I&gt; and    &lt;I&gt;character device&lt;/I&gt; for a device, consider the following. The    &lt;TT&gt;/etc/vfstab&lt;/TT&gt; contains entries for a single filesystem on a Solaris    server: &lt;/BLOCKQUOTE&gt; &lt;DIR&gt;&lt;PRE&gt;/dev/dsk/c0t2d0s7 /dev/rdsk/c0t2d0s7 /opt ufs 3 yes - &lt;/PRE&gt; &lt;BLOCKQUOTE&gt;The first 2 fields in the above entry, list the same disk device    as both a &lt;I&gt;block device&lt;/I&gt; ("dsk") and &lt;I&gt;character device&lt;/I&gt; ("rdsk").    The block device is used by &lt;B&gt;&lt;TT&gt;mount&lt;/B&gt;&lt;/TT&gt; when mounting the filesystem    while the &lt;I&gt;character device&lt;/I&gt; is used by &lt;B&gt;&lt;TT&gt;fsck&lt;/B&gt;&lt;/TT&gt; when    checking the filesystem and &lt;B&gt;&lt;TT&gt;newfs&lt;/B&gt;&lt;/TT&gt; when creating the    filesystem.. Both fields must be present in &lt;TT&gt;/etc/vfstab&lt;/TT&gt;.  &lt;/BLOCKQUOTE&gt;&lt;/DIR&gt;&lt;B&gt;&lt;U&gt;&lt;FONT color=#000080&gt; &lt;P&gt;Breaking Down &lt;TT&gt;c0t2d0s7&lt;/B&gt;&lt;/U&gt;&lt;/FONT&gt;&lt;/TT&gt; &lt;/P&gt; &lt;BLOCKQUOTE&gt;This section breaks down the different components of a disk device    file. In this example, I will be using the disk device file:    &lt;TT&gt;c0t2d0s7&lt;/TT&gt;. The four components of the disk device file are:    controller, target, LUN and slice/partition and further defined in the    following table: &lt;/BLOCKQUOTE&gt; &lt;TABLE cellSpacing=2 cellPadding=2 width=549 border=1&gt;   &lt;TBODY&gt;   &lt;TR&gt;     &lt;TD vAlign=center width="2%"&gt;&lt;B&gt;&lt;TT&gt;       &lt;P&gt;c0&lt;/B&gt;&lt;/TT&gt;&lt;/P&gt;&lt;/TD&gt;     &lt;TD vAlign=center width="98%"&gt;       &lt;P&gt;This device is attached to controller #0. On a SPARCstation this is        usually the on-board SCSI or IDE controller. If this is a PC it usually        refers to the first IDE controller on the motherboard.&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;   &lt;TR&gt;     &lt;TD vAlign=center width="2%"&gt;&lt;B&gt;&lt;TT&gt;       &lt;P&gt;t2&lt;/B&gt;&lt;/TT&gt;&lt;/P&gt;&lt;/TD&gt;     &lt;TD vAlign=center width="98%"&gt;       &lt;P&gt;The device is target #2 - &lt;I&gt;(i.e. the second device on this        controller.)&lt;/I&gt; On a SCSI controller this is the SCSI target ID and is        usually set via a switch on any external enclosure or by jumpers on the        disk itself. On an IDE controller target #2 refers to the second IDE disk.        With IDE this is generally determined by the device's position on the IDE        cable.&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;   &lt;TR&gt;     &lt;TD vAlign=center width="2%"&gt;&lt;B&gt;&lt;TT&gt;       &lt;P&gt;d0&lt;/B&gt;&lt;/TT&gt;&lt;/P&gt;&lt;/TD&gt;     &lt;TD vAlign=center width="98%"&gt;       &lt;P&gt;The device is Logical Unit / "LUN" #0 (the first) on this target. Under        SCSI a single target can support up-to eight devices. This is rarely seen        in practice, but some hardware raid controllers use LUNs.&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;   &lt;TR&gt;     &lt;TD vAlign=center width="2%"&gt;&lt;B&gt;&lt;TT&gt;       &lt;P&gt;s7&lt;/B&gt;&lt;/TT&gt;&lt;/P&gt;&lt;/TD&gt;     &lt;TD vAlign=center width="98%"&gt;       &lt;P&gt;Slice or Partition number 7. Under Solaris, this relates to the        partition number as set when using the &lt;B&gt;&lt;TT&gt;format&lt;/B&gt;&lt;/TT&gt;      command.&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/714742118606354868-5167029173645473761?l=unixtechtips.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unixtechtips.blogspot.com/feeds/5167029173645473761/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=714742118606354868&amp;postID=5167029173645473761&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/714742118606354868/posts/default/5167029173645473761'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/714742118606354868/posts/default/5167029173645473761'/><link rel='alternate' type='text/html' href='http://unixtechtips.blogspot.com/2007/01/understanding-disk-device-files-ie.html' title='Understanding Disk Device Files (i.e. breaking down c0t2d0s7) '/><author><name>HuggyPuggy</name><uri>http://www.blogger.com/profile/04602550959022896368</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='10800658094938042256'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-714742118606354868.post-4556208203515179174</id><published>2007-01-10T21:10:00.001-08:00</published><updated>2007-01-10T21:10:54.929-08:00</updated><title type='text'>Adding SCSI Host Adapter (X6541A) into a Blade 100/150 </title><content type='html'>&lt;U&gt;&lt;FONT color=#000080 size=5&gt; &lt;P&gt;Adding SCSI Host Adapter (X6541A) into a Blade 100/150&lt;/U&gt;&lt;/FONT&gt; &lt;/P&gt;&lt;I&gt; &lt;P&gt;by Jeff Hunter, Sr. Database Administrator&lt;/I&gt; &lt;/P&gt;&lt;B&gt;&lt;U&gt;&lt;FONT color=#000080&gt; &lt;P&gt;Overview&lt;/B&gt;&lt;/U&gt;&lt;/FONT&gt; &lt;/P&gt; &lt;BLOCKQUOTE&gt;A Sun Blade 100/150 can accept the following PCI SCSI host    adapters: &lt;/BLOCKQUOTE&gt; &lt;TABLE cellSpacing=1 cellPadding=1 width=549 border=1&gt;   &lt;TBODY&gt;   &lt;TR&gt;     &lt;TD vAlign=center width="8%"&gt;&lt;B&gt;       &lt;P&gt;Option #&lt;/B&gt;&lt;/P&gt;&lt;/TD&gt;     &lt;TD vAlign=center width="14%"&gt;&lt;B&gt;       &lt;P&gt;Top Level Part #&lt;/B&gt;&lt;/P&gt;&lt;/TD&gt;     &lt;TD vAlign=center width="17%"&gt;&lt;B&gt;       &lt;P&gt;Manufacturing Part #&lt;/B&gt;&lt;/P&gt;&lt;/TD&gt;     &lt;TD vAlign=center width="46%"&gt;&lt;B&gt;       &lt;P&gt;Description&lt;/B&gt;&lt;/P&gt;&lt;/TD&gt;     &lt;TD vAlign=center width="15%"&gt;&lt;B&gt;       &lt;P&gt;Substitute Part #&lt;/B&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;   &lt;TR&gt;     &lt;TD vAlign=center width="8%"&gt;       &lt;P&gt;X1032A&lt;/P&gt;&lt;/TD&gt;     &lt;TD vAlign=center width="14%"&gt;       &lt;P&gt;595-4258&lt;/P&gt;&lt;/TD&gt;     &lt;TD vAlign=center width="17%"&gt;       &lt;P&gt;501-5656&lt;/P&gt;&lt;/TD&gt;     &lt;TD vAlign=center width="46%"&gt;       &lt;P&gt;Single-Ended Ultra/Wide SCSI/FastEthernet (SunSwift PCI)&lt;/P&gt;&lt;/TD&gt;     &lt;TD vAlign=center width="15%"&gt;       &lt;P&gt;501-2741&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;   &lt;TR&gt;     &lt;TD vAlign=center width="8%"&gt;       &lt;P&gt;X2222A&lt;/P&gt;&lt;/TD&gt;     &lt;TD vAlign=center width="14%"&gt;       &lt;P&gt;595-5624&lt;/P&gt;&lt;/TD&gt;     &lt;TD vAlign=center width="17%"&gt;       &lt;P&gt;501-5727&lt;/P&gt;&lt;/TD&gt;     &lt;TD vAlign=center width="46%"&gt;       &lt;P&gt;Dual Ultra-2 SCSI/Dual FastEthernet PCI Adapter&lt;/P&gt;&lt;/TD&gt;     &lt;TD vAlign=center width="15%"&gt;       &lt;P&gt;n/a&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;   &lt;TR&gt;     &lt;TD vAlign=center width="8%"&gt;       &lt;P&gt;X5010A&lt;/P&gt;&lt;/TD&gt;     &lt;TD vAlign=center width="14%"&gt;       &lt;P&gt;595-5377&lt;/P&gt;&lt;/TD&gt;     &lt;TD vAlign=center width="17%"&gt;       &lt;P&gt;375-0097&lt;/P&gt;&lt;/TD&gt;     &lt;TD vAlign=center width="46%"&gt;       &lt;P&gt;Single-Channel Single-Ended Ultra/Wide SCSI (PCI)&lt;/P&gt;&lt;/TD&gt;     &lt;TD vAlign=center width="15%"&gt;       &lt;P&gt;n/a&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;   &lt;TR&gt;     &lt;TD vAlign=center width="8%"&gt;       &lt;P&gt;X6540A&lt;/P&gt;&lt;/TD&gt;     &lt;TD vAlign=center width="14%"&gt;       &lt;P&gt;595-4399&lt;/P&gt;&lt;/TD&gt;     &lt;TD vAlign=center width="17%"&gt;       &lt;P&gt;375-0005&lt;/P&gt;&lt;/TD&gt;     &lt;TD vAlign=center width="46%"&gt;       &lt;P&gt;Dual Single-Ended Ultra/Wide SCSI (PCI)&lt;/P&gt;&lt;/TD&gt;     &lt;TD vAlign=center width="15%"&gt;       &lt;P&gt;n/a&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;   &lt;TR&gt;     &lt;TD vAlign=center width="8%"&gt;       &lt;P&gt;X6541A&lt;/P&gt;&lt;/TD&gt;     &lt;TD vAlign=center width="14%"&gt;       &lt;P&gt;595-4414&lt;/P&gt;&lt;/TD&gt;     &lt;TD vAlign=center width="17%"&gt;       &lt;P&gt;375-0006&lt;/P&gt;&lt;/TD&gt;     &lt;TD vAlign=center width="46%"&gt;       &lt;P&gt;Dual Differential Ultra/Wide SCSI (PCI)&lt;/P&gt;&lt;/TD&gt;     &lt;TD vAlign=center width="15%"&gt;       &lt;P&gt;n/a&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt; &lt;BLOCKQUOTE&gt;In this article I will be documenting the steps for installing and    configuring a Dual Differential Ultra/Wide SCSI (PCI) host adapter (X6541A) in    a Sun Blade 150 running Solaris 8. &lt;/BLOCKQUOTE&gt; &lt;BLOCKQUOTE&gt;The above host adapters are designed to be installed in SPARC    systems running at least Solaris 2.5.1 Hardware:4/97 operating system.  &lt;/BLOCKQUOTE&gt; &lt;BLOCKQUOTE&gt;The host adapters support up to 15 targets on each SCSI bus.  &lt;/BLOCKQUOTE&gt;&lt;B&gt;&lt;U&gt;&lt;FONT color=#000080&gt; &lt;P&gt;Installing the Dual Differential Ultra/Wide SCSI (PCI)&lt;/B&gt;&lt;/U&gt;&lt;/FONT&gt; &lt;/P&gt; &lt;BLOCKQUOTE&gt;The following section documents the steps necessary to install a    Dual Differential Ultra/Wide SCSI (PCI) (X6541A) in a Sun Blade 150.  &lt;/BLOCKQUOTE&gt; &lt;OL&gt;   &lt;OL&gt;&lt;B&gt;&lt;U&gt;     &lt;BLOCKQUOTE&gt;       &lt;LI&gt;Check OS version&lt;/B&gt;&lt;/U&gt; &lt;/LI&gt;&lt;/BLOCKQUOTE&gt;     &lt;BLOCKQUOTE&gt;Check the file &lt;TT&gt;/etc/release&lt;/TT&gt; to ensure you are running        Solaris 2.5.1 or higher. &lt;/BLOCKQUOTE&gt;&lt;PRE&gt;# &lt;B&gt;cat /etc/release &lt;/B&gt;           Solaris 8 2/02 s28s_u7wos_08a SPARC Copyright 2002 Sun Microsystems, Inc.  All Rights Reserved.              Assembled 18 December 2001&lt;/PRE&gt;&lt;B&gt;&lt;U&gt;     &lt;BLOCKQUOTE&gt;       &lt;LI&gt;Exit the OS and power down the system&lt;/B&gt;&lt;/U&gt; &lt;/LI&gt;&lt;/BLOCKQUOTE&gt;     &lt;BLOCKQUOTE&gt;Use either the &lt;TT&gt;shutdown&lt;/TT&gt; command (if this is a server        with active users that should be warned) or &lt;TT&gt;init 0&lt;/TT&gt; (if this is a        stand along server). When at the &lt;TT&gt;ok&lt;/TT&gt; prompt power down the system.      &lt;/BLOCKQUOTE&gt;&lt;B&gt;&lt;U&gt;     &lt;BLOCKQUOTE&gt;       &lt;LI&gt;Unpack host adapter&lt;/B&gt;&lt;/U&gt; &lt;/LI&gt;&lt;/BLOCKQUOTE&gt;     &lt;BLOCKQUOTE&gt;The following items should be included with your host adapter        package: &lt;/BLOCKQUOTE&gt;     &lt;OL&gt;       &lt;BLOCKQUOTE&gt;         &lt;LI&gt;PCI UltraSCSI host adapter &lt;/LI&gt;&lt;/BLOCKQUOTE&gt;       &lt;BLOCKQUOTE&gt;         &lt;LI&gt;2 meter UltraSCSI-compliant cable &lt;/LI&gt;&lt;/BLOCKQUOTE&gt;       &lt;BLOCKQUOTE&gt;         &lt;LI&gt;Electrostatic discharge (ESD) kit &lt;/LI&gt;&lt;/BLOCKQUOTE&gt;&lt;/OL&gt;&lt;B&gt;&lt;U&gt;     &lt;BLOCKQUOTE&gt;       &lt;LI&gt;Open the computer&lt;/B&gt;&lt;/U&gt; &lt;/LI&gt;&lt;/BLOCKQUOTE&gt;&lt;B&gt;&lt;U&gt;     &lt;BLOCKQUOTE&gt;       &lt;LI&gt;Attach the wrist strap&lt;/B&gt;&lt;/U&gt; &lt;/LI&gt;&lt;/BLOCKQUOTE&gt;     &lt;BLOCKQUOTE&gt;Attach the wrist strap between your wrist and a metal part of        the system chassis. &lt;/BLOCKQUOTE&gt;&lt;B&gt;&lt;U&gt;     &lt;BLOCKQUOTE&gt;       &lt;LI&gt;Disconnect power cord from computer&lt;/B&gt;&lt;/U&gt; &lt;/LI&gt;&lt;/BLOCKQUOTE&gt;&lt;B&gt;&lt;U&gt;     &lt;BLOCKQUOTE&gt;       &lt;LI&gt;Remove the filler panel for the desired slot&lt;/B&gt;&lt;/U&gt; &lt;/LI&gt;&lt;/BLOCKQUOTE&gt;     &lt;BLOCKQUOTE&gt;In most cases this will be just one screw to remove in order        to remove the filler panel for the desired PCI slot. &lt;/BLOCKQUOTE&gt;&lt;B&gt;&lt;U&gt;     &lt;BLOCKQUOTE&gt;       &lt;LI&gt;Make sure that the switches and jumpers are correctly set.&lt;/B&gt;&lt;/U&gt;        &lt;/LI&gt;&lt;/BLOCKQUOTE&gt;     &lt;BLOCKQUOTE&gt;For the single-ended host adapter, confirm the following        settings: &lt;/BLOCKQUOTE&gt;     &lt;BLOCKQUOTE&gt;Make sure that all elements of switches U1 and U2 are off.      &lt;/BLOCKQUOTE&gt;     &lt;BLOCKQUOTE&gt;Make sure that jumper TP9 is open. &lt;/BLOCKQUOTE&gt;     &lt;BLOCKQUOTE&gt;For the differential host adapter, confirm the following        settings: &lt;/BLOCKQUOTE&gt;     &lt;BLOCKQUOTE&gt;Make sure that all jumpers (TP1, TP2, TP3, TP5, TP6) are open.      &lt;/BLOCKQUOTE&gt;&lt;B&gt;&lt;U&gt;     &lt;BLOCKQUOTE&gt;       &lt;LI&gt;Install the host adapter&lt;/B&gt;&lt;/U&gt; &lt;/LI&gt;&lt;/BLOCKQUOTE&gt;     &lt;BLOCKQUOTE&gt;Install the host adapter into the PCI slot in your system.        Ensure to secure the card in with the screw used in the removed filler        panel. Using excessive force can bend or damage the pins.  &lt;/BLOCKQUOTE&gt;&lt;B&gt;&lt;U&gt;     &lt;BLOCKQUOTE&gt;       &lt;LI&gt;Close up system&lt;/B&gt;&lt;/U&gt; &lt;/LI&gt;&lt;/BLOCKQUOTE&gt;     &lt;BLOCKQUOTE&gt;Close up the system and remove the anti-static wrist strap.      &lt;/BLOCKQUOTE&gt;&lt;B&gt;&lt;U&gt;     &lt;BLOCKQUOTE&gt;       &lt;LI&gt;Reconnect power cable&lt;/B&gt;&lt;/U&gt; &lt;/LI&gt;&lt;/BLOCKQUOTE&gt;&lt;B&gt;&lt;U&gt;     &lt;BLOCKQUOTE&gt;       &lt;LI&gt;Connect the SCSI cables&lt;/B&gt;&lt;/U&gt; &lt;/LI&gt;&lt;/BLOCKQUOTE&gt;     &lt;BLOCKQUOTE&gt;Connect the SCSI cable to your newly installed SCSI host        adapter and then to the SCSI peripheral(s). &lt;/BLOCKQUOTE&gt;&lt;B&gt;&lt;U&gt;     &lt;BLOCKQUOTE&gt;       &lt;LI&gt;Power on peripherals / system&lt;/B&gt;&lt;/U&gt; &lt;/LI&gt;&lt;/BLOCKQUOTE&gt;     &lt;BLOCKQUOTE&gt;Power on your peripherals and then your system. &lt;/BLOCKQUOTE&gt;     &lt;BLOCKQUOTE&gt;NOTE: If your system starts to reboot, interrupt the reboot        process by pressing the Stop and A keys together. If this is not possible,        allow the system to complete the boot process and then bring the system to        the &lt;TT&gt;ok&lt;/TT&gt; prompt by using &lt;B&gt;&lt;TT&gt;init 0&lt;/B&gt;&lt;/TT&gt;. &lt;/BLOCKQUOTE&gt;&lt;B&gt;&lt;U&gt;     &lt;BLOCKQUOTE&gt;       &lt;LI&gt;Make sure the host adapter is recognized by the system&lt;/B&gt;&lt;/U&gt;      &lt;/LI&gt;&lt;/BLOCKQUOTE&gt;     &lt;BLOCKQUOTE&gt;Use the &lt;B&gt;&lt;TT&gt;probe-scsi-all&lt;/B&gt;&lt;/TT&gt; command to display the        SCSI devices connected to your system. For example: &lt;/BLOCKQUOTE&gt;&lt;PRE&gt;ok &lt;B&gt;probe-scsi-all &lt;/B&gt;/pci@1f,2000/scsi@2 Target 8 Unit 0 Disk SEAGATE ST34371W SUN4.2G8254 /pci@1f,2000/scsi@2,1 Target 1 Unit 0 Disk SEAGATE ST34371W SUN4.2G8254&lt;/PRE&gt;     &lt;BLOCKQUOTE&gt;In the example, the first SCSI port (scsi@2) has one disk        drive connected (target 8). The second SCSI port (scsi@2,1) also has one        disk drive connected (target 1). &lt;/BLOCKQUOTE&gt;&lt;B&gt;&lt;U&gt;     &lt;BLOCKQUOTE&gt;       &lt;LI&gt;Reboot your system (using the -r option)&lt;/B&gt;&lt;/U&gt; &lt;/LI&gt;&lt;/BLOCKQUOTE&gt;&lt;PRE&gt;ok &lt;B&gt;boot -r&lt;/PRE&gt;&lt;U&gt;     &lt;BLOCKQUOTE&gt;       &lt;LI&gt;Test the installation with SunVTS&lt;/B&gt;&lt;/U&gt; &lt;/LI&gt;&lt;/BLOCKQUOTE&gt;     &lt;BLOCKQUOTE&gt;You can use the SunVTS diagnostic program exercise your system        to verify the functionality, reliability, and configuration of the new        host adapter card. It is recommended to run the SunVTS program before        attempting to utilize the new host adapter for any applications.      &lt;/BLOCKQUOTE&gt;     &lt;BLOCKQUOTE&gt;The SunVTS program needs to be run as the &lt;I&gt;root&lt;/I&gt; userid.      &lt;/BLOCKQUOTE&gt;&lt;PRE&gt;# &lt;B&gt;su&lt;/PRE&gt;&lt;/B&gt;     &lt;BLOCKQUOTE&gt;Bring up the SunVTS program (GUI Window): &lt;/BLOCKQUOTE&gt;&lt;PRE&gt;# &lt;B&gt;/opt/SUNWvts/bin/sunvts&lt;/PRE&gt;     &lt;OL&gt;&lt;/B&gt;       &lt;BLOCKQUOTE&gt;         &lt;LI&gt;Select a disk drive (any disk) that is attached to the host adapter          card you just installed. &lt;/LI&gt;&lt;/BLOCKQUOTE&gt;       &lt;BLOCKQUOTE&gt;         &lt;LI&gt;Start the test by hitting the "Start" button. &lt;/LI&gt;&lt;/BLOCKQUOTE&gt;       &lt;BLOCKQUOTE&gt;         &lt;LI&gt;Verify that no errors have occurred by checking the SunVTS status          window. &lt;/LI&gt;&lt;/BLOCKQUOTE&gt;       &lt;BLOCKQUOTE&gt;         &lt;LI&gt;If no problems occur, stop SunVTS by hitting the "Stop" button and          exit from the SunVTS application. &lt;/LI&gt;&lt;/BLOCKQUOTE&gt;&lt;/OL&gt;&lt;/OL&gt;&lt;/OL&gt; &lt;DIR&gt; &lt;DIR&gt; &lt;BLOCKQUOTE&gt;Your host adapter card is ready to run  applications!&lt;/BLOCKQUOTE&gt;&lt;/DIR&gt;&lt;/DIR&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/714742118606354868-4556208203515179174?l=unixtechtips.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unixtechtips.blogspot.com/feeds/4556208203515179174/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=714742118606354868&amp;postID=4556208203515179174&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/714742118606354868/posts/default/4556208203515179174'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/714742118606354868/posts/default/4556208203515179174'/><link rel='alternate' type='text/html' href='http://unixtechtips.blogspot.com/2007/01/adding-scsi-host-adapter-x6541a-into.html' title='Adding SCSI Host Adapter (X6541A) into a Blade 100/150 '/><author><name>HuggyPuggy</name><uri>http://www.blogger.com/profile/04602550959022896368</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='10800658094938042256'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-714742118606354868.post-6646510111018129635</id><published>2007-01-10T21:09:00.000-08:00</published><updated>2007-01-10T21:10:00.140-08:00</updated><title type='text'>Solstice DiskSuite - (Solaris 2.5.1 - Solaris 8) </title><content type='html'>&lt;B&gt;&lt;U&gt;&lt;FONT color=#800000&gt; &lt;P&gt;Solstice DiskSuite - &lt;I&gt;(Solaris 2.5.1 - Solaris 8)&lt;/B&gt;&lt;/I&gt;&lt;/U&gt;&lt;/FONT&gt; &lt;/P&gt; &lt;BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"&gt;   &lt;P&gt;&lt;A href="http://wwws.sun.com/software/solaris/8/ds/ds-disksuite/"&gt;Solstice    DiskSuite Software Data Sheet - (Solaris 8)&lt;/A&gt;&lt;BR&gt;&lt;A    href="outbind://98/SOLARIS_SolsticeDiskSuiteSupportMatrix.shtml"&gt;DiskSuite    Support Matrix&lt;/A&gt;&lt;BR&gt;&lt;A    href="outbind://98/SOLARIS_IntroductionToSolsticeDiskSuite.shtml"&gt;Introduction&lt;/A&gt;&lt;BR&gt;&lt;A    href="outbind://98/SOLARIS_InstallingSolsticeDiskSuite421.shtml"&gt;Installing&lt;/A&gt;&lt;BR&gt;&lt;A    href="outbind://98/SOLARIS_CommandLineToolsSolsticeDiskSuite421.shtml"&gt;Command    Line Tools&lt;/A&gt;&lt;BR&gt;&lt;A    href="outbind://98/SOLARIS_CreateMetadevices_DiskSuiteCommands421.shtml"&gt;&lt;B&gt;Creating    Metadevices - &lt;I&gt;(Using DiskSuite 4.2.1 Commands)&lt;/B&gt;&lt;/I&gt;&lt;/A&gt;&lt;BR&gt;&lt;A    href="outbind://98/SOLARIS_CreateMetadevices_DiskSuiteCommands421.shtml#State Database Replicas"&gt;Metadevice    State Database - &lt;I&gt;(State Database Replicas)&lt;/I&gt;&lt;/A&gt;&lt;BR&gt;&lt;A    href="outbind://98/SOLARIS_CreateMetadevices_DiskSuiteCommands421.shtml#Creating a Stripe"&gt;Creating    a Stripe - &lt;I&gt;(RAID 0)&lt;/I&gt;&lt;/A&gt;&lt;BR&gt;&lt;A    href="outbind://98/SOLARIS_CreateMetadevices_DiskSuiteCommands421.shtml#Creating a Concatenation"&gt;Creating    a Concatenation - &lt;I&gt;(RAID 0)&lt;/I&gt;&lt;/A&gt;&lt;BR&gt;&lt;A    href="outbind://98/SOLARIS_CreateMetadevices_DiskSuiteCommands421.shtml#Creating Mirrors"&gt;Creating    Mirrors - &lt;I&gt;(RAID 1)&lt;/I&gt;&lt;/A&gt;&lt;BR&gt;&lt;A    href="outbind://98/SOLARIS_CreateMetadevices_DiskSuiteCommands421.shtml#Creating a RAID5 Volume"&gt;Creating    a RAID5 Volume - &lt;I&gt;(RAID 5)&lt;/I&gt;&lt;/A&gt;&lt;BR&gt;&lt;A    href="outbind://98/SOLARIS_CreateMetadevices_DiskSuiteCommands421.shtml#Creating a Trans Metadevice"&gt;Creating    a Trans Metadevice&lt;/A&gt;&lt;BR&gt;&lt;A    href="outbind://98/SOLARIS_CreateMetadevices_DiskSuiteCommands421.shtml#Creating a Hot Spare"&gt;Creating    a Hot Spare&lt;/A&gt;&lt;BR&gt;&lt;A    href="outbind://98/SOLARIS_RemovingMetadevices_DiskSuiteCommands421.shtml"&gt;&lt;B&gt;Removing    Metadevices - &lt;I&gt;(Using DiskSuite 4.2.1 Commands)&lt;/B&gt;&lt;/I&gt;&lt;/A&gt;&lt;BR&gt;&lt;A    href="outbind://98/SOLARIS_RemovingMetadevices_DiskSuiteCommands421.shtml#Removing a State Database Replica"&gt;Removing    a State Database Replica&lt;/A&gt;&lt;BR&gt;&lt;A    href="outbind://98/SOLARIS_RemovingMetadevices_DiskSuiteCommands421.shtml#Removing a Stripe"&gt;Removing    a Stripe - &lt;I&gt;(RAID 0)&lt;/I&gt;&lt;/A&gt;&lt;BR&gt;&lt;A    href="outbind://98/SOLARIS_RemovingMetadevices_DiskSuiteCommands421.shtml#Removing a Concatenation"&gt;Removing    a Concatenation - &lt;I&gt;(RAID 0)&lt;/I&gt;&lt;/A&gt;&lt;BR&gt;&lt;A    href="outbind://98/SOLARIS_RemovingMetadevices_DiskSuiteCommands421.shtml#Removing a Mirror"&gt;Removing    a Mirror - &lt;I&gt;(RAID 1)&lt;/I&gt;&lt;/A&gt;&lt;BR&gt;&lt;A    href="outbind://98/SOLARIS_RemovingMetadevices_DiskSuiteCommands421.shtml#Removing a RAID5 Volume"&gt;Removing    a RAID5 Volume - &lt;I&gt;(RAID 5)&lt;/I&gt;&lt;/A&gt;&lt;BR&gt;&lt;A    href="outbind://98/SOLARIS_RemovingMetadevices_DiskSuiteCommands421.shtml#Removing a Trans Metadevice"&gt;Removing    a Trans Metadevice&lt;/A&gt;&lt;BR&gt;&lt;A    href="outbind://98/SOLARIS_RemovingMetadevices_DiskSuiteCommands421.shtml#Removing a Hot Spare"&gt;Removing    a Hot Spare&lt;/A&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/714742118606354868-6646510111018129635?l=unixtechtips.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unixtechtips.blogspot.com/feeds/6646510111018129635/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=714742118606354868&amp;postID=6646510111018129635&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/714742118606354868/posts/default/6646510111018129635'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/714742118606354868/posts/default/6646510111018129635'/><link rel='alternate' type='text/html' href='http://unixtechtips.blogspot.com/2007/01/solstice-disksuite-solaris-251-solaris.html' title='Solstice DiskSuite - (Solaris 2.5.1 - Solaris 8) '/><author><name>HuggyPuggy</name><uri>http://www.blogger.com/profile/04602550959022896368</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='10800658094938042256'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-714742118606354868.post-1682539579629431794</id><published>2007-01-10T21:08:00.001-08:00</published><updated>2007-01-10T21:08:48.522-08:00</updated><title type='text'>Solaris Volume Manager - (Solaris 9) </title><content type='html'>&lt;B&gt;&lt;U&gt;&lt;FONT color=#800000&gt; &lt;P&gt;Solaris Volume Manager - &lt;I&gt;(Solaris 9)&lt;/B&gt;&lt;/I&gt;&lt;/U&gt;&lt;/FONT&gt; &lt;/P&gt; &lt;BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"&gt;   &lt;P&gt;&lt;A    href="http://wwws.sun.com/software/solaris/ds/ds-volumemgr/index.html"&gt;Solaris    Volume Manager Data Sheet - (Solaris 9)&lt;/A&gt;&lt;BR&gt;&lt;A    href="outbind://97/SOLARIS_IntroductionToVolumeManager9.shtml"&gt;Introduction&lt;/A&gt;&lt;BR&gt;&lt;A    href="outbind://97/SOLARIS_InstallingVolumeManager9.shtml"&gt;Installing&lt;/A&gt;&lt;BR&gt;&lt;A    href="outbind://97/SOLARIS_CommandLineToolsVolumeManager9.shtml"&gt;Command Line    Tools&lt;/A&gt;&lt;BR&gt;&lt;A    href="outbind://97/SOLARIS_StartingtheVolumeManagerConsoleVolumeManager9.shtml"&gt;Starting    the Volume Manager Console GUI - (Enhanced Storage)&lt;/A&gt;&lt;BR&gt;&lt;A    href="outbind://97/SOLARIS_CreateVolumes_VolumeManager9Commands.shtml"&gt;&lt;B&gt;Creating    Volumes - &lt;I&gt;(Using Solaris 9 Volume Manager Commands)&lt;/B&gt;&lt;/I&gt;&lt;/A&gt;&lt;BR&gt;&lt;A    href="outbind://97/SOLARIS_CreateVolumes_VolumeManager9Commands.shtml#State Database Replicas"&gt;State    Database - &lt;I&gt;(State Database Replicas)&lt;/I&gt;&lt;/A&gt;&lt;BR&gt;&lt;A    href="outbind://97/SOLARIS_CreateVolumes_VolumeManager9Commands.shtml#Creating a Stripe"&gt;Creating    a Stripe - &lt;I&gt;(RAID 0)&lt;/I&gt;&lt;/A&gt;&lt;BR&gt;&lt;A    href="outbind://97/SOLARIS_CreateVolumes_VolumeManager9Commands.shtml#Creating a Concatenation"&gt;Creating    a Concatenation - &lt;I&gt;(RAID 0)&lt;/I&gt;&lt;/A&gt;&lt;BR&gt;&lt;A    href="outbind://97/SOLARIS_CreateVolumes_VolumeManager9Commands.shtml#Creating Mirrors"&gt;Creating    Mirrors - &lt;I&gt;(RAID 1)&lt;/I&gt;&lt;/A&gt;&lt;BR&gt;&lt;A    href="outbind://97/SOLARIS_CreateVolumes_VolumeManager9Commands.shtml#Creating a RAID5 Volume"&gt;Creating    a RAID5 Volume - &lt;I&gt;(RAID 5)&lt;/I&gt;&lt;/A&gt;&lt;BR&gt;&lt;A    href="outbind://97/SOLARIS_CreateVolumes_VolumeManager9Commands.shtml#Creating a Hot Spare"&gt;Creating    a Hot Spare&lt;/A&gt;&lt;BR&gt;&lt;A    href="outbind://97/SOLARIS_RemovingVolumes_VolumeManager9Commands.shtml"&gt;&lt;B&gt;Removing    Volumes - &lt;I&gt;(Using Solaris 9 Volume Manager Commands)&lt;/B&gt;&lt;/I&gt;&lt;/A&gt;&lt;BR&gt;&lt;A    href="outbind://97/SOLARIS_RemovingVolumes_VolumeManager9Commands.shtml#Removing a State Database Replica"&gt;Removing    a State Database Replica&lt;/A&gt;&lt;BR&gt;&lt;A    href="outbind://97/SOLARIS_RemovingVolumes_VolumeManager9Commands.shtml#Removing a Stripe"&gt;Removing    a Stripe - &lt;I&gt;(RAID 0)&lt;/I&gt;&lt;/A&gt;&lt;BR&gt;&lt;A    href="outbind://97/SOLARIS_RemovingVolumes_VolumeManager9Commands.shtml#Removing a Concatenation"&gt;Removing    a Concatenation - &lt;I&gt;(RAID 0)&lt;/I&gt;&lt;/A&gt;&lt;BR&gt;&lt;A    href="outbind://97/SOLARIS_RemovingVolumes_VolumeManager9Commands.shtml#Removing a Mirror"&gt;Removing    a Mirror - &lt;I&gt;(RAID 1)&lt;/I&gt;&lt;/A&gt;&lt;BR&gt;&lt;A    href="outbind://97/SOLARIS_RemovingVolumes_VolumeManager9Commands.shtml#Removing a RAID5 Volume"&gt;Removing    a RAID5 Volume - &lt;I&gt;(RAID 5)&lt;/I&gt;&lt;/A&gt;&lt;BR&gt;&lt;A    href="outbind://97/SOLARIS_RemovingVolumes_VolumeManager9Commands.shtml#Removing a Hot Spare"&gt;Removing    a Hot Spare&lt;/A&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/714742118606354868-1682539579629431794?l=unixtechtips.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unixtechtips.blogspot.com/feeds/1682539579629431794/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=714742118606354868&amp;postID=1682539579629431794&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/714742118606354868/posts/default/1682539579629431794'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/714742118606354868/posts/default/1682539579629431794'/><link rel='alternate' type='text/html' href='http://unixtechtips.blogspot.com/2007/01/solaris-volume-manager-solaris-9.html' title='Solaris Volume Manager - (Solaris 9) '/><author><name>HuggyPuggy</name><uri>http://www.blogger.com/profile/04602550959022896368</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='10800658094938042256'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-714742118606354868.post-3939696430367078764</id><published>2007-01-10T21:06:00.001-08:00</published><updated>2007-01-10T21:06:42.889-08:00</updated><title type='text'>Using NFS - (Solaris) </title><content type='html'>&lt;U&gt;&lt;FONT color=#000080 size=5&gt; &lt;P&gt;Using NFS - (Solaris)&lt;/U&gt;&lt;/FONT&gt; &lt;/P&gt;&lt;I&gt; &lt;P&gt;by Jeff Hunter, Sr. Database Administrator&lt;/I&gt; &lt;/P&gt; &lt;P&gt;This brief article touches on several of the important commands that are used  to NFS a file system on Solaris. Now keep in mind that with most Solaris  configurations; enabling a Sun Solaris server to mount or share a file system,  the required daemons will already be running. If not, this article may help you  with this process. &lt;/P&gt; &lt;P&gt;The first thing to ensure is that the proper daemons for running NFS are  started. If unsure, I will typically just run them when I cannot determine  whether or not they are running: &lt;/P&gt; &lt;DIR&gt;&lt;PRE&gt;$ &lt;B&gt;su - &lt;/B&gt;$ &lt;B&gt;cd /usr/lib/nfs &lt;/B&gt;$ &lt;B&gt;./mountd &lt;/B&gt;$ &lt;B&gt;./nfsd&lt;/PRE&gt;&lt;/DIR&gt;&lt;/B&gt; &lt;TABLE cellSpacing=0 cellPadding=1 width=580 border=0&gt;   &lt;TBODY&gt;   &lt;TR&gt;     &lt;TD vAlign=center bgColor=#ffffff&gt;&lt;B&gt;&lt;FONT color=#ff0000&gt;       &lt;P&gt;NOTE&lt;/FONT&gt;:&lt;/B&gt; &lt;/P&gt;       &lt;DIR&gt;       &lt;DIR&gt;&lt;B&gt;&lt;TT&gt;       &lt;P&gt;mountd:&lt;/B&gt;&lt;/TT&gt; RPC server that answers requests for NFS access        information and file system mount requests &lt;/P&gt;&lt;B&gt;&lt;TT&gt;       &lt;P&gt;nfsd:&lt;/B&gt;&lt;/TT&gt; The daemon that handles client file system requests        &lt;/P&gt;&lt;/DIR&gt;&lt;/DIR&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;B&gt;&lt;U&gt; &lt;P&gt;Sharing A File System&lt;/B&gt;&lt;/U&gt; &lt;/P&gt; &lt;BLOCKQUOTE&gt;The following example will &lt;I&gt;share&lt;/I&gt; a file system    &lt;TT&gt;/software&lt;/TT&gt; so that others may be able to mount it: &lt;/BLOCKQUOTE&gt; &lt;DIR&gt;&lt;PRE&gt;# &lt;B&gt;share /software&lt;/PRE&gt;&lt;/B&gt; &lt;BLOCKQUOTE&gt;If I want to check all file systems being shared from my system:  &lt;/BLOCKQUOTE&gt;&lt;PRE&gt;# &lt;B&gt;share &lt;/B&gt;-               /software   rw   ""&lt;/PRE&gt;&lt;/DIR&gt;&lt;B&gt;&lt;U&gt; &lt;P&gt;How to NFS A File System&lt;/B&gt;&lt;/U&gt; &lt;/P&gt; &lt;BLOCKQUOTE&gt;Now, from another machine, I want to NFS the file system that is    being shared above: &lt;/BLOCKQUOTE&gt; &lt;DIR&gt;&lt;PRE&gt;# &lt;B&gt;mount -F nfs alex:/software /mnt/software&lt;/PRE&gt;&lt;/DIR&gt;&lt;U&gt; &lt;P&gt;How to Unmount an NFS File System&lt;/B&gt;&lt;/U&gt; &lt;/P&gt; &lt;BLOCKQUOTE&gt;Finally, let's unmount the previously mounted file system:  &lt;/BLOCKQUOTE&gt; &lt;DIR&gt;&lt;PRE&gt;# &lt;B&gt;umount /mnt/software&lt;/PRE&gt;&lt;/DIR&gt;&lt;/B&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/714742118606354868-3939696430367078764?l=unixtechtips.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unixtechtips.blogspot.com/feeds/3939696430367078764/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=714742118606354868&amp;postID=3939696430367078764&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/714742118606354868/posts/default/3939696430367078764'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/714742118606354868/posts/default/3939696430367078764'/><link rel='alternate' type='text/html' href='http://unixtechtips.blogspot.com/2007/01/using-nfs-solaris.html' title='Using NFS - (Solaris) '/><author><name>HuggyPuggy</name><uri>http://www.blogger.com/profile/04602550959022896368</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='10800658094938042256'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-714742118606354868.post-8802532278750080957</id><published>2007-01-10T21:05:00.001-08:00</published><updated>2007-01-10T21:05:53.174-08:00</updated><title type='text'></title><content type='html'>&lt;U&gt;&lt;FONT color=#000080 size=5&gt; &lt;P&gt;Determine Which Package a Particular File Belongs To - (Sun  Solaris)&lt;/U&gt;&lt;/FONT&gt; &lt;/P&gt;&lt;I&gt; &lt;P&gt;by Jeff Hunter, Sr. Database Administrator&lt;/I&gt; &lt;/P&gt; &lt;P&gt;&lt;BR&gt;Use the &lt;B&gt;&lt;TT&gt;pkgchk&lt;/B&gt;&lt;/TT&gt; command to determine which package a  particular file belongs to. The syntax is: &lt;/P&gt;&lt;PRE&gt;# /usr/sbin/pkgchk -l -p /absolute/path/todir&lt;/PRE&gt; &lt;P&gt;For example, &lt;/P&gt;&lt;PRE&gt;# &lt;B&gt;/usr/sbin/pkgchk -l -p /usr/bin/pgrep &lt;/B&gt;Pathname: /usr/bin/pgrep Type: regular file Expected mode: 0555 Expected owner: root Expected group: bin Expected file size (bytes): 14688 Expected sum(1) of contents: 63968 Expected last modification: Mar 16 05:53:45 AM 2000 Referenced by the following packages:         SUNWcsu Current status: installed&lt;/PRE&gt; &lt;P&gt;You can also simply query the packages directory as follows: &lt;/P&gt;&lt;PRE&gt;# &lt;B&gt;grep /usr/bin/pgrep /var/sadm/install/contents &lt;/B&gt;/usr/bin/pgrep f none 0555 root bin 14688 63968 953204025 SUNWcsu&lt;/PRE&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/714742118606354868-8802532278750080957?l=unixtechtips.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unixtechtips.blogspot.com/feeds/8802532278750080957/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=714742118606354868&amp;postID=8802532278750080957&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/714742118606354868/posts/default/8802532278750080957'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/714742118606354868/posts/default/8802532278750080957'/><link rel='alternate' type='text/html' href='http://unixtechtips.blogspot.com/2007/01/determine-which-package-particular-file.html' title=''/><author><name>HuggyPuggy</name><uri>http://www.blogger.com/profile/04602550959022896368</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='10800658094938042256'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-714742118606354868.post-3559994442460331881</id><published>2007-01-10T21:04:00.003-08:00</published><updated>2007-01-10T21:04:50.283-08:00</updated><title type='text'>Diagnostic Command - (Sun Solaris) </title><content type='html'>&lt;U&gt;&lt;FONT color=#000080 size=5&gt; &lt;P&gt;Diagnostic Command - (Sun Solaris)&lt;/U&gt;&lt;/FONT&gt; &lt;/P&gt;&lt;I&gt; &lt;P&gt;by Jeff Hunter, Sr. Database Administrator&lt;/I&gt; &lt;/P&gt;&lt;B&gt;&lt;U&gt;&lt;FONT color=#000080&gt; &lt;P&gt;prtdiag&lt;/B&gt;&lt;/U&gt;&lt;/FONT&gt; &lt;/P&gt; &lt;BLOCKQUOTE&gt;Use the following command to obtain detailed diagnostics    information about your system configuration: &lt;/BLOCKQUOTE&gt; &lt;DIR&gt;&lt;PRE&gt;# &lt;B&gt;/usr/platform/`uname -i`/sbin/prtdiag -v &lt;/B&gt; System Configuration: Sun Microsystems  sun4u Sun Blade 150 (UltraSPARC-IIe 650MHz) System clock frequency: 93 MHZ Memory size: 1.75GB  ==================================== CPUs ====================================                E$          CPU     CPU       Temperature CPU  Freq      Size        Impl.   Mask     Die    Ambient ---  --------  ----------  ------  ----  --------  --------  0    650 MHz  512KB       US-IIe   3.3     56 C     29 C  ================================= IO Devices =================================      Bus   Freq Brd  Type  MHz   Slot        Name                              Model ---  ----  ----  ----------  --------------------------------  ----------------------  0   pci    33            7  isa/dma-isadma (dma)  0   pci    33            7  isa/serial-su16550 (serial)  0   pci    33            7  isa/serial-su16550 (serial)  0   pci    33            8  sound-pci10b9,5451.10b9.5451.1 (+  0   pci    33           12  network-pci108e,1101.1 (network)  SUNW,pci-eri  0   pci    33           12  firewire-pci108e,1102.1001 (fire+  0   pci    33           13  ide-pci10b9,5229.c3 (ide)  0   pci    33           19  SUNW,m64B (display)               ATY,RageXL  ============================ Memory Configuration ============================ Segment Table: ----------------------------------------------------------------------- Base Address       Size       Interleave Factor  Contains ----------------------------------------------------------------------- 0x0                256MB             1           Label DIMM0 0x40000000         512MB             1           Label DIMM1 0x80000000         512MB             1           Label DIMM2 0xc0000000         512MB             1           Label DIMM3  =============================== usb Devices ===============================  Name          Port# ------------  ----- device          4  =============================== device#4 Devices ===============================  Name          Port# ------------  ----- keyboard      mouse ============================ Environmental Status ============================ Fan Speeds: ---------------------------- Fan Device            Speed ---------------------------- system                 100%  ================================ HW Revisions ================================ ASIC Revisions: --------------- ebus: Rev 1  System PROM revisions: ---------------------- OBP 4.6.5 2002/06/03 16:49 POST 2.0.1 2001/08/23 17:13&lt;/PRE&gt;&lt;/DIR&gt;&lt;B&gt;&lt;U&gt;&lt;FONT color=#000080&gt; &lt;P&gt;prtconf&lt;/B&gt;&lt;/U&gt;&lt;/FONT&gt; &lt;/P&gt; &lt;BLOCKQUOTE&gt;Use the following command to obtain detailed system information    about your Sun Solaris installation: &lt;/BLOCKQUOTE&gt; &lt;DIR&gt;&lt;PRE&gt;# &lt;B&gt;/usr/sbin/prtconf &lt;/B&gt; System Configuration:  Sun Microsystems  sun4u Memory size: 1792 Megabytes System Peripherals (Software Nodes):  SUNW,Sun-Blade-100     packages (driver not attached)         SUNW,builtin-drivers (driver not attached)         deblocker (driver not attached)         disk-label (driver not attached)         terminal-emulator (driver not attached)         obp-tftp (driver not attached)         dropins (driver not attached)         kbd-translator (driver not attached)         ufs-file-system (driver not attached)     chosen (driver not attached)     openprom (driver not attached)         client-services (driver not attached)     options, instance #0     aliases (driver not attached)     memory (driver not attached)     virtual-memory (driver not attached)     pci, instance #0         ebus, instance #1             flashprom (driver not attached)             eeprom (driver not attached)             idprom (driver not attached)         isa, instance #0             dma, instance #0                 floppy, instance #0                 parallel (driver not attached)             power, instance #0             serial, instance #0             serial, instance #1         network, instance #0         firewire, instance #0         usb (driver not attached)         pmu, instance #0             i2c, instance #0                 temperature, instance #0                 card-reader (driver not attached)                 dimm (driver not attached)                 dimm (driver not attached)                                 dimm (driver not attached)                 dimm (driver not attached)             ppm, instance #0             beep, instance #0             fan-control, instance #0         sound (driver not attached)         ide, instance #0             disk (driver not attached)             cdrom (driver not attached)             dad, instance #0             dad, instance #1             sd, instance #0         pci (driver not attached)         SUNW,m64B, instance #0     SUNW,UltraSPARC-IIe, instance #0     pseudo, instance #0&lt;/PRE&gt;&lt;/DIR&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/714742118606354868-3559994442460331881?l=unixtechtips.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unixtechtips.blogspot.com/feeds/3559994442460331881/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=714742118606354868&amp;postID=3559994442460331881&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/714742118606354868/posts/default/3559994442460331881'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/714742118606354868/posts/default/3559994442460331881'/><link rel='alternate' type='text/html' href='http://unixtechtips.blogspot.com/2007/01/diagnostic-command-sun-solaris.html' title='Diagnostic Command - (Sun Solaris) '/><author><name>HuggyPuggy</name><uri>http://www.blogger.com/profile/04602550959022896368</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='10800658094938042256'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-714742118606354868.post-6565781130380009604</id><published>2007-01-10T21:04:00.001-08:00</published><updated>2007-01-10T21:04:07.266-08:00</updated><title type='text'>Using Package Manager on Solaris </title><content type='html'>&lt;U&gt;&lt;FONT color=#000080 size=5&gt; &lt;P&gt;Using Package Manager on Solaris&lt;/U&gt;&lt;/FONT&gt; &lt;/P&gt;&lt;I&gt; &lt;P&gt;by Jeff Hunter, Sr. Database Administrator&lt;/I&gt; &lt;/P&gt;&lt;B&gt;&lt;U&gt;&lt;FONT color=#800000&gt; &lt;P&gt;Adding a Package&lt;/B&gt;&lt;/U&gt;&lt;/FONT&gt; &lt;/P&gt;&lt;PRE&gt;  # &lt;B&gt;pkgadd -d samba-2.0.5-sol7-sparc-local&lt;/PRE&gt;&lt;U&gt;&lt;FONT color=#800000&gt; &lt;P&gt;Checking for Packages&lt;/B&gt;&lt;/U&gt;&lt;/FONT&gt; &lt;/P&gt;&lt;PRE&gt;  # &lt;B&gt;pkginfo | grep -i samba &lt;/B&gt;  application SMCsamba       samba&lt;/PRE&gt;&lt;B&gt;&lt;U&gt;&lt;FONT color=#800000&gt; &lt;P&gt;Removing a Package&lt;/B&gt;&lt;/U&gt;&lt;/FONT&gt; &lt;/P&gt;&lt;PRE&gt;  # &lt;B&gt;pkgrm SMCsamba&lt;/PRE&gt;&lt;/B&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/714742118606354868-6565781130380009604?l=unixtechtips.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unixtechtips.blogspot.com/feeds/6565781130380009604/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=714742118606354868&amp;postID=6565781130380009604&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/714742118606354868/posts/default/6565781130380009604'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/714742118606354868/posts/default/6565781130380009604'/><link rel='alternate' type='text/html' href='http://unixtechtips.blogspot.com/2007/01/using-package-manager-on-solaris.html' title='Using Package Manager on Solaris '/><author><name>HuggyPuggy</name><uri>http://www.blogger.com/profile/04602550959022896368</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='10800658094938042256'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-714742118606354868.post-7660737690095947584</id><published>2007-01-10T21:03:00.001-08:00</published><updated>2007-01-10T21:03:35.660-08:00</updated><title type='text'>Configuring Power Management (Sun Blades Only) </title><content type='html'>&lt;U&gt;&lt;FONT color=#000080 size=5&gt; &lt;P&gt;Configuring Power Management (Sun Blades Only)&lt;/U&gt;&lt;/FONT&gt; &lt;/P&gt;&lt;I&gt; &lt;P&gt;by Jeff Hunter, Sr. Database Administrator&lt;/I&gt; &lt;/P&gt; &lt;P&gt;Hard drive and system power management are adjustable with the  &lt;B&gt;&lt;TT&gt;dtpower&lt;/B&gt;&lt;/TT&gt; application with Solaris 8 7/01 release and higher.  However, the power management features were not present in Solaris 8 10/00 and  Solaris 8 1/01 releases. By default, power management is &lt;I&gt;enabled&lt;/I&gt; on all  new Sun Blade systems. &lt;I&gt;(I really wish Sun would change this!)&lt;/I&gt; &lt;/P&gt; &lt;P&gt;When the system is in low-power mode, the hard drive eventually spins down to  conserve power. Later, when you perform a task that accesses the hard drive, the  hard drive spins up again. You might have to wait a few seconds for the hard  drive to spin up to full speed. If you find that the delay is inconvenient, you  can turn off Energy Star power management using one of the two methods provided  below: &lt;/P&gt;&lt;B&gt;&lt;U&gt; &lt;P&gt;Method #1&lt;/B&gt;&lt;/U&gt; &lt;/P&gt; &lt;DIR&gt; &lt;DIR&gt; &lt;P&gt;You can disable the Energy Star power management feature by using the  &lt;B&gt;&lt;TT&gt;dtpower&lt;/B&gt;&lt;/TT&gt; application. &lt;/P&gt; &lt;P&gt;Login as the "root" account and at the system prompt type: &lt;/P&gt;&lt;PRE&gt;# &lt;B&gt;/usr/openwin/bin/dtpower&lt;/PRE&gt;&lt;/B&gt; &lt;P&gt;The dtpower application is displayed. &lt;/P&gt; &lt;P&gt;Under the Current power saving scheme menu, select &lt;I&gt;Disabled&lt;/I&gt;. &lt;/P&gt; &lt;P&gt;Press the OK button. &lt;/P&gt;&lt;/DIR&gt;&lt;/DIR&gt; &lt;P&gt;&lt;BR&gt;&lt;B&gt;&lt;U&gt;Method #2&lt;/B&gt;&lt;/U&gt; &lt;/P&gt; &lt;P&gt;The main configuration file for controller Power Management is  &lt;TT&gt;/etc/power.conf&lt;/TT&gt;. &lt;/P&gt; &lt;DIR&gt; &lt;DIR&gt; &lt;P&gt;As the root user ID, edit the &lt;TT&gt;/etc/power.conf&lt;/TT&gt; file as follows to  disable all Automatic Power Management: &lt;/P&gt;&lt;/DIR&gt;&lt;/DIR&gt; &lt;TABLE cellSpacing=2 cellPadding=2 width=550 border=1&gt;   &lt;TBODY&gt;   &lt;TR&gt;     &lt;TD vAlign=center&gt;&lt;PRE&gt;# # Copyright (c) 1996 - 2001 by Sun Microsystems, Inc. # All rights reserved. # #pragma ident   "@(#)power.conf 1.14    99/10/18 SMI" # # Power Management Configuration File #  # Statefile     Path statefile               /usr/.CPR   # Auto-Shutdown Idle(min)       Start/Finish(hh:mm)     Behavior autoshutdown    30              9:00 9:00       noshutdown  device-dependency-property removable-media /dev/fb &lt;B&gt;autopm          disable &lt;/B&gt; system-threshold                always-on&lt;/PRE&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt; &lt;DIR&gt; &lt;DIR&gt; &lt;P&gt;Run the command: &lt;/P&gt;&lt;PRE&gt;# &lt;B&gt;/usr/sbin/pmconfig&lt;/PRE&gt;&lt;/B&gt; &lt;P&gt;This utility is run from the command line after manual changes have been made  to the &lt;TT&gt;/etc/power.conf&lt;/TT&gt; file. For editing changes made to the  &lt;TT&gt;/etc/power.conf&lt;/TT&gt; file to take effect, users must run  &lt;B&gt;&lt;TT&gt;pmconfig&lt;/B&gt;&lt;/TT&gt;. &lt;/P&gt; &lt;P&gt;pmconfig is also run at each system boot. &lt;/P&gt;&lt;/DIR&gt;&lt;/DIR&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/714742118606354868-7660737690095947584?l=unixtechtips.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unixtechtips.blogspot.com/feeds/7660737690095947584/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=714742118606354868&amp;postID=7660737690095947584&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/714742118606354868/posts/default/7660737690095947584'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/714742118606354868/posts/default/7660737690095947584'/><link rel='alternate' type='text/html' href='http://unixtechtips.blogspot.com/2007/01/configuring-power-management-sun-blades.html' title='Configuring Power Management (Sun Blades Only) '/><author><name>HuggyPuggy</name><uri>http://www.blogger.com/profile/04602550959022896368</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='10800658094938042256'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-714742118606354868.post-560074449501925896</id><published>2007-01-10T21:02:00.003-08:00</published><updated>2007-01-10T21:02:55.126-08:00</updated><title type='text'>Configuring Telnet / FTP to login as root (Solaris) </title><content type='html'>&lt;U&gt;&lt;FONT color=#000080 size=5&gt; &lt;P&gt;Configuring Telnet / FTP to login as root (Solaris)&lt;/U&gt;&lt;/FONT&gt; &lt;/P&gt;&lt;I&gt; &lt;P&gt;by Jeff Hunter, Sr. Database Administrator&lt;/I&gt; &lt;/P&gt; &lt;P&gt;Now before getting into the details of how to configure Solaris for root  logins, keep in mind that this is VERY BAD security. Make sure that you NEVER  configure your production servers for this type of login. &lt;/P&gt;&lt;B&gt;&lt;U&gt; &lt;P&gt;Configure Telnet for root logins&lt;/B&gt;&lt;/U&gt; &lt;/P&gt; &lt;BLOCKQUOTE&gt;Simply edit the file &lt;CODE&gt;/etc/default/login&lt;/CODE&gt; and comment    out the following line as follows: &lt;/BLOCKQUOTE&gt; &lt;DIR&gt;&lt;PRE&gt;# If CONSOLE is set, root can only login on that device. # Comment this line out to allow remote login by root. # # CONSOLE=/dev/console&lt;/PRE&gt;&lt;/DIR&gt;&lt;B&gt;&lt;U&gt; &lt;P&gt;Configure FTP for root logins&lt;/B&gt;&lt;/U&gt; &lt;/P&gt; &lt;BLOCKQUOTE&gt;First remove the 'root' line from &lt;TT&gt;/etc/ftpusers&lt;/TT&gt;.  &lt;/BLOCKQUOTE&gt; &lt;BLOCKQUOTE&gt;Also, don't forget to edit the file &lt;TT&gt;/etc/ftpaccess&lt;/TT&gt; and    comment out the 'deny-uid' and 'deny-gid' lines. If the file doesn't exist,    there is no need to create it. &lt;/BLOCKQUOTE&gt; &lt;TABLE cellSpacing=0 width=590 border=0&gt;   &lt;TBODY&gt;   &lt;TR&gt;     &lt;TD vAlign=center bgColor=#ffffff&gt;&lt;B&gt;&lt;FONT color=#ff0000&gt;       &lt;P&gt;NOTE&lt;/FONT&gt;:&lt;/B&gt; If you are using Solaris 9 or Solaris 10, the        &lt;TT&gt;ftp*&lt;/TT&gt; files are located in  &lt;TT&gt;/etc/ftpd&lt;/TT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/714742118606354868-560074449501925896?l=unixtechtips.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unixtechtips.blogspot.com/feeds/560074449501925896/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=714742118606354868&amp;postID=560074449501925896&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/714742118606354868/posts/default/560074449501925896'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/714742118606354868/posts/default/560074449501925896'/><link rel='alternate' type='text/html' href='http://unixtechtips.blogspot.com/2007/01/configuring-telnet-ftp-to-login-as-root.html' title='Configuring Telnet / FTP to login as root (Solaris) '/><author><name>HuggyPuggy</name><uri>http://www.blogger.com/profile/04602550959022896368</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='10800658094938042256'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-714742118606354868.post-7280453884621141376</id><published>2007-01-10T21:02:00.001-08:00</published><updated>2007-01-10T21:02:24.865-08:00</updated><title type='text'>Booting Options and Using EEPROM </title><content type='html'>&lt;U&gt;&lt;FONT color=#000080 size=5&gt; &lt;P&gt;Booting Options and Using EEPROM&lt;/U&gt;&lt;/FONT&gt; &lt;/P&gt;&lt;I&gt; &lt;P&gt;by Jeff Hunter, Sr. Database Administrator&lt;/I&gt; &lt;/P&gt;&lt;B&gt;&lt;U&gt;&lt;FONT color=#000080&gt; &lt;P&gt;EEPROM Command&lt;/B&gt;&lt;/U&gt;&lt;/FONT&gt; &lt;/P&gt; &lt;BLOCKQUOTE&gt;The &lt;B&gt;&lt;TT&gt;eeprom&lt;/B&gt;&lt;/TT&gt; command is located in    &lt;B&gt;&lt;TT&gt;/usr/sbin/eeprom&lt;/B&gt;&lt;/TT&gt;. The &lt;TT&gt;eeprom&lt;/TT&gt; command is used to    display or change the values of parameters in the EEPROM. It processes    parameters in the order given. When processing a parameter accompanied by a    value, &lt;TT&gt;eeprom&lt;/TT&gt; makes the indicated alteration to the EEPROM; otherwise    it displays the parameter's value. When given no parameter specifiers,    &lt;TT&gt;eeprom&lt;/TT&gt; displays the values of all EEPROM parameters. A '-' (hyphen)    flag specifies that parameters and values are to be read from the standard    input (one parameter or &lt;I&gt;parameter = value&lt;/I&gt; per line). Only the    super-user (root) may alter the EEPROM contents. &lt;/BLOCKQUOTE&gt; &lt;BLOCKQUOTE&gt;When the &lt;TT&gt;eeprom&lt;/TT&gt; command is executed in user mode, the    parameters with a trailing question mark (?) need to be enclosed in double    quotation marks (" ") to prevent the shell from interpreting the question    mark. Preceding the question mark with an escape character (\) will also    prevent the shell from interpreting the question mark. &lt;/BLOCKQUOTE&gt; &lt;BLOCKQUOTE&gt;The remainder of this section descibes some of the common usages    of the &lt;TT&gt;eeprom&lt;/TT&gt; command in Solaris. &lt;/BLOCKQUOTE&gt;&lt;B&gt;&lt;U&gt; &lt;BLOCKQUOTE&gt;Query Values&lt;/B&gt;&lt;/U&gt; &lt;/BLOCKQUOTE&gt; &lt;DIR&gt; &lt;BLOCKQUOTE&gt;To query all current EEPROM values, simply use the &lt;TT&gt;eeprom&lt;/TT&gt;    command with no arguments. If you only want to determine one EEPROM value,    specify it as an argument. Here are two examples of using the &lt;TT&gt;eeprom&lt;/TT&gt;    command: &lt;/BLOCKQUOTE&gt; &lt;DIR&gt;&lt;PRE&gt;# &lt;B&gt;eeprom auto-boot? &lt;/B&gt;auto-boot?=true # &lt;B&gt;eeprom &lt;/B&gt;test-args: data not available. diag-passes=1 pci-probe-list=7,c,3,8,d,13,5 local-mac-address?=false fcode-debug?=false ttyb-rts-dtr-off=false ttyb-ignore-cd=true ttya-rts-dtr-off=false ttya-ignore-cd=true silent-mode?=false scsi-initiator-id=7 oem-logo: data not available. oem-logo?=false oem-banner: data not available. oem-banner?=false ansi-terminal?=true screen-#columns=80 screen-#rows=34 ttyb-mode=9600,8,n,1,- ttya-mode=9600,8,n,1,- output-device=screen input-device=keyboard load-base=16384 auto-boot?=true boot-command=boot diag-file: data not available. diag-device=disk net boot-file: data not available. boot-device=disk net use-nvramrc?=false nvramrc: data not available. security-mode=none security-password: data not available. security-#badlogins=0 mfg-mode=off diag-level=max diag-switch?=false error-reset-recovery=boot&lt;/PRE&gt;&lt;/DIR&gt;&lt;B&gt;&lt;U&gt; &lt;BLOCKQUOTE&gt;auto-boot?&lt;/B&gt;&lt;/U&gt; &lt;/BLOCKQUOTE&gt; &lt;BLOCKQUOTE&gt;Used to control the &lt;I&gt;auto-boot&lt;/I&gt; feature. This option controls    whether the system directly boots up. You can disable &lt;I&gt;auto-boot&lt;/I&gt; so next    time it stays at the &lt;TT&gt;ok&lt;/TT&gt; prompt for starting installations. Use the    following command and reboot the system: &lt;/BLOCKQUOTE&gt; &lt;DIR&gt;&lt;PRE&gt;# &lt;B&gt;eeprom "auto-boot?"=false&lt;/PRE&gt;&lt;/DIR&gt;&lt;/DIR&gt;&lt;/B&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/714742118606354868-7280453884621141376?l=unixtechtips.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unixtechtips.blogspot.com/feeds/7280453884621141376/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=714742118606354868&amp;postID=7280453884621141376&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/714742118606354868/posts/default/7280453884621141376'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/714742118606354868/posts/default/7280453884621141376'/><link rel='alternate' type='text/html' href='http://unixtechtips.blogspot.com/2007/01/booting-options-and-using-eeprom.html' title='Booting Options and Using EEPROM '/><author><name>HuggyPuggy</name><uri>http://www.blogger.com/profile/04602550959022896368</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='10800658094938042256'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-714742118606354868.post-8112372658157580932</id><published>2006-12-28T02:52:00.001-08:00</published><updated>2006-12-28T02:52:25.698-08:00</updated><title type='text'>I/O Bottleneck - Trouble shooting</title><content type='html'>&lt;STRONG&gt;&lt;FONT face=Verdana&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/STRONG&gt; &lt;H1&gt;What does 100 percent busy mean?&lt;/H1&gt;&lt;FONT  face="verdana, arial, geneva, sans-serif" size=-2&gt;Unix Insider  8/1/99&lt;/FONT&gt;&lt;BR&gt;&lt;BR&gt;&lt;!-- Deck : deck.pt -------------------------------------------------&gt;&lt;!-------------------------------------------------------------------&gt;&lt;FONT  face="verdana, arial, geneva, sans-serif" size=-2&gt;&lt;STRONG&gt;&lt;!-- Author : -------------------------------------------------------&gt;&lt;!-------------------------------------------------------------------&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT  face="verdana, arial, geneva, sans-serif" size=-1&gt;&lt;!-- Body -----------------------------------------------------------&gt; &lt;DIV class=articletxt&gt; &lt;P&gt;&lt;STRONG&gt;Q:&lt;/STRONG&gt; Some of my disks get really slow when they are nearly 100  percent busy; however, when I see a striped volume or hardware RAID unit at high  utilization levels, it still seems to respond quickly. Why is this? Do the old  rules about high utilization still apply?&lt;/P&gt; &lt;P&gt;&lt;STRONG&gt;A:&lt;/STRONG&gt; This occurs because more complex systems don't obey the  same rules as simple systems when it comes to response time, throughput, and  utilization. Even the simple systems aren't so simple. I'll begin our  examination of this phenomenon by looking at a single disk, and then move on to  combinations.&lt;/P&gt; &lt;P&gt;Part of this answer is based on my September 1997 &lt;STRONG&gt;Performance  Q&amp;amp;A&lt;/STRONG&gt; column. The information from the column was updated and  included in my book as of April 1998, and has been further updated for inclusion  in &lt;EM&gt;Sun BluePrints for Resource Management.&lt;/EM&gt; Written by several members  of our group at Sun, this book will be published this summer (see &lt;A  href="http://storage.itworld.com/4650/UIR990801perf/page_1.html#resources"&gt;Resources&lt;/A&gt;  for more information on both the book and the column). I've added much more  explanation and several examples here.&lt;/P&gt; &lt;P&gt;&lt;STRONG&gt;Measurements on a single disk&lt;/STRONG&gt;&lt;BR&gt;In an old-style,  single-disk model, the device driver maintains a queue of waiting requests that  are serviced one at a time by the disk. The terms &lt;EM&gt;utilization, service time,  wait time, throughput,&lt;/EM&gt; and &lt;EM&gt;wait queue length&lt;/EM&gt; have well-defined  meanings in this scenario; and, for this sort of basic system, the setup is so  simple that a very basic queuing model fits it well.&lt;/P&gt; &lt;TABLE cellSpacing=0 cellPadding=3 width=265 align=left border=0&gt;   &lt;TBODY&gt;   &lt;TR&gt;     &lt;TD&gt;&lt;IMG height=90 alt=UIR990801perffig1 hspace=0        src="http://storage.itworld.com/shared/images/2006/12/UIR990801perffig1.gif"        width=265 border=0&gt;&lt;/TD&gt;&lt;/TR&gt;   &lt;TR&gt;     &lt;TD&gt;&lt;FONT face="verdana, arial, geneva, sans-serif" size=-2&gt;&lt;B&gt;Figure 1.        The simple disk model&lt;/B&gt;&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt; &lt;P&gt;Over time, disk technology has moved on. Nowadays, a standard disk is  SCSI-based and has an embedded controller. The disk drive contains a small  microprocessor and about 1 MB of RAM. It can typically handle up to 64  outstanding requests via SCSI tagged-command queuing. The system uses an SCSI  host bus adaptor to talk to the disk. In large systems, there is yet another  level of intelligence and buffering in a hardware RAID controller. However, the  &lt;CODE&gt;&lt;FONT face=courier&gt;iostat&lt;/FONT&gt;&lt;/CODE&gt; utility is still built around the  simple disk model above, and its use of terminology still assumes a single disk  that can only handle a single request at a time. In addition, &lt;CODE&gt;&lt;FONT  face=courier&gt;iostat&lt;/FONT&gt;&lt;/CODE&gt; uses the same reporting mechanism for  client-side NFS mount points and complex disk volumes set up using Solstice  DiskSuite or Veritas Volume Manager.&lt;/P&gt; &lt;P&gt;In the old days, if the device driver sent a request to the disk, the disk  would do nothing else until it completed the request. The time this process took  was the &lt;EM&gt;service time,&lt;/EM&gt; and the average service time was a physical  property of the disk itself. Disks that spun and sought faster had lower (and  thus better) service times. With today's systems, if the device driver issues a  request, that request is queued internally by the RAID controller and the disk  drive, and several more requests can be sent before a response to the first  comes back. The service time, as measured by the device driver, varies according  to the load level and queue length, and is not directly comparable to the  old-style service time of a simple disk drive. The &lt;EM&gt;response time&lt;/EM&gt; is  defined as the total waiting time in the queue plus the service time.  Unfortunately, as I've mentioned before, &lt;CODE&gt;&lt;FONT  face=courier&gt;iostat&lt;/FONT&gt;&lt;/CODE&gt; reports response time but labels it  &lt;CODE&gt;&lt;FONT face=courier&gt;svc_t&lt;/FONT&gt;&lt;/CODE&gt;. We'll see later how to calculate  the actual service time for a disk.&lt;/P&gt; &lt;P&gt;As soon as a device has one request in its internal queue, it becomes busy,  and the proportion of the time that it is busy is the &lt;EM&gt;utilization.&lt;/EM&gt; If  there is always a request waiting, then the device is 100 percent busy. Because  a single disk can only complete one I/O request at a time, it saturates at 100  percent busy. If the device has a large number of requests, and it is  intelligent enough to reorder them, it may reduce the average service time and  increase the throughput as more load is applied, even though it is already at  100 percent utilization. &lt;/P&gt; &lt;P&gt;The diagram below shows how a busy disk can operate more efficiently than a  lightly loaded disk. In practice, the main difference you would see would be a  lower service time for the busy disk, albeit with a higher average response  time. This is because all the requests are present in the queue at the start, so  the response time for the last request includes the time spent waiting for every  other request to complete. In the lightly loaded case, each request is serviced  as it is made, so there is no waiting, and response time is the same as the  service time. If you hear your disk rattling on a desktop system when you start  an application, it's because the head is seeking back and forth, as shown in the  first case. Unfortunately, starting an application tends to generate a single  thread of page-in disk reads. Each such read is not issued until the previous  one is completed, so you end up with a fairly busy disk with only one request in  the queue -- and it can't be optimized. If the disk is on a busy server instead,  there are numerous accesses coming in parallel from different transactions and  different users, so you will get a full queue and more efficient disk usage  overall.&lt;/P&gt; &lt;TABLE cellSpacing=0 cellPadding=3 width=518 align=center border=0&gt;   &lt;TBODY&gt;   &lt;TR&gt;     &lt;TD&gt;&lt;IMG height=233 alt=UIR990801perffig2 hspace=0        src="http://storage.itworld.com/shared/images/2006/12/UIR990801perffig2.gif"        width=518 border=0&gt;&lt;/TD&gt;&lt;/TR&gt;   &lt;TR&gt;     &lt;TD&gt;&lt;FONT face="verdana, arial, geneva, sans-serif" size=-2&gt;&lt;B&gt;Figure 2.        Disk head movements for a request sequence&lt;/B&gt;&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt; &lt;P&gt;&lt;STRONG&gt;Solaris disk instrumentation&lt;/STRONG&gt;&lt;BR&gt;The instrumentation provided  in the Solaris operating environment takes account of this change by taking a  request's waiting period and breaking it up into two separately measured queues.  One queue, called the &lt;EM&gt;wait queue,&lt;/EM&gt; is in the device driver; the other,  called the &lt;EM&gt;active queue,&lt;/EM&gt; is in the device itself. A read or write  command is issued to the device driver and sits in the wait queue until the SCSI  bus and disk are both ready. When the command is sent to the disk device, it  moves to the active queue until the disk sends its response. The problem with  &lt;CODE&gt;&lt;FONT face=courier&gt;iostat&lt;/FONT&gt;&lt;/CODE&gt; is that it tries to report the new  measurements using some of the original terminology. The &lt;EM&gt;wait service  time&lt;/EM&gt; is actually the time spent in the wait queue. This isn't the correct  definition of service time, in any case, and the word &lt;EM&gt;wait&lt;/EM&gt; is being  used to mean two different things.&lt;/P&gt; &lt;TABLE cellSpacing=0 cellPadding=3 width=518 align=center border=0&gt;   &lt;TBODY&gt;   &lt;TR&gt;     &lt;TD&gt;&lt;IMG height=87 alt=UIR990801perffig3 hspace=0        src="http://storage.itworld.com/shared/images/2006/12/UIR990801perffig3.gif"        width=518 border=0&gt;&lt;/TD&gt;&lt;/TR&gt;   &lt;TR&gt;     &lt;TD&gt;&lt;FONT face="verdana, arial, geneva, sans-serif" size=-2&gt;&lt;B&gt;Figure 3.        Two-stage disk model used by Solaris 2&lt;/B&gt;&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt; &lt;P&gt;Utilization (U) is defined as the busy time (B) as a percentage of the total  time (T) as shown below:&lt;/P&gt; &lt;TABLE cellSpacing=0 cellPadding=3 width=342 align=center border=0&gt;   &lt;TBODY&gt;   &lt;TR&gt;     &lt;TD&gt;&lt;IMG height=105 alt=UIR990801equ1 hspace=0        src="http://storage.itworld.com/shared/images/2006/12/UIR990801equ1.gif"        width=342 border=0&gt;&lt;/TD&gt;&lt;/TR&gt;   &lt;TR&gt;     &lt;TD&gt;&lt;FONT face="verdana, arial, geneva, sans-serif"      size=-2&gt;&lt;B&gt;&lt;/B&gt;&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt; &lt;P&gt;Now, we get to something called service time (S), but this is &lt;EM&gt;not&lt;/EM&gt;  what &lt;CODE&gt;&lt;FONT face=courier&gt;iostat&lt;/FONT&gt;&lt;/CODE&gt; prints out and calls  &lt;CODE&gt;&lt;FONT face=courier&gt;svc_t&lt;/FONT&gt;&lt;/CODE&gt;. This is the real thing! It can be  calculated as the busy time (B) divided by the number of accesses that  completed, or alternatively as the utilization (U) divided by the throughput  (X):&lt;/P&gt; &lt;TABLE cellSpacing=0 cellPadding=3 width=497 align=center border=0&gt;   &lt;TBODY&gt;   &lt;TR&gt;     &lt;TD&gt;&lt;IMG height=110 alt=UIR990801equ2 hspace=0        src="http://storage.itworld.com/shared/images/2006/12/UIR990801equ2.gif"        width=497 border=0&gt;&lt;/TD&gt;&lt;/TR&gt;   &lt;TR&gt;     &lt;TD&gt;&lt;FONT face="verdana, arial, geneva, sans-serif"      size=-2&gt;&lt;B&gt;&lt;/B&gt;&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt; &lt;P&gt;&lt;S&lt;SUB&gt;&lt;FONT size=-1&gt;run&lt;/FONT&gt;&lt;/SUB&gt; is as close as you can get to the  old-style disk service time; remember, however, that modern disks can queue more  than one command at a time and can return them in a different order than the  sequence in which they were issued, so it isn't an exact equivalent. To  calculate S&lt;SUB&gt;&lt;FONT size=-1&gt;run&lt;/FONT&gt;&lt;/SUB&gt; from &lt;CODE&gt;&lt;FONT  face=courier&gt;iostat&lt;/FONT&gt;&lt;/CODE&gt; output, you need to divide the utilization by  the total number of reads and writes, as we see here.&lt;/P&gt;&lt;PRE&gt;&lt;FONT face=courier&gt;  % iostat -xn ...                               extended device statistics   r/s  w/s   kr/s   kw/s wait actv wsvc_t asvc_t   %w   %b device  21.9 63.5 1159.1 2662.9  0.0  2.7    0.0   31.8   0    93 c3t15d0  &lt;/FONT&gt; &lt;/PRE&gt; &lt;P&gt;In this case U = 93% = 0.93, and throughput X = r/s + w/s = 21.9 + 63.5 =  85.4; so, service time S = U/X = 0.011 = 11 milliseconds (ms), while the  reported response time R = 31.8 ms. The queue length is reported as 2.7, so this  makes sense, as each request has to wait in the queue for several other requests  to be serviced.&lt;/P&gt; &lt;P&gt;Using the SE Toolkit, a modified version of &lt;CODE&gt;&lt;FONT  face=courier&gt;iostat&lt;/FONT&gt;&lt;/CODE&gt; written in SE prints out the response time and  the service time data, using the format shown below.&lt;/P&gt;&lt;PRE&gt;&lt;FONT face=courier&gt;  % &lt;STRONG&gt;se siostat.se 10&lt;/STRONG&gt; 03:42:50  ------throughput------ -----wait queue----- ----active queue---- disk      r/s  w/s   Kr/s   Kw/s qlen res_t svc_t  %ut qlen res_t svc_t  %ut c0t2d0s0  0.0  0.2    0.0    1.2 0.00  0.02  0.02    0 0.00 22.87 22.87   0 03:43:00  ------throughput------ -----wait queue----- ----active queue---- disk      r/s  w/s   Kr/s   Kw/s qlen res_t svc_t  %ut qlen res_t svc_t  %ut c0t2d0s0  0.0  3.2    0.0   23.1 0.00  0.01  0.01    0 0.72 225.45 16.20   5  &lt;/FONT&gt; &lt;/PRE&gt; &lt;P&gt;We can get the number that &lt;CODE&gt;&lt;FONT face=courier&gt;iostat&lt;/FONT&gt;&lt;/CODE&gt;  calls service time. It's defined as the queue length (Q, shown by &lt;CODE&gt;&lt;FONT  face=courier&gt;iostat&lt;/FONT&gt;&lt;/CODE&gt; with the headings &lt;CODE&gt;&lt;FONT  face=courier&gt;wait&lt;/FONT&gt;&lt;/CODE&gt; and &lt;CODE&gt;&lt;FONT face=courier&gt;actv&lt;/FONT&gt;&lt;/CODE&gt;)  divided by the throughput; but it's actually the residence or response time and  includes all queuing effects:&lt;/P&gt; &lt;TABLE cellSpacing=0 cellPadding=3 width=420 align=center border=0&gt;   &lt;TBODY&gt;   &lt;TR&gt;     &lt;TD&gt;&lt;IMG height=107 alt=UIR990801equ3 hspace=0        src="http://storage.itworld.com/shared/images/2006/12/UIR990801equ3.gif"        width=420 border=0&gt;&lt;/TD&gt;&lt;/TR&gt;   &lt;TR&gt;     &lt;TD&gt;&lt;FONT face="verdana, arial, geneva, sans-serif"      size=-2&gt;&lt;B&gt;&lt;/B&gt;&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt; &lt;P&gt;Taking the values from our &lt;CODE&gt;&lt;FONT face=courier&gt;iostat&lt;/FONT&gt;&lt;/CODE&gt;  example, R = Q / X = 2.7 / 85.4 = 0.0316 = 31.6 ms, which is close enough to  what &lt;CODE&gt;&lt;FONT face=courier&gt;iostat&lt;/FONT&gt;&lt;/CODE&gt; reports. The difference  between 31.6 and 31.8 is due to rounding errors in the reported values of 2.7  and 85.4. Using full precision, the result is identical to what &lt;CODE&gt;&lt;FONT  face=courier&gt;iostat&lt;/FONT&gt;&lt;/CODE&gt; calculates as the response time.&lt;/P&gt; &lt;P&gt;Another way to express response time is in terms of service time and  utilization. This method uses a theoretical model of response time that assumes  that, as you approach 100 percent utilization with a constant service time, the  response time increases to infinity:&lt;/P&gt; &lt;TABLE cellSpacing=0 cellPadding=3 width=498 align=center border=0&gt;   &lt;TBODY&gt;   &lt;TR&gt;     &lt;TD&gt;&lt;IMG height=107 alt=UIR990801equ4 hspace=0        src="http://storage.itworld.com/shared/images/2006/12/UIR990801equ4.gif"        width=498 border=0&gt;&lt;/TD&gt;&lt;/TR&gt;   &lt;TR&gt;     &lt;TD&gt;&lt;FONT face="verdana, arial, geneva, sans-serif"      size=-2&gt;&lt;B&gt;&lt;/B&gt;&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt; &lt;P&gt;Taking our example again, R = S/(1-U) = 0.011 / (1-0.93) = 0.157 = 157 ms.  This is a lot more than the measured response time of 31.8 ms, so the disk is  operating better than the simple model predicts at high utilizations. There are  several reasons for this: the disk is much more complex than the model; it is  actively trying to optimize itself, so the service time isn't constant; and the  incoming data isn't as random as the model's assumptions would have it. However,  the model does provide the right characteristics, and can be used as a simple  way to do a worst-case analysis.&lt;/P&gt; &lt;P&gt;&lt;STRONG&gt;Complex resource utilization characteristics&lt;/STRONG&gt;&lt;BR&gt;One  important characteristic of complex I/O subsystems is that the utilization  measure can be confusing. When a simple system reaches 100 percent busy, it has  also reached its maximum throughput. This is because only one thing is being  processed at a time in the I/O device. When the device being monitored is an NFS  server, a hardware RAID disk subsystem, or a striped volume, the situation is  clearly much more complex. All of these can process many requests in  parallel.&lt;/P&gt; &lt;TABLE cellSpacing=0 cellPadding=3 width=534 align=center border=0&gt;   &lt;TBODY&gt;   &lt;TR&gt;     &lt;TD&gt;&lt;IMG height=192 alt=UIR990801perffig4 hspace=0        src="http://storage.itworld.com/shared/images/2006/12/UIR990801perffig4.gif"        width=534 border=0&gt;&lt;/TD&gt;&lt;/TR&gt;   &lt;TR&gt;     &lt;TD&gt;&lt;FONT face="verdana, arial, geneva, sans-serif" size=-2&gt;&lt;B&gt;Figure 4.        Complex I/O device queue model&lt;/B&gt;&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt; &lt;P&gt;As long as a single I/O is being serviced at all times, the utilization is  reported as 100 percent, which makes sense because it means that the pool of  devices is always busy doing something. However, there is enough capacity for  additional I/Os to be serviced in parallel. Compared to a simple device, the  service time for each I/O is the same, but the queue is being drained more  quickly; thus, the average queue length and response time are less, and the peak  throughput is greater. In effect, the load on each disk is divided by the number  of disks; therefore, the true utilization of the striped disk volume is actually  above 100 percent. You can see how this arises from the alternative definition  of utilization as the throughput multiplied by the service time.&lt;/P&gt; &lt;P&gt;With only one request being serviced at a time, the busy time is the time it  takes to service one request multiplied by the number of requests. If several  requests can be serviced at once, the calculated utilization goes above 100  percent, because more than one thing can be done at a time! A four-way stripe,  with each individual disk 100 percent busy, will have the same service time as  one disk, but four times the throughput, and thus should really report up to 400  percent utilization.&lt;/P&gt; &lt;P&gt;The approximated model for response time in this case changes so that  response time stays lower for a longer period of time; but it still heads for  infinity when the underlying devices each reach 100 percent utilization.&lt;/P&gt; &lt;TABLE cellSpacing=0 cellPadding=3 width=536 align=center border=0&gt;   &lt;TBODY&gt;   &lt;TR&gt;     &lt;TD&gt;&lt;IMG height=114 alt=UIR990801equ5 hspace=0        src="http://storage.itworld.com/shared/images/2006/12/UIR990801equ5.gif"        width=536 border=0&gt;&lt;/TD&gt;&lt;/TR&gt;   &lt;TR&gt;     &lt;TD&gt;&lt;FONT face="verdana, arial, geneva, sans-serif"      size=-2&gt;&lt;B&gt;&lt;/B&gt;&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt; &lt;P&gt;&lt;STRONG&gt;Wrap up&lt;/STRONG&gt;&lt;BR&gt;So the real answer to our initial question is  that the model of disk behavior and performance that is embodied by the  &lt;CODE&gt;&lt;FONT face=courier&gt;iostat&lt;/FONT&gt;&lt;/CODE&gt; report is too simple to cope with  the reality of a complex underlying disk subsystem. We stay with the old report  to be consistent and to offer users familiar data, but in reality, a much more  sophisticated approach is required. I'm working (slowly) on figuring out how to  monitor and report on complex devices like this.&lt;/P&gt; &lt;P&gt;&lt;A name=resources&gt;&lt;/A&gt;&lt;STRONG&gt;&lt;FONT color=red&gt;Resources&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt; &lt;P&gt; &lt;UL&gt;   &lt;LI&gt;SE download site: &lt;A    href="http://www.sun.com/951001/columns/adrian/column2.html"&gt;http://www.sun.com/951001/columns/adrian/column2.html&lt;/A&gt;     &lt;LI&gt;&lt;CODE&gt;&lt;FONT face=courier&gt;virtual_adrian.se&lt;/FONT&gt;&lt;/CODE&gt; rule: &lt;A    href="http://www.sun.com/951001/columns/adrian/column2.html"&gt;http://www.sun.com/951001/columns/adrian/column2.html    &lt;/A&gt;   &lt;LI&gt;Sun BluePrints Online: The Website that promotes best practices in the    datacenter: &lt;A    href="http://www.sun.com/blueprints"&gt;http://www.sun.com/blueprints&lt;/A&gt;    &lt;LI&gt;See Adrian Cockcroft's FAQ for answers to three dozen performance-related    questions: &lt;A    href="http://www.itworld.com/Comp/3380/UIR010329cockcroftletters/"&gt;http://www.itworld.com/Comp/3380/UIR010329cockcroftletters/&lt;/A&gt;    &lt;/LI&gt;&lt;/UL&gt; &lt;P&gt;&lt;FONT color=#000080&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/FONT&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/714742118606354868-8112372658157580932?l=unixtechtips.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unixtechtips.blogspot.com/feeds/8112372658157580932/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=714742118606354868&amp;postID=8112372658157580932&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/714742118606354868/posts/default/8112372658157580932'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/714742118606354868/posts/default/8112372658157580932'/><link rel='alternate' type='text/html' href='http://unixtechtips.blogspot.com/2006/12/io-bottleneck-trouble-shooting.html' title='I/O Bottleneck - Trouble shooting'/><author><name>HuggyPuggy</name><uri>http://www.blogger.com/profile/04602550959022896368</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='10800658094938042256'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-714742118606354868.post-761277248835002814</id><published>2006-12-28T02:30:00.001-08:00</published><updated>2006-12-28T02:30:46.966-08:00</updated><title type='text'>Linux Memory Management</title><content type='html'>&lt;STRONG&gt;&lt;FONT size=5&gt;Linux Memory Management&lt;/FONT&gt;&lt;/STRONG&gt; &lt;DIV id=bodyContent&gt; &lt;H3 id=siteSub&gt;&lt;FONT face=Verdana color=#000080 size=2&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/H3&gt;&lt;!-- start content --&gt; &lt;TABLE  style="MARGIN-TOP: 0px; BORDER-LEFT-WIDTH: 0px; MARGIN-BOTTOM: 1px; WIDTH: 100%; BORDER-RIGHT-WIDTH: 0px"  cellSpacing=0 cellPadding=3&gt;   &lt;TBODY&gt;   &lt;TR&gt;     &lt;TD style="BACKGROUND: #efefef"&gt;       &lt;CENTER&gt;&lt;SMALL&gt;&lt;/SMALL&gt;&amp;nbsp;&lt;/CENTER&gt;&lt;/TD&gt;&lt;/TR&gt;   &lt;TR&gt;     &lt;TD align=middle&gt;&lt;FONT face=Verdana color=#000080    size=2&gt;&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt; &lt;TABLE class=toc id=toc summary=Contents&gt;   &lt;TBODY&gt;   &lt;TR&gt;     &lt;TD&gt;       &lt;DIV id=toctitle&gt;       &lt;H2&gt;Contents&lt;/H2&gt;&lt;SPAN class=toctoggle&gt;[&lt;A class=internal id=togglelink        href="javascript:toggleToc()"&gt;hide&lt;/A&gt;]&lt;/SPAN&gt;&lt;/DIV&gt;       &lt;UL lastCheckbox="null"&gt;         &lt;LI class=toclevel-1&gt;&lt;A          href="http://gentoo-wiki.com/FAQ_Linux_Memory_Management#Overview_of_memory_management"&gt;&lt;SPAN          class=tocnumber&gt;1&lt;/SPAN&gt; &lt;SPAN class=toctext&gt;Overview of memory          management&lt;/SPAN&gt;&lt;/A&gt;          &lt;LI class=toclevel-1&gt;&lt;A          href="http://gentoo-wiki.com/FAQ_Linux_Memory_Management#The_mysterious_880_MB_limit_on_x86"&gt;&lt;SPAN          class=tocnumber&gt;2&lt;/SPAN&gt; &lt;SPAN class=toctext&gt;The mysterious 880 MB limit          on x86&lt;/SPAN&gt;&lt;/A&gt;          &lt;LI class=toclevel-1&gt;&lt;A          href="http://gentoo-wiki.com/FAQ_Linux_Memory_Management#The_difference_among_VIRT.2C_RES.2C_and_SHR_in_top_output"&gt;&lt;SPAN          class=tocnumber&gt;3&lt;/SPAN&gt; &lt;SPAN class=toctext&gt;The difference among VIRT,          RES, and SHR in top output&lt;/SPAN&gt;&lt;/A&gt;          &lt;LI class=toclevel-1&gt;&lt;A          href="http://gentoo-wiki.com/FAQ_Linux_Memory_Management#The_difference_between_buffers_and_cache"&gt;&lt;SPAN          class=tocnumber&gt;4&lt;/SPAN&gt; &lt;SPAN class=toctext&gt;The difference between          buffers and cache&lt;/SPAN&gt;&lt;/A&gt;          &lt;LI class=toclevel-1&gt;&lt;A          href="http://gentoo-wiki.com/FAQ_Linux_Memory_Management#Swappiness_.282.6_kernels.29"&gt;&lt;SPAN          class=tocnumber&gt;5&lt;/SPAN&gt; &lt;SPAN class=toctext&gt;Swappiness (2.6          kernels)&lt;/SPAN&gt;&lt;/A&gt;          &lt;UL&gt;           &lt;LI class=toclevel-2&gt;&lt;A            href="http://gentoo-wiki.com/FAQ_Linux_Memory_Management#Autoregulation"&gt;&lt;SPAN            class=tocnumber&gt;5.1&lt;/SPAN&gt; &lt;SPAN            class=toctext&gt;Autoregulation&lt;/SPAN&gt;&lt;/A&gt; &lt;/LI&gt;&lt;/UL&gt;         &lt;LI class=toclevel-1&gt;&lt;A          href="http://gentoo-wiki.com/FAQ_Linux_Memory_Management#Credits"&gt;&lt;SPAN          class=tocnumber&gt;6&lt;/SPAN&gt; &lt;SPAN class=toctext&gt;Credits&lt;/SPAN&gt;&lt;/A&gt;          &lt;LI class=toclevel-1&gt;&lt;A          href="http://gentoo-wiki.com/FAQ_Linux_Memory_Management#Feedback"&gt;&lt;SPAN          class=tocnumber&gt;7&lt;/SPAN&gt; &lt;SPAN class=toctext&gt;Feedback&lt;/SPAN&gt;&lt;/A&gt;      &lt;/LI&gt;&lt;/UL&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt; &lt;SCRIPT type=text/javascript&gt; if (window.showTocToggle) { var tocShowText = "show"; var tocHideText = "hide"; showTocToggle(); } &lt;/SCRIPT&gt;  &lt;DIV class=editsection style="FLOAT: right; MARGIN-LEFT: 5px"&gt;[&lt;A  title="Edit section: Overview of memory management"  href="http://gentoo-wiki.com/index.php?title=FAQ_Linux_Memory_Management&amp;amp;action=edit&amp;amp;section=1"&gt;edit&lt;/A&gt;]&lt;/DIV&gt;&lt;A  name=Overview_of_memory_management&gt;&lt;/A&gt; &lt;H2&gt;Overview of memory management&lt;/H2&gt; &lt;P&gt;Traditional Unix tools like 'top' often report a surprisingly small amount of  free memory after a system has been running for a while. For instance, after  about 3 hours of uptime, the machine I'm writing this on reports under 60 MB of  free memory, even though I have 512 MB of RAM on the system. Where does it all  go? &lt;/P&gt; &lt;P&gt;The biggest place it's being used is in the disk cache, which is currently  over 290 MB. This is reported by top as "cached". Cached memory is essentially  free, in that it can be replaced quickly if a running (or newly starting)  program needs the memory. &lt;/P&gt; &lt;P&gt;The reason Linux uses so much memory for disk cache is because the RAM is  wasted if it isn't used. Keeping the cache means that if something needs the  same data again, there's a good chance it will still be in the cache in memory.  Fetching the information from there is around 1,000 times quicker than getting  it from the hard disk. If it's not found in the cache, the hard disk needs to be  read anyway, but in that case nothing has been lost in time. &lt;/P&gt; &lt;P&gt;To see a better estimation of how much memory is really free for applications  to use, run the command free -m: &lt;/P&gt; &lt;TABLE  style="BORDER-RIGHT: #bfffbf 1px solid; BORDER-TOP: #bfffbf 1px solid; BORDER-LEFT: #bfffbf 1px solid; BORDER-BOTTOM: #bfffbf 1px solid; BACKGROUND-COLOR: #f2fff2"  cellSpacing=0 cellPadding=0 width="75%"&gt;   &lt;TBODY&gt;   &lt;TR&gt;     &lt;TD      style="BORDER-RIGHT: #a0ffa0 1px solid; BORDER-TOP: #a0ffa0 1px solid; BORDER-LEFT: #a0ffa0 1px solid; BORDER-BOTTOM: #888 1px solid; BACKGROUND-COLOR: #c1ffc1"&gt;&lt;FONT        size=-1&gt;&lt;B&gt;Code:&lt;/B&gt; free -m&lt;/FONT&gt; &lt;/TD&gt;&lt;/TR&gt;   &lt;TR&gt;     &lt;TD&gt;&lt;PRE&gt;             total       used       free     shared    buffers     cached  Mem:           503        451         52          0         14        293  -/+ buffers/cache:        143        360  Swap:         1027          0       1027 &lt;/PRE&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt; &lt;P&gt;The &lt;B&gt;-/+ buffers/cache&lt;/B&gt; line shows how much memory is used and free from  the perspective of the applications. Generally speaking, if little swap is being  used, memory usage isn't impacting performance at all. &lt;/P&gt; &lt;P&gt;Notice that I have 512 MB of memory in my machine, but only 52 is listed as  available by free (this 52 meg is used by the Kernel). This is mainly because  the kernel can't be swapped out, so the memory it occupies could never be freed.  There may also be regions of memory reserved for/by the hardware for other  purposes as well, depending on the system architecture. However, the actualy  memory that is free is 360Meg in this case (buffer memory Free). &lt;/P&gt; &lt;DIV class=editsection style="FLOAT: right; MARGIN-LEFT: 5px"&gt;[&lt;A  title="Edit section: The mysterious 880 MB limit on x86"  href="http://gentoo-wiki.com/index.php?title=FAQ_Linux_Memory_Management&amp;amp;action=edit&amp;amp;section=2"&gt;edit&lt;/A&gt;]&lt;/DIV&gt;&lt;A  name=The_mysterious_880_MB_limit_on_x86&gt;&lt;/A&gt; &lt;H2&gt;The mysterious 880 MB limit on x86&lt;/H2&gt; &lt;P&gt;By default, the Linux kernel runs in and manages only low memory. This makes  managing the page tables slightly easier, which in turn makes memory accesses  slightly faster. The downside is that it can't use all of the memory once the  amount of total RAM reaches the neighborhood of 880 MB. This has historically  not been a problem, especially for desktop machines. &lt;/P&gt; &lt;P&gt;To be able to use all the RAM on an 1GB machine or better, the kernel needs  to be recompiled. Go into 'make menuconfig' (or whichever config is preferred)  and set the following option: &lt;/P&gt; &lt;TABLE  style="BORDER-RIGHT: #7070ff 4px solid; BORDER-TOP: #7070ff 4px solid; BORDER-LEFT: #7070ff 4px solid; BORDER-BOTTOM: #7070ff 4px solid; BACKGROUND-COLOR: #faebd7"  width="75%"&gt;   &lt;TBODY&gt;   &lt;TR&gt;     &lt;TD      style="BORDER-RIGHT: #0000ff 1px solid; BORDER-TOP: #0000ff 1px solid; BORDER-LEFT: #0000ff 1px solid; COLOR: #ffffff; BORDER-BOTTOM: #0000ff 1px solid; BACKGROUND-COLOR: #7070ff"&gt;&lt;FONT        size=-1&gt;Linux Kernel Configuration: Large amounts of memory&lt;/FONT&gt; &lt;/TD&gt;&lt;/TR&gt;   &lt;TR&gt;     &lt;TD&gt;&lt;PRE&gt;Processor Type and Features ----&amp;gt; High Memory Support ----&amp;gt;  (*) 4GB &lt;/PRE&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt; &lt;P&gt;This applies both to 2.4 and 2.6 kernels. Turning on high memory support  theoretically slows down accesses slightly, but according to Joseph_sys and log,  there is no practical difference. &lt;/P&gt; &lt;P&gt;Also, the &lt;A class=extiw title=ebuild:ck-sources  href="http://gentoo-portage.com/Search?search=ck-sources"&gt;ck-sources&lt;/A&gt; kernel  has a patch for 1gb high memory support. &lt;/P&gt; &lt;DIV class=editsection style="FLOAT: right; MARGIN-LEFT: 5px"&gt;[&lt;A  title="Edit section: The difference among VIRT, RES, and SHR in top output"  href="http://gentoo-wiki.com/index.php?title=FAQ_Linux_Memory_Management&amp;amp;action=edit&amp;amp;section=3"&gt;edit&lt;/A&gt;]&lt;/DIV&gt;&lt;A  name=The_difference_among_VIRT.2C_RES.2C_and_SHR_in_top_output&gt;&lt;/A&gt; &lt;H2&gt;The difference among VIRT, RES, and SHR in top output&lt;/H2&gt; &lt;P&gt;VIRT stands for the virtual size of a process, which is the sum of memory it  is actually using, memory it has mapped into itself (for instance the video  card's RAM for the X server), files on disk that have been mapped into it (most  notably shared libraries), and memory shared with other processes. VIRT  represents how much memory the program is able to access at the present moment.  &lt;/P&gt; &lt;P&gt;RES stands for the resident size, which is an accurate representation of how  much actual physical memory a process is consuming. (This also corresponds  directly to the %MEM column.) This will virtually always be less than the VIRT  size, since most programs depend on the C library. &lt;/P&gt; &lt;P&gt;SHR indicates how much of the VIRT size is actually sharable (memory or  libraries). In the case of libraries, it does not necessarily mean that the  entire library is resident. For example, if a program only uses a few functions  in a library, the whole library is mapped and will be counted in VIRT and SHR,  but only the parts of the library file containing the functions being used will  actually be loaded in and be counted under RES. &lt;/P&gt; &lt;DIV class=editsection style="FLOAT: right; MARGIN-LEFT: 5px"&gt;[&lt;A  title="Edit section: The difference between buffers and cache"  href="http://gentoo-wiki.com/index.php?title=FAQ_Linux_Memory_Management&amp;amp;action=edit&amp;amp;section=4"&gt;edit&lt;/A&gt;]&lt;/DIV&gt;&lt;A  name=The_difference_between_buffers_and_cache&gt;&lt;/A&gt; &lt;H2&gt;The difference between buffers and cache&lt;/H2&gt; &lt;P&gt;Buffers are allocated by various processes to use as input queues, etc. Most  time, buffers are some processes' output, and they are file buffers. A  simplistic explanation of buffers is that they allow processes to temporarily  store input in memory until the process can deal with it. &lt;/P&gt; &lt;P&gt;Cache is typically frequently requested disk I/O. If multiple processes are  accessing the same files, much of those files will be cached to improve  performance (RAM being so much faster than hard drives), it's disk cache. &lt;/P&gt; &lt;DIV class=editsection style="FLOAT: right; MARGIN-LEFT: 5px"&gt;[&lt;A  title="Edit section: Swappiness (2.6 kernels)"  href="http://gentoo-wiki.com/index.php?title=FAQ_Linux_Memory_Management&amp;amp;action=edit&amp;amp;section=5"&gt;edit&lt;/A&gt;]&lt;/DIV&gt;&lt;A  name=Swappiness_.282.6_kernels.29&gt;&lt;/A&gt; &lt;H2&gt;Swappiness (2.6 kernels)&lt;/H2&gt; &lt;P&gt;Since 2.6, there has been a way to tune how much Linux favors swapping out to  disk compared to shrinking the caches when memory gets full. &lt;/P&gt; &lt;P&gt;When an application needs memory and all the RAM is fully occupied, the  kernel has two ways to free some memory at its disposal: it can either reduce  the disk cache in the RAM by eliminating the oldest data or it may swap some  less used portions (pages) of programs out to the swap partition on disk. It is  not easy to predict which method would be more efficient. The kernel makes a  choice by roughly guessing the effectiveness of the two methods at a given  instant, based on the recent history of activity. &lt;/P&gt; &lt;P&gt;Before the 2.6 kernels, the user had no possible means to influence the  calculations and there could happen situations where the kernel often made the  wrong choice, leading to thrashing and slow performance. The addition of  swappiness in 2.6 changes this. Thanks, ghoti! &lt;/P&gt; &lt;P&gt;Swappiness takes a value between 0 and 100 to change the balance between  swapping applications and freeing cache. At 100, the kernel will always prefer  to find inactive pages and swap them out; in other cases, whether a swapout  occurs depends on how much application memory is in use and how poorly the cache  is doing at finding and releasing inactive items. &lt;/P&gt; &lt;P&gt;The default swappiness is 60. A value of 0 gives something close to the old  behavior where applications that wanted memory could shrink the cache to a tiny  fraction of RAM. For laptops which would prefer to let their disk spin down, a  value of 20 or less is recommended. &lt;/P&gt; &lt;P&gt;As a sysctl, the swappiness can be set at runtime with either of the  following commands: &lt;/P&gt;&lt;PRE&gt;sysctl -w vm.swappiness=30  echo 30 &amp;gt;/proc/sys/vm/swappiness &lt;/PRE&gt; &lt;P&gt;The default when Gentoo boots can also be set in &lt;FONT  style="FONT-FAMILY: monospace" color=green&gt;/etc/sysctl.conf&lt;/FONT&gt;: &lt;/P&gt; &lt;TABLE  style="BORDER-RIGHT: #ffbfbf 1px solid; BORDER-TOP: #ffbfbf 1px solid; BORDER-LEFT: #ffbfbf 1px solid; BORDER-BOTTOM: #ffbfbf 1px solid; BACKGROUND-COLOR: #fff2f2"  cellSpacing=0 cellPadding=0 width="75%"&gt;   &lt;TBODY&gt;   &lt;TR&gt;     &lt;TD style="BORDER-BOTTOM: #888 1px solid; BACKGROUND-COLOR: #ffafaf"&gt;&lt;FONT        size=-1&gt;&lt;B&gt;File:&lt;/B&gt; /etc/sysctl.conf&lt;/FONT&gt; &lt;/TD&gt;&lt;/TR&gt;   &lt;TR&gt;     &lt;TD&gt;       &lt;DIV class=scroll&gt;&lt;PRE style="HEIGHT: auto"&gt;# Control how much the kernel should favor swapping out applications (0-100) vm.swappiness = 30 &lt;/PRE&gt;&lt;/DIV&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt; &lt;P&gt;Some patchsets (e.g. Con Kolivas' &lt;TT&gt;ck-sources&lt;/TT&gt; patchset) allow the  kernel to auto-tune the swappiness level as it sees fit; they may not keep a  user-set value. &lt;/P&gt; &lt;DIV class=editsection style="FLOAT: right; MARGIN-LEFT: 5px"&gt;[&lt;A  title="Edit section: Autoregulation"  href="http://gentoo-wiki.com/index.php?title=FAQ_Linux_Memory_Management&amp;amp;action=edit&amp;amp;section=6"&gt;edit&lt;/A&gt;]&lt;/DIV&gt;&lt;A  name=Autoregulation&gt;&lt;/A&gt; &lt;H3&gt;Autoregulation&lt;/H3&gt; &lt;P&gt;&lt;A title="Kernel Sources"  href="http://gentoo-wiki.com/Kernel_Sources#gentoo-sources"&gt;gentoo-sources&lt;/A&gt;  (and probably other gentoo 2.6 kernels) prior to 2.6.7-gentoo contains the Con  Kolivas autoregulated swappiness patch. This means that the kernel automatically  adjusts the /proc/sys/vm/swappiness value as needed during runtime, so any  changes you make will be clobbered next time it updates. A good explanation of  this patch and how it works is on &lt;A class="external text"  title=http://kerneltrap.org/node/view/3216  href="http://kerneltrap.org/node/view/3216" rel=nofollow&gt;KernelTrap&lt;/A&gt;. &lt;/P&gt; &lt;P&gt;I repeat: &lt;B&gt;With gentoo-sources (prior to 2.6.7-gentoo) it is neither  necessary nor possible to permanently adjust the swappiness value.&lt;/B&gt; It's  taken care of automatically, no need to worry. &lt;/P&gt; &lt;P&gt;gentoo-sources no longer contains this patch as of 2.6.7-gentoo. The  maintainer of gentoo-sources, Greg, pulled the autoregulation patch from the  ebuild. &lt;A class="external free"  title=http://bugs.gentoo.org/show_bug.cgi?id=54560  href="http://bugs.gentoo.org/show_bug.cgi?id=54560"  rel=nofollow&gt;http://bugs.gentoo.org/show_bug.cgi?id=54560&lt;/A&gt;  &lt;/P&gt;&lt;/DIV&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/714742118606354868-761277248835002814?l=unixtechtips.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unixtechtips.blogspot.com/feeds/761277248835002814/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=714742118606354868&amp;postID=761277248835002814&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/714742118606354868/posts/default/761277248835002814'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/714742118606354868/posts/default/761277248835002814'/><link rel='alternate' type='text/html' href='http://unixtechtips.blogspot.com/2006/12/linux-memory-management.html' title='Linux Memory Management'/><author><name>HuggyPuggy</name><uri>http://www.blogger.com/profile/04602550959022896368</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='10800658094938042256'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-714742118606354868.post-5873954605160934436</id><published>2006-12-28T02:23:00.001-08:00</published><updated>2006-12-28T02:23:26.547-08:00</updated><title type='text'>INFO ON Promiscuous mode </title><content type='html'>&lt;DIV dir=ltr align=left&gt; &lt;P&gt;&lt;FONT face="Century Gothic"&gt;&lt;FONT color=#000080&gt;&lt;FONT size=2&gt;&lt;SPAN  class=356374503-13122006&gt;&lt;STRONG&gt;&lt;U&gt;INFO ON Promiscuous mode&lt;/U&gt;&lt;/STRONG&gt;  &lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt; &lt;P&gt;&lt;FONT face="Century Gothic"&gt;&lt;FONT color=#000080&gt;&lt;FONT size=2&gt;&lt;SPAN  class=356374503-13122006&gt;&lt;/SPAN&gt;Promiscuous mode is usually initiated by a  network sniffer of some sort. Like Ethereal or dsniff. You may want to check  your running processes and verify you're not running something like that or even  a trojaned version or something normal. If I saw that in my logs, I would be  concerned. You can see promiscuous mode by running /sbin/ifconfig -a  &lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt; &lt;P&gt;&lt;FONT face="Century Gothic"&gt;&lt;FONT color=#000080&gt;&lt;FONT size=2&gt;normal:  look--&amp;gt; UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:7153852  errors:0 dropped:0 overruns:0 frame:0 TX packets:6107958 errors:0 dropped:0  overruns:0 carrier:14 &lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt; &lt;P&gt;&lt;FONT face="Century Gothic"&gt;&lt;FONT color=#000080&gt;&lt;FONT size=2&gt;Promiscuous:  look--&amp;gt; UP BROADCAST RUNNING PROMISC MULTICAST MTU:1500 Metric:1 RX  packets:7153858 errors:0 dropped:0 overruns:0 frame:0 TX packets:6107962  errors:0 dropped:0 overruns:0 carrier:14 &lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;/DIV&gt; &lt;DIV dir=ltr align=left&gt;&lt;FONT face="Century Gothic" color=#000080 size=2&gt;&lt;SPAN  class=356374503-13122006&gt;In this case its normal state and can be ignored  :&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt; &lt;DIV dir=ltr align=left&gt;&lt;FONT face="Century Gothic" color=#000080 size=2&gt;&lt;SPAN  class=356374503-13122006&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt; &lt;DIV dir=ltr align=left&gt;&lt;FONT face="Century Gothic" color=#000080 size=2&gt;&lt;SPAN  class=356374503-13122006&gt;eth0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Link  encap:Ethernet&amp;nbsp; HWaddr  00:13:21:07:5A:2B&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; inet  addr:154.1.33.140&amp;nbsp; Bcast:154.1.33.255&amp;nbsp;  Mask:255.255.255.128&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;  UP BROADCAST RUNNING &lt;FONT color=#800080&gt;&lt;STRONG&gt;MULTICAST&lt;/STRONG&gt;&lt;/FONT&gt;&amp;nbsp;  MTU:1500&amp;nbsp;  Metric:1&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RX  packets:15985086 errors:0 dropped:0 overruns:0  frame:0&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TX  packets:21467022 errors:0 dropped:0 overruns:0  carrier:0&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; collisions:0  txqueuelen:1000&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RX  bytes:7258750788 (6922.4 Mb)&amp;nbsp; TX bytes:15187993324 (14484.3  Mb)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;  Interrupt:25&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt; &lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt; &lt;DIV dir=ltr align=left&gt;&lt;FONT face="Century Gothic" color=#000080 size=2&gt;&lt;SPAN  class=356374503-13122006&gt;eth1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Link  encap:Ethernet&amp;nbsp; HWaddr  00:13:21:07:5A:2A&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; inet  addr:172.18.39.17&amp;nbsp; Bcast:172.18.39.127&amp;nbsp;  Mask:255.255.255.128&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;  UP BROADCAST RUNNING &lt;STRONG&gt;&lt;FONT color=#800080&gt;MULTICAST&lt;/FONT&gt;&amp;nbsp;&lt;/STRONG&gt;  MTU:1500&amp;nbsp;  Metric:1&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RX  packets:39861538 errors:0 dropped:0 overruns:0  frame:0&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TX  packets:78187478 errors:0 dropped:0 overruns:0  carrier:0&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; collisions:0  txqueuelen:1000&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RX  bytes:2552135645 (2433.9 Mb)&amp;nbsp; TX bytes:118484247360 (112995.3  Mb)&lt;BR&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/714742118606354868-5873954605160934436?l=unixtechtips.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unixtechtips.blogspot.com/feeds/5873954605160934436/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=714742118606354868&amp;postID=5873954605160934436&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/714742118606354868/posts/default/5873954605160934436'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/714742118606354868/posts/default/5873954605160934436'/><link rel='alternate' type='text/html' href='http://unixtechtips.blogspot.com/2006/12/info-on-promiscuous-mode.html' title='INFO ON Promiscuous mode '/><author><name>HuggyPuggy</name><uri>http://www.blogger.com/profile/04602550959022896368</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='10800658094938042256'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry></feed>