Sunday, December 27, 2009

After replace the faulty HBA Card, need to perform below actions

After replace the faulty HBA Card on SUN Servers, need to perform below actions

1)SAN Team update the zoning and masking for the new HBA-WWN No like <10000000C9388B24>

2) SA Team run the below commands, these steps will get the path active

#update_drv -f sd ; devfsadm -C -c disks
#update_drv -f sd ; devfsadm -C -c disks
#vxdctl enable

Wednesday, December 16, 2009

Symbolic Values for File and Directory Permissions

Symbolic Values for File and Directory Permissions :-


Symbol Function* Description

u Who User (owner)
g Who Group
o Who Others
A Who All
= Operation Assign
+ Operation Add
- Operation Remove
r Permission Read
w Permission Write
x Permission Execute
l Permission Mandatory locking, setgid bit is on, group execution bit is off
s Permission setuid or setgid bit is on
S Permission suid bit is on, user execution bit is off
t Permission Sticky bit is on, execution bit for others is on
T Permission Sticky bit is on, execution bit for others is off

Tuesday, December 15, 2009

How to bring Processors offline permanently / permanently

How to bring Processors offline Temporarily

#psradm -f 1 2 3 4
1,2,3,4 ---> processors numbers, we get this info from prtdiag -v.

How to bring Processors offline permanently

This document describes how to use the commands 'asr-enable' and
'asr-disable' to manually disable CPUs on a Sun Fire V480/V880
V490/V890.
This document also provides examples of the steps necessary to implement
these ASR commands for single and multiple CPUs.

Steps to Follow

Using the ASR commands to manually enable or disable CPUs on V480/V880
490/v890
========================================================================
=======

The user level commands 'asr-enable' and 'asr-disable' can be used to
manually enable or disable system devices. To view the full list of
devices that can be enabled or disabled, type the command at the ok
prompt.
Below is an example of the asr-enable command for the V480 -

{2} ok asr-enable

Usage: asr-enable
Where is an absolute device path, a device alias, or a device
label.
Valid device labels include:
cpu3-bank3 cpu3-bank2 cpu3-bank1 cpu3-bank0
cpu2-bank3 cpu2-bank2 cpu2-bank1 cpu2-bank0
cpu1-bank3 cpu1-bank2 cpu1-bank1 cpu1-bank0
cpu0-bank3 cpu0-bank2 cpu0-bank1 cpu0-bank0
pci-slot5 pci-slot4 pci-slot3 pci-slot2
pci-slot1 pci-slot0 gptwo-slotc gptwo-slotb gptwo-slota ob-ide ob-net0
ob-net1 ob-fcal io-bridge9 io-bridge8 io-bridge5
cpu3 cpu2 cpu1 cpu0
* cpu3-bank* cpu2-bank* cpu1-bank*
cpu0-bank* pci* pci-slot* gptwo-slot*
io-bridge* cpu*

Output from V490
=================

Be aware that the devices are changed and replaced by "cmp" instead of
"cpu"
cpu3-bank3 = cmp3-bank3

{1} ok asr-enable

Usage: asr-enable

Where is an absolute device path, a device alias, or a device label.
Valid device labels include:
cmp3-bank3 cmp3-bank2 cmp3-bank1 cmp3-bank0
cmp2-bank3 cmp2-bank2 cmp2-bank1 cmp2-bank0
cmp1-bank3 cmp1-bank2 cmp1-bank1 cmp1-bank0
cmp0-bank3 cmp0-bank2 cmp0-bank1 cmp0-bank0
pci-slot5 pci-slot4 pci-slot3 pci-slot2
pci-slot1 pci-slot0 gptwo-slotc gptwo-slotb gptwo-slota ob-ide ob-net0
ob-net1 ob-fcal io-bridge9 io-bridge8 io-bridge5
cmp3 cmp2 cmp1 cmp0
* cmp3-bank* cmp2-bank* cmp1-bank*
cmp0-bank* pci* pci-slot* gptwo-slot*
io-bridge* cmp*

The .asr is another user-level command, that will display the current
status (enabled or disabled) of devices that are supported by ASR (the
example output is for V480):

{0} ok .asr
ASR Disablement Status
Component: Status

CPU/Memory: Enabled
IO-Bridge5: Enabled
IO-Bridge8: Enabled
IO-Bridge9: Enabled
GPTwo Slots: Enabled
Onboard FCAL: Enabled
Onboard Net1: Enabled
Onboard Net0: Enabled
Onboard IDE: Enabled
PCI Slots: Enabled

