Sunday, February 26, 2017

How to Create VNIC and Assign a IP Address on Solaris 11

Hello Friends,

In my old post, I described that how we will create a new local solaris zone on global zone. As you know every zone has their own networking but how it is works and configured we need to understand, So in this post, I will explain to you how to create a virtual network on Solaris 11 before zone creation.

For creating Virtual NIC and assigning fix static IP address in Solaris 11 we need to understand the basic difference between older version of Solaris and Solaris 11.

In Solaris 10, according to the NIC manufacturer,physical network interfaces are named as (Ex:bge,e1000g,nxge).But in Solaris 11 onwards,the names are hidden from the view and all the interfaces will be named as net0,net1…netx.

Before forward to main work we need to know that using which command we can check which interface has been mapped to physical interface. Using below command you can check all the network interface details.

sun01# dladm show-phys
LINK              MEDIA                STATE      SPEED  DUPLEX    DEVICE
net0              Ethernet             up         1000   full      bge001
net1              Ethernet             up         1000   full      bge002

If you want to show all dladm level devices,including VNIC’s & aggregation links,use the below command-

sun01# dladm show-link
LINK                CLASS     MTU    STATE    OVER
net0                phys      1500   up       --
net1                phys      1500   up       --

In Solaris 11,you can give a meaning full description(net1/oracle_VIP) to all the IP address on the system unlike Solaris 10. (e1000g1:2)

How to assigning new IP address to NIC:-

1. We can see how we assigned IP address to the physical interface, so in the first step we will check all the physical interface using below command.

sun01# dladm show-phys
LINK              MEDIA                STATE      SPEED  DUPLEX    DEVICE
net0              Ethernet             up         1000   full      bge001
net1              Ethernet             up         1000   full      bge002

2. In this step we would know how we will create a new interface so you can use the below command for this.

sun01# ipadm create-ip net1

3. This is the main step to assign the static ip address to the newly created interface net1. You can use below command or syntax to assign the fixed IP.

sun01#ipadm create-addr -T static -a local=10.135.0.2/24 net1

You can change your IP address accordingly. 

4. Now we will Verify whether IP address is configured or not which we assigned on above step.

sun01# ifconfig  net1
net1: flags=1000843 mtu 1500 index 7
        inet 10.135.0.2 netmask ffffff00 broadcast 10.135.0.255
        ether 0a:cB:12:8e:15:e2

If you see the above output, the new IP address is shown on net1 interface successfully. Using above all 4 steps you can know how we will assinged the static ip address to the sun solaris 11 operating system.

Now we will go for Virtual Network Interface creation steps.I can create N number of VNIC’s using single physical interface.These VNIC are treated as actual physical interface and possible to assign to local zones with  full access to it.

How to create a new VNIC using interface net2:-

1. In the initial steps I will run the same command to check out the all physical interface which is available on the Solaris 11 Server.

sun01# dladm show-phys
LINK              MEDIA                STATE      SPEED  DUPLEX    DEVICE
net0              Ethernet             up         1000   full      bge001
net1              Ethernet             up         1000   full      bge002
net2              Ethernet             unknown    1000   full      bge003

If you see the above command output network interface "net2" is in unknow state, So in the next step I will create a new VNIC using net2.

2. In this step we will create a new VNIC using net2. In my case i will suppose VNIC name “vnic01”, so for creating the new VNIC we will run the below command which describe below.

sun01#dladm create-vnic  -l net2 vnic01

3.Now, We will plumb the virtual interface and create a default IP to new VNIC.

sun01# dladm create-vnic  -l net2 vnic01
sun01# ipadm create-ip vnic01
sun01# ifconfig vnic01
vnic01: flags=1000842 mtu 1500 index 8
        inet 0.0.0.0 netmask 0
        ether 2c:18:10:Ce:1a:12

4. Now we will assign the new IP address to VNIC and verfif that new IP for vnic01 is configured or not.

sun01# ipadm create-addr -T static -a local=10.135.0.3/24 vnic01
sun01# ifconfig vnic01
vnic01: flags=1000843 mtu 1500 index 8
        inet 10.135.0.3 netmask ffffff00 broadcast 10.135.0.255
        ether 2c:18:10:Ce:1a:12

5. In the final step we will try to run snoop on VNIC which we have create now. You can verify through snooping is that VNIC01 is working fine or not.

