Friday, September 1, 2017

How to clear the disk errors without reboot in VxVM 


There are two procedures to do this :

Procedure 1 (setting up mirror ):

# vxassist -g rootdg mirror swapvol2 rootdg03
# vxassist -g rootdg remove mirror swapvol2 !rootdg02

verify results by using "vxprint -thg rootdg"
Please make sure that swapvol2 is now located on disk c6t8d0

OR

Procedure 2 (Evacuate rootdg2) :

# /etc/vx/bin/vxevac -g rootdg rootdg02 rootdg03

verify results by using "vxprint -thg rootdg"
Please make sure that swapvol2 is now located on disk c6t8d0

Note :If any one of the above procedure works then downtime is not required, else need to replace and add the new disk. 
How to format and create a LUN on FC60 - HP-Ux


1. Unmount the file system which are from the FC60 LUNS.

     # umount  /archive

 This is the FS which is created from the LUN 0.

2. De-activate the VG containing the FC60 LUNS

     # vgchange -a n /vg01

3. Check the LUN status and ID's

    # amdsp -a IDMP003_FC60  

4. Delete LUN 2 and assign the disks to unassigned group.

    # amdsp -D 2 IDMP003_FC60

    Delete LUN 0 and assign the disks to unassigned group.

    # amdsp -D 0 IDMP003_FC60

5. Remove the Hot spare disk

    # ammgr -d 3:4 IDMP003_FC60  

6. Verify the Array status.

    # amdsp -a IDMP003_FC60

7. Create a LUN X (X can be 0,1,2..) with RAID 1 on the array

    # amcfg -L A:2 -d  1:0,3:0 -r 1  IDMP003_FC60

8. Verify whether the LUN is created with proper disks selected.

    # amdsp -a  IDMP003_FC60  

9. Verify that the LUN is available for system use with ioscan.

========================================================================
// Follow the below mirroring procedure for root VG:
========================================================================

In this example, the disk to be used as an additional mirror copy will be /dev/dsk/c0t5d0,
which will include the boot, root, and the swap logical volumes.

The primary mirror copy will be on /dev/dsk/c0t6d0.

1. Add a bootable LVM disk. Create a physical volume using pvcreate with the -B option.

# pvcreate -B /dev/rdsk/c0t5d0

2. Add the physical volume to the existing root volume group with vgextend:

# vgextend /dev/vg00 /dev/dsk/c0t5d0

3. Use mkboot to place boot utilities in the boot area:

# mkboot -l /dev/rdsk/c0t5d0

Use mkboot to add an AUTO file in boot LIF area:

# mkboot -a "hpux" /dev/rdsk/c0t5d0

Or, use the -lq option to allow the system to boot in the event that one of the disks is unavailable, resulting in a loss of quorum.

# mkboot -a "hpux -lq" /dev/rdsk/c0t5d0

NOTE: Use the -lq option when the root volume group contains only 2 disks.
      If more than 2 disks are in the root volume group, the -lq option is not needed as quorum will be maintained even if 1 disk fails.

Check the contents of the AUTO file with

# lifcp /dev/rdsk/c0t5d0:AUTO -

Alternatively, one could set the alternate boot path variable according to for example

# setboot -a 8/0/19/0.5.0

The hardware address of the disk that will become the mirror disk can be determined with 'ioscan -fnC disk'. To check, use setboot without any arguments.

If desired, activate autosearch and autoboot by

# setboot -s on -b on

4. Use pvdisplay -v to note the sequence of the logical volumes on the primary disk.

# pvdisplay -v /dev/dsk/c0t6d0

NOTE: In the following, the standard sequence lvol1, lvol2, lvol3, and so forth, is assumed.

Create mirror copies of the boot logical volume, primary swap logical volume, root logical volume,
and other logical volumes as needed, in the correct sequence

# lvextend -m 1 /dev/vg00/lvol1 /dev/dsk/c0t5d0
# lvextend -m 1 /dev/vg00/lvol2 /dev/dsk/c0t5d0
# lvextend -m 1 /dev/vg00/lvol3 /dev/dsk/c0t5d0

// Perform the lvextend on rest all of the logical volumes.
Use pvdisplay -v to check the correct sequence of the logical volumes on the mirror disk.

# pvdisplay -v /dev/dsk/c0t5d0

5. Update all physical volumes in the volume group so that the logical volume become the root, boot, primary swap, or a dump volume when the system is next booted:

# lvlnboot -r /dev/vg00/lvol1 /dev/vg00
# lvlnboot -s /dev/vg00/lvol2 /dev/vg00
# lvlnboot -d /dev/vg00/lvol2 /dev/vg00

Check with :

# lvlnboot -v

Both disks must be listed for root, boot and swap definitions.

NOTE: Without the lvlnboot sequence the system will not be able to boot automatically if the primary disk fails.

In order to correct it then, the system will have to be booted into LVM maintenance mode.

6. In order to test the mirror configuration, shut down the system and boot from the mirror disk.

# shutdown -ry 0

The system will shut down and reboot. As the system starts to come back up, look for the message (system's output may vary):

TO INTERRUPT THE BOOT SEQUENCE, PRESS ...

Interrupt the boot sequence. This will display the Boot Admin display. At the boot_admin> prompt type:

bo Mirror_disk_hardware_address or bo alt
if the alternate boot device has been configured. The system will prompt to interact with IPL, answer 'no', and the system will boot from the mirror root disk.

Tuesday, August 29, 2017

Procedure for lupatch upgrade on Solaris

1) Copy the patch to any location, for instance /tmp/10_Recommended_CPU_2013-07

2) Stop the application

3) Edit passwd and group file to unhash entries

4) Create an alternate boot environment
     #lucreate -n zfs6BE

5) Verify the status
     #lustatus

6) Apply the patches to zfs6BE
    #luupgrade -n zfs6BE -t -s /tmp/10_Recommended_CPU_2013-07/patches/

7) Verify the BE status
     #lustatus

8) #ludelete <oldbename> //deletes oldbe and all zfs filesystem associated with it.
    #ludelete zfs3BE

9) Activate the new Boot environment
     #luactivate zfs6BE

10) Reboot
     #init 6

11) After booting , verify the patch version
      #uname -a
   

