28 December 2010

Local Port Forwarding In SSH

Anyone familiar with UNIX administration is almost assuredly familiar
with SSH.  As a de facto standard of remote access, it can be used as
a replacement to telnet, ftp, rcp, and rlogin.  Additionally, it can
be used to provide a secure channel for other needs such encrypting

18 December 2010

op, An Alternative To sudo

**** What is op? ****

For those unfamiliar with op, one can think of op as being similar
to sudo.  As taken from the man page (op.1):

16 December 2010

Using Logical Network Interfaces

Logical interfaces (logints, vips) are sometimes overlooked though can be
quite handy.  For instance, they can be used for IP based hosting (think
webservers), failover of clustered services, testing, providing network
connectivity for zones, etc.  Additionally, they are relatively trivial

12 December 2010

BIOS Boot Device - Solaris

In 'Host Info - Boot Parameters', we saw how the boot device on Solaris
could be identified using 'prtconf'.  The output was similar to:
        boot-device:    '/pci@1e,600000/ide@d/disk@0,0:a

09 December 2010

Mounting an SVM Root Disk from CDROM

The following illustrates how to mount a root disk under Solaris Volume
Manager (SVM) control when booted from a CDROM.  Our host details:
        HOST:                   snorkle

06 December 2010

FreeBSD Issue with Solaris NFS Shares

In a past NAS migration attempt, it was discovered that FreeBSD boxes
don't necessarily play well with NFS mounts shared from Solaris boxes
when the mount IP is on a virtual interface.  The reason behind this
issue is that Solaris, in dealing with virtual interfaces, responds

02 December 2010

Host Info - Windows Server pt. 1

What's this, a Windows Server post?  He's lost his mind, right?!
This post can be chalked up to "what if X", as in, what if I want to
get host information on a Windows server from the command line.  So,
adding to the host info series, here's how to get memory, cpu, and boot

29 November 2010

Host Info - Boot Parameters

Now entering the batter's box of the 'host info' series, boot parameters
of a running host.  Our lineup of hosts and "stats" are:
        HOSTS:          snorkle (sunhost), tux (linhost), beastie (bsdhost)
 

28 November 2010

Trust, But Verify

In setting up this blog, my intention has been to submit posts that are
technically sound and accurate.  The posts could then serve me in the
future as reference and hopefully be of service to others.  A comment I
received about one of my posts caused me to go back and read thoroughly

27 November 2010

Replacing VxVM with SVM for the rootdisk

The purpose of this post is to illustrate how to replace Veritas Volume
Manager (VxVM) with Sun Volume Manager (SVM) for control of the root disk
while leaving application volumes under VxVM control.  I had originally
tested this against Solaris 9 sparc running VxVM 4.0, though have updated

24 November 2010

Host Info - Network Interfaces

As part of the 'host info' series, we're on to network interfaces.
I know, can't be too hard, run 'ifconfig'.  That's fine if you want IP
(layer 3) related information, but what about layer 2 details?  To get
link status, associated interface speed, duplex, and VLAN tagging

21 November 2010

Overlaid Mount Problem

In UNIX environments, it's not uncommon to see various file systems (FS)
mounted, be it local storage, fiber attached from a SAN, network based
like NFS, etc.  These mounts may be exist for any number of reasons,
such as application data, user home directories, additional log space,

18 November 2010

VLAN Tagged Interfaces (Linux)

A while back, I wrote on how to setup VLAN tagged interfaces on Solaris
and FreeBSD.  Though I've also needed to set them up under Linux, I
never seemed to get around to writing up how to do so.  To remedy this,
the following are our setup details:

17 November 2010

Host Info - Disks

Continuing the 'host info' series, we check out what disks are presented
to the system.  As usual, the details of our hosts are:
        HOSTS:          snorkle (sunhost), tux (linhost), beastie (bsdhost)

15 November 2010

Host Info - CPUs

Following up on memory in the 'host info' series is CPUs.  As with memory,
the details of our hosts are:
        HOSTS:          snorkle (sunhost), tux (linhost), beastie (bsdhost)

12 November 2010

Host Info - Memory

This post on memory is the first in a series on how to retrieve various
bits of host information from Solaris, Linux, and FreeBSD.  The OS
details are:


09 November 2010

Removing / Recovering an Open File (Linux)

