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.