May 31, 2016

Actual Memory monitoring in AIX systems

Many AIX users are facing troubles during actual memory usage in IBM servers. But the below simple calculation may reduce your doubts.

The command svmon -G can be used to determine the actual memory consumption of a server. To determine if the memory is over-committed, you need to divide the memory-virtual value by the memory-size value, e.g.:

bash-4.2# svmon -G
               size       inuse        free         pin     virtual   mmode
memory      8388608     8357353       31255     1831582     6924332     Ded
pg space    4325376       29713

               work        pers        clnt       other
pin         1577710           0           0      253872
in use      6924332           5     1433016

PageSize   PoolSize       inuse        pgsp         pin     virtual
s    4 KB         -     2981497       29713      337742     1548476
m   64 KB         -      335991           0       93365      335991
bash-4.2# 

In this example, the memory-virtual value is 6924332, and the memory-size value is 5079040. Note that the actual memory-inuse (8388608) is nearly the same as the memory-size (5079040) value. This is simply AIX caching as much as possible in its memory. Hence, the memory-free value is typically very low, 31255 in the example above. As such, determining the memory size based on the memory-free value does not provide a good interpretation of the actual memory consumption, as memory typically includes a lot of cached data.

Now, to determine the actual memory consumption, divide memory-virtual by memory-size:

# bc
scale=2
6924332/8388608
.82


Thus, the actual memory consumption is 82% of the memory. The size of the memory is 8388608 blocks of 4 KB = 2097152 MB. The free memory is thus: (100% - 82%) * 2097152 MB = 37748736 MB.

Try to keep the value of memory consumption less than 90%. Above that, you will generally start seeing paging activity using the vmstat command. By that time, it is a good idea to lower the load on the system or to get more memory in your system.

May 26, 2016

Managing disk/ storage in Linux

1) df - disk space of file systems
Reports various partitions, their mount points and the used and available space on each.

# df -H
Filesystem             Size   Used  Avail Use% Mounted on
/dev/mapper/ROOTVG-rootfs
                        21G    14G   6.1G  70% /
tmpfs                   11G   7.7G   2.9G  73% /dev/shm
/dev/sda1              508M    40M   442M   9% /boot
/dev/mapper/ROOTVG-tmpfs
                       5.2G   145M   4.8G   3% /tmp
/dev/mapper/DATAVG-datalv01
                       529G   409G    94G  82% /u01
/dev/mapper/TEMPVG-templv01
                       269G   193G    63G  76% /u10
#

2) fdisk -l
Use fdisk -l to list all disk / storage attached to system. But if system is a vm and multipather is enabled, then message/ output will be more.
you can use below filterations and other commands to view details about disk / storage

a) Using lsblk:

# lsblk -o KNAME,TYPE,SIZE,MODEL
KNAME TYPE   SIZE MODEL
sda   disk   150G Virtual Disk  
sda1  part   500M
sda2  part   127G
dm-0  lvm   19.5G
dm-1  lvm     16G
dm-4  lvm    4.9G
sdb   disk   127G Virtual Disk  
sdb1  part   127G
dm-3  lvm    254G
sdd   disk   127G Virtual Disk  
dm-3  lvm    254G
sdc   disk   500G 1814      FAStT
dm-2  lvm    500G
[root@eh-uatdb1 ~]#


b) Using filters in lsblk


# lsblk -d -n -oNAME,RO | grep '0$' | awk {'print $1'}
sda
sdb
sdd
sdc
#

c) lsblk command is graphical window:


















d) view disks

# file /dev/disk/by-id/* | awk -F'/' 'NR>1{print "\047/dev/"$NF}' | sort | uniq
'/dev/dm-0'
'/dev/dm-1'
'/dev/dm-2'
'/dev/dm-3'
'/dev/dm-4'
'/dev/sda'
'/dev/sda1'
'/dev/sda2'
'/dev/sdb'
'/dev/sdb1'
'/dev/sdc'
'/dev/sdd'
#

e) sfsik

Sfdisk is another utility with a purpose similar to fdisk, but with more features. It can display the size of each partition in MB.

f) more filteration on sfdisk
# sfdisk -l -uM

Disk /dev/sda: 19581 cylinders, 255 heads, 63 sectors/track
Units = mebibytes of 1048576 bytes, blocks of 1024 bytes, counting from 0

   Device Boot Start   End    MiB    #blocks   Id  System
/dev/sda1   *     1    500    500     512000   83  Linux
/dev/sda2       501  130557  130057  133178368   8e  Linux LVM
/dev/sda3         0      -      0          0    0  Empty
/dev/sda4         0      -      0          0    0  Empty

