Thursday, December 12, 2013

Solaris 11- Configuring Nsswitch.conf

##Configuring nsswitch.conf
The next step is to configure the svc:/system/name-service/switch service .

solaris:~$ svccfg -s name-service/switch
svc:/system/name-service/switch> setprop config/default = files
svc:/system/name-service/switch> setprop config/host = "files dns"
svc:/system/name-service/switch> setprop config/ipnode = astring: "files dns"
svc:/system/name-service/switch> exit
solaris:~$ svcadm refresh name-service/switch
solaris:~$ svcadm restart name-service/switch

Now examine the /etc/nsswitch.conf to confirm it worked:


Solaris 11- Configuring DNS Client on the server?

Now use the svccfg to modify the svc:/network/dns/client service:
solaris:~$ svccfg -s dns/client
svc:/network/dns/client> listprop config
config application
config/value_authorization astring solaris.smf.value.name-service.dns.client
config/nameserver net_address 10.0.0.1

Modify the config/nameserver property and list the results:
svc:/network/dns/client> setprop config/nameserver = (192.168.1.1 4.2.2.2 8.8.8.8)
svc:/network/dns/client> listprop config
config application
config/value_authorization astring solaris.smf.value.name-service.dns.client
config/nameserver net_address 192.168.1.1 4.2.2.2 8.8.8.8

Add the config/search and config/domain properties and list the results:
svc:/network/dns/client> setprop config/search = xyz.com
svc:/network/dns/client> setprop config/domain = xyz.com
svc:/network/dns/client> listprop config
config application
config/value_authorization astring solaris.smf.value.name-service.dns.client
config/nameserver net_address 192.168.1.1 4.2.2.2 8.8.8.8
config/search astring xyz.com
config/domain astring xyz.com
svc:/network/dns/client> exit

Finally refresh and restart the dns/client service:
solaris:~$ svcadm refresh dns/client
solaris:~$ svcadm restart dns/client


Solaris 11 - How to change the hostname of the server?

1 - To check the current environment properties:
root@solaris:~# svccfg -s system/identity:node listprop config
config                 application        
config/enable_mapping boolean     true
config/nodename       astring     solaris
config/loopback       astring     solaris
2 - Set the new hostname
root@solaris:~# svccfg -s system/identity:node setprop config/nodename="my-host-name"
root@solaris:~# svccfg -s system/identity:node setprop config/loopback="my-host-name"
3- Refresh the properties:
root@solaris:~# svccfg -s system/identity:node refresh
4 - Restart the service:
root@solaris:~# svcadm restart system/identity:node
5 - verify that the changes took place:
root@solaris:~# svccfg -s system/identity:node listprop config
config                 application       
config/enable_mapping boolean     true
config/nodename       astring     my-host-name
config/loopback       astring     my-host-name
root@solaris:~# hostname

my-host-name

Tuesday, November 12, 2013

Oracle Solaris 11 Auditing

Important files to know: /etc/security/audit_class and /etc/security/audit_event
Important Commands to know: auditconfig , auditrecord
Location for Auditing Logs : /var/audit/

auditconfig -getflags
auditconfig -getnaflags (Get non-attributable flag)
auditconfig -getplugin   (To determine which plugins are active)
auditconfig -lspolicy ( List of policies)
auditconfig -getpolicy 
auditconfig -setpolicy -cnt (Removing the cnt policy)

auditrecord -c lo (To determine the type of records included under the lo class. Option -c is for selecting the class as mentioned in audit_class)





Friday, November 8, 2013

Configuring Solaris Zones in VCS Clusters

I have been thinking from quite a while for providing the High Availability to Non-Global zones Vertias Clusters.

Lets see , how we can configure the same.

In Vertias Cluster, Assuming that the non global zone will be on a shared storage and we are configuring a failover or a parallel Service Group.

Configure a parallel service group with required storage resources (DiskGroup,Volume, Mount, etc.) to mount the zone root on the nodes. Set the required dependency between storage resources (DiskGroup->Volume->Mount).
sysA# hagrp -add zone_grp
sysA# hagrp -modify zone_grp Parallel 1 (This step is not included while configuring failover)
sysA# hagrp -modify zone_grp SystemList sysA 0 sysB 1
sysA# hares -add zone_dg DiskGroup zone_grp
sysA# hares -add zone_vol Volume zone_grp
sysA# hares -add zone_mnt Mount zone_grp
sysA# hares -link zone_mnt zone_vol
sysA# hares -link zone_vol zone_dg