The normal ASR function is that disabling a CPU with 'asr-disable' will
effectively disable the entire CPU module, so disabling CPU1 will also
take
CPU3 out of the system. To bring a CPU back alive after it has been
disabled, you must 'asr-enable' the CPU and then power-cycle the system.

Similarly, if you have CPU1 & CPU3 disabled,then enabling (asr-enable)
only CPU1 will still leave CPU3 disabled, so CPU1 will still be
[effectively] disabled as well, so you must enable both CPUs (and
power-cycle) before either CPU is available. Simply asr-enable'ing a cpu
and reseting the system isn't good enough , you must power-cycle.

You need to use the .asr command at the ok prompt to check the status of
each CPU. The OBP command 'reset-all' should be used immediately after
'asr-enable' or 'asr-disable', so that these commands can take effect.

Here are some examples (based on 4-way V480 server) of the steps you
need to follow in order get a CPU(s) back alive after it has been
disabled:

1. Example procedure to asr-disable and asr-enable single CPU (4-way
system) :
The steps to "asr-enable" a previously "asr-disable'd" CPU (this is not
needed if the CPU was failed by POST, this is only needed when the CPU
has been manually "asr-disable"d):

a) ok asr-disable cpu1 (v480)
a1)ok asr-disable cmp1 (v490)
b) ok reset-all --> CPU1 and CPU3 (the other cpu on the same module)

now disabled and unavailable and the system will respond
with:
Resetting ...
WARNING: Offlining/Disabling CPU1...and CPU3...Done.

c) At this point if 'reset-all' is performed (or 'reset-all' followed by
power cycle) CPU1 will still be unavailable. This can be verified via
.env command (at the ok prompt), which will show the status only for
CPU0&2, or at the OS level by using the commands 'psrinfo -v' and
'prtdiag -v'.

d) To enable CPU1/CMP1:
ok asr-enable cpu1 (V480)
d1) ok asr-enable cmp1 (V490)
ok .asr (to check status)
ok reset-all --> cpu1 is still unavailable (can be verified by using
.env, which will only show the status for CPU0 & CPU2 Power-cycle
(power-off/power-on) --> cpu1 & cpu3 are now available.
This can be verified via the .env command (OBP level), which will now
show the status for all 4 CPUs, or at the OS level by using the
commands:
'psrinfo -v' and 'prtdiag -v'.

2. Example procedure to asr-disable and asr-enable CPU1 & CPU3 (4-way
system):

{3} ok asr-disable cpu1 (V480)
{3} ok asr-disable cpu3 (V480)
{3} ok asr-disable cmp1 (V490)
{3} ok asr-disable cmp3 (V490)

{3} ok .asr (to check ASR Disablement Status)
Component: Status

CPU0/Memory: Enabled
CPU1: Disabled
Memory Bank0: Enabled
Memory Bank1: Enabled
Memory Bank2: Enabled
Memory Bank3: Enabled
CPU2/Memory: Enabled
CPU3: Disabled
Memory Bank0: Enabled
Memory Bank1: Enabled
Memory Bank2: Enabled
Memory Bank3: Enabled
IO-Bridge5: Enabled
IO-Bridge8: Enabled
IO-Bridge9: Enabled
GPTwo Slots: Enabled
Onboard FCAL: Enabled
Onboard Net1: Enabled
Onboard Net0: Enabled
Onboard IDE: Enabled
PCI Slots: Enabled

{3} ok reset-all
Resetting ... WARNING: Offlining/Disabling CPU1...and CPU3...Done.

To bring back CPU1 and CPU3 both CPU's need to be asr-enabled (if only
CPU1 is enabled, after 'reset-all' the system will again offline
(effectively disable) both CPU1 and CPU3):

ok asr-enable cpu1 (V480)
ok asr-enable cpu3 (V480)
ok asr-enable cmp1 (V490)
ok asr-enable cmp3 (v490)
ok reset-all
ok .asr (to check ASR Disablement Status)

Component: Status
CPU/Memory: Enabled
IO-Bridge5: Enabled
IO-Bridge8: Enabled
IO-Bridge9: Enabled
GPTwo Slots: Enabled
Onboard FCAL: Enabled
Onboard Net1: Enabled
Onboard Net0: Enabled
Onboard IDE: Enabled
PCI Slots: Enabled

ok .env (will still not display the status for CPU1 & CPU3)

After power-cycle both CPU's will be back on-line.

3.To disable and then enable the entire CPU module in Slot B (both CPU1
& CPU3) the following commands can be used as well:

