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
31 October 2010
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
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.
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
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
Labels:
file recovery,
files,
fs,
fuser,
solaris
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:
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
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
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
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
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
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
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.
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
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
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
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
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.
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.
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.
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
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 "--", "*",
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
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
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,
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:
counterpart in 24 hour format?
via perl:
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
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:
On a Solaris host, to quickly determine how a hard disk may be carved up,
one can simply run prtvtoc against the device:
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
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
Labels:
blog info
Subscribe to:
Posts (Atom)