Bring the service group online on all the nodes. This command mounts the zone root on all the nodes.
sysA# hagrp -online zone_grp -any  (Parallel)
sysA# hagrp -online zone_grp -sysA  (Failover)

Boot the local zone on all the nodes outside VCS.
sysA# zoneadm -z local-zone1 boot
sysB# zoneadm -z local-zone2 boot

Run the hazonesetup utility with correct arguments on all the nodes successively.(Parallel)
sysA# hazonesetup -g zone_grp -r zone_res -z local-zone1 -p password -a -l -s sysA,sysB
sysB# hazonesetup -g zone_grp -r zone_res -z local-zone2 -p password -a -l -s sysA,sysB

Run the hazonesetup utility with correct arguments on all the nodes successively.(Failover)
sysA# hazonesetup -g zone_grp -r zone_res -z local-zone1 -p password -a  -s sysA,sysB
sysB# hazonesetup -g zone_grp -r zone_res -z local-zone2 -p password -a  -s sysA,sysB


Set the proper dependency between the Zone resource and other storage
resources. The Zone resource should depend on storage resource
(Mount->Zone).
sysA# hares -link zone_res zone_mnt

How-to for simple SysAdmin tasks which gets performed differently on Solaris 11

The previous behavior of modifying a configuration file to configure naming services no longer works. 

How a system will get information on hosts, users? 

On Solaris 10 - Update /etc/nsswitch.conf

On Solaris 11 

#svccfg -s svc:/system/name-service/switch:default


How a system will be able to resolve the hostname resolution with DNS?

On Solaris 10 - Update /etc/resolv.conf

On Solaris 11

# svccg
svc:> select /network/dns/client
svc:/network/dns/client> setprop config/options = "ndots:2,retrans:3,retry:1"
svc:/network/dns/client> listprop config/options
config/options astring     ndots:2,retrans:3,retry:1
# svcadm refresh dns/client

How to change the hostname of the system?
On Solaris 10- Update /etc/nodename

On Solaris 11

# svccfg -s svc:/system/identity:node setprop config/nodename = astring: nodename
# svcadm refresh svc:/system/identity:node

# svcadm restart svc:/system/identity:node

How to change or configure Locale and the timezone?



Solaris 11 -changing locale
# svccfg -s svc:/system/environment:init setprop environment/LANG = astring: fr_FR.UTF-8# svcadm refresh svc:/system/environment


Solaris 11- For changing Timezone

# svccfg -s timezone:default setprop timezone/localtime= astring: US/Mountain

# svcadm refresh timezone:default

How to set default route on Solaris 10 vs 11?
On Solaris 10,
You need to update /etc/defaultrouter

Oracle Solaris 11, you can persistently set the default route for a system,
route -p add default ip-address

Few Important Solaris 11 process

The below are the few important processes which does not require any administration but important to know.

fsflush
System daemon that flushes pages to disk
init
Initial system process that starts and restarts other processes and SMF components
intrd
System process that monitors and balances system load due to interrupts
kmem_task
System process that monitors memory cache sizes
pageout
System process that controls memory paging to disk
sched
System process that is responsible for OS scheduling and process swapping
vm_tasks
System process with one thread per processor that balances and distributes virtual memory related workloads across CPUs for better performance.
zpool-pool-name
System process for each ZFS storage pool containing the I/O taskq threads for the associated pool

Monday, November 4, 2013

Understanding the Boot Process of Solaris 11 -First Cloud Ready OS

##Boot Process on Sparc Platforms.##

The boot process can be divided in 4 parts in Sparc Platforms. However the last three steps are common on the SPARC and x86 hardwares.

1. OpenBoot PROM phase
-The OpenBoot Program starts looking for a filesystem reader, it reads the partition map on the boot disk, called a VTOC , at sector 0 . The utility will find and load a file reader from sectors 0-15 , an area called the boot block.
-Now it can find and read the boot archive , a collection of configuration files and driver code that prepares the system to load and execute the kernel program.

Imp1 : We can override the values that are passed as defaults to the kernel by running  " boot -a " 
Imp2: We can also change the running state or the logging level of Solaris 11 system using "boot -m "

boot -m milestone=<milestone> ( none | all | single-user |multi-user|multi-user-server ] -For setting run state.
boot -m [quiet|verbose|debug]   --For Logging

##Boot Process on x86 Platforms.##
In x86 boot process the BIOS call the Master Boot Record (MBR) , 512-byte construct that includes support for a partition table and bootstrap code. The MBR provides support for multibooting, a practice of putting multiple operating systems on a single disk.