{3} ok asr-disable gptwo-slotb
{3} ok .asr

ASR Disablement Status
Component: Status

CPU/Memory: Enabled
IO-Bridge5: Enabled
IO-Bridge8: Enabled
IO-Bridge9: Enabled
GPTwo Slot A: Enabled
GPTwo Slot B: Disabled
GPTwo Slot C: Enabled
Onboard FCAL: Enabled
Onboard Net1: Enabled
Onboard Net0: Enabled
Onboard IDE: Enabled
PCI Slots: Enabled

{3} ok reset-all
Resetting ...

WARNING: Offlining/Disabling CPU1...and CPU3...Done.

To bring back the cpu's in slot B use the command:

{0} ok asr-enable gptwo-slotb
{0} ok .asr
ASR Disablement Status
Component: Status

CPU/Memory: Enabled
IO-Bridge5: Enabled
IO-Bridge8: Enabled
IO-Bridge9: Enabled
GPTwo Slots: Enabled
Onboard FCAL: Enabled
Onboard Net1: Enabled
Onboard Net0: Enabled
Onboard IDE: Enabled
PCI Slots: Enabled

After a 'reset-all' and power-cycle of the system the cpu's in slot B
(cpu1 and cpu3) will be back online.

Documentations about ASR:
V880 Sun Fire 880 Server Owner's Guide /Chapter 6
http://docs.sun.com/app/docs/doc/806-6592-11?q=806-6592-11

How to restrict application user-IDs for direct login to the servers

How to restrict users from logging into server directly from SSH

General way
====================
Add the below line in /ets/ssh/sshd_config file

DenyUsers



Hartford Way
=====================

Here we put the restricted users list in /etc/profile.no.direct.login.IDs
Need to put the below script in /etc/profile.

# DENY DIRECT LOGIN #
# The following section denys direct login of certain id's.
# To utilize this code: create a file /etc/profile.no.direct.login.IDs.
# Set ownership of above file to root, protection to 444.
# Each line in the file contains one ID for which direct login is prohibited.
# Each entry in the file must begin in column 1.
#
if [ -f /etc/profile.no.direct.login.IDs ]
then
cat /etc/profile.no.direct.login.IDs | while read ID_ENTRY;
do
if [ "`logname`" == $ID_ENTRY ]
then
echo ""
echo "###########################################"
echo "# Direct login not allowed for this ID !! #"
echo "###########################################"
echo ""
echo "Exiting..."
sleep 2
exit
fi
done
Fi
# END DENY DIRECT LOGIN #

--------------------------------------------------------------------------

Last however is a simple add in to /etc/profile

REALNAME=$(who am i)
if [ "$LOGNAME" == "$REALNAME" ]
echo "Naughty child, direct login disabled $LOGNAME"
exit 1
fi

Note that who am i is different than LOGNAME when su - is used.

You will have to add a loop to only check these users, lets say they are in a list

while read -r uname

if [ "$LOGNAME" == "$uname"
then
REALNAME=$(who am i)
if [ "$LOGNAME" == "$REALNAME" ]
then
echo "Naughty child, direct login disabled $LOGNAME"
exit 1
fi
fi

done < /etc/specialusers
-----------------------------------------------------------------------------
For Bourne and POSIX shells, add the following to /etc/profile:

#unsupported statements to prevent users from login but allow su.
name=`logname`
if [ $name = username ]
then
echo $name not allowed to login...only su
logout
fi
#end

Note: username should be replaced with the name of the user to
whom direct login access is denied.


For C shell, add the following to /etc/csh.login:

#unsupported statements to prevent users from login but allow su.
set name=`logname`
if ( $name == username ) then
echo $name not allowed to login...only su
exit
endif
#end

----------------------------------------------------------------------

Hello,

This is the final solution. I will write a
Knowledge Brief about it:

a) As in any good company, inetd-based
protocols were disabled (telnet, rsh, rlogin).

b) Ordinary users have access to the server
via SSH only.

c) Added into sshd_config:

DenyUsers oracle prdadm

d) Installed SUDO and SUDOSH.
Everyone is familar with sudo, and
sudosh is available at:

http://sourceforge.net/projects/sudosh

For example, to log in as oracle:

/bin/sudo -u oracle /usr/local/bin/sudosh

SUDOSH captures all keystrokes on the tty and
the user cannot forge them! There is also a
replay command to check what the user did:

sudosh-replay

Note that sudosh can be a login Shell too!

Bingo: SUDOSH was a perfect and relatively easy method that made the customer happy.