Wednesday, August 23, 2017

xhost:  unable to open display "localhost:0.0"


1) just run vncserver on root and oracle user.

# vncserver
New 'oracle.triples.com:1 (root)' desktop is oracle.triples.com:1
Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/oracle.triples.com:1.log
[root@oracle sysconfig]#

2) Make sure 2 processes are running ( with :1 and :2). One is from root and other one is from oracle user.

# ps -ef | grep -i vnc
root      1607     1  0 Aug21 ?        00:00:00 Xvnc :1 -desktop oracle.triples.com:1 (root) -httpd /usr/share/vnc/classes -auth /root/.Xauthority -geometry 1024x768 -depth 16 -rfbwait 30000 -rfbauth /root/.vnc/passwd -rfbport 5901 -pn
root      1646     1  0 Aug21 ?        00:00:00 vncconfig -iconic
root      7528 20562  0 08:58 pts/3    00:00:00 grep -i vnc
oracle   28023     1  0 Aug22 ?        00:00:00 Xvnc :2 -desktop oracle.triples.com:2 (oracle) -httpd /usr/share/vnc/classes -auth /home/oracle/.Xauthority -geometry 1024x768 -depth 16 -rfbwait 30000 -rfbauth /home/oracle/.vnc/passwd -rfbport 5902 -pn
oracle   28044     1  0 Aug22 ?        00:00:00 vncconfig -iconic

3) check if vnc service is running

oracle# service vncserver status
Xvnc is running...

4) Download vncviewer and run in Jumphost machine.

5) connect to oracle machine (while connecting use oracle1:1) where :1 is the process that is started with root

6) Now make sure xhost + is running (this should be from vnc viewer)

oracle#xhost +
access control disabled, clients can connect from any host



Friday, August 18, 2017

Syslog configuration in RHEL 6

1.  Log in to the server by putty and switch to “root” user

2.  Check which syslog is running as daemon by
    #ps -ef |grep syslog

3.  Copy the original config file by
    #cp /etc/rsyslog.conf /etc/rsyslog.org

4.  Edit the rsyslog.conf and add the destination like the following rows depending on the region the system belongs.
#########This is the destination for forwarding syslog messages######
############ DATACENTER AND LOAD BALANCER#######
*.*     @10.130.X.X:514
############################################################

5.  Restart the rsyslog service by
    #service rsyslog restart

6.  Check the rsyslog has been restarted with new PID and test with sending an event to the syslog
    #ps –ef |grep syslog
    #logger –p user.err “ A test for check”
    #tail /var/log/messages to see if the above test has arrived

Veritas Volume Manager Commands and Examples


display disk listings:

        # vxdisk list


display volume manager object listings

        # vxprint -ht


display free space in a disk group    

        # vxdg -g <diskgroup> free


       
list all volume manager tasks currently running on the system  

        # vxtask list



add a disk to Volume Manager (devicename = cXtXdX) (prompt driven)
               
        # vxdiskadd <devicename>



designate/remove a disk as a hot-relocation spare

        # vxedit set spare=on <diskname>

        # vxedit set spare=off <diskname>



rename a disk

        # vxedit rename <old_diskname> <new_diskname>