The x86 counterpart to the OBP boot utility is the GRUB(Grand Unified Boot Loader)

2. Booter phase
At this point the boot archive file gets read. it comes in a sequence before a file system is available, which is why system needs a special file reader, identified by bootfs variable , to begin with.

Imp: There are three important variables which are being passed.
-bootfs - Locates the file system reader. (variable value eg: rpool/ROOT/solaris)
-kernel -This variable locates the kernel program (variable value eg: /platform/i86pc/kernel/amd64/unix
-module - This variable locates the boot archive file (variable value eg: /platform/i86pc/amd64/boot_archive )

3. Ramdisk phase 
The Ramdisk component is a file in ISO format that is mounted and used as a stand-alone, read-only filesystem. It contains drivers and configuration files which setup the earliest stanges of initalizing the kernel program.

Imp: Boot archive is the ramdisk image.

4. Kernel phase
Once those drivers supports the root file system and can attach it to the root device specified in system setup. The kernel then extracts the remaining primary modules from the boot archive, initializes itself, mounts the real root file system, then discards the boot archive. Once initialized, the kernel program can call other programs that build the system to a user-accessible state.

In details:
Once the kernel is loaded, it starts the UNIX system, mounts the necessary file systems from vfstab and  runs /usr/sbin/init to bring the system to the “initdefault” state specified in /etc/inittab

When the system is booted, init is invoked and the following occurs. First, it reads the properties for the svc:/system/environment:init service. Among these properties are values for locale-related environments, such as LANG or LC_CTYPEinit then looks in /etc/inittab for the initdefault entry 

Inittab Important Entires
ap::sysinit:/usr/sbin/autopush -f /etc/iu.ap
smf::sysinit:/lib/svc/bin/svc.startd    >/dev/msglog 2<>/dev/msglog </dev/console

p3:s1234:powerfail:/usr/sbin/shutdown -y -i5 -g0 >/dev/msglog 2<>/dev/msglog

Lets understand each of the top two important entries.
ONE   ap::sysinit:/usr/sbin/autopush -f /etc/iu.ap
The autopush command configures the list of modules to be automatically pushed onto the stream when a device is opened. It can also be used to remove a previous setting or get information on a setting.

cat iu.ap  -This file contains 
#        major     minor       lastminor        modules
          wc            -1                 0                  ldterm  ttcompat

          qcn            0             255                 ldterm  ttcompat

The mentioned modules in the file are present in /kernel/drv directory. For example wc.conf is mentioned in the /kernel/drv and the modules will be loaded accordingly.

SECOND


smf::sysinit:/lib/svc/bin/svc.startd    >/dev/msglog 2<>/dev/msglog </dev/console

svc.startd is the master restarter daemon for Service Management Facility (SMF) and the default restarter for all services. svc.startd starts, stops, and restarts services based on administrative requests, system failures, or application failures

So, Now lets understand what is boot-archive.
When we install Solaris 11, the system creates the archive by copying key files from the root filesystem . And when ever we make any configuration change which might affect one of these files, so it's important to keep boot archive in sync with the root filesystem copy before shutting down.(sync using update-archive command )

Imp: In solaris 11 the bootadm utility is used to perform the below task.
SPARC: bootadm list-archive and update-archive
x86 : bootadm list-archive | update-archive | list-menu |set-menu

Imp: 

Wednesday, September 18, 2013

How to failover a VCS Service Group ?

For Example: You have a service group(sg1) currently running on nodeA and you want to fail it over to node B. Then you need to run the below command to perform the failover.

hagrp -switch sg1 to nodeB

VCS- Implementing Veritas Cluster File System (CFS)

Veritas Cluster File System (CFS)

CFS allows the same file system to be simultaneously mounted on multiple nodes in the cluster.

The CFS is designed with master/slave architecture. Though any node can initiate an operation to create, delete, or resize data, the master node carries out the actual operation. CFS caches the metadata in memory, typically in the memory buffer cache or the vnode cache. A distributed locking mechanism, called GLM, is used for metadata and cache coherency among the multiple nodes.

The examples here are :

1. Based on VCS 5.x but should also work on 4.x
2. A new 4 node cluster with no resources defined.
3. Diskgroups and volumes will be created and shared across all nodes.

Before you configure CFS

1. Make sure you have an established Cluster and running properly.
2. Make sure these packages are installed on all nodes:

VRTScavf Veritas cfs and cvm agents by Symantec
VRTSglm Veritas LOCK MGR by Symantec

3. Make sure you have a license installed for Veritas CFS on all nodes.
4. Make sure vxfencing driver is active on all nodes (even if it is in disabled mode).

Check the status of the cluster

Here are some ways to check the status of your cluster. On these examples, CVM/CFS are not configured yet.



# cfscluster status
 NODE         CLUSTER MANAGER STATE            CVM STATE
serverA        running                        not-running                   
serverB        running                        not-running                   
serverC        running                        not-running                   
serverD        running                        not-running                   

 Error: V-35-41: Cluster not configured for data sharing application

# vxdctl -c mode
mode: enabled: cluster inactive

# /etc/vx/bin/vxclustadm nidmap
Out of cluster: No mapping information available

# /etc/vx/bin/vxclustadm -v nodestate
state: out of cluster

# hastatus -sum

-- SYSTEM STATE
-- System               State                Frozen             

A  serverA             RUNNING              0                   
A  serverB             RUNNING              0                   
A  serverC             RUNNING              0                   
A  serverD             RUNNING              0

Configure the cluster for CFS

During
configuration, veritas will pick up all information that is set on your
cluster configuration. And will activate CVM on all the nodes.

# cfscluster config

       The cluster configuration information as read from cluster
       configuration file is as follows.
               Cluster : MyCluster
               Nodes   : serverA serverB serverC serverD


       You will now be prompted to enter the information pertaining
       to the cluster and the individual nodes.

       Specify whether you would like to use GAB messaging or TCP/UDP
       messaging. If you choose gab messaging then you will not have
       to configure IP addresses. Otherwise you will have to provide
       IP addresses for all the nodes in the cluster.
 
       ------- Following is the summary of the information: ------
               Cluster         : MyCluster
               Nodes           : serverA serverB serverC serverD
               Transport       : gab
       -----------------------------------------------------------


       Waiting for the new configuration to be added.

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

       Cluster File System Configuration is in progress...
       cfscluster: CFS Cluster Configured Successfully
Check the status of the cluster

Now let's check the status of the cluster. And notice that there is now a new service group cvm. CVM is required to be online before we can bring up any clustered filesystem on the nodes.

# cfscluster status

 Node             :  serverA
 Cluster Manager  :  running
 CVM state        :  running
 No mount point registered with cluster configuration


 Node             :  serverB
 Cluster Manager  :  running
 CVM state        :  running
 No mount point registered with cluster configuration


 Node             :  serverC
 Cluster Manager  :  running
 CVM state        :  running
 No mount point registered with cluster configuration


 Node             :  serverD
 Cluster Manager  :  running
 CVM state        :  running
 No mount point registered with cluster configuration

# vxdctl -c mode
mode: enabled: cluster active - MASTER
master: serverA

# /etc/vx/bin/vxclustadm nidmap
Name                             CVM Nid    CM Nid     State
serverA                         0          0          Joined: Master
serverB                         1          1          Joined: Slave
serverC                         2          2          Joined: Slave
serverD                         3          3          Joined: Slave

# /etc/vx/bin/vxclustadm -v nodestate
state: cluster member
       nodeId=0
       masterId=1
       neighborId=1
       members=0xf
       joiners=0x0
       leavers=0x0
       reconfig_seqnum=0xf0a810
       vxfen=off

# hastatus -sum

-- SYSTEM STATE
-- System               State                Frozen             

A  serverA             RUNNING              0                   
A  serverB             RUNNING              0                   
A  serverC             RUNNING              0                   
A  serverD             RUNNING              0                   

-- GROUP STATE
-- Group           System               Probed     AutoDisabled    State         

B  cvm             serverA             Y          N               ONLINE        
B  cvm             serverB             Y          N               ONLINE        
B  cvm             serverC             Y          N               ONLINE        
B  cvm             serverD             Y          N               ONLINE

How to find a file or files using maximum space on Unix Systems like Solaris , Linux, HP-UX or AIX?

Example For Finding out the file bigger than 100MB
find /var -xdev -size +100000000c -exec ls -lh {} \;

-xdev is being used so that you can find out the file in the filesystem where /var is located. Many times we have other filesystems as well part of /var like /var/crash(which is mounted from a another Filesystem) . 

So, my advice is to always xdev to ensure that you are searching in the right directory.

Tuesday, September 17, 2013

HP Service Guard Basic Commands and Important Files

1. How to check the Service Guard Cluster Version?
root@nodeA:/# cmversion
A.11.17.00

2.  How to search for the existing SG clusters in the network?
cmquerycl to search existing Serviceguard clusters in the Network.

root@nodeA:/# cmquerycl -v
Looking for Serviceguard nodes ... Done
Cluster Name Node Name Version Status
Swrecovery
nodeA up to date
nodeB up to date

3. How to check the status of the cluster?
root@nodeA:/etc/cmcluster/sw# cmviewcl -v
CLUSTER STATUS
swrecovery up
NODE STATUS STATE
nodeA up running
nodeB up running

4. How to ensure that the Cluster will start at boot time?
Update: /etc/rc.config.d/cmcluster
AUTOSTART_CMCLD =1 

5. How to stop the cluster on both nodes?
#cmhaltcl -v

6. How to start the node in the cluster?
cmrunnode nodeB

7. How to halt a node in the cluster?
cmhaltnode -v nodeB

8. How to start and halt a package?
cmrunpkg -v sw-pkg
cmhaltpkg -v sw-pkg

Few more details.
# cmmodpkg –e pkg1 Globally enable switching for a package.
# cmmodpkg –d pkg1 Globally disable switching for a package.
# cmmodpkg –n nodeA –e pkg1 Enable a node to run a package.
# cmmodpkg –n nodeA –d pkg1 Disable a node to run a package


Wednesday, June 12, 2013

Setting no expiry of the accounts on solaris

To turn off password aging and setting the user account to non-expiry


passwd -x -1 username

Tuesday, May 28, 2013

HP-UX - Find out the serial number of the server

Itanium
#machinfo

PA-RISC
#getconf MACHINE_SERIAL

HP-UX - How to check the kernel parameter utilization?

Lets assume we are checking the utilization of shmmax
#kcusage
Tunable Usage / Setting 
============================================= 
dbc_max_pct 5 / 50 
maxdsiz 37666816 / 1073741824 
maxdsiz_64bit 7258112 / 4294967296 
maxfiles_lim 56 / 8192 
maxssiz 1179648 / 8388608 
maxssiz_64bit 20480 / 268435456 
maxtsiz 421888 / 100663296 
maxtsiz_64bit 237568 / 1073741824 
maxuprc 0 / 256 
max_thread_proc 57 / 256 
msgmni 2 / 512 
msgseg 0 / 8192 
msgtql 0 / 1024 
nfile 586 / 65536 
nflocks 20 / 4096 
ninode 653 / 4880 
nkthread 484 / 8416 
nproc 150 / 4200 
npty 0 / 60 
nstrpty 0 / 60 
nstrtel 0 / 60 
semmni 23 / 2048 
semmns 25 / 8192 
shmmax 17906400 / 68719476736  --- Utilization is 17906400 of 68719476736
shmmni 7 / 400 

HP-UX - How to set the kernel parameter?

Lets assume that we need to change the kernel parameter shmmax.

Kctune is used to change the kernel parameter.
kctune shmmax=4398046511104

Tuesday, May 21, 2013

Solaris - Find out the serial number of the server?


How to find out the serial number of the server by running prtdiag command?
root@Server1:~ # prtdiag -v > /var/tmp/prtdiag.out; sed -n '/^Ch/{p;n;n;p;}' /var/tmp/prtdiag.out; rm /var/tmp/prtdiag.out
Chassis Serial Number
0000XXX000

Monday, May 20, 2013

Redhat- How to find the Hardware Model on linux ?


Dmidecode reports information about your system's hardware as described in your system BIOS according to the SMBIOS/DMI standard

#dmidecode

This information typically includes system manufacturer, model name, serial number, BIOS version, asset tag as well as a lot of other details of varying level of interest and reliability depending on the manufacturer. This will often include usage status for the CPU sockets, expansion slots (e.g. AGP, PCI, ISA) and memory module slots, and the list of I/O ports (e.g. serial, parallel, USB).

Aix -How to find RAM on the server?


The bootinfo command uses the device configuration databases in information searches.
Just type the following command as the root user:
#bootinfo -r
It will displays amount of real memory in kilobytes. bootinfo command may not be available in latest AIX UNIX version, try following command:

#lsattr -El sys0 | grep realmem

Aix- How to check if kernel is 32bit or 64 bit?

KERNEL_BITMODE

# getconf KERNEL_BITMODE
64

HARDWARE_BITMODE

# getconf HARDWARE_BITMODE
64

Redhat Linux - How to for GFS Filesystems

How-to for GFS Filesystems

You can use either of the following formats to create a clustered GFS file system:
#gfs_mkfs -p lock_dlm -t ClusterName:FSName -j Number BlockDevice
#mkfs -t gfs -p lock_dlm -t LockTableName -j NumberJournals BlockDevice

You can use either of the following formats to create a local GFS file system:
#gfs_mkfs -p lock_nolock -j NumberJournals BlockDevice
#mkfs -t gfs -p lock_nolock -j NumberJournals BlockDevice

At each node, mount the GFS file systems. For more information about mounting a GFS file
Command usage:
mount BlockDevice MountPoint
mount -o acl BlockDevice MountPoint
The -o aclmount option allows manipulating file ACLs. If a file system is mounted without the -o acl mount option, users are allowed to view ACLs (with getfacl), but are not allowed to set them (with setfacl).

Formatting the logical Volume
#gfs_mkfs -p lock_dlm -t alpha:mydata1 -j 8 /dev/vg01/lvol0

The gfs_jadd command must be run on mounted file system, but it only needs to be run on one node in the cluster. All the other nodes sense that the expansion has occurred.

#lvextend -L +80G /dev/vgcl_gfs_san_eos/vol01_lv
#gfs_grow -v /dev/vgcl_gfs_san_eos/vol01_lv /db/eospr1/vol01

Aix -How to find processor Type on IBM Power Systems

Find the type of processor on AIX

Method 1-Using lsattr

#lsattr -El proc0|grep type
type        PowerPC_POWER6 Processor type        False

# lsattr -El proc0|grep type
type        PowerPC_POWER7 Processor type        False


Method 2- Using lscfg

# lscfg -vpl proc0 |grep Name  Name:  PowerPC,POWER5

Sunday, May 19, 2013

HP-UX 11.23 mount: cdfs : Invalid argument" Error While Mounting a CD-ROM

While trying to mount the DVD on HP-UX 11.23 , we got the below error.

#mount /dev/dsk/c0t0d0 /cdrom  
mount: cannot access -specific mount command


#mount -F cdfs -o cdcase /dev/dsk/c0t0d0 /cdrom  
mount: cdfs : Invalid argument  



The DVD drive is claimed and online in the ioscan output.Other DVDs have been tried as well, but with the same results.

To resolve the issue, the cdfs kernel module was checked and found that the module was not loaded.

#kcmodule -B cdfs=loaded   
After loading the cdfs kernel module .The DVD was successfully mounted.

HP-UX - Timeout called with negative time" error in dmesg and syslog.log file


Error Message in dmesg and syslog.log on HP-UX 11.11


Timeout called with negative time.  function == 0x8647F8, arg == 0x41EC1C00, ticks == 0xF7E66F3E,  flags == 0x0    
Timeout called with negative time.  function == 0x8647F8, arg == 0x41EC1C00, ticks == 0xF7E66F3D,  flags == 0x0    


This normally happens due to the old mpt driver on the Operating system.

In my case the issue was resolved after upgrading the MPT driver. This issue is fixed with the B.11.11.0701. version of MPT driver.

Unlock a user account on Aix


Run the below commands to unlock the user account on Aix

#chsec -f  /etc/security/lastlog -a "unsuccessful_login_count=0" -userid
#chuser "account_locked=false" -userid

Reset Root Password on Linux (RHEL, Ubuntu)

Try and enter the run-level 1, if you already know it then follow the step 4 below.

1. Stop the system at the Grub Screen.
2. Use the arrows to select the boot entry you want to modify,  press e to edit the entry.
3. Use the arrows to go to kernel line , press e to edit this entry , at the end of the line add the word single

Press ESC to go back to the parent menu, press b to boot this kernel

4. Run passwd command to reset the password.

Redhat Linux 5,6 - How to Scan and configure new Luns from Storage?


SCAN AND CONFIGURE NEW LUNS on RHEL 5 and RHEL 6

If you have 4 fc ports on which you have assigned the storage luns.
Then you need to run the below for loop to scan the LUNS on all the 4 ports.

for i in host1 host2 host3 host0
> do
> echo "1" > /sys/class/fc_host/$i/issue_lip
> echo "- - -" > /sys/class/scsi_host/$i/scan
> done

After this you can run fdisk -l or multipath -ll to see the new luns. Once the new luns are visible , you can use the luns using LVM or raw paritioning.

IF you want to rescan the disk lun then you can run the below command.


echo 1 > /sys/block/sda/device/rescan
echo 1 > /sys/block/sdb/device/rescan
echo 1 > /sys/block/sdc/device/rescan
echo 1 > /sys/block/sdd/device/rescan

How to freeze and unfreeze the Service Group (SG) on Veritas Cluster Server (VCS)


Freeze the Service Group test_sg
#hagrp -freeze test_sg


Unfreeze the Service Group test_sg
#hagrp -unfreeze test_sg


Ignite-UX make_tape_recovery Fails with list_expander Error

While running the make_tape_recovery, you could get the below error.

#make_tape_recovery -x inc_entire=vg00 -a /dev/rmt/0mn command, the following error occurs:

ERROR: The list_expander command failed. This could be due to a problem with  the -x options specified - Check the existence of the included   device(s)

There could be a issue with filesystem which might be mentioned in the /etc/fstab by not mounted and due to which this error occurs.


Either mount the filesystem which is mentioned in the fstab or comment out the entry of the filesystem in fstab.

I fixed the issue in my environment as the issue was with a device listed in vg00 . It turned out that the /etc/fstab had a file system mounting to a device in vg00 that no longer existed.
Removing the entry in the /etc/fstab file resolved the issue.

Best of Luck!

Error Message: "Not a typewriter"


Information

Some of the most confusing error messages in HP-UX are the following:
Not a typewriter and ENOTTY
These error messages are not only limited to HP-UX, but are also common UNIX messages. In some systems, the errors may appear as the following:
Inappropriate ioctl for device and Not a teletype

Details

This messages are usually not the result of an error related to the I/O device. If a library routine fails for some reason unrelated to a system call, and a programmer calls the normal error reporting routine perror() on every failure, the leftover ENOTTY will result in an inappropriate Not a typewriter error message. So for Telnet and SSH cases, if a user name is not found in the password file, this error may occur.
This error is also related to terminal settings (Old UNIX systems use the term typewriter and of course, it can be said that this error message is obsolete). It means that the program attempts to perform some I/O operation that would be legal on a terminal, and returns with an error. The errors may be related to the terminal emulators if a remote connection is attempted.
In conclusion, to understand the exact issue, other symptoms and error messages need to be investigated.

Solaris 10 -Troubleshooting HBA Card or LUN Issue

Run the command fcinfo hba-port to get the WWPN and WWNN , Contact Storage Administrator to help you further with the PN and NN number, if the HBA port status is not showing as on-line.

# fcinfo hba-port
HBA Port WWN: 21000003ba9b1739   --WWPN
        OS Device Name: /dev/cfg/c1
        Manufacturer: QLogic Corp.
        Model: 2200
        Firmware Version: 02.01.145
        FCode/BIOS Version: ISP2200 FC-AL Host Adapter Driver: 1.15 04/03/22
        Serial Number: not available
        Driver Name: qlc
        Driver Version: 20110321-3.05
        Type: L-port
        State: online
        Supported Speeds: 1Gb
        Current Speed: 1Gb
        Node WWN: 20000003ba9b1739  --WWNN
HBA Port WWN: 210000e08b80eee8 --WWPN
        OS Device Name: /dev/cfg/c2
        Manufacturer: QLogic Corp.
        Model: 375-3102-xx
        Firmware Version: 03.03.28
        FCode/BIOS Version:  fcode: 1.13;
        Serial Number: not available
        Driver Name: qlc
        Driver Version: 20110321-3.05
        Type: unknown
        State: offline
        Supported Speeds: 1Gb 2Gb
        Current Speed: not established
        Node WWN: 200000e08b80eee8 ---WWNN
HBA Port WWN: 210000e08b81e0d3  --WWPN
        OS Device Name: /dev/cfg/c3
        Manufacturer: QLogic Corp.
        Model: 375-3102-xx
        Firmware Version: 03.03.28
        FCode/BIOS Version:  fcode: 1.13;
        Serial Number: not available
        Driver Name: qlc
        Driver Version: 20110321-3.05
        Type: unknown
        State: offline
        Supported Speeds: 1Gb 2Gb
        Current Speed: not established
        Node WWN: 200000e08b81e0d3 --WWPN

Error fsadm: You don't have a license to run this program -Online JFS , Vxfs filesystem

How to resolve the error "fsadm: You don't have a license to run this program"  while extending the Veritas filesystem(vxfs)?

While you are extending your file-system, you have got the below error.
# fsadm -F vxfs -b 138500M /u01 
ERROR: fsadm: You don't have a license to run this program


1. Check weather the ONLINEJFS software has been installed on  HP-UX.

#swlist -l bundle |grep -i jfs   
 B3929CA               B.11.11        HP OnLineJFS    
 B3929DA               3.5-ga15-03    HP OnLineJFS 3.5  
2. Check the license type of OnlineJFS/VxFS installed on the server.
# vxlicrep
VERITAS License Manager vxlicrep utility version 3.00.007  
Copyright (C) VERITAS Software Corp 2002. All Rights reserved.  
Creating a report on all VERITAS products installed on this system   
-----------------***********************-----------------      
License Key                         = 012345678901234567890123 
Product Name                        = VERITAS File System     License Type                                = PERMANENT 
Site License                        = YES     
Features :=     
HP_OnlineJFS                        = Enabled 

3. Check the available VxFS and VxVM licenses and features on the system.
# vxlicense -p    
 vrts:vxlicense: INFO: Feature name: HP_OnlineJFS [50] 
 vrts:vxlicense: INFO: Number of licenses: 1 (non-floating)  vrts:vxlicense:   INFO: Expiration date: No expiration date 
 vrts:vxlicense: INFO: Release Level: 22  
vrts:vxlicense: INFO: Machine Class: All  
vrts:vxlicense: INFO: Site ID: 0   
4. Check if the OnLineJFS features were enabled and if you the following output.

 # vxenablef
  The system is not licensed.
Resolution:
Enabled the full functionality of OnlineJFS/VxFS in the kernel using the following command
# vxenablef –a 
After performing the above command, try to extend the file system through “fsadm” and it will work fine.


Veritas Cluster Server (VCS) - Adding a user account

Many faced problems while adding a user account to the Veritas Cluster Server online.

Here is what you need to do.


Make the configuration read-write
#haconf -makerw

Add the user admin1
#hauser -add admin1

Add the user admin1 to the Administrators Group
#haclus -modify Administrators -add admin1

Then again make the VCS configuration read-only.(It is always important to make it readonly)
#haconf -makero

Solaris 10 - Troubleshoot NIC or Network link failure

There could be few network components which can cause a network failure.

1. NIC card or a Network Card
2. The Network Cable
3. The connected switch

Lets try to understand how we can troubleshoot these issues.

First check if the IP Address is already assigned to the network interface by running the ifconfig command.

1. In my case, we  have interface ce0 which already has a IP assigned and the status is showing as up.

# ifconfig -a
lo0: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> mtu 8232 index 1
        inet 127.0.0.1 netmask ff000000
ce0: flags=1000803<UP,BROADCAST,MULTICAST,IPv4> mtu 1500 index 2
        inet 10.192.1.10netmask ffffff00 broadcast 10.192.XX.255
        ether 0:3:ba:9b:17:3a
ce1: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 3
        inet 192.168.XX.XX netmask fffffe00 broadcast 192.168.XX.255
        ether 0:3:ba:9b:17:39

Though the interface is showing as up ,now lets check the link status.

# dladm show-dev
ce0             link: down      speed: 0     Mbps       duplex: unknown
ce1             link: up        speed: 1000  Mbps       duplex: full
#

Now the link is showing as down, now lets try to find out the failure

Action Plan to Eliminate components
a. First change the cable to see if the cable has a problem -Eliminate cable
b. Check from the network team if there is a issue with the switch. -Eliminate switch
c. If both the above components are good then get the network card changed.


Redhat Linux -Troubleshooting SAN Lun unavailability and HBA Issue


First , we will try to understand the Scenario  Suppose the LUN is coming from a storage and it is being used on Redhat Linux in LVM. Now when you run df -k, you see errors.

#df -k - This gives an error on the filesystem

Run pvs  -This will give us the details of the disk.
Look at the left column of PV, this will give you the details disks present in the volume group vgora

#pvs

  PV              VG     Fmt  Attr PSize   PFree
  /dev/emcpoweray vgora  lvm2 a--  101.15G    0
  /dev/emcpowerx1 vgora  lvm2 a--  139.70G 9.70G
  /dev/sda2       vgroot lvm2 a--   31.97G    0

Check the details of the HBA
a. HBA Port state
root@test1: # cat /sys/class/fc_host/host1/port_state
Online

b. HBA speed 
root@test1: # cat /sys/class/fc_host/host1/speed
4 Gbit

c.Port Name -WWPN
root@test1: # cat /sys/class/fc_host/host1/port_name
0x20010024e859e129

d.Node Name -WWNN
root@test1: # cat /sys/class/fc_host/host1/node_name
0x20000024e859e129

Provide the required info to the Storage team and they may help you to resolve the problem.

Configuring NFS on AIX

NFS services are being used for sharing the files across the Unix platform.

1. Update /etc/exports
directory     -option[,option]

Eg:

/home -root=ballet,access=ballet

2. Start the nfs services

startrc -s nfs

3. Check the status of the NFS services
lssrc -g nfs