Friday, December 11, 2009

To reset ssmon on unix servers

#pam_tally --user ssmon --reset

Console RSC

================================================================================
Access the System Controller command line interface (CLI). This is
accomplished using the console escape characters. (normally "#.")

{0} ok #.
sc>

================================================================================
Please login: admin
Password: sun123 (default password)
rsc>console

================================================================================
SC Alert: SC Request to send Break to host.

vi /etc/default/kbd

#this will keep a spurious break from being sent
KEYBOARD_ABORT=alternate

From OS, while on console, do the following:


~
^b
xir #send break

================================================================================
Navigating between the OS level and the RSC card level using tip (serial)
or telnet (ehternet) sessions on the Sun Fire(TM) 280R, V480, and V880
Server products.
Document Body Top

There are two methods to switch from the OS level to the RSC card. Choose
the appropriate method depending on how you are connected to the RSC card.



Navigating between RSC and the OS using telnet
-----------------------------------------------

Execute the following command from the OS level: ~.
This will return the console to the rsc> prompt

To resume your connection with the OS type "console" at the rsc> prompt.



Navigating between RSC and the OS using tip
--------------------------------------------

Execute the following command: ~~.
You may have to run the command 1-2 times before the console will return to
the rsc> prompt.

To resume your connection with the OS type "console" at the rsc> prompt.

Executing the command ~. will disconnect the tip session with the RSC card.



If the escape character ~ does not work
----------------------------------------

If the escape character ~ fails to return the console session to the rsc>
prompt, run the following command:

# ./rscadm show escape_char
escape_char="*"

The escape character is ~ by default, but can be user defined. To return to
the rsc> prompt, type the escape_char followed by a period (.). In this
example, you would type *. or ~*. to return to the rsc> prompt.



How to clear open console sessions
-----------------------------------

rsc> console
Console session already in use.

If the console is busy, run either of the following commands to reset the
console and clear any open sessions:

From the rsc prompt:

rsc> resetrsc

From the OS:

./rscadm resetrsc

================================================================================
RSC Commands at the rsc> prompt.

environment Displays current environmental information

showenvironment (The showenvironment command is not available on Sun
Enterprise[TM] 250 servers.)

shownetwork Displays the current network configuration

console Connects you to the server console

break Puts the server in debug mode

xir Generates an externally initiated reset to the server

bootmode Controls server firmware behavior, if followed by a server reset
within 10 minutes (similar to L1-key combinations on Sun keyboards)

-u

Force the server to direct the console to RSC; the -u option must precede any
boot_mode you specify; requires server reset

normal

Normal boot; server runs low-level diagnostics; requires server reset

forth

Enter Forth interpreter as soon as possible (equivalent to L1-F on keyboard);
requires server reset

reset_nvram

Reset all NVRAM variables to default values (equivalent to L1-N on keyboard);
requires server reset

diag

Force the server to run full diagnostics (equivalent to L1-D on keyboard);
requires server power-off and power-on

skip_diag

Force the server to skip diagnostics (equivalent to L1-S on the keyboard);
requires server power-off and power-on

reset Resets the server immediately

poweroff Powers off the server

poweron Powers on the server

loghistory Displays the history of all events logged in the RSC event buffer

consolehistory Displays the history of all console messages logged in the
buffer

consolerestart Makes the current boot and run console logs "original"

set Sets a configuration variable

Table 1.

serial_baud
serial_stop
serial_data
serial_hw_handshake

ppp_local_ip_addr
ppp_remote_ip_addr
ppp_enabled
page_enabled

mail_enabled
page_info1
page_init1
page_password1

page_baud1
page_data1
page_parity1
page_stop1

page_info2
page_init2
page_password2
page_baud2

page_data2
page_parity2
page_stop2
customerinfo

hostname
mailuser
mailhost
ip_mode

ip_addr
ip_netmask
ip_gateway
escape_char

country_code +
page_verbose *
tpe_link_test



+rsc 2.0 and above

*not available for the 250

show Displays one or more configuration variables

date Displays or sets the current time and date

password Changes your RSC password

useradd Adds an RSC user account

userdel Deletes an RSC user account

usershow Shows characteristics of an RSC user account

userpassword Sets or changes a user's password

userperm Sets the authorization for a user

resetrsc Resets RSC immediately

help Displays a list of RSC shell commands and a brief description of each

version Displays the RSC firmware version

showsc (The showsc command is not available on Sun Enterprise 250 servers.)

logout Ends your current RSC shell session