Disk /dev/sdb: 16578 cylinders, 255 heads, 63 sectors/track
Units = mebibytes of 1048576 bytes, blocks of 1024 bytes, counting from 0

   Device Boot Start   End    MiB    #blocks   Id  System
/dev/sdb1         0+ 130047  130048- 133169151+  8e  Linux LVM
/dev/sdb2         0      -      0          0    0  Empty
/dev/sdb3         0      -      0          0    0  Empty
/dev/sdb4         0      -      0          0    0  Empty

Disk /dev/sdd: 16578 cylinders, 255 heads, 63 sectors/track

Disk /dev/sdc: 65270 cylinders, 255 heads, 63 sectors/track
Units = mebibytes of 1048576 bytes, blocks of 1024 bytes, counting from 0

   Device Boot Start   End    MiB    #blocks   Id  System
/dev/sdc1         0      -      0          0    0  Empty
/dev/sdc2         0      -      0          0    0  Empty
/dev/sdc3         0      -      0          0    0  Empty
/dev/sdc4         0      -      0          0    0  Empty

Disk /dev/mapper/ROOTVG-rootfs: 2549 cylinders, 255 heads, 63 sectors/track

Disk /dev/mapper/ROOTVG-swapfs: 2088 cylinders, 255 heads, 63 sectors/track

Disk /dev/mapper/DATAVG-datalv01: 65270 cylinders, 255 heads, 63 sectors/track

Disk /dev/mapper/TEMPVG-templv01: 33156 cylinders, 255 heads, 63 sectors/track

Disk /dev/mapper/ROOTVG-tmpfs: 637 cylinders, 255 heads, 63 sectors/track
#

f) lsscsi - List scsi devices

Lists out the scsi/sata devices like hard drives and optical drives.

[root@eh-uatdb1 ~]# lsscsi
[0:0:0:0]    disk    Msft     Virtual Disk     1.0   /dev/sda
[1:0:0:0]    disk    Msft     Virtual Disk     1.0   /dev/sdb
[1:0:0:1]    disk    IBM      1814      FAStT  1060  /dev/sdc
[1:0:0:2]    disk    Msft     Virtual Disk     1.0   /dev/sdd
[root@eh-uatdb1 ~]#



3) Find CPU details using "lscpu" command:

# lscpu
Architecture:          x86_64
CPU op-mode(s):        32-bit, 64-bit
Byte Order:            Little Endian
CPU(s):                4
On-line CPU(s) list:   0-3
Thread(s) per core:    1
Core(s) per socket:    4
CPU socket(s):         1
NUMA node(s):          1
Vendor ID:             GenuineIntel
CPU family:            6
Model:                 44
Stepping:              2
CPU MHz:               2399.493
BogoMIPS:              4798.98
Hypervisor vendor:     Microsoft
Virtualization type:   full
L1d cache:             32K
L1i cache:             32K
L2 cache:              256K
L3 cache:              12288K
NUMA node0 CPU(s):     0-3
#



4) mount
The mount is used to mount/unmount and view mounted file systems.

[root@eh-uatdb1 ~]# mount | column -t
/dev/mapper/ROOTVG-rootfs    on  /                         type  ext4                   (rw)
proc                         on  /proc                     type  proc                   (rw)
sysfs                        on  /sys                      type  sysfs                  (rw)
devpts                       on  /dev/pts                  type  devpts                 (rw,gid=5,mode=620)
tmpfs                        on  /dev/shm                  type  tmpfs                  (rw)
/dev/sda1                    on  /boot                     type  ext4                   (rw)
/dev/mapper/ROOTVG-tmpfs     on  /tmp                      type  ext4                   (rw)
/dev/mapper/DATAVG-datalv01  on  /u01                      type  ext4                   (rw)
/dev/mapper/TEMPVG-templv01  on  /u10                      type  ext4                   (rw)
none                         on  /proc/sys/fs/binfmt_misc  type  binfmt_misc            (rw)
/tmp                         on  /tmp                      type  none                   (rw,bind)
/var/tmp                     on  /var/tmp                  type  none                   (rw,bind)
/home                        on  /home                     type  none                   (rw,bind)
none                         on  /sys/kernel/config        type  configfs               (rw)
sunrpc                       on  /var/lib/nfs/rpc_pipefs   type  rpc_pipefs             (rw)
gvfs-fuse-daemon             on  /root/.gvfs               type  fuse.gvfs-fuse-daemon  (rw,nosuid,nodev)
[root@eh-uatdb1 ~]#