reserve/unreserve a disk (space won't be allocated unless specifically mentioned in vxassist)

        # vxedit set reserve=on <diskname>

        # vxedit set reserve=off <diskname>



take a disk offline (first remove the disk from its disk group) (devicename=cXtXdXs2)

        #vxdisk offline <devicename>
       


remove a disk

        (first, stop any applications associated with the volume,
         unmount the volume, stop the volume,
         if you need the data on the disk, move the volumes to another disk or back up volume)

        --removing the disk from its disk group:

        # vxdg -g <diskgroup> rmdisk <diskname>


        --remove the disk from volume manager control  (devicename=cXtXdXs2)

        # vxdisk rm <devicename>



display multipath information

        # vxdisk list <diskname>



create a disk group

        (see 'add a disk to volume manager - if the group does not exist, you will be prompted)



upgrade a disk group

        --list disk group version
       
        # vxdg list <diskgroup>


        --upgrade disk group to highest version currently running

        # vxdg upgrade <diskgroup>



destroy a disk group

        # vxdg destroy <diskgroup>



display disk group information

        # vxdg list

        # vxdg list <diskgroup>



move a disk group

        (stop any applications associated with all volumes in the disk group,
         unmount and stop all volumes in the disk group:

        --deport (disable local access) the disk group to be moved on first system

        # vxdg deport <diskgroup>


        --import (enable local access) the disk group and its disks from the second system

        # vxdg import <diskgroup>


        --start all volumes in the disk group on the second system

        # vxrecover -g <diskgroup> -sb

    or  # vxvol -g <diskgroup> startall



estimating maximum volume size (any_valid_type = raid5, stripe, mirror)

        # vxassist -g <diskgroup> maxsize layout=<any_valid_type>



create a concatenated volume (length examples = 15g, 15m)

        # vxassist -g <diskgroup> make <volumename> <length> <diskname> <diskname>



create a striped volume (length examples = 15g, 15m)

        # vxassist -g <diskgroup> make <volumename> <length> layout=stripe <diskname> \
                      <diskname>



create a raid5 volume (without logging) (length examples = 15g, 15m)

        # vxassist -g <diskgroup> make <volumename> <length> layout=raid5,nolog <diskname> \
          <diskname> <diskname> <diskname>



create a raid5 volume (with logging) (length examples = 15g, 15m)

        # vxassist -g <diskgroup> make <volumename> <length> layout=raid5,log <diskname> \
          <diskname> <diskname> <diskname>



create a mirrored volume (without DRL) (length examples = 15g, 15m)

        # vxassist -g <diskgroup> make <volumename> <length> layout=mirror,nolog <diskname> \
                      <diskname>



create a mirrored volume (with DRL) (length examples = 15g, 15m)

        # vxassist -g <diskgroup> make <volumename> <length> layout=mirror,log <diskname> \
                      <diskname>



mirror an existing volume

        # vxassist mirror <volumename> <diskname_of_disk_to_be_mirrored>



mirror all volumes within a disk group

        # vxmirror -g <diskgroup> -a



mirror the root (boot) disk

        EEPROM variable "use-nvramrc?" must be set to true
       
        # vxrootmir -v <medianame>



remove a mirror (use 'vxprint -g <diskgroup> -ht' to get plexname)

       
        # vxplex -o rm dis <plexname>



add a log to an existing volume

        # vxassist addlog <volumename> <diskname>



remove a log from an existing volume

        # vxassist remove log <volumename>



create a raid 0+1 volume (without DRL)

        # vxassist -g <diskgroup> make <volumename> <length> layout=mirror-stripe,nolog \
          nmirror=# nstripe=# <diskname> <diskname> <diskname>



create a raid 1+0 volume (without DRL)

        # vxassist -g <diskgroup> make <volumename> <length> layout=stripe-mirror,nolog \
          nmirror=# nstripe=# <diskname> <diskname> <diskname>



resize a volume

        # vxassist -g <diskgroup> growto <volumename> <length>

        # vxassist -g <diskgroup> growby <volumename> <length>

        # vxassist -g <diskgroup> shrinkto <volumename> <length>

        # vxassist -g <diskgroup> shrinkby <volumename> <length>



estimate how much a volume can grow

        # vxassist -g <diskgroup> maxgrow <volumename>



remove a volume

        (stop all applications associated with the volume,
         unmount volume (remove /etc/vfstab entry))

        --stop volume

        # vxvol stop <volumename>

        -- remove volume  (for raid 1+0, use 'rf-rm')

        # vxedit -r rm <volumename>              

     or # vxassist remove volume <volumename>



change the volume read policy

        # vxvol rdpol <policy> <volumename>

        # vxvol rdpol prefer <volumename> <preferred_plex_name>



change volume attributes

        # vxedit set <field>=<value> <volumename>



resize a filesystem  (ufs cannot be shrunk, only grown)

        # vxresize -g <diskgroup> <volumename> + <size>
        # vxresize -g <diskgroup> <volumename> - <size>

       

join subdisks  (must be in the order of offset on disks)

        # vxsd join <subdisk> <subdisk> <subdisk>     
NFS Stale Error 

When your NFS server is restarted, it is common for existing clients to report a "Stale NFS file handle" when accessing shared resources. This is a server issue, not a client issue as one may assume.

To resolve this, there are 2 options:

1) Refresh the server (Recommended)

The server needs to have a new registry of connected clients in the local exports table. To achieve this, just run the following command:

exportfs -f
This is described in the manual page as:

In 'new' mode, flush everything out of the kernels export table.
Any clients that are active will get new entries added by mountd when they make their next request.

2) Remount the client mount

Remounting the share can be achieved as follows:

#mount -o remount /home
The client may not let you do this if there are processes using the share. You will see an error like this:

umount.nfs: /home: device is busy
If this is the case, use fuser to see what is using the share like this:

#fuser -fvm /home/
The response may be similar to this:

root@server# fuser -fvm /home/
 USER PID ACCESS COMMAND
 /home/: root kernel mount /home root 1884 ..c.. tail

Check and kill the process and mount accordingly.



Increase size of volume in VxVM

1) Shutdown the Database or application running on the Server.

2) Unmount the respective filesystem using umount command

3) /etc/vx/bin/vxresize -g AB06F_DG -F vxfs lvol2 15g

4) Mount the file system back. 
Ignite backup commands on HP-Ux


1) make_net_recovery -Av -s 192.168.0.15 int_entire=vg00

2) go to ignite server 192.168.0.15 /var/opt/ignite/recovery/archives

3) check the old&new sizes and if the variation is less, delete the old file.

4) can run 7 to 8 servers in a single time.

Thursday, August 17, 2017

rpm erase fails on Linux

# rpm -e maui-3.3-alt1.1.x86_64
/var/tmp/rpm-tmp.FJADIo: line 1: /usr/sbin/preun_service: No such file or directory
error: %preun(maui-3.3-alt1.1.x86_64) scriptlet failed, exit status 127
error: maui-3.3-alt1.1.x86_64: erase failed

Tried with yum also, doesn't work.

# yum remove maui-3.3-alt1.1.x86_64
Loaded plugins: fastestmirror, langpacks
Resolving Dependencies
--> Running transaction check
---> Package maui.x86_64 0:3.3-alt1.1 will be erased
--> Finished Dependency Resolution
base/7/x86_64                                            | 3.6 kB     00:00
extras/7/x86_64                                          | 3.4 kB     00:00
updates/7/x86_64                                         | 3.4 kB     00:00

Dependencies Resolved

================================================================================
 Package        Arch             Version              Repository           Size
================================================================================
Removing:
 maui           x86_64           3.3-alt1.1           installed           3.0 M

Transaction Summary
================================================================================
Remove  1 Package

Installed size: 3.0 M
Is this ok [y/N]: y
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Warning: RPMDB altered outside of yum.
** Found 3 pre-existing rpmdb problem(s), 'yum check' output follows:
ipa-client-4.4.0-14.el7.centos.7.x86_64 has installed conflicts freeipa-client: ipa-client-4.4.0-14.el7.centos.7.x86_64
ipa-client-common-4.4.0-14.el7.centos.7.noarch has installed conflicts freeipa-client-common: ipa-client-common-4.4.0-14.el7.centos.7.noarch
ipa-common-4.4.0-14.el7.centos.7.noarch has installed conflicts freeipa-common: ipa-common-4.4.0-14.el7.centos.7.noarch
/var/tmp/rpm-tmp.ocZcPk: line 1: /usr/sbin/preun_service: No such file or directory
error: %preun(maui-3.3-alt1.1.x86_64) scriptlet failed, exit status 127
Error in PREUN scriptlet in rpm package maui-3.3-alt1.1.x86_64
  Verifying  : maui-3.3-alt1.1.x86_64                                       1/1

Failed:
  maui.x86_64 0:3.3-alt1.1

Complete

# rpm -qa | grep -i maui
maui-3.3-alt1.1.x86_64

 
It works with below command

# rpm -e maui-3.3-alt1.1.x86_64 --noscripts
warning: /var/spool/maui/maui-private.cfg saved as /var/spool/maui/maui-private.cfg.rpmsave
# rpm -qa | grep -i maui
#