setlocator Turn the system locator LED on or off (Sun Fire[TM] V480 servers
only).

showlocator Show the state of the system locator LED (Sun Fire V480 servers
only).

showdate Same as the date command without arguments. (Not available for Sun
Enterprise 250 servers.)

setdate Same as the date command with arguments. (Not available for Sun
Enterprise 250 servers.)


rscadm subcommands

help Displays a list of rscadm commands and brief descriptions for each

date Displays or sets the current time and date

set Sets a configuration variable

show Displays one or more configuration variables

shownetwork Shows current RSC card network configuration (RSC 2.0 and above)

loghistory Returns the most recent log entries (RSC 2.0 and above)

resetrsc Resets RSC immediately

download Downloads firmware to the RSC flash PROM

send_event Logs an event; can also send an alert message

modem_setup Changes configuration of the modem connected to the RSC serial
port

useradd Adds an RSC user account

userdel Deletes an RSC user account

usershow Shows characteristics of an RSC user account

userpassword Sets or changes a user's password

userperm Sets the authorization for a user

version Reports the RSC version on the host (RSC 2.0 and above)

status Same as the version -v command. (RSC 2.0 and above)


OBP Commands

rsc-hard-reset Performs a hard reset of RSC; this is the same as using the
command rscadm resetrsc.

rsc-soft-reset Performs a soft reset of RSC; this is the same as using the
command rscadm resetrsc -s.

diag-output-to rsc*|rsc-console**|ttya Directs POST output to either RSC (1)
or ttya (0). This command takes effect after the next server reset. (E250
only)

diag-console rsc*|rsc-console**|ttya This command directs power-on self-test
(POST) output to either RSC (1) or ttya (0). This command takes effect after
the next server reset. (Not available for the 250)

rsc-mac-update Updates the RSC Ethernet address from the contents of the
server ID PROM. Use this command after replacing the server NVRAM module.

.rsc Displays RSC information, including the diag-output-to setting and the
RSC POST status word.

*Available for Sun Enterprise 250 servers only. For other supported workgroup
servers, you must set input-device and output-device to rsc-console rather
than to rsc. The test we made on SF280R showed that we had to use rsc rather
than rsc-console argument. So, it's apparently not applicable to E250 ONLY.
To be checked.

**For Sun Enterprise 250 servers, you must set input-device and output-device
to rsc rather than to rsc-console.


OBP Environment Variable Properties

input-device rsc|rsc!|ttya

output-device rsc|rsc!|ttya

diag-out-console true|false ( SF280R and V480 only ???? should be checked
also on V880 and E250 servers. )

================================================================================
What to do if RSC is configured and the password is forgotten.

STEP BY STEP SOLUTION TO THIS PROBLEM:

1. STEP 1:
Access the system as root to create a new RSC user: If root can
login into system remotely
then proceed to Step 2 If root can not access system remotely
and RSC is currently the active
console then the only other way to gain access to the system
console would be through ttya,
but because RSC is configured we would need to change the
system's output and input devices
back to their default settings. Setting these defaults can be
accomplished by using one of
the following two methods:

* Method 1:
After turning on the power to your system, watch the front
panel wrench LED for rapid
flashing during the boot process. Press the front panel Power
button twice (with a short,
one-second delay in between presses).

Notes:
The above procedure sets all nvram parameters to their default
settings.
These changes are temporary and the original values will be
restored after the next
hardware or software reset.

* Method 2:
Remove RSC card. By removing the RSC card the output and input
devices will forced to ttya.
For information on how to remove the RSC card please refer to
your Server Owner's Guide.

2. STEP 2:
a. Execute the following 3 commands in order to create a new RSC
user with full permissions:

/usr/platform/`uname -i`/rsc/rscadm useradd
/usr/platform/`uname -i`/rsc/rscadm userperm cuar
/usr/platform/`uname -i`/rsc/rscadm userpassword

Notes: You may need to delete an RSC user if there are 4
existing users defined. If you
did not remove the RSC card, please proceed to step c.

b. Reinstall RSC card. For information on How to install the RSC
card please refer to your
Server's Owner's Guide.
c. Reboot the RSC card.
d. Log into RSC using the login and password created in Step a.

================================================================================

Mount an ISO image on a Solaris filesystem with lofiadm

Mount an ISO image on a Solaris filesystem with lofiadm

Many software packages can be downloaded in the form of an ISO image. Rather than burning the image to a CD-ROM to access its contents, it is easy to mount the image directly into the filesystem using the lofiadm and mount commands.

