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