Showing posts with label AIX. Show all posts
Showing posts with label AIX. Show all posts

Wednesday, May 10, 2017

How to add a disk on AIX Logical Volume Manager (LVM)

In the last post of AIX, I had explained that how we create a logical volume manager on AIX operating system. In this post, I will explain to you how to add a disk on AIX logical volume manager.

LVM (Logical Volume Manager) is a tool for logical volume management which includes allocating disks, striping, mirroring and resizing logical volumes.With LVM, a hard drive or set of hard drives is allocated to one or more physical volumes.

LVM allows users to create partitions from more than one disk and allows them to extend the filesystem size online within few seconds.

Step by step method to add a disk on LVM.

1. In the first step we will add the physical or virtual disk to the logical partition. Once the new disk is added on the logical partition then we can able to go for next step.

2. Now, rescan your system hardware so that the Operating system can find which new hard disk is add on the server. For this please use the below command to scan the hardware on AIX operating system.

aix:/> cfgmgr

3. In this step, we will check the disk. For example, let’s assume that the new disk is hdisk1, so please run the below command to check the disk.

aix:/> lsdev -Cc disk
hdisk0  Available  Virtual SCSI Disk Drive
hdisk1  Available  Virtual SCSI Disk Drive

aix:/> lspv
hdisk0      00f68f03d1e42951       rootvg          active
hdisk1      00f68f03d20beafd       vstorage        active
hdisk2      00f68f03d20ceb37       vstorage        active

if you see the above both output, you can found that hdisk1 is available to add on Voulme group.

4. In this step, now you need to create a new group and move the new disk hdisk1 in there. Let's assume the new group named is "rootvg". So please find the below command to create a new group and add the disk in it.

aix:/> mkvg -y rootvg hdisk1

5. Now you can look at the size of hdisk1. Please run the below command , you can found the below output regarding the disk space of your disk and this command would not work if it is not associated with the volume group.

aix:/> lspv hdisk1
PHYSICAL VOLUME:    hdisk1                   VOLUME GROUP:     rootvg
PV IDENTIFIER:      00f68f03d1e42951 VG IDENTIFIER     00f68f0300004c0000000153d1e429c1
PV STATE:           active
STALE PARTITIONS:   0                        ALLOCATABLE:      yes
PP SIZE:            128 megabyte(s)          LOGICAL VOLUMES:  17
TOTAL PPs:          799 (102272 megabytes)   VG DESCRIPTORS:   2
FREE PPs:           118 (15104 megabytes)    HOT SPARE:        no
USED PPs:           681 (87168 megabytes)    MAX REQUEST:      256 kilobytes
FREE DISTRIBUTION:  11..00..00..00..107
USED DISTRIBUTION:  149..160..159..160..53
MIRROR POOL:        None

6. In this step , now we will create a log logical volume for jfs2 file system and this needs to be part of vloume group "rootvg".

aix:/> mklv -t jfs2log rootvg 1

As i can not paste the my machine output as I am already add it, You can add at your end , if any issue occur on this stage please comment on the post.

7. Now, we will check the new logical volume (lv) and you can used the below command to check the new logical volume present on the AIX server.Normally on AIX server we are used "loglv00" logical name, as on my machine I used the same name.

aix:/> lsvg
rootvg

aix:/> lsvg -l rootvg
rootvg:
LV NAME             TYPE       LPs     PPs     PVs  LV STATE      MOUNT POINT
hd5                 boot       1       1       1    closed/syncd  N/A
hd6                 paging     404     404     1    open/syncd    N/A
loglv00             jfs2log    1       1       1    open/syncd    N/A
hd4                 jfs2       4       4       1    open/syncd    /

If you see the above both the output, you can find that "rootvg" is voulme group present and in rootvg, you can find the logical volume "loglv00".

8. In this, we will create a logical volume and fixed their size , lets assume we will used 30GB size and used the logical volume name lglv_test.

aix:/> lsvg rootvg
aix:/> mklv -t jfs2 -y lglv_test rootvg 30G
aix:/> mkfs -o log=/dev/loglv00 -V jfs2 /dev/lglv_test

