Showing posts with label bdf. Show all posts
Showing posts with label bdf. Show all posts

Wednesday, February 15, 2017

Step by Step NFS Server and Client Configuration in HP-UX

In this post, I will explain step by step method of NFS server and client configuration on HP-UX operating system. Network File System is a distriubted file system which allows a client computer to access a file system that shared on another computer’s or server's.

NFS server is configured on the server locally on attached physically disk. On my HP-UX server i will configured the NFS server and for client you can use same HP-UX operating machine or other linux machine.

We can used the below NFS server IP and client IP on my own HP-UX machine and Linux machine.

NFS Server : 10.135.0.27 and share folder /backup
NFS Client : 10.135.0.2 and mount point /home/backup

Steps involved to configure the NFS Server:

1. First we will make sure both NFS server(10.135.0.27) and client(10.135.0.2) are accessible. After that we will make an entry in /etc/hosts or Configure it in DNS to resolve the IP if you use server name instead of IP address. But in our case we will use IP address instead of name.

hpx:/>vi /etc/hosts

10.135.0.27 hpxnfsserver
10.135.0.2 hpxnfsclient

The /etc/hosts entry would we same on both server and client machine so it can be accessible to each other.


2. In second step we will identify the folder to be export from server to the client. On my HP-UX server machine, I am going to export the folder /backup.

3. Now we will change the shared folder permission, normally we don't provide the read/write access to shared folder but in my case for testing purpose i will provide the (777) permission so that NFS client user can read/write the data on shared folder.

hpx:/>#chmod 777 /backup

4. In this step we change the NFS_SERVER=1 to enable your server to act as a NFS Server in the configuration file /etc/rc.config.d/nfsconf

hpx:/>vi /etc/rc.config.d/nfsconf
Change the NFS_SERVER parameter as follow.
NFS_SERVER=1
PCNFS_SERVER=0
START_NFSLOGD=0
START_MOUNTD=1
MOUNTD_OPTIONS=""
Save and exit the file.

5. In final step we will add an entry of our shared folder in the export file /etc/dfs/dfstab with proper permission.

#vi /etc/dfs/dfstab
/usr/sbin/share -F nfs -o rw -d “Test directory” /backup

Save and exit the file.

If you see the above line "/backup is shared folder and we will provide the "rw" read/write access to this folder.

6. Now please restart the nfs service on NFS server and make it permanent so after reboot of HP-UX server the shared folder is not umount.

hpx:/>/sbin/init.d/nfs.server stop
hpx:/>/sbin/init.d/nfs.server start

7. Using below command we can check the NFS folder is shared or not and also we can ensure which client can access this machine.

hpx:/>/usr/sbin/exportfs -av

shareall -F nfs

Steps involved to access the NFS shared folder to the NFS clients:

1. Now for NFS client configuration i will login on my Linux machine.In my case i will use my Centos machine as a client, You can select your NFS client machine as per your requirement.

2. On client machine, please select the mount point to where we have to mount the NFS shared folder /backup which we exported from NFS Server 10.135.0.27. On my Linux machine, I will mount it on /home/backup.

3. In this step we will verify the list of shares available on client machine. Please use the below "showmount" command to check which NFS shared folder is accessible.

hpx:/>showmount -e 10.135.0.27
export list for 10.135.0.27
/backup

If we get the output, server side export configuration doesnt have any problem between nfs server and client.

3. In next step we will mount the nfs share locally on our desintation mount point folder.

hpx:/>mount 10.135.0.27:/backup /home/backup

4. In final step, you can check the NFS mount folder using "bdf" command. It is show you the mount folder where all existing data is store. For testing purpose you can create any file on /home/backup.

Hope, you will like my this post, it is cover all the installation and configuration part step by step. Please let me know if you encouter any issue during NFS configuration on HP-UX machine.

Monday, February 6, 2017

How to increase/extend file system size in HP-UX 11i

Hello Friends,

In this post, I will describe how to extend or increase the file system size on HP-UX 11i operating system. Before extending the file system size we need to understand first file system type, which type of file system currently used in HP-UX operating environment.

For example, in my HP-UX operating system, I want to increase the root partition size, so for this first I need to check which file system type is it. So for checking this we will used "fstyp" command.

-------------------------------------------------------------------------------------------------------------------
hpx:/> fstyp /dev/vg00/lvol3
vxfs
-------------------------------------------------------------------------------------------------------------------

In above command output, my logical volume for root /dev/vg00/lvol3 is mounted on '/". So for root file system the type os "vxfs".

The extendfs command should be used to extend JFS (VxFS) file systems that are not mounted. The Ceritas online JFS extends a file system in using the fsadm command.So basically we can extend file system through two command.

1. Increase/Extend file system size using "fsadm".
2. Increase/Extend file system size using "extendfs".

