This small document will helps you how to create volume groups (VG) after mapping host from storage.
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.
hdisk0 00f9d98b1cc32587 rootvg active
hdisk1 00f9d98bc23769cf None
hdisk2 00f9d98bc2381d77 None
hdisk3 00f9d98bc238343f None
hdisk0
00f9d98b1cc32587
rootvg active
hdisk2
00f9d98bc2381d77
None
hdisk3
00f9d98bc238343f
None
hdisk0 00f9d98b1cc32587 rootvg active
hdisk1 00f9d98bc23769cf binvg active
hdisk2 00f9d98bc2381d77 datavg active
hdisk3 00f9d98bc238343f bkpvg active
Use "lsdev" command to view storage attached with passing "disk" as a parameter.
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.