Friday, June 8, 2018

Rename Logical volume and mount point on SUSE Linux

Rename Logical volume and mount point on SUSE Linux.

while doing day today administration task on SUSE linux one day i got task to rename existing LV name and mount point.when i got this task first thought in my mind was ,is it possible while File system is in mounted state ??.so answer to this is NO.

Here is the scenario

Filesystem                              Type  Size      Used   Avail   Use%   Mounted on
/dev/mapper/vg01-lvopt_IBM ext3  9.8G      2.8G    6.5G  30%       /opt/IBM
Rename LV name from lvopt_IBM to lvopt_IBMNew and chnage mount point to /opt/IBMNew
solution:

1.First take fstab file backup using command
  cp /etc/fstab /etc/org_fstab

2.mkdir -p /opt/IBMNew   //make sure that same name directory not exist in mentioned path.

3.umount /opt/IBM

4.lvrename vg01  lvopt_IBM   lvopt_IBMNew

syntax: lvrename [vg name]  old_lv_name   new_lv_name

5.Change /etc/fstab entry with New LV and mount point name

old 

/dev/vg01/lvopt_IBM  /opt/IBM             ext3       defaults              1 2

New

/dev/vg01/lvopt_IBMNew  /opt/IBMNew            ext3       defaults              1 2

6. mount /opt/IBMNew  

Check mounted file system using command 

df -hT /opt/IBMNew
Filesystem                              Type  Size      Used   Avail   Use%   Mounted on
/dev/mapper/vg01-lvopt_IBMNew ext3  9.8G      2.8G    6.5G  30%       /opt/IBMNew

Thanks .


Thursday, June 7, 2018

Recovering AIX root password using NIM server

                   
Recovering AIX root password using NIM server
---------------------------------------------------------------------------------
When AIX admin came across situation where  demand is recovery of  AIX root password.
In this situation there are 2 method

1. AIX DVD
2. NIM SPOT  // Here SPOT must be at same AIX OS level.
SPOT is shared product object tree which is used to boot NIM client(AIX LPAR).

So here i will prefer 2 option.use convenient option according to environment.

NIM SPOT : generally used for network boot of NIM client.

steps to boot NIM client(AIX LPAR) in maintenance mode

1.On NIM server define client
2.Assign NIM spot resource to client.
3.Initialize operation on NIM client(AIX LPAR) using command smitty nim_mac_op and select maint_boot = enable a machine to boot in maintenance mode
4.Boot into SMS menu.

IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM 
IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM 
IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM 
IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM 
IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM 
IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM 
IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM 
IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM 
IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM 
IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM 
IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM 
IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM 
IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM 
IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM 

1 = SMS Menu 5 = Default Boot List 
8 = Open Firmware Prompt 6 = Stored Boot List 


Select option 1


5. Select option 4


Main Menu 

1. Select Language 
2. Password Utilities NOT available in LPAR mode 
3. View Error Log 
4. Setup Remote IPL (Initial Program Load) 
5. Change SCSI Settings 
6. Select Console NOT available in LPAR mode 
7. Select Boot Options 


6.On next screen admin should choose correct NIC adapter on which he set IP parameter for NIM server ,NIM client
(AIX LPAR) ,subnetmask and NIM client gateway.

Network Parameters 

1. IP Parameters 
2. Adapter Configuration 
3. Ping Test

enter value which suits network environment in your orgnization