Following up on "Removing / Recovering an Open File (Solaris)," the aim
here is to do the same with Linux.  The setup is the same, wherein a
'tail' is run in another terminal to hold open a file descriptor to a
file, while said file is accidentally removed.  Though the following

07 November 2010

new tools

The following new utilities have been posted to the 'Tools' page:

     getldp.pl -- determine device information for what a network interface is 
            connected to by way of reading CDP or LLDP packets
   

06 November 2010

Identifying DMP Subpaths in Solaris

Recently I stumbled across one of my notes detailing a quick way to
identify the underlying subpaths supporting VxDMP devices:
        frost [0] /usr/sbin/vxdisk path

03 November 2010

Free Space and Inodes

Have you ever exhausted capacity on a volume when it still shows storage
space available?  The following details such a situation where the
intention is to simply copy some man pages into a directory.

31 October 2010

Logical Disk Names In Solaris

Anyone familiar with Solaris instantly recognizes c1t3d0s4 and that
it identifies slice 4 on disk c1t3d0.  That's great, but what does the
rest mean.  On other UNIX OSes, you might get sdb3 or da2s1a to identify
a disk slice / partition and have to use a variety of means to determine

29 October 2010

Fix a Broken chmod, or How to chmod chmod

So here's the setup.  You've logged into one of your servers to update
permissions on a file only to see this:

        server [0] /bin/chmod +x /opt/somefile

28 October 2010

Reassociating a Failed Disk in Veritas

Recently we had a situation wherein Vertias Volume Manager (VxVM)
marked a disk as 'failed' while additionally presenting the disk
available for use though unconfigured.  The weird part was that VxVM
continued to allow use of the volume until the volume was stopped.

21 October 2010

Removing / Recovering an Open File (Solaris)

While working with filesystems, one will inevitably have to deal with a
file that is quickly growing and becoming unmanageable.  Unfortunately,
this situation normally becomes evident because the space of a volume
has been nearly exhausted.  If retention is necessary, you could set up

19 October 2010

Fun with FACLs

Quick, think of a way to give a specific user (jdoe) access to a
particular set of files which are owned by a different user (ivan)
and group (moskau).  Depending of what you are trying to accomplish,
I can immediately think of 7 ways:

Creating a Mirrored Volume with Geom (FreeBSD)

INTRO

While it's not uncommon to find a Solaris host with some sort of RAID
configuration in place, within some environments, RAID configurations

Solaris Devpath Enumeration

The purpose of this doc is show how to physically identify and enumerate
your disk devices on a Sun branded box.  The reasons to do this may
include identifying a disk for replacement, determining the bus it is
attached to, I/O balancing, etc.  Of note, this doc is only valid with Sun

ZFS Pool and FS Creation

Volume and file system management are traditionally separate affairs,
being created and maintained individually of one another.  With Sun's
ZFS, the line between the two become blurred.  As a brief understanding,
a 'zpool' can be generically considered a volume, comprised of multiple

18 October 2010

Option 82 Decoding

When looking at DHCP leases, one sometimes may need to be able to
decode the option 82 (op82) string passed to the DHCP server.  In
the examples below, the op82 string is provided as the
'relay-agent-remote-id''.  The value provided, however, isn't

Rebuilding a Solaris Package

Have you ever needed to rebuild a package already installed on a Solaris
host?  Though it may seem to be a rare case, I've had to do this several
times in the past and have yet to find any clear information on it.
A recent instance was where a primary host had a piece of software

Breaking and Syncing a SVM Root Mirror (Solaris)

INTRO

The information detailed below is to assist with proactive planning for
the potential demise and recovery of a host back to the state it was

Breaking and Syncing a Hardware Root Mirror (Solaris)

INTRO

The information detailed below is to assist with proactive planning for
the potential demise and recovery of a host back to the state it was

Solaris HWADDRs from OBP

Occasionally, it's useful to know the hwaddr or MAC addr of an interface
without actually booting a box, such as when you are setting up a
jumpstart config for said box.  On Sun Sparc based machines, this
information can be obtained within the OpenBoot (OB) environment.

Static Routes in Solaris

This tip may seem somewhat trivial as we all know that to retain static
routes in Solaris, you simply create an init script such as the following:

        adler [0] ls -l /etc/rc2.d/S76route

IPMP and 802.1q on Linux