5) View details from attached volume groups:

( must be in graphical view)

system --> administration --> Logical volume management -->

It will show below window. Here you can manage your volume groups. You can create lvs also.


6) Creating VG and LV on Linux :

To view Un-allocated volume and Create volume group (VG):

system --> administration --> Logical volume management --> Unallocated Volumes --> Partition
( see below image to follow)





























To create Logical Volume(LV)  on VG:

system --> administration --> Logical volume management --> select VG name --> Create :Logical Volume --> Enter Logival Volume Name --> Give LV size --> Give proposed mount point Name ( go with default file system)
( see below image to follow)






























To View the LV name:
system --> administration --> Logical volume management --> select VG name -->select Logical View ( here you can view any space available to create more lv or not)





























Related Link:

creating volume groups and mount storage in IBM-AIX



May 20, 2016

creating volume groups and mount storage in IBM-AIX

This small document will helps you how to create volume groups (VG) after mapping host from storage.

Step-1 : Run "cfmgr" after mapping host in storage

e.g.,
# cfgmgr


Step-2 : List attached disks, use “lspv” ( physical volume)

# lspv
hdisk0          00f9d98b1cc32587                    rootvg          active     
hdisk1          none                                None                       
hdisk2          none                                None                       
hdisk3          none                                None                       

#

Here, after disk name "none" is coming means, physical volume is not created. So you need to create pvs.

Step-3 : Verify the size of attached disks

# bootinfo -s hdisk1
102400
# bootinfo -s hdisk2
1048576
# bootinfo -s hdisk3
512000
#

Step-4: create volume group (vg)

a) Enable pv, It will create pvid :
# chdev -l hdisk1 -a pv=yes
hdisk1 changed
# chdev -l hdisk2 -a pv=yes
hdisk2 changed
# chdev -l hdisk3 -a pv=yes
hdisk3 changed
#

 b) Now list all PVs, it will show all PVid.

bash-4.2# lspv
hdisk0          00f9d98b1cc32587                    rootvg          active     
hdisk1          00f9d98bc23769cf                    None                       
hdisk2          00f9d98bc2381d77                    None                       
hdisk3          00f9d98bc238343f                    None                       
bash-4.2#

c) Now create Volume group:
# smit mkvg à Add an Original Volume group à Enter Volume group name ( e.g., binvg) à Now select required / planned PV Name ( as seen below) à





















à e.g., select “hdisk1”. See below screen shot



















à Now run set info (press two times enter) à Exit ( Esc + 0)
Note: select "yes" if you want to create volume group forcefully. 

Now confirm, whether PV created or not. 

# lsvg
rootvg
binvg
#
# lspv
hdisk0          00f9d98b1cc32587                    rootvg          active     
hdisk1          00f9d98bc23769cf                    binvg           active     
hdisk2          00f9d98bc2381d77                    None                       
hdisk3          00f9d98bc238343f                    None                        
#
( Initially “None” when not assigned to any VG). 

Step-5: create File system