Tuesday, August 15, 2017

yppasswd: can't find the master ypserver: Internal NIS error - Cent OS 7

1)  When trying to change the password from the NIS client, it throws the below error :

# yppasswd drbalep
yppasswd: can't find the master ypserver: Internal NIS error

# cat /etc/yp.conf
# /etc/yp.conf - ypbind configuration file
# Valid entries are
#
# domain NISDOMAIN server HOSTNAME
#       Use server HOSTNAME for the domain NISDOMAIN.
#
# domain NISDOMAIN broadcast
#       Use  broadcast  on  the local net for domain NISDOMAIN
#
# domain NISDOMAIN slp
#       Query local SLP server for ypserver supporting NISDOMAIN
#
# ypserver HOSTNAME
#       Use server HOSTNAME for the  local  domain.  The
#       IP-address of server must be listed in /etc/hosts.
#
# broadcast
#       If no server for the default domain is specified or
#       none of them is rechable, try a broadcast call to
#       find a server.
#
#domain abc server jkty.triples.com
domain abc broadcast

2) Change the entries in /etc/yp.conf

# vi /etc/yp.conf

domain abc server jkty.triples.com
#domain abc broadcast

3) Start and enable the ypbind service.

# systemctl start ypbind
# systemctl enable ypbind

# yppasswd drbalep
Changing NIS account information for drbalep on jkty.
Please enter root password:
Changing NIS password for drbalep on jkty.
Please enter new password:
Please retype new password:

The NIS password has been changed on jkty.




Failed to start NIS/YP...Unit ypbind service ent..


1) when trying to restart the ypbind service or whenever you reboot the server you get the above error message, then follow the below steps.

2) check /etc/yp.conf file entries

# broadcast
#       If no server for the default domain is specified or
#       none of them is rechable, try a broadcast call to
#       find a server.
#
#domain abc server hundi.triples.com
#domain abc server jkty.triples.com
domain abc broadcast

3) Change the entries in /etc/yp.conf file as it is trying to broadcast the NIS servers that are available. So, it is waiting to respond and nothing got reply.

Just point to the definite server to respond immediately.

#domain abc server hundi.triples.com
domain abc server jkty.triples.com
#domain abc broadcast

4) Restart the service

# systemctl start ypbind
# systemctl enable ypbind

#ypwhich
jkty.triples.com







Monday, August 14, 2017

No such file or directory while accessing NFS shared directory -- Cent OS 7


1) When trying to access NFS shared directory which are already exported fine, you get no such file or directory then check the firewall is enabled or not. In my case firewall is enabled.

# sestatus
SELinux status:                 enabled
SELinuxfs mount:                /sys/fs/selinux
SELinux root directory:         /etc/selinux
Loaded policy name:             targeted
Current mode:                   enforcing
Mode from config file:          enforcing
Policy MLS status:              enabled
Policy deny_unknown status:     allowed
Max kernel policy version:      28

]# cat /etc/sysconfig/selinux | grep -i selinux
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#     enforcing - SELinux security policy is enforced.
#     permissive - SELinux prints warnings instead of enforcing.
#     disabled - No SELinux policy is loaded.
SELINUX=enforcing -----
# SELINUXTYPE= can take one of three two values:
SELINUXTYPE=targeted

2) # cat /etc/sysconfig/selinux | grep -i selinux
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#     enforcing - SELinux security policy is enforced.
#     permissive - SELinux prints warnings instead of enforcing.
#     disabled - No SELinux policy is loaded.
SELINUX=disabled ----

3) Now reboot the server

# reboot








Exportfs error on Cent OS 7


Error : No host name given with /home (rw, no_root_squash) , suggest * (rw, no_root_squash) to avoid warning

Make the correct entries in the exportfs file like below :

# cat /etc/exports
/home  triple.fso.com(rw,no_root_squash)

# exportfs -a   ( Export the entries to kernel)






How to add new user without user id and group id 


1) useradd -m <username>

    useradd -m raj

2) passwd <username>

    passwd raj

Sunday, August 13, 2017

Procedure for collecting getsysinfo in HP-Ux

    Running getsysinfo script
      a. FTP the file to machine in Binary format.
      b. #chmod 755 getsysinfo.sh
      c. #sh getsysinfo.linux.sh

    Send across the outputs (/tmp/sysinfo.zip)

Run the script: HPUX

1. From your email, save the attached file to your PC e.g. \ directory and extract it.
2. ftp getsysinfo.sh to the server, any directory e.g. /tmp.

   Steps to ftp getsysinfo.sh from PC to server,
   a. In Start-Programs, open MS-DOS prompt, cd \
   b. ftp hostname, or ftp IP_address, login as root.
   c. ftp> cd /tmp
   d. ftp> bin
   e. ftp> put getsysinfo.sh
   f. ftp> bye

3. in the server, # cd /tmp
4. # chmod 755 getsysinfo.sh
5. # sh ./getsysinfo.sh ( run this command )
6. Please e-mail the out put file..


Logical Volume Management in HP-Ux


1) Reducing LV

fsadm -d -D -e -E /triples
fsadm -F vxfs -b 76800M /triples
lvreduce -L 76800M /dev/AR/lvol8

2) Extending LV

fsadm -d -D -e -E /triples1
lvextend -L 174080M /dev/AR/lvol4
fsadm -F vxfs -b 174080M /triples1

3) Creating LV

#lvcreate -L 10240M /dev/vg00
Logical volume "/dev/vg00/lvol10" has been successfully created with
character device "/dev/vg00/rlvol10".
Logical volume "/dev/vg00/lvol10" has been successfully extended.
Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.conf

#newfs -F vxfs /dev/vg00/rlvol10
version 6 layout
10485760 sectors, 10485760 blocks of size 1024, log size 16384 blocks
largefiles supported

Thursday, August 10, 2017

yppasswdd not running on nis master host on centos 7

1) Make sure you have the correct DNS entries and hosts file entries

# yppasswd
yppasswd: yppasswdd not running on NIS master host

2) Include Master server and slave server details in /etc/hosts file.

# cat /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
#::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
134.18.X.X  testclient.wing.com testclient
134.18.X.X  testslave.wing.com testslave
134.18.X.X  testmaster.wing.com  testmaster