Given an ISO image in /export/temp/software.iso, a loopback file device (/dev/lofi/1) is created with the following command:

lofiadm -a /export/temp/software.iso /dev/lofi/1

The lofi device creates a block device version of a file. This block device can be mounted to /mnt with the following command:

mount -F hsfs -o ro /dev/lofi/1 /mnt

These commands can be combined into a single command:

mount -F hsfs -o ro `lofiadm -a /export/temp/software.iso` /mnt


Unmount and detach the images :-

Use umount command to unmount image:
# umount /mnt

Now remove/free block device:
# lofiadm -d /dev/lofi/1

For more information read lofiadm and lofi man pages by typing the following command:
man lofiadm

Wednesday, November 11, 2009

To identify the public interface and heartbeat interfaces in the cluster

To identify the public interface and heartbeat interfaces in the cluster

#lltstat -nvv

Monday, November 9, 2009

to stop cron on solaris 10

#svcadm disable -st cron

Tuesday, October 27, 2009

Change Group Ownership of Symbolic Links in Unix

By default, chown changes the ownership of the file pointed to by the link, not the link itself. If you need to change the link's owner/group, use the "-h" option.

-h If the file is a symbolic link, change the owner of
the symbolic link. Without this option, the owner of
the file referenced by the symbolic link is changed.

Ex: #chown -h root:root /etc/hosts

#chgrp -h new_group symbolic_link_name

Sunday, October 25, 2009

Networking

How do I find the speed my network card is at?

a. /usr/sbin/ndd -set /dev/hme instance 0
1. instance 0 - hme0
2. instance 1 - hme1
b. /usr/sbin/ndd -get /dev/hme transciever_inuse
1. 0 - onboard
2. 1 - offboard card (mii)
c. /usr/sbin/ndd -get /dev/hme link_status
1. 0 - down
2. 1 - up
d. /usr/sbin/ndd -get /dev/hme link_speed
1. 0 - 10Mb
2. 1 - 100Mb
e. /usr/sbin/ndd -get /dev/hme link_mode
1. 0 - half duplex
2. 1 - full duplex

2. How do I configure what my network card is capable of?

a. Method 1
1. /etc/system
a. this sets global defaults for the driver, therefore
it is effective for all instances of the card
b. HME/QFE/GE interfaces
1. set hme:hme_adv_autoneg_cap=0
a. advertise auto negotiate capability
b. 0 - off
c. 1 - on
2. set hme:hme_adv_100T4=0
a. advertise deprecated 100Mbit T4 capability
b. 0 - off
c. 1 - on
3. set hme:hme_adv_100fdx=0
a. advertise 100Mbit full duplex capability
b. 0 - off
c. 1 - on
4. set hme:hme_adv_100hdx=0
a. advertise 100Mbit half duplex capability
b. 0 - off
c. 1 - on
5. set hme:hme_adv_10fdx=0
a. advertise 10Mbit full duplex capability
b. 0 - off
c. 1 - on
6. set hme:hme_adv_10hdx=0
a. advertise 10Mbit half duplex capability
b. 0 - off
c. 1 - on
c. ERI interface
1. set eri:adv_autoneg_cap=0
a. advertise auto negotiate capability
b. 0 - off
c. 1 - on
2. set eri:adv_100T4=0
a. advertise deprecated 100Mbit T4 capability
b. 0 - off
c. 1 - on
3. set eri:adv_100fdx=0
a. advertise 100Mbit full duplex capability
b. 0 - off
c. 1 - on
4. set eri:adv_100hdx=0
a. advertise 100Mbit half duplex capability
b. 0 - off
c. 1 - on
5. set eri:adv_10fdx=0
a. advertise 10Mbit full duplex capability
b. 0 - off
c. 1 - on
6. set eri:adv_10hdx=0
a. advertise 10Mbit half duplex capability
b. 0 - off
c. 1 - on
c. QE/LE interfaces
1. these 10mbit interfaces dont support full duplex
operation
b. Method 2
1. This method allows more granular control over the interface
driver. You can specify configuration by port.
2. /usr/sbin/ndd -set /dev/hme instance 0
a. instance 0 - hme0
b. instance 1 - hme1
b. /usr/sbin/ndd -set /dev/hme adv_autoneg_cap 0
1. advertise auto negotiate capability
2. 0 - off
3. 1 - on
c. /usr/sbin/ndd -set /dev/hme adv_100fdx_cap 0
1. advertise 100Mbit full duplex capability
2. 0 - off
3. 1 - on
d. /usr/sbin/ndd -set /dev/hme adv_100hdx_cap 0
1. advertise 100Mbit half duplex capability
2. 0 - off
3. 1 - on
e. /usr/sbin/ndd -set /dev/hme adv_100T4_cap 0
1. advertise deprecated 100Mbit T4 capability
2. 0 - off
3. 1 - on
f. /usr/sbin/ndd -set /dev/hme adv_10fdx_cap 0
1. advertise 10Mbit full duplex capability
2. 0 - off
3. 1 - on
g. /usr/sbin/ndd -set /dev/hme adv_10hdx_cap 0
1. advertise 10Mbit half duplex capability
2. 0 - off
3. 1 - on