# smitty crfs
Select “Add an Enhanced Journal File system” à select “ Add an Enhanced Journal File system” again ( to automatically create logical volume (LV) à select your VG ( eg, binvg) à




















à select Unit ( as GB) . Use Esc+4 to list info à Enter Required size ( use max -2 GB aprx from actual VG size) à  Enter Mount point Name à Select restartable  option as “Yes” (see from below screen shot) – Press Enter to Apply




















After hit “Enter” key




















Step-6 : Now mount it

n  Before mount
bash-4.2# df -g
Filesystem    GB blocks      Free %Used    Iused %Iused Mounted on
/dev/hd4          10.00      9.81    2%    10880     1% /
/dev/hd2           5.00      2.08   59%    63366    12% /usr
/dev/hd9var        5.00      4.69    7%     6351     1% /var
/dev/hd3          20.00     10.85   46%      409     1% /tmp
/dev/hd1           5.00      5.00    1%        5     1% /home
/dev/hd11admin      0.50      0.50    1%        5     1% /admin
/proc                 -         -    -         -     -  /proc
/dev/hd10opt       5.00      4.86    3%     7004     1% /opt
/dev/livedump      0.50      0.50    1%        4     1% /var/adm/ras/livedump
bash-4.2#
bash-4.2# mount /u01
bash-4.2#
After mount
bash-4.2# df -g
Filesystem    GB blocks      Free %Used    Iused %Iused Mounted on
/dev/hd4          10.00      9.81    2%    10880     1% /
/dev/hd2           5.00      2.08   59%    63366    12% /usr
/dev/hd9var        5.00      4.69    7%     6351     1% /var
/dev/hd3          20.00     10.85   46%      409     1% /tmp
/dev/hd1           5.00      5.00    1%        5     1% /home
/dev/hd11admin      0.50      0.50    1%        5     1% /admin
/proc                 -         -    -         -     -  /proc
/dev/hd10opt       5.00      4.86    3%     7004     1% /opt
/dev/livedump      0.50      0.50    1%        4     1% /var/adm/ras/livedump
/dev/fslv00       98.00     97.98    1%        4     1% /u01
bash-4.2#

In similar way I assigned all PVs ( Physical volumes):

# lspv
hdisk0          00f9d98b1cc32587                    rootvg          active     
hdisk1          00f9d98bc23769cf                    binvg           active     
hdisk2          00f9d98bc2381d77                    datavg          active     
hdisk3          00f9d98bc238343f                    bkpvg           active     
bash-4.2#
#
bash-4.2# lsvg
rootvg
binvg
datavg
bkpvg
#
# df –g
bash-4.2# df -g
Filesystem    GB blocks      Free %Used    Iused %Iused Mounted on
/dev/hd4          10.00      9.81    2%    10895     1% /
/dev/hd2           5.00      2.08   59%    63366    12% /usr
/dev/hd9var        5.00      4.69    7%     6353     1% /var
/dev/hd3          20.00     10.85   46%      409     1% /tmp
/dev/hd1           5.00      5.00    1%        5     1% /home
/dev/hd11admin      0.50      0.50    1%        5     1% /admin
/proc                 -         -    -         -     -  /proc
/dev/hd10opt       5.00      4.86    3%     7004     1% /opt
/dev/livedump      0.50      0.50    1%        4     1% /var/adm/ras/livedump
/dev/fslv00       98.00     97.98    1%        4     1% /u01
/dev/fslv01      990.00    989.85    1%        4     1% /u02
/dev/fslv02      445.00    444.93    1%        4     1% /u03
bash-4.2#


Add more disk to exting VG:

If you want to add more disks to existing volume group, then you need to extend volume group.

Extend VG ( add more disk to exting vg):

e.g.,

# smit extendvg























To remove exting file system:

If you want to remove one exiting file system, then you need to use "rmfs". So that you can create new vg and file system. But before that you need to clear the volume group.

#rmfs /u01

To Clear Volume Group ( vg):
e.g.,
# chdev -l hdisk4 -a pv=clear

To view what storage attached:
Use "lsdev" command to view storage attached with passing "disk" as a parameter.

bash-4.2$ lsdev -Cc disk
hdisk0  Available 01-00-00 SAS RAID 10 Disk Array
hdisk1  Available 04-00-01 MPIO FC 2145
hdisk2  Defined   04-00-01 MPIO FC 2145
hdisk3  Available 04-00-01 MPIO FC 2145
hdisk4  Available 04-00-01 IBM MPIO DS5020 Array Disk
hdisk5  Available 04-00-01 MPIO FC 2145
hdisk6  Available 04-00-01 MPIO FC 2145
hdisk7  Available 04-00-01 MPIO FC 2145
hdisk8  Available 04-00-01 MPIO FC 2145
hdisk9  Available 04-00-01 MPIO FC 2145
hdisk10 Available 04-00-01 IBM MPIO DS5020 Array Disk
hdisk11 Available 04-00-01 IBM MPIO DS5020 Array Disk
hdisk12 Available 04-00-01 IBM MPIO DS5020 Array Disk
hdisk13 Available 04-00-01 IBM MPIO DS5020 Array Disk
bash-4.2$ 

To view details about volume groups ( vg):
e.g.,
# lsvg -l datavg
datavg:
LV NAME             TYPE       LPs     PPs     PVs  LV STATE      MOUNT POINT
loglv02             jfs2log    1       1       1    open/syncd    N/A
fslv03              jfs2       750     750     1    open/syncd    /u02


To find WWN number to map host in Storage:
a) AIX
       # lscfg -vl fcs*| grep "Network Address"
b) LINUX
      # systool -c fc_host -v | grep port_name
c) Window Server
Open Solution Manager, Then run below command in solution manager console
c:\> Get-WmiObject -class MSFC_FCAdapterHBAAttributes -namespace “root\WMI” | ForEach-Object {(($_.NodeWWN) | ForEach-Object {“{0:x}” -f $_}) -join “:”}


Related Link:

Managing disk / storage in Linux 

Have you changed your prompt!
-- Chnage prompt:
[ehdb6][/] => cd /tmp
[ehdb6][/tmp] => vi /etc/profile
[ehdb6][/tmp] => . profile
[ehdb6][/tmp] #


Scenario analysis:

-- During some maintenance activity, one of VG ( e.g., "binvg" deactivated.), I tried to tried to create with new vg name ( eg. binvg2) but while creating file system with mount option, it doesn't allow to proceed. Because already file system exits on that. I tried with "rmfs" to remove file system which was not worked. These are wrong attempts:

Now from this situation we will bring the existing "binvg".

-- After creating "binvg2"

bash-4.2# lspv
hdisk0          00047abed0a7c10c                    rootvg          active    
hdisk2          00047abe3407efc6                    None                      
hdisk3          00047abe33d16121                    None                      
hdisk4          00047abe19ec463c                    binvg2          active    
hdisk1          00047a6ae1ee0669                    rootvg          active    
hdisk5          00047abe19ec5b0c                    binvg2          active    
hdisk6          none                                None                      
hdisk7          none                                None                      
hdisk8          none                                None                      
hdisk9          none                                None                      
hdisk10         none                                None                      
hdisk11         none                                None                      
bash-4.2#

bash-4.2#
bash-4.2# lsvg -l binvg2
binvg2:
LV NAME             TYPE       LPs     PPs     PVs  LV STATE      MOUNT POINT

-- Showing "binvg" exists

bash-4.2# lsvg
old_rootvg
rootvg
binvg2
binvg
#

-- Export VG info to memory

bash-4.2# exportvg binvg

-- Deactivate "binvg2"

bash-4.2# varyoffvg binvg2
bash-4.2# exportvg binvg2

-- View physical volumes

bash-4.2# lspv
hdisk0          00047abed0a7c10c                    rootvg          active    
hdisk2          00047abe3407efc6                    None                      
hdisk3          00047abe33d16121                    None                      
hdisk4          00047abe19ec463c                    None                      
hdisk1          00047a6ae1ee0669                    rootvg          active    
hdisk5          00047abe19ec5b0c                    None                      
hdisk6          none                                None                      
hdisk7          none                                None                      
hdisk8          none                                None                      
hdisk9          none                                None                      
hdisk10         none                                None                      
hdisk11         none                                None                      

-- Now import VG info to specified disk

bash-4.2# importvg -y binvg hdisk4
synclvodm: No logical volumes in volume group binvg.
binvg

-- Verify

bash-4.2# lspv
hdisk0          00047abed0a7c10c                    rootvg          active    
hdisk2          00047abe3407efc6                    None                      
hdisk3          00047abe33d16121                    None                      
hdisk4          00047abe19ec463c                    binvg           active    
hdisk1          00047a6ae1ee0669                    rootvg          active    
hdisk5          00047abe19ec5b0c                    binvg           active    
hdisk6          none                                None                      
hdisk7          none                                None                      
hdisk8          none                                None                      
hdisk9          none                                None                      
hdisk10         none                                None                      
hdisk11         none                                None  
#

-- Verify the file system, check that specified mount point is avialable 
                 
bash-4.2# vi /etc/filesystems
"/etc/filesystems" 117 lines, 2198 characters
.....
.....
*

/:
        dev             = /dev/hd4
        vfs             = jfs2
        log             = /dev/hd8
        mount           = automatic
        check           = false
        type            = bootfs
        vol             = root
        free            = true

/home:
        dev             = /dev/hd1
"/etc/filesystems" 117 lines, 2198 characters
*
* US Government Users Restricted Rights - Use, duplication or
* disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
*
*
*
* This version of /etc/filesystems assumes that only the root file system
* is created and ready.  As new file systems are added, change the check,
* mount, free, log, vol and vfs entries for the appropriate stanza.
*

/:
        dev             = /dev/hd4
        vfs             = jfs2
        log             = /dev/hd8
        mount           = automatic
        check           = false
        type            = bootfs
        vol             = root
        free            = true

/home:
        dev             = /dev/hd1
        vfs             = jfs2
        log             = /dev/hd8
        mount           = true
        check           = true
        vol             = /home
        free            = false

/usr:
        dev             = /dev/hd2
        vfs             = jfs2
        log             = /dev/hd8
        mount           = automatic
        check           = false
        type            = bootfs
        vol             = /usr
        free            = false

/var:
        dev             = /dev/hd9var
        vfs             = jfs2
        log             = /dev/hd8
        mount           = automatic
        check           = false
        type            = bootfs
        vol             = /var
        free            = false