3) Now it works

# yppasswd
Changing NIS account information for dumper on testserver.
Please enter old password:
Changing NIS password for dumper on testserver.
Please enter new password:






Wednesday, August 9, 2017

Changing the hostname on Centos 7
-------------------------------------------

1) To check the current hostname of the Server/VM

[root@dhana-testrhel7 ~]# hostname
dhana-testrhel7

[root@dhana-testrhel7 ~]# cat /etc/sysconfig/network
# Created by anaconda
HOSTNAME=cs-centos7vm-01.test.com
GATEWAY=192.168.10.1
[root@dhana-testrhel7 ~]#

[root@dhana-testrhel7 ~]# hostnamectl status
 Static hostname: dhana-testrhel7
 Icon name: computer-vm
 Chassis: vm
 Machine ID: f786930c19gd428fa8d40d328573bd67
 Boot ID: 0b0dfb1f19j54b44b90c2d94bb91c785
 Virtualization: vmware
 Operating System: Red Hat Enterprise Linux Server 7.3 (Maipo)
 CPE OS Name: cpe:/o:redhat:enterprise_linux:7.3:GA:server
 Kernel: Linux 3.10.0-514.el7.x86_64
 Architecture: x86-64
[root@dhana-testrhel7 ~]#

2) To change the hostname to cs-centos7vm-01

[root@dhana-testrhel7 ~]# hostnamectl set-hostname cs-centos7vm-01

[root@dhana-testrhel7 ~]# hostname
cs-centos7vm-01.test.com

[root@dhana-testrhel7 ~]# hostnamectl status
   Static hostname: cs-centos7vm-01.test.com
   Icon name: computer-vm
   Chassis: vm
   Machine ID: f786930c19gd428fa8d40d328573bd67
   Boot ID: 0b0dfb1f19j54b44b90c2d94bb91c785
   Virtualization: vmware
   Operating System: Red Hat Enterprise Linux Server 7.3 (Maipo)
   CPE OS Name: cpe:/o:redhat:enterprise_linux:7.3:GA:server
   Kernel: Linux 3.10.0-514.el7.x86_64
   Architecture: x86-64
[root@dhana-testrhel7 ~]#

3) Reboot the server to apply permanently.

[root@dhana-testrhel7 ~]# reboot

[root@cs-centos7vm-01 ~]# hostname
cs-centos7vm-01.test.com


Tuesday, August 1, 2017

How to make Veritas disk online 

1. Set the "remove" flag.

To be able to get the disks back in the disk-group, we need to be able to reinitialize them. To reinitialize the disks, disks have to be removed from the disk-group. To be able to remove disks with the failed flag on, the -k flag has to be used with the rmdisk command.

#vxdg -k -g rootdg rmdisk disk02

NOTE: "failed" flag will be replaced by "removed" flag.

2. Uninitialize the disk.

#cd /usr/lib/vxvm/bin
#./vxdiskunsetup -C c5t1d0

NOTE: Disk status changes from error state to offline state.


3. Initialize the disk.
#./vxdisksetup -I c5t1d0

NOTE: Disk status changes from offline status to online status.

4. "Add" the disk to the disk-group.

NOTE: To add the disks back in the disk-group, the adddisk command has to be used with the -k flag. With this command automatically the vxvm header information of the "failed" vxvm disks is updated with the existing disk-group information.

#vxdg -k -g rootdg adddisk disk02=c5t1d0

NOTE: The "removed" flag is set to off and as a result no more "removed was:" messages. The disks are also again part of there original disk-groups.


5. Re-synchronize the volumes.
#vxrecover -g rootdg -sb

Note:
-s start any disabled volumes
-b execute vxrecover in the background

6. Run vxtask list to check the progress.
Open SSL installation on IBM-AIX

1) Export the path of the compiler before installation.

# export PATH=/usr/vac/bin/:$PATH
# which xlc
/usr/vac/bin/xlc

# export cc=xlc

2) Configuring and compiling 

# ./config --prefix=/usr/local/ssl<version> --openssldir=/usr/local/ssl<version>
# make
# make install

3) To check the installed version of OpenSSL

# openssl -v 

Friday, July 21, 2017

Restoring data from Tape in EMC Networker

1. Start Networker User program on the Networker server or on the local machine that you want to do the restore to. On the local machine the program is called winworkr.exe and should be in the nsr/bin directory. You can create a desktop shortcut to the program but you need to add the -s sun1.rafil.com to the end of the executable line in order to point to the Networker server.

2. Click the Recover button.

3. Select the system you want to restore from..

4. Select the system you want to restore to..

5. Scroll through the appropriate directory hierarchy to select the files and/or directories that you want to restore. You must right click selections to mark them for restore.

6. The latest available versions will be selected. If you want an earlier version then go to the View menu, select change browse time and select the date that you want to go back to. You will need to re-select and re-mark the files and/or directories that you want restored.

7. After selection in either case also go to the View menu and select the Required Volumes item. This will tell you which tape or file device that the items are located on. In the case of older tapes that may not be in the library you may have to cross-reference the Legato-Tape-List spreadsheet to find out if it is a Monthly at Iron Mountain or if it is a weekly that will be in our safe. You may have to retrieve the tape; load it in the library, inventory the library and load the tape in the drive prior to the restore.

8. You may double check the version date by going to the Networker Administrator program; select the Volumes tab along the bottom and double-click the tape number or volume name. This should pop up a window that lists everything on the media. You may double check that the file and proper revision you are looking for is on that tape.

9. After that return to the Networker User program and select the Options menu and the Recover Options sub-menu item. Make the appropriate selections for renaming or overwriting the recovered files. You may also designate an alternate directory location if necessary.

10. Once all of that is completed then select the Start button and monitor the progress of the restore.

11. When the restore is complete, unload the tape from the drive, remove the tape from the library and return it to the proper location in the safe and/or Iron Mountain.

Wednesday, July 12, 2017

Manage HP Service Guard on Linux clusters

Note : The Linux clusters have two cluster nodes running RHEL or SLES with one or more Service guard packages, each with shared file systems and VIP.

1) Start the cluster.