3. How do I configure what my link partner is capable of?

a. /usr/sbin/ndd -set /dev/hme instance 0
1. instance 0 - hme0
2. instance 1 - hme1
b. /usr/sbin/ndd -get /dev/hme lp_autoneg_cap
1. link partner has auto negotiate capability
2. 0 - off
3. 1 - on
c. /usr/sbin/ndd -get /dev/hme lp_100fdx_cap
1. link partner has 100Mbit full duplex capability
2. 0 - off
3. 1 - on
d. /usr/sbin/ndd -get /dev/hme lp_100hdx_cap
1. link partner has 100Mbit half duplex capability
2. 0 - off
3. 1 - on
e. /usr/sbin/ndd -get /dev/hme lp_100T4_cap
1. link partner has deprecated 100Mbit T4 capability
2. 0 - off
3. 1 - on
f. /usr/sbin/ndd -get /dev/hme lp_10fdx_cap
1. link partner has 10Mbit full duplex capability
2. 0 - off
3. 1 - on
g. /usr/sbin/ndd -get /dev/hme lp_10hdx_cap
1. link partner has 10Mbit half duplex capability
2. 0 - off
3. 1 - on

4. How can I tell if my card is active on the network?

a. Method 1 (Openboot PROM)
1. watch-net

5. How do I use multiple ethernet interfaces on the same network segment?

a. Method 1 (modern cards, 1997+)
1. Modern Sun Adapters have unique mac addresses encoded in the FCode Prom.
2. /usr/sbin/eeprom local-mac-address?=true

b. Method 2 (older cards)
1. From InfoDoc 16733; "Section 3.2.3(4) of the IEEE 802.3 spec
defines a reserved bit in the Ethernet Address that can be
used to administer a universally assigned ethernet
addresses. A Locally administered address (LAA) can be
implemented to ensure a unique HW address."
2. Setting the LAA bit can be done by using a 0A hex as the
first digit instead of 08.
3. /usr/sbin/ifconfig hme1 ether 0a:0:20:00:01

6. How do I determine if local mac addresses are in use on my host?

a. /usr/sbin/prtconf -pv | /usr/bin/grep local-mac-address

Veritas Volume Manager



1. How do I allow a user to write to a managed raw device?

a. /usr/bin/chown is not persistent across reboots
b. /usr/sbin/vxedit set user=oracle group=dba mode=600 volume

How do I use an alternate window manager?

a. Bypassing CDE
1. echo "exec /path/to/alternate/window/manager" > .xsession
b. Maintaining CDE
1. Xresources
a. cd /usr/dt/config/C/Xresources.d
b. /usr/bin/cp Xresources.ow Xresources.wm
c. Modify Xresources.wm
1. Dtlogin*altDtName: Alternate WindowManager
2. Dtlogin*altDtKey: /path/to/alternate/window/manager
3. Dtlogin*altDtStart: /usr/dt/config/Xsession.wm
4. Dtlogin*altDtLogo: WMlogo
2. Xsession
a. cd /usr/dt/config
b. /usr/bin/cp Xsession.ow Xsession.wm
c. Modify Xsession.wm
1. Place windowmanager environment
3. Logo (for display in CDE login)
a. cd /usr/dt/appconfig/icons/C
b. /usr/bin/cp OWlogo.pm WMlogo.pm
1. Replace this with your own XPM file

2. How do I disable X Windows from starting at boot?

a. Method 1 (recommended)
1. /usr/dt/bin/dtconfig -d
b. Method 2
1. /usr/bin/mv /etc/rc2.d/S99dtlogin /etc/rc2.d/s99dtlogin

How do I grow a ufs filesystem?

2. How do I grow a ufs filesystem?

