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
b) Now list all PVs, it will show all PVid.
Note: select "yes" if you want to create volume group forcefully.
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.
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
#
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)
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:
#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.
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] #
-- 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]
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
No comments:
Post a Comment