Tanti Technology

My photo
Bangalore, karnataka, India
Multi-platform UNIX systems consultant and administrator in mutualized and virtualized environments I have 4.5+ years experience in AIX system Administration field. This site will be helpful for system administrator in their day to day activities.Your comments on posts are welcome.This blog is all about IBM AIX Unix flavour. This blog will be used by System admins who will be using AIX in their work life. It can also be used for those newbies who want to get certifications in AIX Administration. This blog will be updated frequently to help the system admins and other new learners. DISCLAIMER: Please note that blog owner takes no responsibility of any kind for any type of data loss or damage by trying any of the command/method mentioned in this blog. You may use the commands/method/scripts on your own responsibility. If you find something useful, a comment would be appreciated to let other viewers also know that the solution/method work(ed) for you.

Monday 21 October 2013

Knowing the aix filesystem structure

what is filesystem?


A filesystem is a set of files ,directories and other structures.


filesystem maintains information and identify the location of a file or directory's data .


it may also contain  a boot block, a superblock ,bitmaps and one or more allocation groups.


*allocation group contains disk i-nodes and fragments.




filesystem supported by aix


    1.  JFS(journaled filesystem)
    2.  JFS2(enhanced journaled filesystem)
    3.  NFS(network filesystem)
    4.  CDRFS(cd-rom filesystem)


JFS


it uses database journaling techniques, such as recording file changes sequentially,  to a mintain the integrity of control structure.


each journaled filesysten resides on distint jfs logical volume


JFS2
it uses extent based allocation to allow higher performance,larger filesystem and larger file-size.


each enhanced journaled filesystem must reside on a distinct JFS2 logical volume.


when aix is installed using default option ,it creates JFS2 filesystem.


NFS


it is distributed filesystem that allows users to access files and directories located on remote computers and use those files and directories as they are local.


CDRFS


this filesystem allows you to access the content of CD-ROM through the normal filesystem interfaces.




filesystem structure


journaled file-system uses following data structures:


               1.)  superblock
               2.)  allocation group
               3.)  inodes
               4.)  blocks
               5.)  fragments
               6.)  device logs


superblock


super block contains controlinformation aboyt a filesyatem such as
 1. overall size of file-system in 512 byte blocks
 2. file-system name
 3. file-system log device
 4. version no.
 5. no. of inodes 
 6. list of free inodes,free blocks
 7. date and time of creation
 8. file-system state


corruption of super-block may lead the  filesystem to become un-usable.


***the system keeps a second copy of the super-block on logical block 31.


allocation group


An allocation group consists of inodes and its correspondong data blocks.


An allocation group spans multiple adjacentdisk blocks and improves the speed of i/o operations


inode


inode contains control information about the file .it contains following details of files

 1. type
2. size
3. owner
4. date and time of creation
5. last accessed
6. a pointer to block that stores the actual data


# istat  /abhi/aks


data block 


data block stores the actual data of the file or pointers to another data block




device logs


the jfs log stores transactional information about filesystem metadata changes. this data can be used to roll back incomplete operations if the machine crashes.




*filesystem used for logging is of type "jfs2log"
in aix, hd8 is the common log  


things you must know

/root            -  it is root user home directory.

/home          - here all users that you have created will be stored.

/bin             -  it contains executable binaries that any user can run.

/sbin           -  it contains the executable binaries that only admin or root  user can run.

/etc              - it contains all the configuration files. like files related to DNS ,DHCP configuration etc

/dev             -  as we know that in unix everything is file. so, all devices that are defined in aix will have one
                                     file in this directory.

/tmp             -      it contains all the temporary files.

/var               -     it contains all the log files                     

VIO SERVER BASICS

virtual I/O is the term used to describe the ability to share physical I/O resources across partiotions.


physical resouces that are being shared are adapter cards located in pci-x slots of managed system.


vioserver software runs on seperate partitions. which is created using HMC.






benifits of vio server