Described herein is the practice of using IPMP (IP MultiPathing) and VLAN
tagged (802.1q trunking) interfaces layered together for the purpose of
port considerations (read: consolidation) and HA (high availability).
The following points should be noted relevant to the host used in the

Process Environments

When working on a host, it is sometimes of value to know the environmental
settings, such as PATH, that a process is currently using.  Fortunately,
there a way of obtaining this information for Solaris, Linux, and FreeBSD.
The following is an example for cron from a Solaris x86 box (though sparc

Recovering from a corrupted ext3 journal

Occasionally, an EXT3 volume's journal will become corrupted.  When
this occurs, Linux will proactively remount the volume in question as
read-only in attempt to stave off further data corruption, loss, etc.
When the volume is remounted r/o, lines similar to the following can be

Package Builds in Linux

This document details how to create a package on Linux.  Only the creation
of a simple package is detailed in this doc.  For more elaborate packages,
see the relevant man pages.

Package Builds in FreeBSD

This document details how to create a package on FreeBSD.  Only the
creation of a simple package is detailed in this doc.  For more elaborate
packages, see the relevant man pages.

Package Builds in Solaris

This document details how to create a package on Solaris.  Only the
creation of a simple package is detailed in this doc.  For more elaborate
packages, see the relevant man pages.

Network Ports and Processes

Looking at a host, there are times when it may be indeterminable
what process may be holding a particular port open.  Perhaps because
there is no entry for the port in /etc/services, thus netstat, etc,
will not display a recognizable name.  The reason may be that the port

Strange Filenames

Inevitably, while working on a server, one will come across a file with a
strange name that seemingly cannot be easily operated upon.  Some examples
of commonplace files tend to be "!" and "@", wherein the "strange" file
was created while working perhaps in vi.  Other examples may be "--", "*",

Simple Pattern Replacements

Managing data within a file sometimes requires that all instances of a
specific word / phrase be replaced with that of another.  This could be
something along the lines of a file from one host is copied to another,
thus the hostname contained in the file must be updated to reflect the

Solaris Management Facility

With the advent of Solaris 10, Sun introduced a new mechanism to manage
the running of services, the services management facility (smf(5)).
This is important to note as it impacts the startup of services
traditionally handled via the various rcX.d directories.  In short, while

Package File Ownership

Once a system is built and begins to be used, undoubtedly, more files
are added to the system.  These files may be logs, user / application
created files, files that are part of a package, or those compiled
from source.  When poking around a system, one may stumble across a file

File Times

Occasionally it may be necessary to determine the various times of a file.
These times break down to access (when the file was last accessed),
modification (time of last modification), and inode (time of last
modification of the inode (mode / permission changes, etc.).  FreeBSD,

Epoch Time

Have you ever needed a way to determine UNIX (Epoch) Time, or perhaps its
counterpart in 24 hour format?

via perl:

Disk Cloning in FreeBSD

Disk Cloning in FreeBSD:

A few assumptions:
        master disk:  da0

Base Conversions

Every now and then, it may be necessary to do base conversions on numbers.
While some may be readily able to read 0x17 in hexadecimal as 23 in
decimal as 10111 in binary as 27 in octal, there are those who may not.
A simple example of how this information may be of use would be in

Determining Partition Tables

This tip deals somewhat with Solaris, though moreso with FreeBSD.
On a Solaris host, to quickly determine how a hard disk may be carved up,
one can simply run prtvtoc against the device:

Disk Cloning in Solaris

Disk Cloning in Solaris:

A few assumptions:
        master disk:  c0t0d0

17 October 2010

VLAN Tagged Interfaces (FreeBSD)

In order to make use of VLAN tagged interfaces in FreeBSD, kernel support
must be added, thus requiring a rebuild of the kernel.  Also, you must
have an interface capable of handling VLAN tagging (can be determined
by the man page of the interface driver, ex: man bge).  Kernel support

16 October 2010

VLAN Tagged Interfaces (Solaris)

In order to use VLAN tagged interfaces in Solaris, one simply needs to
have an interface capable of handling VLAN tagging (can be determined by
the man page of the interface driver, ex: man bge, as well as man dladm).
Providing an interface supportive of VLAN tagging, one may configure the

For what purpose?

As a UNIX engineer for the past 10 years, I've asked more than a few
questions along the way.  If I couldn't find someone with an answer, I'd
scrounge around trying to dig up an answer online or available docs. 
At the same time, I'd work by trial and error attempting to resolve my