9. In the seconf last step we will mount the newly created file system on the AIX operating system.

aix:/> mkdir /test
aix:/> mount -o log=/dev/loglv00 /dev/lglv_test /test

In this example , we will create a "/test" file system and mount the file system on this folder.

10. In the final step we will make a permament entry of this file system in "/etc/filesystems file so once you take a reboot of AIX server, file system will mount permamently, otherwise you need to mount again if you not made an entry in /etc/filesystems.

Hope this post is useful for you, as this step by step method you can not found in other sites, In case still you are facing any issue related to this topic, please comment on this post, I will revert to you with solution.

Tuesday, March 14, 2017

How to configure NTP Server on AIX Operating system

In the last post, I had explained the NTP (Network Time Protocol) on Solaris 10 & 11 server. Now in this post, I will explain the same NTP server and client configuration for AIX operating system.

As you know NTP ( Network time Protocol) is one of the oldest internet protocol still in use and it allows the synchronization of computer clocks distributing UTC (Coordinated Universal Time) over the network.

Step by Step Configuration of NTP:

1. In the initial step we must verify that we have check the available NTP server on AIX server. For this please run the below command.

AIX:/>lssrc -ls xntpd
-----------------------------------------------
 Program name:    /usr/sbin/xntpd
 Version:         3
 Leap indicator:  00 (No leap second today.)
 Sys peer:        ntp.aix.in.com
 Sys stratum:     4
 Sys precision:   -18
 Debug/Tracing:   DISABLED
 Root distance:   0.014709
 Root dispersion: 0.066422
 Reference ID:    192.168.1.22
 Reference time:  dc721077.d3a8e000  Tue, Mar 14 2017  7:47:19.826
 Broadcast delay: 0.003906 (sec)
 Auth delay:      0.000122 (sec)
 System flags:    pll monitor filegen
 System uptime:   19248381 (sec)
 Clock stability: 0.000107 (sec)
 Clock frequency: 0.000000 (sec)
 Peer: ntp.aix.in.com
      flags: (configured)(sys peer)
      stratum:  3, version: 3
      our mode: client, his mode: server
 Peer: ntpuk.aix.in.com
      flags: (configured)(sys peer)
      stratum:  3, version: 3
      our mode: client, his mode: server
Subsystem         Group            PID          Status
xntpd            tcpip            8520514      active
------------------------------------------------------

You can found the above output once you run the above command to check the available NTP server. On my AIX machine if you see the sys peer should show a valid server (ntp.aix.in.com). If the server is not showing any ntp server then we need to correct it by adding a server line into /etc/ntp.conf and will take restart of "xntpd" services.

Note : In this post I will use my dummy NTP name instead of real NTP server because of security reason.

2. As your NTP server is not configured and it is show "insame" then you need to add manual entry on the NTP configuration file.

AIX:/>vi /etc/ntp.conf

server ntp.aix.in.com
server ntpuk.aix.in.com

Once you added these ntp server entry manually on the configuration file then please take a restart of NTP services.

AIX:/>stopsrc -s xntpd
AIX:/>startsrc -s xntpd

Using above command we can stop and start the "xntpd" service on AIX operating system.

3. In this step you need to again verify the status of newly added NTP server.

AIX:/>lssrc -ls xntpd

It is taking some time that time because it synchronize process is running. Once the synchronization has been complete and you run the above command you can found the NTP server entry as describe in Step 1.

Step by Step configuration of NTP Client:

1. On the client machine you need to again verify that you have a server suitable for synchronization or not. For this please run the below command.

AIX:/>ntpdate -d ntp.aix.in.com
-----------------------------------------------------------
14 Mar 08:16:21 ntpdate[64356890]: 3.4y
transmit(192.168.1.22)
receive(192.168.1.22)
transmit(192.168.1.22)
receive(192.168.1.22)
transmit(192.168.1.22)
transmit(192.168.1.22)
transmit(192.168.1.22)
server 192.168.1.22, port 123
stratum 16, precision -6, leap 11, trust 000
refid [63.15.23.11], delay 0.03688, dispersion 24.00334
transmitted 4, in filter 4
reference time:      00000000.00000000  Thu, Feb  7 2036  7:28:16.000
originate timestamp: dc721745.3ff1b000  Tue, Mar 14 2017  8:16:21.249
transmit timestamp:  dc721746.3d08a000  Tue, Mar 14 2017  8:16:22.238
filter delay:  0.03688  0.05624  0.00000  0.00000
               0.00000  0.00000  0.00000  0.00000