/tmp:
        dev             = /dev/hd3
        vfs             = jfs2
        log             = /dev/hd8
        mount           = automatic
        check           = false
        vol             = /tmp
        free            = false

/admin:
        dev       = /dev/hd11admin
        vol       = "/admin"
        mount     = true
        check     = false
        free      = false
        vfs       = jfs2
        log       = /dev/hd8

/proc:
        dev       = /proc
        vol       = "/proc"
        mount     = true
        check     = false
        free      = false
        vfs       = procfs

/opt:
        dev             = /dev/hd10opt
        vfs             = jfs2
        log             = /dev/hd8
        mount           = true
        check           = true
        vol             = /opt
        free            = false

/var/adm/ras/livedump:
        dev             = /dev/livedump
        vfs             = jfs2
        log             = /dev/hd8
        mount           = true
        account         = false

:q!

-- View physical volumes

bash-4.2# lspv
hdisk0          00047abed0a7c10c                    rootvg          active    
hdisk2          00047abe3407efc6                    None                      
hdisk3          00047abe33d16121                    None                      
hdisk4          00047abe19ec463c                    binvg           active    
hdisk1          00047a6ae1ee0669                    rootvg          active    
hdisk5          00047abe19ec5b0c                    binvg           active    
hdisk6          none                                None                      
hdisk7          none                                None                      
hdisk8          none                                None                      
hdisk9          none                                None                      
hdisk10         none                                None                      
hdisk11         none                                None  
#

-- Now re-create file system on the vg
                 
bash-4.2# crfs -v jfs2 -g binvg -m /u01 -a size=98G -A yes
File system created successfully.
102757108 kilobytes total disk space.
New File System size is 205520896

-- Verify
         
bash-4.2# mount -a
mount: 0506-324 Cannot mount /dev/hd1 on /home: The requested resource is busy.
mount: 0506-324 Cannot mount /dev/hd11admin on /admin: The requested resource is busy.
mount: 0506-324 Cannot mount /proc on /proc: The requested resource is busy.
mount: 0506-324 Cannot mount /dev/hd10opt on /opt: The requested resource is busy.
mount: 0506-324 Cannot mount /dev/livedump on /var/adm/ras/livedump: The requested resource is busy.
bash-4.2# df -gt
Filesystem    GB blocks      Used      Free %Used Mounted on
/dev/hd4           5.00      0.18      4.82    4% /
/dev/hd2           5.00      2.79      2.21   56% /usr
/dev/hd9var        2.00      0.34      1.66   18% /var
/dev/hd3           7.00      0.01      6.99    1% /tmp
/dev/hd1          20.00      6.39     13.61   32% /home
/dev/hd11admin      0.12      0.00      0.12    1% /admin
/proc                 -         -         -    -  /proc
/dev/hd10opt       2.00      0.21      1.79   11% /opt
/dev/livedump      0.25      0.00      0.25    1% /var/adm/ras/livedump
/aha                  -         -         -    -  /aha
/dev/fslv00       98.00      0.02     97.98    1% /u01
bash-4.2#

-- successful.

NFS Mount:


-- Do a NFS mount

step-1: Export the directory in source system


bash-4.2# smitty nfs
--> Network file system NFS -->  Add a Directory to Exports List -->  give directory name

                                        Add a Directory to Exports List

bash-4.2# smitty nfs
                                        Add a Directory to Exports List

Type or select values in entry fields.
Press Enter AFTER making all desired changes.
 
[TOP]                                                   [Entry Fields]
* Pathname of directory to export                    [/u03]                                                   /
  Anonymous UID                                      [-2]
  Public filesystem?                                  no                                                     +
* Export directory now, system restart or both        both                                                   +
  Pathname of alternate exports file                 []
  Allow access by NFS versions                       []                                                      +
  External name of directory (NFS V4 access only)    []
  Referral locations (NFS V4 access only)            []
  Replica locations                                  []
  Ensure primary hostname in replica list             yes                                                    +
  Allow delegation?                                  []
  Scatter                                             none                                                   +
* Security method 1                                  [sys,krb5p,krb5i,krb5,dh]                               +
[MORE...24]

F1=Help                    F2=Refresh                  F3=Cancel                   F4=List



Step:2 : Go for mount

bash-4.2# smitty nfs


smitty nfs
--> Network file system NFS -->  Configure NFS on This System -->  Add a File System for Mounting


Add a File System for Mounting