To start the cluster, use the following command. This command will start each of the nodes in the cluster as well as the Data Protector package:
# cmruncl

2) Stop the cluster.

To shut down the cluster, use the following command:
# cmhaltcl –f
The -f option will shut down the package running on the cluster and then all the cluster nodes.

3) Check the cluster logs.

All the cluster events (except the specifics events for packages) are tracked in the system logs. You can check the latest cluster events by using the following command:
# tail -f /var/ log/messages

4) Check the cluster status.

Use the following commands to check the cluster status. Both cluster nodes should be up and running, the package should be running in the primary node and both AUTO_RUN and switching should be enabled in both nodes:
# cmviewcl
# cmviewcl –v
Upgrade Apache on HP-Ux server


Upgrading  Apache version to 2.2.15.x on all HP-Ux Servers.

1) Review this update.

See this update:
https://h20392.www2.hp.com/portal/swdepot/displayProductInfo.do?productNumber=HPUXWSATW326


2) Get the target Apache package.

Search for the following on this page and download it:
HP-UX Apache-based Web Server v.3.26 powered by Apache Tomcat Webmin
https://h20392.www2.hp.com/portal/swdepot/searchProducts.do


3) Upload this package to the target HPUX server.

Use winscp to upload this package to the target HPUX server.


4) Install this package.

a. Check the current Apache version on the HPUX server. Run this command:
      #swlist|grep Apache
b. Install this package. Run this command:
      #swinstall -s /root/Apache/HP-UX_11.31_HPUXWS22ATW-B326-11-31-64.depot \*
c. Check the Apache version after upgrade. Run this command:
      #swlist|grep Apache
d. Make sure now the Apache version is B.2.2.15.15.


5) Check the SMH running status.

Open the SMH link from IE and make sure it works properly.
Adding additional swap when primary is almost full 

Scenario : Primary swap lvol2 already exists in vg00.  Now  the space is occupied with all the processes. The better way to extend the size of the swap is add another disk and create secondary swap.

Note : Reboot is must to effect the changes.

Procedure :

1) Create physical volume on disk
     # pvcreate /dev/rdsk/c1t0d0

2) Create vg directory
     # mkdir /dev/vg14

3) Create the device file for your new character device
     # mknod /dev/vg14/group c 64 0x014000

NOTE: "vgnn: nn" is the vg number in decimal, "c" = character device, "64" = driver number, "0xnn0000: nn" is the vg number in hexadecimal)

4) Create the volume group which will contain your secondary swap.
     # vgcreate /dev/vg14 /dev/dsk/c1t0d0

5) Create the logical volume for your secondary swap
     # lvcreate -L 128 /dev/vg14

6)  Verify the physical volume
      # pvdisplay /dev/dsk/c1d0d0

7) Verify the physical volume assigned to volume group
     # vgdisplay -v

8) Verify the logical volume
     # lvdisplay /dev/vg14/lvol15

9) Use SAM to declare your new secondary swap or use the command line
     # swapon /dev/vg14/lvol15

10) Verify it has been added in "/etc/fstab" when using SAM, or add it manually when using the command line.

Extending the Logical Volume in Cluster Environment


1.   Stopping the Cluster group (MSGW2) which is using by Logical Volume /dev/mapper/MSGW2-lvol1.

                      Syntax: clusvcadm –d <Group >
                          
                         #Clusvcadm –d MSGW2 

2. Extending the Logical volume /dev/mapper/MSGW2-lvol1 size to 25 GB

     Syntax: lvextened  -L <size> <LV Name>




3. Resizing the Logical volume /dev/mapper/MSGW2-lvol1 file system upto 25 GB.

                       Syntax: resize2fs <Logical Volume Name> <Size>



4. Starting the Cluster Group (MSGW2).

Syntax: clusvcadm –e <Group >
                                             
 

Wednesday, July 5, 2017

FTP Configuration on Windows Server

For new ftp user creation please follow the below mentioned steps:

1) Go to start à Administrative tools à Internet Information Services (IIS) Manager

2)  Then Under FTP sites you can find the Default FTP side. Then go to properties.

3)  In that Directory Security under Deniedaccess you can find the existing IP addresses which are all available now.

4)  Then click on add tab enter the IP address of which you want to give access. Then click ok.

5) Then Right click on default web side click stop after few seconds click on start for restarting the ftp services.
How to download Skype on Linux machine


1) Make sure your server is connected to internet

2) To download the skype from internet

# wget  https://www.skype.com/en/download-skype/skype-for-linux/downloading-web/?type=weblinux-rpm

3) To install the rpm package for skype

# yum install skypeforlinux-64-alpha.rpm  
How to update the kernel value dynamically on Linux Server


 To update the kernel value dynamically

# sysctl -w kernel.domainname="Linuxtest.com"

we can check the value in below configuration file

# cat /etc/sysctl.conf


Wednesday, April 12, 2017

Procedure to replace the VxVM disks on HP-Ux

There are several ways to remove the disk, but to make sure that rootdg is not affected by any action, I would recommend to remove the disk from rootdg first, by using

# vxdg -g rootdg rmdisk rootdg02

# vxdisk offline c4t8d0

# vxdisk list
c4t8d0  should have status "offline"

Now change the disk (physical HW). After adding the disk run

# vxdctl enable

# vxdisk list
if c4t8d0 is still "offline"

# vxdisk online c4t8d0

# vxdisk list
disk should be in status "online invalid"  if not "vxconfigd -k -m enable"

Now you have to add the disk to rootdg again

# /etc/vx/bin/vxdisksetup -i c4t8d0

# vxdg -g rootdg addisk rootdg02=c4t8d0

Thursday, April 6, 2017

Upgrading the Firmware on Solaris 


1) From the System Console execute the following command to update the firmware


JUPI_ORD4_SC1:SC> flashupdate -f ftp://root:toor@10.3.5.45//114527-12 all scapp rtos

As part of this update, the system controller will automatically reboot.
RTOS will be upgraded automatically during the next boot.
ScApp will be upgraded automatically during the next boot.

After this update you must reboot each active domain that was upgraded.

Rebooting will interrupt any current operations.
This includes keyswitch changes, Solaris reboots
and all current connections.
Do you want to continue? [no] yes
Waiting for critical processes to finish.  This may take a while.
Critical processes have finished.