partitions can be created without requiring additional physical adapter.


 suppose you are having 3 ethernet adapters in your P570 box. and you have planned to create 12 partiotions. it means you need 12 physical ethernet adapters for this that means extra cost . because of this only vio server came into picture. by using vio server if you are having only one ethernet adapter that is enough and is assigned to vio server .  in this scenario you can create 12 virtual ethernet adapter through HMC  and assign to the partitions.


going to aix environment


$help  - it is very useful  .it will show you list of commands used in vio server .


$oem_setup_env


you will get #prompt. now you can run aix commands




to view the mapping



$ lsmap -all
SVSA            Physloc                             Client Partition ID
--------------- -------------------------------------- ------------------
vhost0          U8234.ZMA.0123494-V5-C22            0x00000006

VTD                   vtscsi0
Status                Available
LUN                   0x7100000000000000
Backing device        abhivg_rootvg
Physloc

VTD                   vtscsi44
Status                Available
LUN                   0x8800000000000000
Backing device        hdisk99
Physloc               U7311.i20.063CD7C-P1-C02-T1                                                                                                
SVSA Physloc Client Partition ID --------------- ----------------------------------------------------- vhost1 U8234.zmc.01234C94-V5-C22 0x00000001 VTD NO VIRTUAL TARGET DEVICE FOUND


here, you see the  vhost0vhost1 these are the adapters corresponding to particular partition.

here , vhost0  corresponds to partition id 6
         vhost1  correspond to partition id 1

VIRTUAL TARGET DEVICE(VTD)
it can be logical volume,PV or a file that you are assigning  to particular  partition by mapping that with the related adapter(vhost). 

here for vhost0  ,
 a VTD  is defined named vtscsi0 which is backed by logical volume "abhivg_rootvg"
also vtscsi44 which is backed by hdisk99 attached to vio server.


how to map the VTD to particular partition.






1.create a logical volume of the required size you want to map.


$mklv -lv abhilv rootvg 5G
abhilv available


#lsvg -lv rootvg