sun01# snoop -d vnic01

The same way you can create a multiple VNIC and assign a new IP address to it. Hope you got some idea about Solaris 11 networking part after reading this post. Please let me know if you have any doubt regarding this post.

Thursday, February 23, 2017

Sun Solaris File System Management

If you are working on Sun Solaris operating system and wants to more grow up on this operating system, you definitely like my post because in this post I will explain you the most important thing file system management.

I will describe all the file systems command in this post which is generally used on all Solaris version operating system. Using these command you are more familiar about the file system management on Solaris server.

How to create a new file system on Solaris Server:-

We are using two type of file system (UFS & ZFS) on Solaris operating system. In this example we are taking UFS file system as for ZFS file system creation information you can found in my older post.

  • Create a new file system-
          sun01#newfs /dev/rdsk/c0d0s1
  • View minfree value-
          sun01#fstyp -v /dev/rdsk/c0d0s1 | head
  • Set minfree value for a new file system-
          sun01#newfs -m 2 /dev/dsk/c0d0s1
  • Change minfree value on an existing file system-
          sun01#tunefs -m 1 /dev/rdsk/c0d0s1

In the above my example, my hard disk name is c0d0s1.

How to Monitoring File System Usage on Solaris Server:-

In Sun Solaris Server , you must be aware about the capacity of file system. You can check file system usage using several commands.
  • Display the capacity of file systems in readable format-
          sun01#df -h
  • Display the disk allocation size in Kbytes-
         sun01#df -k
  • Display the available space on a device or disk-
         sun01#df -k /dev/dsk/c0d0s1
  • Display the disk usage in readable format-
          sun01#du -h /home
  • Display the disk usage including files-
          sun01#du -ak /home
  • Display the disk usage in summary format-
          sun01#du -sk /home

How to Checking or repair the File System on Solaris Server:-

We can repair and check the file system on Sun Solaris server. You can use the "fsck" command for this one but make sure you never run the fsck command on a mounted file system. You need umount file system first then run repair or check the Solaris file system.

  • Check or repair an unmounted filesystem-
           sun01#fsck /dev/rdsk/c0d0s1
  • Check or repair using the mount point directory-
          sun01#fsck /export/home 
  • To use a backup superblock number on Solaris server-
          sun01#fsck -o b=32 /dev/rdsk/c0d0s1 
  • To use an alternative superblock number-
          sun01#fsck -o b=518432 /dev/rdsk/c0d0s1

Hope, you are like my this post. Please comment on the post if you are facing any issue. I will try to resolve your issue as soon as possible.

How to change a disk in SVM Solaris volume manager

Hope you are doing well at your end. This post documentation explain how to change a disk in SVM ( Solaris volume manager).It means that we have mirrored the disk (RAID1) using SVM. Solaris Volume manager is basically used for creating, modifying & partitioning the different RAID partition.

In this post, I will take my sparc server machine. My Sun Sparc server consist 2 hard disk, let us assume the server has 2 hard disk: c0t0d0 and c0t1d0. We will assume c0t0d0 failed and need to be replaced.

Step by Step Method as described below:

1. In the initial step, we will find that which hard disk is down or faulty. To check this we will used "format" command.

sun01# format
       0. c0t0d0 <__drive type unknown__>
          /pci@0,600000/pci@0/pci@8/pci@0/scsi@1/sd@0,0
       1. c0t1d0 <SUN146G cyl 14087 alt 2 hd 24 sec 848>
          /pci@0,600000/pci@0/pci@8/pci@0/scsi@1/sd@1,0

If you see the "format" command output, we have two disk "c0t0d0,c0t1d0". Disk "c0t0d0" is in faulty state and it's down, You can see the drive type is in unknown state.

2. If you are running the "metastat" command you can see the status of hard disk which is show status in "need maintenance".

sun01# metastat    # will show status in "need maintenance"

        flags           first blk       block count
     a        u         16              8192            /dev/dsk/c0t0d0s7
     a        u         8208            8192            /dev/dsk/c0t0d0s7
     a    p  luo        16              8192            /dev/dsk/c0t1d0s7
     a    p  luo        8208            8192            /dev/dsk/c0t1d0s7

sun01# metadb -d c0t0d0s7
sun01# metadb

Using above command we delete metadb on failing disk and check that metadb on the other disk.

