Sunday, December 13, 2015

How to export and mount the nfs filesystem in aix?

How to export and mount the nfs filesystem in aix?


1. Ground work:
We need the below information in hand and confirm the required deamon status.
            ü  Nfs Server name
            ü  Exported directory
            ü  Nfs Client name
            ü  Nfs local mount point name.
            ü  check showmount -e  --> To confirm the exported directory list.
            ü  showmount -a  --> To confirm the list of nfs client server names.

Server Side Configuration: Start the NFS and portmap daemon

# lslpp –L | grep bos.net*  --> Check the nfs server and client installed.
# startsrc –g nfs  --> start the nfs group deamon
# startsrc -s nfsd   --> start the nfsd deamon
# startsrc -s mountd  --> start the mountd deamon
# lssrc -g nfs  --> check the nfs group deamon in active state
# lssrc -s  nfsd  --> Check the nfsd deamon
# lssrc -s mountd  --> check the mountd deamon

•   Client Side Configuration:      Start the NFS and portmap daemon

# lslpp –L | grep bos.net*  --> Check the nfs server and client installed
# startsrc –g nfs   --> start the nfs group deamon
# startsrc –s portmap  --> start the portmap deamon.
# lssrc -s nfsd  --> check the nfs group deamon in active state
# lssrc -s portmap  --> Check the protmap deamon in active state.
# lssrc -s biod   --> Check the biod deamon in active state.


2. Exporting an NFS filesystem

Using Smitty:
# ls -l /etc/exports  --> Check exports file exits.
# cp -p /etc/exports /etc/exports_bak   --> Take the backup of the exports file.
# smitty mknfsexp  --> Exporting the nfs filesystem.
            Specify appropriate values in the PATHNAME of directory to export
             MODE to export directory,
            EXPORT directory now, system restart or both fields.
# cat /etc/exports  --> To confirm the exported directory are present on the /etc/exports.

Using Command line:

# cp -p /etc/exports /etc/exports_bak   --> Take the backup of the exports file.
# vi /etc/exports  --> To Create an entry for each directory to be exported, using the full path name of the directory.
# exportfs -a  --> To read the /etc/exports file and exports all the directories listed.
# showmount -e  --> To confirm the exported directory listed.
# showmount -a  --> To confirm the nfs client name and directory list.


3. Mounting the NFS filesystem on the client.

Using Smitty:
# showmount -e <server_name>  --> To verify the NFS server has exported the directory.
# mkdir /local_directory    --> To create the mounting directory if not already exist.
#  smitty mknfsmnt  --> mount the NFS filesystem.
            PATHNAME of mount point.
            PATHNAME of remote directory.
            HOST where remote directory resides.
            MOUNT now, add entry to /etc/filesystems or both?
            /etc/filesystems entry will mount the directory on system RESTART.
            MODE for this NFS file system.
 #df -gt <NFS mount_name>  --> To confirm the nfs filesystem has been mounted

Using Command line:
# showmount -e <server_name>  --> To verify the NFS server has exported the directory.
# mkdir /local_directory    --> To create the mounting directory if not already exist.
# mount ServerName:/remote/directory /local/directory 
 #df -gt <NFS mount_name>  --> To confirm the nfs filesystem has been mounted



4. Roll back

Unexporting the NFS filesystem on the NFS server

Using Smitty:

Login to the NFS server and follw the below procedure.
# cp -p /etc/exports  --> To copy the exports directory.
# smitty rmnfsexp  --> To unexport the nfs directory.

Using command line:
# vi /etc/exports --> To Find the entry for the directory you wish to unexport, and the delete that line.
# cat /etc/exports   --> To check the directory now is removed and unexported.
If NFS is current running,
#exportfs -u <directory_name  --> where dirname is the full path name of the directory you just deleted from the /etc/exports file.


Removing the NFS mount on the NFS client server.

Using Smitty:
#smitty rmnfsmnt
# cat /etc/filesystems  --> To confirm the entry has been deleted properly.

Using command line:
#umount <directoryname>   --> To unmount the directory.
# cp -p /etc/filesystems /etc/filesystems_bak   --> To take the backup of the /etc/filesytems file.
# vi /etc/filesystems  --> Find the entry for the directory you just unmounted, and then delete it.
# cat /etc/filesystems  --> To confirm the entry for the directory you just unmounted properly.


Note: If you happy about the above article, please leave your comments / Reactions.

Thursday, December 10, 2015

How to calculate PP size in aix?

How to calculate PP size in aix?


If you dont specify the PP size during the creation of volume group, AIX will take default size. However we can identify the PP size within a second once we understand the concept. 

In aix, the pp size is calculating based on the size of the disks. AIX can use the specific numbers as the PP size. and the pp size is the constant one.. which means it should be in any one of the below numbers.

1, 2, 4, 8, 16, 32, 64,128,512,1024, (MB).

If the disk size is exactly 2 then the PP size would be 2MB
If the disk size is exactly 4 then the PP size would be 4MB
If the disk size is exactly 8 then the PP size would be 8MB
.like wise we can get to know if the disk size is exactly 16,32,64,128,256,512,1024 GB then the pp size is 16MB, 32MB, 64MB, 128MB, 256MB, 512MB, 1024MB respectively.
.

If the disk size is between 4GB < 8GB then the pp size is 8MB (Greater than 4  GB & less than 8GB)
If the disk size is between 8GB < 16GB then the pp size is 16MB.(Greater than 8  GB & less than 16GB)
Please see the below diagram for the rest of the disk size and its pp size.