Increase/Extend file system size using "fsadm":-

1. Before extend the file system size we need to verify that online JFS license is installed on the system.

For HP-UX 11i v1 operating system:
-------------------------------------------------------------------------------------------------------------------
hpx:/> vxlicense -t HP_OnlineJFS
vrts:vxlicense: INFO: Feature name: HP_OnlineJFS [50]
vrts:vxlicense: INFO: Number of licenses: 1 (non-floating)
vrts:vxlicense: INFO: Expiration date: No expiration date
vrts:vxlicense: INFO: Release Level: 22
vrts:vxlicense: INFO: Machine Class: All
vrts:vxlicense: INFO: Site ID: 0

For HP-UX 11i  v2|v3 operating system:
-------------------------------------------------------------------------------------------------------------------
hpx:/> vxlicrep | grep Online
HP_OnlineJFS                        = Enabled
-------------------------------------------------------------------------------------------------------------------
In above command output you can verify that onlineJFS license is installed on the system. Both the command we can use HP-UX version wise.

2. To extend the file system size , we will check the current size of file system. In this post as you know we will extend the "root" file system size, so for check the current size status we used "bdf" command. Please find the "bdf" command output as listed below.
-------------------------------------------------------------------------------------------------------------------
hpx:/> bdf
Filesystem          kbytes    used   avail %used Mounted on
/dev/vg00/lvol3    1835008  17942 1703507   1% /
-------------------------------------------------------------------------------------------------------------------
To check the current voulme group size for this file system please run the below command.

hpx:/> vgdisplay -v vg00
LV Name                     /dev/vg00/lvol3
LV Status                     available/syncd
LV Size (Mbytes)        1792
Current LE                  224
Allocated PE               224
Used PV                      1

Now, we will extend the file system size using the below command.
-------------------------------------------------------------------------------------------------------------------
hpx:/>lvextend -l 300 /dev/vg00/lvol3
Logical volume "/dev/vg00/lvol3" has been successfully extended.
Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.conf
-------------------------------------------------------------------------------------------------------------------
Volume group is now extend, you can see the new volume group status using the below command.

hpx:/> vgdisplay -v vg00
LV Name                     /dev/vg00/lvol3
LV Status                     available/syncd
LV Size (Mbytes)        2400
Current LE                  300
Allocated PE               300
Used PV                      1

hpx:/>fsadm -F vxfs -b 2400M /
UX:vxfs fsadm: INFO: V-3-25942: /dev/vg00/lvol3 size increased from 1835008 sectors to 2457600 sectors.

3. Now you file system "root" size has been extend , to need to check new extended size please run the below command.
-------------------------------------------------------------------------------------------------------------------
hpx:/> bdf
Filesystem          kbytes    used   avail %used Mounted on
/dev/vg00/lvol3    24576008  18095 2287043   1% / 
-------------------------------------------------------------------------------------------------------------------
If you see in above bdf command output the available size for "root" partition size is extend.


Increase/Extend file system size using "extendfs":-

1. To extend the file system size , we will check the current size of file system. In this post as you know we will extend the "root" file system size, so for check the current size status we used "bdf" command. Please find the "bdf" command output as listed below.
-------------------------------------------------------------------------------------------------------------------
hpx:/> bdf
Filesystem          kbytes    used   avail %used Mounted on
/dev/vg00/lvol3    1835008  17942 1703507   1% /
-------------------------------------------------------------------------------------------------------------------
To check the current voulme group size for this file system please run the below command.

hpx:/> vgdisplay -v vg00
LV Name                     /dev/vg00/lvol3
LV Status                     available/syncd
LV Size (Mbytes)        1792
Current LE                  224
Allocated PE               224
Used PV                      1

Now, we will extend the file system size using the below command. The procedure is same as previous one.

2. For extending the file system size using "extendfs" we need to umount the "root" file system then extend the size and re-again mount it. 

hpx:/>lvextend -l 300 /dev/vg00/lvol3
Logical volume "/dev/vg00/lvol3" has been successfully extended.
Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.conf
-------------------------------------------------------------------------------------------------------------------
hpx:/>umount /
hpx:/>extendfs /dev/vg00/lvol3
hpx:/>mount /
-------------------------------------------------------------------------------------------------------------------
Once you mount the "root" file system again then check the newly size of file system, for this we will use same command bdf.
-------------------------------------------------------------------------------------------------------------------
hpx:/> bdf
Filesystem          kbytes    used   avail %used Mounted on
/dev/vg00/lvol3    24576008  18095 2287043   1% / 
-------------------------------------------------------------------------------------------------------------------

So, now we are able to extend or increase the file system size using two way on HP-UX operating system. Hope, you like my post, please let me know if you facing issue during the extend file system size on HP-UX operating system.