filter offset: -0.00081 -0.00750 0.000000 0.000000
               0.000000 0.000000 0.000000 0.000000
delay 0.03688, dispersion 24.00334
offset -0.000812

14 Mar 08:16:23 ntpdate[64356890]: no server suitable for synchronization found
--------------------------------------------------------------------------

If you get the message ," no server suitable for synchronization found", verify xntpd is running on the server also verify that no firewalls are blocking port 123.

2. If the no server suitable for synchronization then you must specify the xntpd server in /etc/ntp.conf.

AIX:/>vi /etc/ntp.conf

server ntp.aix.in.com

Once you added the NTP server entry on client configuration file then restart the "xntpd" service again.

AIX:/>startsrc -s xntpd

3. If you want to start the xntpd service on boot time then you need to uncomment the below lines on the configuration file.

AIX:/>vi /etc/rc.tcpip

Unconmment the following line

start /usr/sbin/xntpd "$src-running"

4. Now verify the NTP server on client machine has been synchronized or not. Please use the same command which we used for checking the status.

AIX:/>lssrsc -ls xntpd

This time on the NTP client machine sys peer should display the IP Address or name of your "xntpd" server. As you know it is taking some time to synchronization so you must wait for time.

Monday, February 20, 2017

How To Reset Root Password In AIX Operating System

When you will forget the root password on AIX operatings system then it is difficult to us to recover the root password again. So in this post I will explain step by step to you how to reset the root password in AIX.

Their are several ways using which we can reset the root password on AIX, here I will provide you step by step method to reset root password.

1. In the first step , You need to insert the operating system same version media disk on cd/dvd rom and power on the AIX machine.

2. When the screen of icons appears, or you hear a double beep sound from hardware of AIX, please press the F1 key repeatedly until the System Management Services menu appears.

3. Select Multiboot option from the SMS (System Management Services) menu

4. Select Install From option from multiboot screen.

5. Select the device (CD rom) that keep the AIX operating system image and then select Install.

6. Select the AIX version icon from the screen menu.

7. Please describe your current system as the system console by pressing the F1 key and then press Enter.

8. In this step you need to select the number of your preferred language and press Enter. In my case I use global language "English".

9. Once you select the language in this step you need to select Start Maintenance Mode for System Recovery by typing 3 and press Enter.

10. In the second last step you can ingnore the messages like that "select Access a Root Volume Group". 

A message displays explaining that you will not be able to return to the Installation menus without rebooting if you change the root volume group at this point.

11. Please Type 0 and press Enter.

Type the number of the appropriate volume group from the list and press Enter.

Select Access this Volume Group and start a shell by typing 1 and press Enter.

At the # (number sign) prompt, type the passwd command at the command line prompt to reset the root password.

# passwd
Changing password for "root"
root's New password: 
Enter the new password again:

12. In the final step , you need to write everything from the buffer to the hard disk and reboot the system.

sync;sync;sync;reboot

When the login screen appears, the password you set in above step 11 should now permit access to root privileges.

Hope, you like this post , using this post we can easily reset the root password in AIX operating system. If you are facing any issue please comment on this post.

How to check Operating Systems Version is 64-bit or 32-Bit

Hello Friends,

In this post, you can see how we will check the operating system is 32 bit or 64 bit. Normally when we download any software on Unix platform they have dependency regarding the operating system version. So after following my this post you can easily get the information about the operating system version information.
When you work on Unix operating system then you must know the version of operating system. Because without getting exact version of OS, you can not install the packages on the Linux system.

Here, I mentioned the command and their output using these commands you can easily found the version of operating system. It is 32 bit or 64 bit.

Linux Operating System:

#uname –a
Linux vibhor 3.10.0-229.el7.x86_64 #1 SMP Fri Mar 6 11:36:42 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

#uname  -m
x86_64

If the output has "x86_64",the environment is 64 bit.

Solaris Operating System:

#isainfo options

-v         Prints detailed information about the other options
-b         Prints the number of bits in the address space of the native instruction set.
-n         Prints the name of the native instruction set used by portable applications supported by the current version of the OS.
-k         Prints the name of the instruction set or sets that are used by the OS kernel components such as device drivers and STREAMS modules.

[vibhor]# isainfo -v

64-bit sparcv9 applications
        ima fmaf vis2 vis popc
32-bit sparc applications
        ima fmaf vis2 vis popc v8plus div32 mul32

[vibhor]# isainfo -b
64

[vibhor]#isainfo
sparcv9 sparc

The output for the above command should be sparcv9 sparc for a 64-bit operating System.

AIX Operating System:

vibhor:/> getconf -a | grep KERN
KERNEL_BITMODE:                         64

vibhor:/> bootinfo -y
64

The output of the above command should be 64 for a 64-bit hardware. The command must be executed as root.

Note: on AIX, the -y option will specify if the hardware is 32- or 64-bit mode while bootinfo -k will specify if the kernel is 32- or 64-bit (this command must be run as root).

HP-UX Operating system:
         
 hpx:/> getconf KERNEL_BITS
 64
         
The output of the above command should be 64 for a 64-bit operating system.

Wednesday, February 15, 2017

How to boot AIX to Single User Mode in order to perform maintenance

In this post, I will explain to you, how do we boot AIX server to single user mode in order to perform maintenance. AIX is IPM operating system which is widely used today.

In AIX operating system we do not need to use single user mode very much, because many problems or issues require having the root file systems unmounted for repairs. 

In my post you can found the list of some issues when it's good to use single-user.

  • System boot hangs due to NFS configuration issues
  • Debug problems with entries in /etc/inittab
  • If you want to work on the system without users login to attempt.
  • If you want to work without applications starting up
Normally when we repair any file system if it is get crashed then we use "fsck" utility and their command but for this repair process the good condition is you need to unmount /tmp & /var file system.

If the system boots fine from the root volume group, then booting into single-user to repair or perform work has advantages. These advantages of this as listed below.
  • Its boots faster than Maintenance Mode.
  • It allows you to run all commands you would normally have access to in multi user.
  • Unlike maintenance mode, there is no possibility that hdisks will be renamed.

Procedure to boot AIX operating system to Single User mode: 

I will explain you two way to boot the system in single user mode which is describe below.

Standalone System (no HMC):
  • First boot system with no media in the CD/DVD drive on AIX operating system.
  • Wait until you see the options of choosing another boot list, and hear beeps on the console
  • Press 6 to start diagnostics
System using an HMC:
  • Select the LPAR in the HMC GUI
  • Select Operations -> Activate
  • In the Activate window, click the button that says "Advanced"
  • Change "Boot mode" to "Diagnostic with stored boot list"
  • Click "OK" to save that change, then "OK" again to activate.
After above steps you will get the below screen on the AIX operating system monitor. If these below message you get that's means your operating system boot process is already start.

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

You will see the normal AIX boot header, since you are booting from your system hard disk:

------------------------------------------------------------------------------------------------
                                Welcome to AIX.
                       boot image timestamp: 11:55 02/15
                 The current time and date: 15:35:02 02/15/2017
               number of processors: 2    size of memory: 4096MB
          boot device: /vdevice/v-scsi@70000007/disk@2300000000000000
                     kernel size: 15034876; 64 bit kernel
-----------------------------------------------------------------------------------------------

Now you will get the diagnostic license information page and their message on the screen which are describe as below. Several keys are used to control the diagnostics:
  • The Enter key continues the procedure or performs an action.
  • The Backspace key allows keying errors to be corrected.
  • The cursor keys are used to select an option.
Now, please press Enter. The next screen will show you Diagnostic Functions you can perform. On newer versions of firmware you will see Option 5 to start Single User Mode.