[TOP]                                                   [Entry Fields]
* Pathname of mount point                            [/u03]                                                /
* Pathname of remote directory                       [/u03]
* Host where remote directory resides                [ehdb7]
  Mount type name                                    []
* Security method                                    [sys]                                                +
* Mount now, add entry to /etc/filesystems or both?   both                                                +
* /etc/filesystems entry will mount the directory     yes                                                 +
   on system restart.                                                                    
* Mode for this NFS file system                       read-write                                          +
* Attempt mount in foreground or background           background                                          +
  Number of times to attempt mount                   []                                                    #
  Buffer size for read                               []                                                    #
  Buffer size for writes                             []                                                    #
[MORE...26]  

(Enter) save+exit


-- To remount again, User mount -a ( do if required )

e.g.,

bash-4.2# umount /u03
bash-4.2# df -gt
Filesystem    GB blocks      Used      Free %Used Mounted on
/dev/hd4           5.00      0.19      4.81    4% /
/dev/hd2           5.00      2.81      2.19   57% /usr
/dev/hd9var        2.00      0.41      1.59   21% /var
/dev/hd3           7.00      0.02      6.98    1% /tmp
/dev/hd1          20.00     16.60      3.40   83% /home
/dev/hd11admin      0.12      0.00      0.12    1% /admin
/proc                 -         -         -    -  /proc
/dev/hd10opt       2.00      0.21      1.79   11% /opt
/dev/livedump      0.25      0.00      0.25    1% /var/adm/ras/livedump
/aha                  -         -         -    -  /aha
/dev/fslv00       98.00     26.90     71.10   28% /u01


bash-4.2# mount -a
mount: 0506-324 Cannot mount /dev/hd1 on /home: The requested resource is busy.
mount: 0506-324 Cannot mount /dev/hd11admin on /admin: The requested resource is busy.
mount: 0506-324 Cannot mount /proc on /proc: The requested resource is busy.
mount: 0506-324 Cannot mount /dev/hd10opt on /opt: The requested resource is busy.
mount: 0506-324 Cannot mount /dev/livedump on /var/adm/ras/livedump: The requested resource is busy.
mount: 0506-324 Cannot mount /dev/fslv00 on /u01: The requested resource is busy.

Now check again,

bash-4.2# df -gt
Filesystem    GB blocks      Used      Free %Used Mounted on
/dev/hd4           5.00      0.19      4.81    4% /
/dev/hd2           5.00      2.81      2.19   57% /usr
/dev/hd9var        2.00      0.41      1.59   21% /var
/dev/hd3           7.00      0.02      6.98    1% /tmp
/dev/hd1          20.00     16.60      3.40   83% /home
/dev/hd11admin      0.12      0.00      0.12    1% /admin
/proc                 -         -         -    -  /proc
/dev/hd10opt       2.00      0.21      1.79   11% /opt
/dev/livedump      0.25      0.00      0.25    1% /var/adm/ras/livedump
/aha                  -         -         -    -  /aha
/dev/fslv00       98.00     26.90     71.10   28% /u01
ehdb7:/u03      1300.00    829.61    470.39   64% /u03
bash-4.2#



Hope, You learn something.

Note: Assume IP address of host "ehdb7" is 192.168.1.1

Create LV on VG and mount, do a NFS mount to other server

1) unmount  ( if mounted)

bash-4.2# unmount /test

2) view lv information


bash-4.2# lsvg -l bkpvg  
bkpvg:
LV NAME             TYPE       LPs     PPs     PVs  LV STATE      MOUNT POINT
loglv01             jfs2log    1       1       1    open/syncd    N/A
fslv01              jfs2       900     900     2    open/syncd    /u04
fslv04              jfs2       20      20      1    closed/syncd  /test
bash-4.2#

3) remove lv ( if you want)

bash-4.2# rmlv fslv04
Warning, all data contained on logical volume fslv04 will be destroyed.
rmlv: Do you wish to continue? y(es) n(o)? y
rmlv: Logical volume fslv04 is removed.


4) create lv

crfs -v jfs2 -g bkpvg -m /mount2  -a size=20G -A yes

bash-4.2# crfs -v jfs2 -g bkpvg -m /mount2  -a size=20G -A yes
File system created successfully.
20970676 kilobytes total disk space.
New File System size is 41943040
bash-4.2#


5) Mount it