a. Unmounted filesystem (not /, /usr, /var)
1. Allocate additional contiguous disk space with format(1m)
a. Unnecessary if you are using a volume manager
2. /usr/lib/fs/ufs/mkfs -G rawdevice newsize
b. Mounted filesytem (not /, /usr, /var)
1. Allocate additional contiguous disk space with format(1m)
a. Unnecessary if you are using a volume manager
2. /usr/lib/fs/ufs/mkfs -G -M mountpoint rawdevice newsize

3. How do I determine what type of filesystem a given device has?

a. Method 1 (root)
1. /usr/sbin/fstyp blockdevice


4. What are inodes 0, 1, and 2 used for?

a. Inode 0 is unusable. It is used to mark unused inodes.
b. Inode 1 is unusable. Use of this inode for bad block information
is deprecated.
c. Inode 2 is "/" or "root" of the filesystem.

5. What do I do if I have a corrupt boot block?

a. ok boot cdrom -s
b. /usr/sbin/installboot /usr/platform/`uname -i`/lib/fs/ufs/bootblk /dev/rd

How do I add a disk to the system?

How do I add a disk to the system? 

a. While the system is up ( no fcal)
1. Solaris <= 7
a. Generate /devices structure
1. /usr/sbin/drvconfig
b. Generate /dev structure
1. /usr/sbin/devlinks
c. Generate /dev/dsk and /dev/rdsk links
1. /usr/sbin/disks
2. Solaris 8
a. Generate /devices, /dev, /dev/dsk, /dev/rdsk links
1. /usr/sbin/devfsadm
b. While the system is up ( fcal )
1. Get the enclosure name
a. /usr/sbin/luxadm probe
2. Add the disk
a. /usr/sbin/luxadm insert_device enclosure,slot
c. With a reboot
1. Method 1
a. /usr/sbin/shutdown -g0 -i0 "disk addition"
b. Reconfigure Boot (From OpenBoot PROM monitor)
1. boot -r
2. Method 2
a. /usr/bin/touch /reconfigure

How do I know the limits for shared memory kernel tunables?

 How do I know the limits for shared memory kernel tunables?

a. Read /usr/include/sys/shm.h

What is shared memory?

What is shared memory?

a. Just as it sounds. Shared memory is an Interprocess
Communication (IPC) mechanism used by multiple processes to
access common memory segments.

How do I list available signals?

 How do I list available signals?

a. /usr/bin/kill -l
b. Read /usr/include/sys/signal.h
c. Solaris 2.6/7
1. /usr/bin/man -s 5 signal
d. Solaris 8
1. /usr/bin/man -s 3HEAD signal

Ex:
bash-3.00# kill -l
1) SIGHUP 2) SIGINT 3) SIGQUIT 4) SIGILL
5) SIGTRAP 6) SIGABRT 7) SIGEMT 8) SIGFPE
9) SIGKILL 10) SIGBUS 11) SIGSEGV 12) SIGSYS
13) SIGPIPE 14) SIGALRM 15) SIGTERM 16) SIGUSR1
17) SIGUSR2 18) SIGCHLD 19) SIGPWR 20) SIGWINCH
21) SIGURG 22) SIGIO 23) SIGSTOP 24) SIGTSTP
25) SIGCONT 26) SIGTTIN 27) SIGTTOU 28) SIGVTALRM
29) SIGPROF 30) SIGXCPU 31) SIGXFSZ 32) SIGWAITING
33) SIGLWP 34) SIGFREEZE 35) SIGTHAW 36) SIGCANCEL
37) SIGLOST 41) SIGRTMIN 42) SIGRTMIN+1 43) SIGRTMIN+2
44) SIGRTMIN+3 45) SIGRTMAX-3 46) SIGRTMAX-2 47) SIGRTMAX-1
48) SIGRTMAX

How do I do a recursive grep?

How do I do a recursive grep?

a. Method 1 (recommended)
1. /usr/bin/find . | /usr/bin/xargs /usr/bin/grep PATTERN
2. displays filename:match
b. Method 2 (recommended)
1. /usr/bin/find . -exec /usr/bin/grep PATTERN {} /dev/null \;
2. displays filename:match

Ex:
bash-3.00# find /tmp | xargs grep "RTMAX"
/tmp/nsig:RTMAX-3 default
/tmp/nsig:RTMAX-2 default
/tmp/nsig:RTMAX-1 default
/tmp/nsig:RTMAX default

What is load?

1. What is load?

a. Load is the number of processes currently in the run queue.
b. Method 1
1. /usr/bin/w -u
2. displays load average over last 1, 5 and 15 minutes
c. Method 2
1. /usr/bin/uptime
2. displays load average over last 1, 5 and 15 minutes