Retrieving: ftp://root:toor@10.3.5.45//114527-12/sgcpu.flash
Validating  ................... Done

Programming PROM /N0/SB0/FP0
Erasing     .................. Done
Programming .................. Done
Verifying   .................. Done

Programming PROM /N0/SB0/FP1
Erasing     .................. Done
Programming .................. Done
Verifying   .................. Done

Programming PROM /N0/SB1/FP0
Erasing     .................. Done
Programming .................. Done
Verifying   .................. Done

Programming PROM /N0/SB1/FP1
Erasing     .................. Done
Programming .................. Done
Verifying   .................. Done

Programming PROM /N0/SB2/FP0
Erasing     .................. Done
Programming .................. Done
Verifying   .................. Done

Programming PROM /N0/SB2/FP1
Erasing     .................. Done
Programming .................. Done
Verifying   .................. Done

Programming PROM /N0/SB3/FP0
Erasing     .................. Done
Programming .................. Done
Verifying   .................. Done

Programming PROM /N0/SB3/FP1
Erasing     .................. Done
Programming .................. Done
Verifying   .................. Done

Programming PROM /N0/SB4/FP0
Erasing     .................. Done
Programming .................. Done
Verifying   .................. Done

Programming PROM /N0/SB4/FP1
Erasing     .................. Done
Programming .................. Done
Verifying   .................. Done

Programming PROM /N0/SB5/FP0
Erasing     .................. Done
Programming .................. Done
Verifying   .................. Done

Programming PROM /N0/SB5/FP1
Erasing     .................. Done
Programming .................. Done
Verifying   .................. Done

Retrieving: ftp://root:toor@10.3.5.45//114527-12/sgpci.flash
Validating  ....... Done

Programming PROM /N0/IB6/FP0
Erasing     ...... Done
Programming ...... Done
Verifying   ...... Done

Programming PROM /N0/IB7/FP0
Erasing     ...... Done
Programming ...... Done
Verifying   ...... Done

Programming PROM /N0/IB8/FP0
Erasing     ...... Done
Programming ...... Done
Verifying   ...... Done

Programming PROM /N0/IB9/FP0
Erasing     ...... Done
Programming ...... Done
Verifying   ...... Done

Rebooting the SC to automatically complete the upgrade.

Rebooting. All network client connections closed. Reestablish any needed connections.
Connection closed by foreign host.

bash#

Saturday, April 1, 2017

Virtual to Virtual (V2V) Migration on Solaris 10

Source server:

1) Get the hostid of the virtual server
#zlogin eharsh001 hostid

2) Shutdown the server
#zoneadm -z eharsh001 halt

3) Take the copy of the server using CPIO and sent to NFS location
#cd /zones
#find eharsh001 -print | cpio -oP@ | gzip > /mnt/hpnfs/SOLARIS/eharsh001.cpio.gz




Destination server:

1)  Attach the zone
#zoneadm -z eharsh001 attach -a /mnt/hpnfs/SOLARIS/eharsh001.cpio.gz

2) Boot the zone
#zoneadm list -vc

#zoneadm -z eharsh001 boot
Configure ASM disks for Oracle DB on Linux

1) Get the LUNS for ASM disks and configure in below file :

#vi /etc/udev/rules.d/96-asmmultipath.rules
ACTION=="add|change", ENV{DM_UUID}=="mpath-360002ac0000000000000001400015b68", SYMLINK+="mapper/asm-data0001", GROUP="dba", OWNER="oragrid", MODE="0660"
ACTION=="add|change", ENV{DM_UUID}=="mpath-360002ac0000000000000001500015b68", SYMLINK+="mapper/asm-data0002", GROUP="dba", OWNER="oragrid", MODE="0660"
ACTION=="add|change", ENV{DM_UUID}=="mpath-360002ac0000000000000001600015b68", SYMLINK+="mapper/asm-data0003", GROUP="dba", OWNER="oragrid", MODE="0660"
ACTION=="add|change", ENV{DM_UUID}=="mpath-360002ac0000000000000001700015b68", SYMLINK+="mapper/asm-data0004", GROUP="dba", OWNER="oragrid", MODE="0660"
ACTION=="add|change", ENV{DM_UUID}=="mpath-360002ac0000000000000001800015b68", SYMLINK+="mapper/asm-arch0001", GROUP="dba", OWNER="oragrid", MODE="0660"
ACTION=="add|change", ENV{DM_UUID}=="mpath-360002ac0000000000000001900015b68", SYMLINK+="mapper/asm-arch0002", GROUP="dba", OWNER="oragrid", MODE="0660"
ACTION=="add|change", ENV{DM_UUID}=="mpath-360002ac0000000000000002a00015b68", SYMLINK+="mapper/asm-redo0001", GROUP="dba", OWNER="oragrid", MODE="0660"
ACTION=="add|change", ENV{DM_UUID}=="mpath-360002ac0000000000000002b00015b68", SYMLINK+="mapper/asm-redo0002", GROUP="dba", OWNER="oragrid", MODE="0660"

2)  Reload the rules using below command to update to kernel.
 # /sbin/udevadm control --reload-rules
 # /sbin/udevadm trigger --type=devices --action=change



Tuesday, March 21, 2017

Users not able to login after reboot/migration

This would happen if the account got locked after 14 failed logins.  Please remember that there might be many sessions/terminals for the same user which would make this happen. To resolve this please follow the below steps :

# pam_tally --user=orauser --reset           (or)

# pam_tally2 --user=orauser --reset   (Orauser is the username)

Sunday, March 19, 2017

To Recover VxVM configuration if VxVM has been reinstalled on HP-Ux


  # rm /etc/vx/reconfig.d/state.d/install-db

  # vxconfigd -m disable

  # vxiod set 10

  # vxdctl init

  # vxconfigd -k -m enable

  # vxdctl initdmp

  # nohup /etc/vx/bin/vxrelocd root & (VxVM ONLY)

  # nohup /usr/sbin/dgcfgdaemon &

  # vxprint        (to see group and volume states)

  # vxrecover      (to recover volumes - if needed)

  # vxrecover -s   (to start volumes -if needed)