bash-4.2# mount /mount2
bash-4.2# df -g
Filesystem    GB blocks      Free %Used    Iused %Iused Mounted on
/dev/hd4           5.50      5.32    4%    10540     1% /
/dev/hd2           7.50      5.10   33%    53148     5% /usr
/dev/hd9var        5.75      5.30    8%     8979     1% /var
/dev/hd3           5.25      4.99    5%      379     1% /tmp
/dev/fwdump        5.50      5.26    5%        5     1% /var/adm/ras/platform
/dev/hd1           5.25      5.25    1%       61     1% /home
/dev/hd11admin      0.25      0.25    1%        5     1% /admin
/proc                 -         -    -         -     -  /proc
/dev/hd10opt       4.50      4.29    5%     9009     1% /opt
/dev/livedump      0.25      0.25    1%        4     1% /var/adm/ras/livedump
/aha                  -         -    -        16     1% /aha
/dev/fslv00       49.00     37.71   24%    41097     1% /u02
/dev/fslv02      700.00    178.07   75%      111     1% /u03
/dev/fslv01      900.00    707.31   22%      631     1% /u04
/dev/fslv03       19.00     19.00    1%        4     1% /rootvgbkp
/dev/fslv04       20.00     20.00    1%        4     1% /mount2
bash-4.2#
bash-4.2#


6) Export it for nfs 

smit nfs --> Network file system --> Add a Directory to Exports List

                                                       Add a Directory to Exports List

Type or select values in entry fields.
Press Enter AFTER making all desired changes.

[TOP]                                                   [Entry Fields]
* Pathname of directory to export                    [/mount2]                                                                          /
  Anonymous UID                                      [-2]
  Public filesystem?                                  yes                                                                                   +
* Export directory now, system restart or both        now                                                                                   +
  Pathname of alternate exports file                 []
  Allow access by NFS versions                       []                                                                                     +
  External name of directory (NFS V4 access only)    []
  Referral locations (NFS V4 access only)            []                                                  
  Replica locations                                  []
  Ensure primary hostname in replica list             yes                                                                                   +
  Allow delegation?                                   no                                                                                    +
  Scatter                                             none                                                                                  +
* Security method 1                                  [sys,krb5p,krb5i,krb5,dh]                                                              +
[MORE...24]                    


7) View the status 

bash-4.2# showmount -e
export list for ehbkpdb1:
/rootvgbkp   (everyone)
/mount2 (everyone)
bash-4.2#

-- View exported filesystems to do nfs mount ( to be excuted in remote host) from x.x.9.31
bash-4.2# showmount -e 192.168.1.1
export list for 192.168.1.1:
/rootvgbkp   (everyone)
/mount2 (everyone)
bash-4.2#

8) pre-requisites

a) Add hostname in '/etc/hosts' both source and target systems
b) Export the directory in source system
c) Create a empty directory in target system (/)

9) create nfs

smit nfs --> Network file system --> add file system for mounting -->

                                                Add a File System for Mounting

Type or select values in entry fields.
Press Enter AFTER making all desired changes.

[TOP]                                                   [Entry Fields]
* Pathname of mount point                            [/u03]                                                          /
* Pathname of remote directory                       [/u03]
* Host where remote directory resides                [192.168.1.1]
  Mount type name                                    []
* Security method                                    [sys]                                                                  +
* Mount now, add entry to /etc/filesystems or both?   now                                                                   +
* /etc/filesystems entry will mount the directory     yes                                                                   +
   on system restart.  
* Mode for this NFS file system                       read-write                                                            +
* Attempt mount in foreground or background           background                                                            +
  Number of times to attempt mount                   []                                                                      #
  Buffer size for read                               []                                                                      #
  Buffer size for writes                             []                                                                      #
[MORE...26]            


10) verify

# df -gt
Filesystem    GB blocks      Used      Free %Used Mounted on
/dev/hd4          11.00      0.20     10.80    2% /
/dev/hd2           4.50      2.92      1.58   65% /usr
/dev/hd9var        4.50      0.44      4.06   10% /var
/dev/hd3          10.50      2.55      7.95   25% /tmp
/dev/hd1          20.50      7.08     13.42   35% /home
/dev/hd11admin      0.50      0.00      0.50    1% /admin
/proc                 -         -         -    -  /proc
/dev/hd10opt       5.50      0.14      5.36    3% /opt
/dev/livedump      0.50      0.00      0.50    1% /var/adm/ras/livedump
/dev/fslv00       98.00     56.47     41.53   58% /u01
192.168.1.1:/u03     20.00      0.00     20.00    1% /u03
#


11) To Take rootvg backup: (aix)

e.g.,

# mksysb -i -e -p -v /rootvgbkpn1/DB01/node1

Hope it works for you.

Translate >>