IP Parameters 
1. Client IP Address [x.x.x.x ] 
2. Server IP Address [x.x.x.x
3. Gateway IP Address [x.x.x.x
4. Subnet Mask [x.x.x.x



7. Do ping test to verify  whether NIM server is reachable from NIM client.


Network Parameters 

1. IP Parameters 
2. Adapter Configuration 
3. Ping Test


8.Return to MAIN screen


Main Menu 

1. Select Language 
2. Setup Remote IPL (Initial Program Load) 
3. Change SCSI Settings 
4. Select Console 
5. Select Boot Options

9.Next screen


1. Select Install/Boot Device 


10. select Network


Select Device Type 
1. Diskette 
2. Tape 
3. CD/DVD 
4. IDE 
5. Hard Drive 
6. Network 
7. List all Devices 



11. On next screen admin need to choose correct adapter for network boot.

12. Select Normal boot mode.

1. Information 
2. Normal Mode Boot
3. Service Mode Boot 

13.On next screen choose YES option

Are you sure you want to exit System Management Services? 
1. Yes 
2. No 

14.On next screen choose "Access a Root Volume Group".


Type the number of your choice and press Enter. 


0 Continue 

88 Help ? 
 99 Previous Menu 


15. After choosing  0 option and it will list volume group details .



Option1 Access this volume group and start a shell before mounting file systems
Option 2 Allows you to perform file system maintenance on /, /usr, /tmp, and /var before mounting them
.
16.choose correct volume group.

17.

choose option 1 and press Enter. 

1) Access this Volume Group and start a shell   
2) Access this Volume Group and start a shell before mounting filesystems 



18. If AIX admin wants to edit file he must set TERM to terminal type.


If you intend to use SMIT or vi, set your terminal type in preparation for editing the file.

terminal types are lft, ibm3151, or vt100.

        TERM=
        export TERM
when admin want to edit any configuration file at that point export of TERM variable will come in picture.

19.
Execute command
 #passwd root   //To chnage root passwd

set password
20. sync;sync;sync;reboot     //To save changes

Second method ,which i will say traditional one is using AIX OS media DVD to recover or reset password .

other solution for resetting AIX server root password are like below
1.Find Jump server from where trust(pass-wordless configuration) configured to affected server and 
reset password of root
2. Sudo root access to other user than root ,so that user can execute root user command to reset password.


Thanks









Thursday, April 5, 2018

AIX connection timeout error

AIX connection timeout error on certain port have following  possibilities

1. service on the target  AIX host isn't running and therefore nothing is listening on the port.
2. firewall running somewhere in route is blocking connections to the port on AIX host .
3.check whether port is listening on AIX host.

command to check port status on AIX server

aixhost# netstat -Aan |grep port number

example

netstat -Aan |grep 22

what i do if i get connection timeout error on AIX host.

First thing i will do is check whether require service is running on AIX host,if that service is not running then check /etc/services file for required port and check that if that port is commented .
If that port is commented then remove comment from file and restart service and check again connection is succeeding or not.

on AIX host execute following command to check if port is open for connection.

#telnet [server-name] port-number

another issue may from firewall ,may be firewall blocking communication between AIX server and target client,so there must be new firewall rule need to enable this communication.check with network guy for firewall .


thanks !!!





Wednesday, April 4, 2018

How to manage print queue on AIX

 AIX admin  do following task while managing  print queue.
Print a job
Query the status of the job.
Cancel his print job.
Change priority of print job.
start or stop print queue.
start stop  ‘qdaemon’ on AIX.

Here i am discussing some command to check status of printer queue on AIX.
Check the status of the qdaemon process
 #ps -ef | grep qdaemon  //important process

If qdaemon process found in inoperative state then Start the qdaemon process by following command.
 #startsrc -s qdaemon
Stop the qdaemon
 #stopsrc -s qdaemon

***The qdaemon tracks both job requests and the resources(printer) necessary to complete the jobs.

There are diffrent commands to show status of printer queue on AIX.

example:

#lpstat
#enq -A
#lsallq

understand lpstat command output on AIX
======================================
#lpstat -p[queue name]
This command displays a list similar to the following:
Queue  Dev      Status      Job    Files      User      PP      %      Blks      CP      Rnk

Queue- Queue name
Dev- Queue device name
Status- Current status of the queue
Job -Job Number
Files- Name of file being printed
User- Aix user ID (owner of AIX print job)


PP- number of pages in print job
%- Percentage of AIX print job done.
Blks- Number of blocks the print job has broken
Cp- Number of copies
Rnk- Job rank in the print queue

qchk command example

#qchk -Pqueuename
shows status of a specific AIX queue
#qchk -A
Shows status of all AIX queues

There other command qadm in AIX to manage queue ,like printer queue UP and down.

example

#qadm -U[qname] Bring queue UP.
#qadm -D [qname] Bring queue DOWN.
#qadm -K [qname] Bring forcefully queue down.

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

Different state of printer on AIX

Ready - Printer on AIX OS ready to accept print jobs
Dev-Wait- Printer is not ready, not on-line, out of paper paper jam, or
Running- Printer on AIX OS printing
Down - Printer is not ready but will accept jobs

Troubleshooting Printer queue on AIX.

possible reason for facing issue on AIX printer queue.

1.check printer cable properly connected or not
2.make sure that printer is online.
3.printer is not out of paper.
4.qdaemon process is running on AIX server.if "qdaemon" process not running no printer will able do his print job.
5.make sure that job is not already printed.
6.make sure that AIX admin not sent job to incorrect printer.
=========================================
How to mange print queue on AIX
===============================
In printer management on AIX we generally do following.

1.start printer queue.
2.stop printer queue.
3.know the status of printer queue.



1.How to stop/start Printer queue on AIX.

step 1.

SMIT spooler ----manage print queue----stop/start print queue ---Print queue name and press enter


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

2.How to check status of Printer queue on AIX

SMIT  spooler ----manage print queue---know the status of print queue----enter print queue name
and press enter .

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

Print Queue on AIX using command line
root@servername:/root : lpstat -p[queue_name]
Queue   Dev   Status    Job Files              User         PP %   Blks  Cp Rnk
------- ----- --------- --- ------------------ ---------- ---- -- ----- --- ---

Flag

-p   printer status

some example of lpstat from MAN page

Examples
       1    To display the status for all print queues, enter:

            lpstat
       2    To display the long status for all printers, enter:

            lpstat -t

       3    To display a job number in the print queue lp0, enter:

            lpstat -plp0 This command displays a list similar to the following:

            Queue  Dev      Status      Job    Files      User      PP      %      Blks      CP      Rnk
            lp0    dlp0     running     39     motd       guest     10      83      12        1       1



Command examples on AIX for managing printer.
===================================
Display the default queue on AIX :
#qchk -q

To display the status of the printer lp0 on AIX:
#qchk -P lp0

To display the status of specific job numberon AIX :
#qchk -# [job number]

To display the status of all queues:
#qchk -A

To cancel the specific print job on AIX:
#qcan -x [job number]

To enable queue xyz on AIX:
#enable xyz

To disable queue xyz:
#disable xyz

To display the status all queues:
#lpstat

To display the status of print queue lp0:
#lpstat -p lp0

To display the jobs submitted by user root AIX:
#lpstat -u root

To display the status of queue testq:
#lpq -P testq


     

Thursday, March 15, 2018

Volume group types in AIX


Types of Volume group and their characteristic in AIX
Nomal VG- Max PV 32
Big VG- Max PV 128
 Scalable VG- Max PV 1024


Below table give exact Idea types of volume group in AIX.


VG 
Maximum PVs
Maximum PPs per VG
Normal VG
32
32,512 (1016 * 32)
Big VG
128
130,048 (1016 * 128)
Scalable VG
1024
2,097,152

Scenario
Convert AIX Volume group from Normal to big using following command

prerequisite before conversion from MAN page of AIX chvg:

The -B flag cannot be used if there are any stale physical partitions.

Once the volume group is converted, it cannot be imported into AIX 4.3.1 or lower versions.

The -B flag cannot be used if the volume group is varied on in concurrent mode.

There must be enough free partitions available on each physical volume for the VGDA expansion for this operation to be successful.
Because the VGDA resides on the edge of the disk and it requires contiguous space for expansion, the free partitions are required on the edge of
the disk. 

#chvg -B vgname

Example

# chvg -B myvg
0516-1164 chvg: Volume group myvg changed.  With given characteristics myvg
        can include up to 128 physical volumes with 1016 physical partitions each.

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

Scenario
Convert AIX Volume group from big to scalable using following command

Varyoff vg first then execute command chvg like below.


Prerequisites before converting AIX volume group from Big to scalable
====================================================
1.No stale partition in VG
2.AIX volume group must be varied off state
3.on AIX VG there must be some free PP.


# varyoffvg myvg

# chvg -G myvg

then varyon vg using below command

# varyonvg myvg

check Volume group type in AIX by using following command

lsvg myvg |grep -i MAX PV





 From MAN page of chvg AIX:

**Once the volume group is converted, it cannot be imported into AIX 5.2 or lower versions.


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

understanding T-Factor in AIX

AIX admin every time add new disk to volume group.so while adding physical volume to volume group need to concider following calculation.

Total number of PP= disk size / PP size.

max PP per PV in AIX like below

MAX PPs per PV:     1016   //maximum PP in VG where we adding new disk.

suppose PV in volume group rootvg having size 20 GB then above calculation looks like below

Total number of PP on PV =20480 /128

Total number of PP on PV=160

but there is situation while adding PV to volume group you get following error:

**Unable to extend volume group

**use chvg command with -t option to attempt to change the 
maximum Physical Partitions per Physical volume for this volume group


so in above situation T factor comes in picture .

so how to decide T factor:

suppose i want add 200 GB disk in volume group then number of PP on new disk is 1600.

200*1024 (convert to MB)=204800
204800 / 128 (PP size in Vg)     =   1600 PP on new PV.


here this PV will be rejected by VG giving reason that limitation of max PP which is 1016.

to increase PP per PV in volume group command is like below

#chvg -t vgname

factor value = number off PPs on new disk / 1016

factor value= 1600 / 1016

factor value=1.5  //

factor value should be round up so it will be 2.

chvg -t 2 rootvg

after this command  "MAX PPs per PV:  2032"

now after changing T factor AIX admin tried to add the command  will definitely succeed.

AIX chvg T -Factor table for reference :






In short we can say that T-factor increase Number of PP per PV in AIX ,but deceases number of PV in AIX Volume group.









Saturday, March 10, 2018

Troubleshooting AIX file system extend issue

Troubleshooting AIX file system extend issue
=================================

scenario:

extend /test on AIX client by 100 GB.

current size /test is 5GB.

chfs -a size=+100G /test

Error Message:  0516-787 extendlv: Maximum allocation for logical volume is 512

analysis:

here found that PP size in VG is 128 MB and MAX limit of LP is 512,so maximum allowed File system extend is 65GB.

calculation
=============================
current LV MAX size
128 (PP size)*512(max LP limit of LV)= 65GB
here need to extend max limit so that we extend FS to 105 GB

MAX LP calculation 
1024*105=107520/128 =840 LP require to set in MAX LP .

solution:

extend LV's  maximum LP limit by using following command

chlv -x [no of lp] [lvname]
extendlv testlv [no. of LP]
or 
smit chlv==>change characteristic to logical volume==>select LV=>find and enter MAX LP value and press enter

 and then execute filesystem extend command.

chfs -a size=+100G /test

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

How to Extend Physical volume in AIX volume group from storage end.

solution:

i came across this type of scenario when there was no free PP available on AIX volume group.
so i requested to storage guy to extend existing Physical volume.
following details requested storage guy to identify Lun at storage side
1.Lun ID 
2.Physical volume size
3.Lun name.

after Physical volume expanded from storage side AIX admin need to execute following command to add free PP in Physical volume.

#chvg -g testvg

-g   this flag scan disk in volume group and add addtional PP to Physical volume on AIX if its grown in size.

please dont  confuse between "-g" and "G" flag of chvg.here capital "G" is for changing volume group to scalable format.remember that if there is stale partition on AIX volume group we cant proceed with this command ,first we need to sort out this issue.


In AIX there are three types of volume group .

1.normal -32 PV
2.Big-128 PV
3.scalable-1024 PV

command example:

#chvg -B vgname  -convert volume group to Big type which can accommodate 128 physical volume.there must be no stale partition before executing this command 

#chvg -G vgname -covert to scalable volume group.
while executing above command please make sure that there is no stale PP on volume group.
also there is free PP available on each physical volume to accommodate VGDA expansion and most important AIX volume group must be varied off state.







 








Vfiler mount error mount: 1831-011

Vfiler mount troubleshoot on AIX server
=============================

while mounting Vfiler on AIX client getting follwing error :

#mount -t nfs [vfiler path] /mount point

"mount.nfs: access denied by server while mounting"
 Error: mount: 1831-011

incident analysis :

NetApp filer
  :From storage side check whether AIX client has access to Vfiler.

Observation: From NetApp filer side AIX client didn't Vfiler access .

Action done to solve issue:
Add AIX client to Vfiler access list.



#mount -t nfs [vfiler path] /mount point

IT works !!!!!!

other checks for vfiler troubleshoot:

  • check required ports are open at filer side and confirm that firewall is not blocking communication between vfiler and AIX client.
  • check whether mount point is not busy at AIX client side.