2. map the logcal volume to particular adapter(vhost#) associated to the particular partition using "mkvdev" command.

$ mkvdev -vdev abhilv -vadapter vhost3 -dev abhi_disk
abhi_disk Available




in this command the following parameters are used,


-vdev -  to specify  the backing device
-vadapter - the adapter corresponding to particular partition you want to map
-dev - to give the name for VTD





$ lsmap -vadapter vhost3

SVSA            Physloc                       Client Partition ID
--------------- ------------------------------- ------------------
vhost3          U8234.EMA.0688C94-V5-C24      0x00000007

VTD                   abhi_disk
Status                Available
LUN                   0x8100000000000000
Backing device        abhilv
Physloc   


how to remove the virtual target device
            
$ rmdev -dev abhi_disk  or $ rmvdev -vtd  abhi_disk
abhi_disk removed
$lsmap -vadapter vhost3

SVSA            Physloc                            Client Partition ID
--------------- -----------------------------------------------------
vhost3         U8234.zmc.01234C94-V5-C22          0x00000007

VTD                   NO VIRTUAL TARGET DEVICE FOUND

vio server patch management

Step 1

  *   Download the service pack from the fix central website.
  *   Go through the   Readme and Release Notes for Virtual I/O Server 2.2 VIOS 2.2.0.10 FixPack 24
  *   Copy  the  service pack to /tmp.


                         #  scp  –r    VIOS_2.2.0.10-FP24   padmin@:/tmp

Step 2


*        Take the configuration  backup

*      check the  current ioslevel
                
                     $  ioslevel
                         2.1.3.0

*       take the vios-mksysb

              $ backupios-file -mksysb

*        take the viosbr backup
                   $ viosbr -backup -file  /home/padmin/ abhi_config  

*       check the readability of viosbr image

                     $ viosbr -view -file /tmp/abhi_config_bkp.tar.gz

If everything is ok  go ahead  with the upgradation activity.

step 3

Before applying any  new package we need to commit the older ioslevel.
                
                       $ updateios  -commit
                       There are no uncommitted updates.

step 4

start  the vio-upgrade using the command updateios.

                         $ updateios -install -accept  -dev /tmp/VIOS_2.2.0.10-FP24/


Output looks like this.....
                         
                  *******************************************************************************
                                                  installp PREVIEW:  installation will not actually occur.
                                        +-----------------------------------------------------------------------------+
                                                                  Pre-installation Verification...
                                         +-----------------------------------------------------------------------------+
                                                                  Verifying selections...done
                                                                 Verifying requisites...done
                                                                  Results...
                                                                   WARNINGS
                                                                              --------
                                                                 Problems described in this section are not likely to be the source of any
                                                                 immediate or serious failures, but further actions may be necessary or
                                                                 desired.
                                                      Already Installed
                                                 -----------------
                                                                 The following filesets which you selected are either already installed
                                                                 or effectively installed through superseding filesets.
                                                                           tpc.rte 4.1.0.97                                          # TPC Runtime Install Files
                                                                          tivoli.tsm.client.msg.ZH_TW 6.1.0.0        # TSM Client Messages - Chines...
                                                                         tivoli.tsm.client.msg.ZH_CN 6.1.0.0         # TSM Client Messages - Chines...
                                                                       tivoli.tsm.client.msg.RU_RU 6.1.0.0           # TSM Client Messages - Russian
                                                                       tivoli.tsm.client.msg.PT_BR 6.1.0.0           # TSM Client Messages - Portug...
                                                                       tivoli.tsm.client.msg.PL_PL 6.1.0.0           # TSM Client Messages - Polish
                                                                       tivoli.tsm.client.msg.KO_KR 6.1.0.0        # TSM Client Messages - Korean
                                                                       tivoli.tsm.client.msg.JA_JP 6.1.0.0         # TSM Client Messages - Japanese
                                                                        tivoli.tsm.client.msg.IT_IT 6.1.0.0         # TSM Client Messages - Italian
   


---------------------------some output truncated-----------------------------------------------------


step 5


once  patch  upgradation is complete you will get the prompt.
now check the “installation summary”. check the result field.
if it contains "success" then  no issues you have successfully upgraded the server.
Installation Summary
-----------------------------------------------------------------------------------------------------------
Name                                                 Level          Part           Event          Result
------------------------------------------------------------------------------------------------------------
bos.rte.install                                    6.1.6.1         USR         APPLY       SUCCESS
bos.rte.install                                    6.1.6.1         ROOT      APPLY       SUCCESS
vios.agent.rte                                    1.0.0.0         USR         APPLY       SUCCESS
vios.agent.rte                                    1.0.0.0         ROOT      APPLY       SUCCESS
pool.basic.rte                                    6.1.6.0         USR         APPLY       SUCCESS
pool.basic.rte                                    6.1.6.0         ROOT      APPLY       SUCCESS
xlC.aix61.rte                                     11.1.0.1       USR         APPLY       SUCCESS
tivoli.tivguid                                     1.3.3.1         USR         APPLY       SUCCESS
tivoli.tivguid                                     1.3.3.1         ROOT      APPLY       SUCCESS
sysmgt.cimserver.pegasus.rte           2.9.0.20       USR         APPLY       SUCCESS
sysmgt.cimserver.pegasus.rte           2.9.0.20       ROOT      APPLY       SUCCESS
sysmgt.cim.providers.osbase            1.2.8.20       USR         APPLY       SUCCESS
sysmgt.cim.providers.smash             1.2.8.20       USR         APPLY       SUCCESS
sysmgt.cim.providers.scc                  1.2.8.20       USR         APPLY       SUCCESS
sysmgt.cim.providers.metric             1.2.8.20       USR         APPLY       SUCCESS


step 6

now you need to shutdown  the vio  server.
before shutting down ,check whether all vio-clients are shutdown if not shutdown
all  vio-client partitions.

once done shutdown the vio-server.

                             $ shutdown -restart


step 7


*       Once the vio server is up .login to the server  and accept the license.
                                 $ license -accept

*       Check the ioslevel.
                                   $ ioslevel
                                     2.2.0.10-FP-24

That means vio- upgradation  is complete.

step 8

check the mappings  and configuration  details from the configuration backup 

VIO server introduction.

The Virtual I/O Server is software that is located in a logical partition. 

This software facilitates the sharing of physical I/O resources between client logical partitions within the server. 

The Virtual I/O Server provides virtual SCSI target, virtual fibre channel, Shared Ethernet Adapter, and PowerVM™ Active Memory Sharing capability to client logical partitions within the system. 

As a result, client logical partitions can share SCSI devices, fibre channel adapters, Ethernet adapters, and expand the amount of memory available to logical partitions using paging space devices. 

The Virtual I/O Server software requires that the logical partition be dedicated solely for its use. 

--------------------------------------------------------------------------------------------------------------------------

 Why to use vio server



Using the Virtual I/O Server facilitates the following functions: 

  •  Sharing of physical resources between logical partitions on the system

  •  Creating logical partitions without requiring additional physical I/O resources

  •  Creating more logical partitions than there are I/O slots or physical devices available with the ability for logical partitions to have dedicated I/O, virtual I/O, or both

  •  Maximizing use of physical resources on the system

  •  Helping to reduce the Storage Area Network (SAN) infrastructure



--------------------------------------------------------------------------------------------------------------------------
                               



Requirement for vio server.

 Minimum Hardware requirements to create the Virtual I/O Server partition: 

  1.     POWER5 server,     :    the VIO capable machine.
  2.     Hardware management console(HMC) : to create the partition and assign resources.
  3.     Storage adapter:         The server partition needs at least one storage adapter. 
  4.     Physical disk:             A disk large enough to make sufficient-sized logical volumes on it.
  5.     Ethernet adapter:        Allows securely route network traffic from a virtual  Ethernet   to                                                 real network adapter.
       6.      Memory:                     At least 128 MB of memory.

--------------------------------------------------------------------------------------------------------------------------

 NOTE:                     The Virtual I/O Server provides the Virtual SCSI (VSCSI) Target and Shared Ethernet adapter virtual I/O function to client partitions. 
                            This is accomplished by assigning physical devices to the Virtual I/O Server partition, then configuring virtual adapters on the clients to allow communication between the client and the Virtual I/O Server. 



-----------------------------------------------------------------------------------------------------------------------



SUPPORTED OS AS VIO CLIENT

Virtual I/O server supports the following operating systems as virtual I/O client:
 •    AIX 
 •    SUSE LINUX Enterprise Server 9 for POWER 
  •   Red Hat Enterprise Linux AS for POWER Version 3 
  •   Red Hat Enterprise Linux AS for POWER Version 4 










Capabilities of the Virtual I/O Server 

  •        Ethernet Adapter Sharing
  •        Virtual SCSI disK
  •        Interacts with AIX and Linux partitions

  •                 The Virtual I/O Server provides a restricted scriptable command line user interface (CLI). All aspects of Virtual I/O server administration are accomplished through the CLI, including:-
                                 Device management (physical, virtual, LVM) 
                                 Network configuration 
                                 Software installation and update 
                                 Security 
                                 User management 
                                 Installation of OEM software 
                                 Maintenance tasks

  •     The creation and deletion of the virtual client and server adapter is managed by the HMC GUI and POWER5 server firmware. The association between the client and server adapters is defined when the virtual adapters are created.



VIRTUAL SCSI

 •       Virtual SCSI is based on a client/server relationship. 
 •       The virtual I/O resources are assigned using an HMC. 
 •       Virtual SCSI enables sharing of adapters as well as disk devices. 
 •       Dynamic LPAR operations allowed. 
 •       Dynamic mapping between physical and virtual resources on the virtual I/O server. 

NOTE:        Virtual SCSI is based on a client/server relationship. The virtual I/O server owns the physical resources and acts as the server. The logical partitions access the virtual I/O resources provided by the virtual I/O server as the clients.

The virtual I/O resources are assigned using an HMC.

.Virtual SCSI enables sharing of adapters as well as disk devices.

>>>>>>>>                To make a physical or a logical volume available to a client partition, it is assigned to a virtual SCSI server adapter in the virtual I/O server partition. 
                                   The client partition accesses its assigned disks through a virtual SCSI client adapter. It sees standard SCSI devices and LUNs through this virtual adapter.

>>>>>>>                     Virtual SCSI resources can be assigned and removed dynamically. On the HMC, virtual SCSI target and server adapters can be assigned and removed from a partition using dynamic logical partitioning. 
                                      The mapping between physical and virtual resources on the virtual I/O server can also be done dynamically.

>>>>>>>                        A disk owned by the virtual I/O server can either be exported and assigned to a client partition as a whole or it can be split into several logical volumes. Each of these logical volumes can then be assigned to a different partition.




  EFFECT ON PERFORMNACE IF  USING VSCSI



 This is because there is an overhead associated with Hypervisor calls, and because of the several steps involved for the I/O requests from the initiator to target partition,

 VSCSI will use additional CPU cycles when processing I/O requests. This will not give the same performance from VSCSI devices as from dedicated devices.

 The use of Virtual SCSI will roughly double the amount of CPU time to perform I/O as compared to using directly attached storage. This CPU load is split between the Virtual I/O Server and the Virtual SCSI Client. 

Performance is expected to degrade when multiple partitions are sharing a physical disk, and actual impact on overall system performance will vary by environment. The base-case configuration is when one physical disk is dedicated to a partition.



VIRTUAL ETHERNET


 •         Enables inter-partition communication.
 •         In-memory point to point connections 
 •         Physical network adapters are not needed. 
 •         Similar to high-bandwidth Ethernet connections. 
 •         Supports multiple protocols (IPv4, IPv6, and ICMP). 
 •         No Advanced POWER Virtualization feature required. 


The Virtual Ethernet enables inter-partition communication without the need for physical network adapters in each partition.

 The Virtual Ethernet allows the administrator to define in-memory point to point connections between partitions.

 These connections exhibit similar characteristics, as high bandwidth Ethernet connections supports multiple protocols (IPv4, IPv6, and ICMP). 

Virtual Ethernet requires a POWER5 system with either AIX 5L V5.3 or the appropriate level of Linux and a Hardware Management Console (HMC) to define the Virtual Ethernet devices.

Virtual Ethernet does not require the purchase of any additional features or software, such as the Advanced Virtualization Feature.

Virtual Ethernet is also called "Virtual LAN or even VLAN", which can be confusing, because these terms are also used in network topology topics. But the Virtual Ethernet, which uses virtual devices, has nothing to do with the VLAN known from Network-Topology, which divides a LAN in further Sub-LANs.




 Viosbr Command


The viosbr command  is used  to back up all the relevant data to recover a VIOS after an installation.  


 The viosbr command backs up following mentioned details :-


2.      Logical devices,  such as storage pools,  clusters (VIOS Version 2.2.0.11, Fix Pack 24, Service Pack 1, or later),  file-backed storage pools,  the virtual media repository, and paging space devices.


3.     Virtual devices, such as Etherchannel, shared Ethernet adapter, virtual server adapters, and virtual-server fiber channel adapters.


4.     Device attributes for devices like disks, optical devices, tape devices, fscsi controllers, Ethernet adapters, Ethernet interfaces, and logical Host Ethernet Adapters.


   While viosbr allows you to restore mappings





Backupios  command 


 backupios is used to restore the whole VIOS operating system. 


"The backupios command creates a backup of the Virtual I/O server and places it onto a file system, bootable tape or DVD. You can use this backup to reinstall a system to its original state     after it     has been corrupted

Again, be sure to backup your VIOS environment with both viobr and backupios. Together, they give you the tools you need should something go wrong.


Updateios  command

The updateios command is used to install fixes, or to update the Virtual I/O Server to the latest maintenance level. 

to commit the installed updates, type the following command: 


# updateios -commit


To update the Virtual I/O Server to the latest level, where the updates are located on the mounted file system /home/padmin/update, type the following command: 


# updateios -dev /home/padmin/update