How to create rootdg manually without using vxinstall  HP-Ux

Install VXVM

Start vxconfigd in disabled mode
#vxconfigd -m disable

Start some vxiod threads
#vxiod set 10

Initialize the /etc/vx/volboot file
#vxdctl init

Create rootdg
#vxdg init rootdg

Initialize a disk for VM
#vxdisk -f init <device> type=simple

Add the disk to rootdg
#vxdg -g rootdg adddisk disk01=<device>

To enable vxconfigd daemon
#vxconfigd -k -m enable

To restart subsystem
#vxdctl initdmp

To start vxrelocd daemon on full VXVM
#nohup /etc/vx/bin/vxrelocd root &

Make persistent across reboots
#rm /etc/vx/reconfig.d/state.d/install-db

To start dgcfgdaemon
#nohup /usr/sbin/dgcfgdaemon &

How to grow disk size in SDS Solaris

1) Identify the free disk, volume size and metadevice name.
   #df –h
   /dev/md/dsk/d19         27G   1.5G    25G     6%    /bkup

2) Increase the /bkup by 10GB
   # metattach  d19 c4t50060E80000000000000818D00000009d0

3) Verify the volume size
   #metastat d19

4) Increase the file system  /bkup by 10Gb
   #/usr/sbin/growfs  -M /bkup  /dev/md/rdsk/d19

5) Verify the file system
   #df-h
Disk Cloning on Solaris


1)  Install the Disk

2)  Primary Disk c0t0d0s2
     #dd if=/dev/dsk/c0t0d0s2 of=/dev/dsk/c0t1d0s2 bs=256k

3)  Verify the clone disk has clean filesystem
      #fsck -y /dev/rdsk/c0t1d0s0 

4)  Mount the clone disk
      #mount /dev/dsk/c0t1d0s0 /mnt

5)  Make the clone entry in /etc/vfstab
      #vi /a/etc/vfstab

6)  Boot the clone disk


System Security on Solaris 


1)  Latest patches  (Download from Oracle Site)
    # patchadd <patchname>

2)  Access to the System :
     /etc/default/login
      sshd.config

3)  Limited su (Super User) acess.

4)  Stop unnecessary service at run level
    /etc/inetd.config : finger, discard, daytime, charger, tftp etc

5)  Make the below changes in Kernel file
     vi /etc/system
     user_exec_stack=0
     user_exec_stack_log=0
     set noexec_user_stack=1
     set noexec_user_stack_log=1

6)  Make the changes in shadow file
      vi /etc/shadow
      system - put as LK
      uucp - Put as LK

7) Create the Entry for the logs
     vi /etc/default/cron  - Create a file if not there
     CRONLOG=YES
   

Thursday, March 16, 2017

Re-labeling a disk on Solaris 


1)   To redirect  PRTVTOC output to a file
     
      # prtvtoc /dev/dsk/c0t0d0s0 > /tmp/ab1

2)  To copy the contents of VTOC from one disk to other
     
      # fmthard -s /tmp/ab1 /dev/rdsk/c0t3d0s2

Wednesday, March 15, 2017

Setting Label for Boot Device on Linux



1) Create label for boot

# e2label /dev/sda1 boot

2) Ensure Label is set for boot device

# e2label /dev/sda1
# blkid | grep boot

3) Edit /etc/fstab for boot as below and save it

# vi /etc/fstab
LABEL=boot                 /boot                ext3       acl,user_xattr        1 2

4) Reboot the server

# reboot
Installing Traceroute package on Ubuntu Linux



1) Download the package and Install it
root@lnxvra001:~# sudo apt-get install traceroute
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
  traceroute
0 upgraded, 1 newly installed, 0 to remove and 126 not upgraded.
Need to get 57.0kB of archives.
After this operation, 205kB of additional disk space will be used.
0% [Connecting to us.archive.ubuntu.com]
0% [Connecting to us.archive.ubuntu.com]^C
root@lnxvra001:~#


2) Telnet does not work by default on Ubuntu Systems, Use the below command to check the ports on specific host/server.

root@lnxvra001:/var/tmp# nc -zv 10.254.51.27 1501
Connection to 10.254.51.27 1501 port [tcp/*] succeeded!
Configuring DHCP on Linux RHEL 7


1) Install the DHCP packages
#yum install dhcp*

2) To view the sample conf file
#vim /usr/share/doc/dhcp*/dhcpd.conf.example

3) Configuring DHCP  (get the domain and range details prior)
#vim /etc/dhcp/dhcpd.conf

      subnet 174.166.0.0  netmask 255.255.255.0 {
      range 174.166.0.10  174.166.0.90;
      option domain-name-servers ns1.shakthi.com;
      option domain-name    shakthi.com;
      option routers 174.166.0.1;
      default-lease-time  600;
      max-lease-time  7200;
}

4) Restart and enable the Service.
#systemctl restart httpd
#systemctl enable httpd


How to limit the bandwidth of Non-global zone on Solaris 10


1) To find the network interface and the speed

bash-3.2# dladm show-dev
e1000g0         link: up        speed: 1000  Mbps       duplex: full
e1000g1         link: up        speed: 1000  Mbps       duplex: full


2) The below command will set the bandwidth to 400 Mbps.

bash-3.2# dladm set-linkprop -p maxbw=400 zonename(replace with local zonename)




Tuning the File system on Solaris


1) # newfs -m 1 /dev/rdsk/c0t1d0s0
will create the file system, with the minfree value as 1%

2) bash-3.2# fstyp -v /dev/dsk/c0d0s7 | grep -i min   (% of space reserved for each slice)
minfree 1%      maxbpg  2048    opti   time

3) If 10%, we can change to 1% using below :

   To change the minfree value:
# tunefs -m 1 /dev/dsk/c0t2d0s0
minimum percentage of free space changes from 10% to 1%
How to check the server is physical or Virtual


Windows

From cmd prompt : Systeminfo

HP-Ux

/usr/sbin/swlist | grep "Virtual Partitions"

Solaris

bash-3.00# prtdiag -v | head -3
System Configuration: VMware, Inc. VMware Virtual Platform

Linux

#dmidecode -s system-product-name
#lspci | grep -i vmware