4. Now, we will unconfigure the corresponding disk which is down right now. This is the main step of this post so you can more careful while running the command which is given below.

sun01# cfgadm -al
sun01# cfgadm -f -c unconfigure c0::dsk/c0t0d0
sun01# cfgadm -al

Using cfgadm command we will unconfigure the c0t0d0 faulty hard disk so that we will replace the down hard disk in next step.

5. Now you can change the faulty disk to new one and reconfigure it again with same name.

sun01# cfgadm -c configure c0::dsk/c0t0d0
sun01# cfgadm -al

6. In this steo we will duplicate partitionning schema of first disk to the second and create metadb.

sun01# prtvtoc /dev/rdsk/c0t1d0s2 | fmthard -s - /dev/rdsk/c0t0d0s2
sun01# metadb -a -f -c2 /dev/dsk/c0t0d0s7

7. In second last step you will run all the below command for replacement of the failinf SVM partition.

sun01# metastat
sun01# metareplace -ef d4 c0t0d0s4
sun01# metareplace -ef d3 c0t0d0s3
sun01# metareplace -ef d1 c0t0d0s1
sun01# metareplace -ef d0 c0t0d0s0
sun01# metareplace -ef d5 c0t0d0s5
sun01# metareplace -ef d6 c0t0d0s6
sun01# metasync d0
sun01# metasync d1
sun01# metasync d3
sun01# metasync d4
sun01# metasync d5
sun01# metasync d6
sun01# metasync d7

8. In final step you need to make the disk bootable so that operating system will be boot on the mirror disk.

sun01# installboot /usr/platform/`uname -i`/lib/fs/ufs/bootblk /dev/rdsk/c0t0d0s0

Using this step you can make a disk bootable. I hope this post is useful for you. You are requested to please comment on the post if you have any issue, I will try to back you with my answer.

How to Remove a Non-Global Zone from Solaris Server

In this post, I will explain to you how to remove a Non-Global Zone from Solaris Server.

As you aware that Non-Global zone are hosted on Global zone on Solaris Operating system. You can check the Non-Global zone list using "zoneadm" command. It will show you are running and installed zones on Global zones.

Step by Step Method of removal a Non-Global Zone:

First of all you need to check the Non-Global Zone list to ensure which zone is running on the server.

global# zoneadm list -iv

You will see a display that is similar to the following:

ID  NAME     STATUS       PATH                           BRAND      IP
 0    global       running         /                                   solaris    shared
 1    sun01       running         /zones/sun01                solaris    shared

In the above command output you can see the Non-Global Zone "sun01" is running, which we need to remove or delete from Solaris Server.

Now, we need to shutdown the required zone which we need to delete. We can shutdown the Non-Global zone using below commands.
--------------------------------------------
global#zoneadm -z sun01 halt
or
global#zoneadm -z sun01 shutdown
or
global#zlogin sun01 shutdown
-------------------------------------------
In next step when your Non-Global zone shutdown you need to uninstall the local zone. You can used the below method to uninstall the Non-Global Zone.

global#zoneadm -z sun01 uninstall

Using above command Non-Global zone "sun01" has been uninstall successfully.

In the last step you need to remove or delete all dataset and configuration files of Non-Global zone "sun01" from Global zone.

global#zonecfg -z sun01 delete

Using above command all the configuration files related to this Non-Global zone has been deleted successfully. Now you can remove the folder related to this zone.

So using above method we can remove or delete the Non-Global zone from global zone or Solaris Operating system. Please let me know if you are facing any issue during using this process.

Monday, February 20, 2017

How to Reset Root Password in HP-UX Operating System

In this article, We will learn how to recover or reset the root password in HP-UX operating system.

If you lost the root password on system running on HP-UX operating system, Please follow the below procedure step by step.

1. In the first step, please power on the HP-UX machine and boot the server into single user mode.

To boot the server in single user mode their is several way. Please find the simple way as described below.

Selecting a system to boot. To stop selection process, press and hold the ESCAPE key

Auto boot from primary boot path enabled. To override, press any key within 10 seconds.

Type boot pri isl at the prompt:
boot pri

At the ISL> prompt:, type
hpux -is /stand/vmunix

OR

hpux -is

Here, In above example, the -i option is used to make the system come up in run-level s, for single user mode of operation.

2. In second step while system booting into single user mode you need to interrrupt while booting the server. Once you interrupt the server you will get the HP-UX prompt so you can boot it in single user mode.