if the disk size is 20 GB then what would be the pp size?
The disk size is 20GB which lies between 16GB - 32GB, so the pp size is 32MB.
(The pp size should not be 16MB as the disk size is more than 16GB, so the next PP size is 32, so the system would take 32MB)

Now i am going to ask you one questioin... If the disk size is 132 GB, tell me what is the pp size? 
  Yes, you are correct, the pp size is 256 MB.

Note: Always remember the pp size should be any one of the below numbers for normal & big vg.
1,2,4,8,16,32,64,128,256,1024.


Original and Big Volume Groups
hdisk size between:Default PP Size
1MB - 1,016MB1 MB
1,016MB - 2,032MB2 MB
2,032MB - 4,064MB4 MB
4,064MB - 8,128MB8 MB
8,128MB - 16,256MB16 MB
16,256MB - 32,512MB32 MB
32,512MB - 65,024MB64 MB
65,024MB - 130,048MB128 MB
130,048MB - 260,096MB256 MB
260,096MB - 520,192MB512 MB
520,192MB - 1,040,384MB1,024 MB

Scalable Volume Groups
hdisk size between:Default PP Size
1MB - 2,040MB1 MB
2,040MB - 4,080MB2 MB
4,080MB - 8,160MB4 MB
8,160MB - 16,320MB8 MB
16,320MB - 32,640MB16 MB
32,640MB - 65,280MB32 MB
65,280MB - 130,560MB64 MB
130,560MB - 261,120MB128 MB
261,120MB - 522,240MB256 MB
522,240MB - 1,044,480MB512 MB
1,044,480MB - 2,088,960MB1,024 MB
2,088,960MB - 4,177,920MB2,048 MB
4,177,920MB - 8,355,840MB4,096 MB
8,355,840MB - 16,711,680MB8,192 MB
16,711,680MB - 33,423,360MB16,384 MB
33,423,360MB - 66,846,720MB32,768 MB
66,846,720MB - 133,693,440MB65,536 MB
133,693,440MB - 267,386,880MB131,072 MB

Monday, September 14, 2015

How to deal with network commands in aix?


How to deal with network commands in aix?




Description
Command
List out all connections
netstat -a
To list out only tcp connections
netstat -at
To list out only udp connections
netstat -au
To disable reverse dns lookup
netstat -ant
To list out only listening connection
netstat -tnl
To list process/user id of listening connection
netstat -nlpt
To list out statistics of all packet 
netstat -s
To display kernel routing info
netstat -rn
To print out network interface
netstat -i
To Detailed info of network interface
netstat -ie
To get netstat continuous output
netstat -ct
To display the multicast group info
netstat -g







If you happy with the above aritcle, please leave your reactions.. (It will take less than a second )

How to find out the vhost information of the disk?

How to find out the vhost information of the disk?


Sometimes we are in the situation to find out the VHOST information of particular hdisk. We can easily find out using the below method.


   ü First we need to find out in what VTD the hdisk is belongs to.
   ü Then using VTD, we can find out the vhost info.


For example, if we want to find out the hdisk5 is part of which vhost? Now the short cut is below.


  ü find out vtd which is belongs to the hdisk 

                   $lsmap -all|grep -p hdisk5

                             VTD                   testmachine-16
                             Status                Available
                             LUN                   0x8700000000000000
                             Backing device        hdisk5
                             Physloc               U7311.D20.067DDBB-P1-C02-T1-L113



   ü Now find out the vhost belongs to the VTD

                 syntax:   lsdev -dev <VTD> -field parent

                   $lsdev -dev testmachine-16 -field parent

                             parent
                             vhost3


So hdisk5 is part of vhost3


To confirm:

$lsmap -vadapter vhost3
SVSA            Physloc                                      Client Partition ID
--------------- -------------------------------------------- ------------------
vhost3          U9133.55A.065040H-V22-C16                    0x00000003
VTD                   testmachine-16
Status                Available
LUN                   0x8700000000000000
Backing device        hdisk5

Physloc               U7311.D20.067DDBB-P1-C02-T1-L113

VTD                   testmachine-15
Status                Available
LUN                   0x9200000000000000
Backing device        hdisk6
Physloc               U7311.D20.067DDBB-P1-C02-T1-L66




Saturday, September 5, 2015

How to create/increase/decrease/remove/disable the paging space in aix?

How to create/increase/decrease/remove/disable the paging space in aix?



LIST
How to list out all the paging space details?       #lsps –a       
How to list out the consolidate paging space size?  #lsps –s
CREATE
How to create the paging space
#mkps –s <no of pp> -n –a rootvg       mkps –s 8 –n –a rootvg
INCREASE
How to Increase the Paging space?
#chps –s <no of pp> <paging name>       chps –s 8 paging00
DECREASE
How to decrease the paging space?
#chps –d <no of pp> <paging name>      chps –d 4 pagin00
DELETE
How to delete the paging space?
#swapoff /dev/<paging name>               swapoff /dev/paging00
#rmps <paging name>                            rmps paging00
CONFIGURATION FILE
All the paging space is defined in /etc/swapspaces.       # cat /etc/swapspaces
ENABLE
How to enable the paging space?      #swapon /dev/pagin00
DISABLE
How to disable the paging space?     #swapoff /dev/paging00