On older firmware you will have to go to, 3. Task selection and scroll way down and select 'Start Shell' or 'Single User Mode'

Function Selection:

1. Diagnostic Routines: This selection will test the machine hardware. Wrap plugs and other advanced functions will not be used.
2. Advanced Diagnostic Routines: This selection will test the machine hardware. Wrap plugs and other advanced functions will be used.
3. Task Selection(Diagnostics, Advanced Diagnostics, Service Aids, etc.): This selection will list the tasks supported by these procedures. Once a task is selected, a resource menu may be presented showing all resources supported by the task.
4. Resource Selection: This selection will list the resources in the system that are supported by the diagnostic programs. Once a resource is selected, a task menu will be presented showing all tasks that can be run on the resource(s).
5. Single User Mode: The system will enter single-user mode for software maintenance.

To make a selection, type the number and press Enter [1]: 5

Once you select the 5, you can find the below message on screen.

The system will now continue the boot process.  Please wait...
Saving Base Customize Data to boot disk
Starting the sync daemon
Starting the error daemon
System initialization completed.

It is asking for password , you may enter the password and login on single user mode, after login please check the mounted file system using "df" command.

If you want to exit single user mode and boot into multi user mode then you need to run the 
To exit single-user mode and boot into multiuser in RunLevel 2 use:

aix:/>telinit 2

Once you will press this command you can logout from single user mode to multi user mode. I hope you like my post and all the information which i have mention it. 

Wednesday, February 8, 2017

How to increase or decrease file system size in AIX operating system.

Hello Friends,

Hope you are doing well at your end. In my previous post, I explained you step by step method of extend & reduce of file system size in HP-UX operating system. In this post, I would like to guide you , how to increase or decrease the file system size in AIX operating system.

In AIX platform, normally we are using Journaled File System (JFS) or Enhanced Journaled File system (JFS2). So before moving to main topic we need to understand, what is the advantages of JFS file system in AIX.

JFS file system has more advantages over the BSD and UFS file system which are normally used in Unix environment. The biggest disadvantages of BDS/UFS file system is "file system corruption" in case of power failure or system crash. And this corruption mostly occur during the creation or removal of files in operating system. So JFS file system is resolved such issues.

Using JFS, this problem can be reduced by use of log volume of file system. When the AIX system crash, this log file replayed and bringing back the system online. So all the data before crash written in disk.

Hope, you can understand the advantages of this file system. Now we will move main topic of this post. How we will extend and reduce the file system size. So please follow the below step by step method as describe below.

1. Before increase the size of file system , we need to check the current size of file system, for this please run the below command and check the output.
-------------------------------------------------------------------------------------------------------
aix:/> df -kP /test
Filesystem    1024-blocks      Used Available Capacity Mounted on
/dev/test   716308480 694894144  21414336      98% /test
-------------------------------------------------------------------------------------------------------
If you see the above output, the file system is almost 98% full, so we will increase the file system size to 200 GB.

2. To increase the file system size, please use the below command.
-------------------------------------------------------------------------------------------------------
aix:/>chfs -a size=+$((200000*2048)) /test
or
aix:/>chfs -a size=+200G  /test
-------------------------------------------------------------------------------------------------------
In above command output, we will increase the size of file system /test to 200 GB, so for this we will use "chfs" command. You can use two method for increase the size of file system.

If you have an error 0516-787 extendlv: Maximum allocation for logical volume oraexp is old_limit. For resolving this issue you can run the below command.
-------------------------------------------------------------------------------------------------------
aix:/>chlv -x new_limit lv_name
eg. chlv -x 4000 test
-------------------------------------------------------------------------------------------------------
Note: In my case my file system logical volume name is "test". You can replace your LV name to your LV name.

3.  To decrease the file system size in AIX operating system, please use the below command.
-------------------------------------------------------------------------------------------------------
aix:/>chfs -a size=-$((X*2048)) /fs
-------------------------------------------------------------------------------------------------------
You can replace the "X" size in Mo which you want to decrease it. Using above command you can reduce the size of file system in AIX.

Please post your query in comment if you are facing any issue during increase and reduce of file system in AIX operating system.