hpx:/>boot -is

3. In this step , you need to mount the "/usr" file system on HP-UX operating system server.

hpx:/>mount /usr

4. If it is trusted system on HP-UX operating platform then you need to run the below command on trusted system.

hpx:/>/usr/lbin/tsconvert -r


5. Now, in this step we will reset the root password. For this process we have two method to reset the root password on HP-UX operating system.

Method 1:

hpx:/>passwd root
using above command we can normally reset the root password and set the new password.

Method 2:

hpx:/> vi /etc/passwd

null the password field for root user, so root password will be reset.

6. If root user is locked then unlock using below command.

hpx:/>/usr/lbin/modprpw -k root

7. Once server is up in runlevel 3 again u need to convert as trusted systems.

hpx:/>/usr/lbin/tsconvert

So using above method you can reset the root password on HP-UX operating system server. Please comment on the post if you are facing any issue related to this post.

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 Increase or extend the size of a Linux LVM by adding a new hard disk

Hello Friends,

This post will cover how to increase the disk space for a VMware virtual machine running Linux that is using logical volume manager (LVM). Firstly we will add a new disk to the virtual machine and then extend the original LVM over this additional space.

As there are a number of different ways to increase disk space but I have also posted simple and step by step method. Using this method I am sure you will increase the space easily.

1. First of all before adding any hard disk please run the below command to check the how much space is currently left on the VG group.

#vgdisplay 









If you see above image you can found the volume group name, in my case it is "rootvg".

2. Now run the below command to see the existing LVM disk is currently used in LVM.

#fdisk -l














You can see the above output, the /dev/sda2 hard disk is in used for existing LVM. Now you can add new hard disk on the server.

3. Once you added the new hard disk on the server to increase the size on Linux LVM, lets assume the new hard disk labelled is /dev/sdb. In this step we will need to partition the new hard disk so we can use it.

#fdisk /dev/sdb

It should show us below message to us for next selection.

root@localhost:~# fdisk /dev/sdb
Command (m for help): n

Please select the "n" for adding a new partition. Once we will select the "n" for new partition it is show to us below screen.

Command action
   e   extended
   p   primary partition (1-4)p

We will select the "p" for primary partition so we will add new had disk /dev/sdb as a primary partition.
----------------------------------------------------------------------------------------
Partition number (1-4): 1

First cylinder (1-2610, default 1): "enter"
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-2610, default 2610): "enter"
Using default value 2610
----------------------------------------------------------------------------------------
In above screen, we will select 1 for primary partition and make a default settings.

‘t’ is selected to change to a partitions system ID, in this case we change to ’1′ automatically as this is currently our only partition.
----------------------------------------------------------------------------------------
Command (m for help): t
Selected partition 1
----------------------------------------------------------------------------------------
The hex code ’8e’ was entered as this is the code for a Linux LVM which is what we want this partition to be, as we will be joining it with the original Linux LVM which is currently using /dev/sda4.
----------------------------------------------------------------------------------------
Hex code (type L to list codes): 8e
Changed system type of partition 1 to 8e (Linux LVM)
----------------------------------------------------------------------------------------
‘w’ is used to write the table to disk and exit, all changes that have been done will be saved and then you will be exited from fdisk.
----------------------------------------------------------------------------------------
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
----------------------------------------------------------------------------------------

By using “fdisk -l” now you will be able to see that /dev/sdb1 is listed, this is the new partition created on our newly added /dev/sdb disk.

4. Now we will create a physical volume with this newly added hard disk /dev/sdb1. For physical volume creation we will use "pvcreate" command.

#pvcreate /dev/sdb1
Physical volume "/dev/sdb1" successfully created.

In above command output, you can see the /dev/sdb1 physical volume group has been created.

5. Now the most important steps of this post is using physical volume you can extend or create a new volume group.

If you want to extend the logical volume size of existing Volume group then please use the below command and method. 

#vgextend test /dev/sdb1

In my case my VG name is "test" so I will extend the space in existing VG "test".

If you want to create the new logical voume and want to add physical volume in new VG, please use the below command and method.

#vgcreate rootvg /dev/sdb1

In this case my new VG name is "rootvg".

So, as per my this post, you can add new hard disk in to existing volume group or newly created volume group. Using this volume group you can create or extend the Linux LVM size.