IBM AIX: Volume Management
IBM AIX Logical Volume Management
System Administrator Information
How to create a file system
- Log into server and gain root access
- Select a Volume Group to create the file system under: lsvg (shows what volume groups are on the server)
- Check to see how much disk space is currently available on the desired volume group: lsvg VGNAME (Check for Free PPs:) If there is enough disk space proceed to the next step
- From the results of the lsvg VGNAME Check for the PP size in Megabytes. This will be 16, 32, 64 or 128 MB. The PP size is VERY important to remember as this will determine the number of Physical Partitions that will be used. If the wrong number is used this will either give too much or not enough disk space to the file system but will not cause any failures. You can NOT shrink a file system after its created so this is the only chance to get it correct without deleting and starting over.
- Open a calculator: Enter the number of Megabytes (MB) that you wish to have as the file system size in the calculator, divide that by the number of the PP Size (2048 “Size of file system” / 32 “PP Size” would equal 64 PP’s to be used in the file system creation)
- Create the Logical Volume: Run the following command ‘smitty fs’
- Select ‘Add a logical Volume’
- Select ‘Volume Group Name’:
- Enter the ‘Logical Volume NAME’: There is 15 character limit for this field.
- Enter the number of Physical Partitions: Number of PPs from the above mathematical process
- Select Logical volume TYPE: enter JFS or JFS2 based on requirements. Unless the customer requests JFS select JFS2.
- Select Range of Physical Volumes:
- Change from minimum to maximum
- Press Enter to accept changes. System will run and return an “OK” in the upper left hand corner when the command is complete.
- Exit Smitty lv and enter ‘smitty fs’
- Select Add / Change / Show / Delete File Systems
- Select either Journaled File Systems or Enhanced Journaled File Systems
- Select Add an Enhanced Journaled File System on a Previously Defined Logical Volume
- Select the Logical Volume Name that you created in the previous step
- Enter the mount point:
- Select yes for Mount AUTOMATICALLY at system restart
- Press enter to create the file system
- Exit smitty fs and run the following command: ‘mount /PATH
- Confirm that the file system has been created (df –k |grep PATH)
- Set the permissions and ownerships per customer request
- Task is now complete
How to expand a file system
- Log into server and gain root access
- Run the command: ‘smitty fs’
- Select Add / Change / Show / Delete File Systems
- Select either Journaled File Systems or Enhanced Journaled File Systems
- Select Change / Show Characteristics of an Enhanced Journaled File System and select the file system that you wish to expand
- Convert the number of Megabytes / Gigabytes requested by the customer into 512K blocks:
- Bring up http://www.mydasd.com/converison.htm in a web browser.
- In the Convert what quantity? Field enter the amount of space requested by the customer. Make sure to click the proper options in the left box below the quantity field. The box on the right should always be set to Bytes. Always click the Convert button to make sure you have an updated number in the display box.
- Open a calculator: Enter the number from the webpage and divide that number by 512 (10 GB = 10,737,418,240: 10737418240 / 512 = 20971520)
- In the smitty fs window take the number that is currently listed in the SIZE of file system (in 512-byte blocks) field and add that to the number from the above line in your calculator (Current size + SUM from above line = new size)
- Enter the finial number in your calculator into the SIZE of file system field
- Press Enter to accept changes. System will run and return an “OK” in the upper left hand corner when the command is complete.
- Task is now complete
How to create a volume group (Using Powerpath)
- To bring LUNs in as disks type cfgmgr
- Type lspv |grep hdiskpower (Look for disks that are not assigned, they will be listed as “None”
- Type ‘smitty’ and press enter
- Select ‘System Storage Management (Physical & Logical Storage)’
- Select “Logical Volume Manager”
- Select “Volume Groups”
- Select “Add a Volume Group with PowerPath Devices”
- Enter the Volume Group Name to be created
- Select “Physical partition SIZE in megabytes” (choose 32 MB by default unless directed otherwise)
- Select “PHYSICAL VOLUME names”
- Select the disks to be added to the new Volume Group. Press enter
- Make sure that the line that says Activate volume group AUTOMATICALLY is marked “Yes”
- Press Enter start changes, you will be prompted “are you sure”.
- If you are sure press enter. Make sure you have selected the right information as you can NOT back out the changes.
- From the command line prompt: type ‘lspv |grep hdiskpower’ you should now see that the disks that were assigned as “None” are now assigned to your new Volume Group.
- Exit smitty
- Task is now complete
How to re-create a file system when there are sub file systems present
- Create _new file system
- Un-mount all /PATH/srvr####/ sub file systems
- Copy data to fromthe /PATH/srvr#### file system to the _new one
- Un-mount /PATH/srvr####
- Re-name /PATH/srvr#### to /clocal/srvr####_old
- Re-Mount _old file system
- Change the mount order in /etc/filesystems so that /PATH/srvr####_new mounts before all of the sub file systems
- Un-mount _new file system
- Change mount point of _new and drop the _new part
- Mount /PATH/srvr#### file system
- Create sub file systems (cntr0001 dblog01) mount points (directories)
- Run a mount on the rest of the file systems
| Task | AIX 5L Version 5 | |
|---|---|---|
| Storage structure | A disk is composed of physical partitions.
A physical volume is a physical disk the same thing as a disk. A volume group is composed of physical volumes. A volume group is divided into logical volumes. A filesystem is placed into a logical volume. A logical volume is extensible and can reside on more than one volume. |
|
| Run multiple tasks in a GUI environment | smit lvmwsm |
|
| Move a logical volume to another logical volume | migratepv |
|
| Create a logical volume | mklv |
|
| Extend a logical volume | extendlv |
|
| Remove a logical volume | rmlv |
|
| Create a volume group | mkvg |
|
| Remove a disk from a volume group | reducevg |
|
| Add disks to a volume group | extendvg |
|
| Change logical volume settings | chlv |
|
| Display volume group information | lsvg |
|
| Display performance statistics for storage | lvmstat |
|
| Manage volumes | chlvmklvrmlv |
|
| Add a copy to an existing volume | mklvcopy |
IBM Disk Utilities in a nutshell
IBM Volume Manager in a nutshell
Listing Volume Groups
lsvg
rootvg
HACMPvg
paritemvg
yatirimvg
pbackupvg
ybackupvg
Detailed information about a Volume Group
root@paritem:/ >lsvg paritemvg
VOLUME GROUP:paritemvgVG IDENTIFIER:00c076eb00004c000000010852f95257
VG STATE:activePP SIZE:32 megabyte(s)
VG PERMISSION:read/writeTOTAL PPs:3196 (102272 megabytes)
MAX LVs:256FREE PPs:5 (160 megabytes)
LVs:2USED PPs:3191 (102112 megabytes)
OPEN LVs:2QUORUM:3
TOTAL PVs:4VG DESCRIPTORS: 4
STALE PVs:0STALE PPs:0
ACTIVE PVs:4AUTO ON:no
MAX PPs per VG:32512
MAX PPs per PV:1016MAX PVs:32
LTG size (Dynamic): 1024 kilobyte(s)AUTO SYNC:no
HOT SPARE:noBB POLICY:relocatable
Listing logical volumes in a Volume Group
root@paritem:/ >lsvg -l paritemvg
paritemvg:
LV NAMETYPELPsPPsPVsLV STATEMOUNT POINT
parfslogjfs2log111open/syncdN/A
paritemlvjfs2319031904open/syncd/paritem
Detailed information about a Logival Volume
root@paritem:/ >lslv paritemlv
LOGICAL VOLUME:paritemlvVOLUME GROUP:paritemvg
LV IDENTIFIER:00c076eb00004c000000010852f95257.2 PERMISSION:read/write
VG STATE:active/completeLV STATE:opened/syncd
TYPE:jfs2WRITE VERIFY:off
MAX LPs:4096PP SIZE:32 megabyte(s)
COPIES:1SCHED POLICY:parallel
LPs:3190PPs:3190
STALE PPs:0BB POLICY:relocatable
INTER-POLICY:maximumRELOCATABLE:yes
INTRA-POLICY:middleUPPER BOUND:32
MOUNT POINT:/paritemLABEL:/paritem
MIRROR WRITE CONSISTENCY: on/ACTIVE
EACH LP COPY ON A SEPARATE PV ?: yes
Serialize IO ?:NO
Listing physical volumes in a Logical Volume
root@paritem:/ >lslv -l paritemlv
paritemlv:/paritem
PVCOPIESIN BANDDISTRIBUTION
hdisk5798:000:00020%160:160:159:160:159
hdisk6798:000:00020%160:160:159:160:159
hdisk7797:000:00020%160:160:159:160:158
hdisk4797:000:00019%160:159:159:160:159
Listing All Physical Volumes in the system
root@paritem:/ >lspv
hdisk000c076eb47dc9ccdrootvgactive
hdisk100c076eb48a321d1rootvgactive
hdisk200c076eb52dc8486HACMPvg
hdisk300c076eb52dc87cbHACMPvg
hdisk400c076eb52f945b8paritemvgactive
hdisk500c076eb52f948ecparitemvgactive
hdisk600c076eb52f94c26paritemvgactive
hdisk700c076eb52f94f61paritemvgactive
hdisk800c076eb52f9882eyatirimvg
hdisk900c076eb52f98b5cyatirimvg
hdisk1000c076eb52f98e8byatirimvg
hdisk1100c076eb52f99260yatirimvg
hdisk1200c076ebb148f11dpbackupvgactive
hdisk1300c076ebb148f470pbackupvgactive
hdisk1400c076ebb14935e2ybackupvg
hdisk1500c076ebb1493921ybackupvg
Detailed information about a Physical Volume
root@paritem:/ >lspv hdisk5
PHYSICAL VOLUME:hdisk5VOLUME GROUP:paritemvg
PV IDENTIFIER:00c076eb52f948ec VG IDENTIFIER00c076eb00004c000000010852f95257
PV STATE:active
STALE PARTITIONS:0ALLOCATABLE:yes
PP SIZE:32 megabyte(s)LOGICAL VOLUMES:1
TOTAL PPs:799 (25568 megabytes)VG DESCRIPTORS:1
FREE PPs:1 (32 megabytes)HOT SPARE:no
USED PPs:798 (25536 megabytes)MAX REQUEST:1 megabyte
FREE DISTRIBUTION:00..00..00..00..01
USED DISTRIBUTION:160..160..159..160..159
Listing logical volumes on a Pyhsical Volume
root@paritem:/ >lspv -l hdisk5
hdisk5:
LV NAMELPsPPsDISTRIBUTIONMOUNT POINT
paritemlv798798160..160..159..160..159 /paritem
Changing FileSystem Properties
# first check the avaliable free space
# previously explained
lsvg <volume group name>
# adding 40GB to a mount point
Chfs –a size=+20000000 /pbackup(20000000/512=39063MB)
# can also be made by smitty chfs
Smitty chfs > Change / Show Characteristics of an Enhanced Journaled File System > Select the file system
# changing a mount point
Chfs –d /pbackup /paritem_backup
# config file
/etc/filesystems
# further chfs options are in chfs manual pages
man chfs
# if there is hacmp managed system then
# changing filesystem should be made by “smitty hacmp”
Smitty hacmp > System Management > Logical Volume Management > Shared File Systems > Enhanced Journaled File Systems > Change / Show Characteristics of a Shared Enhanced Journaled File System > Select the File System
(http://www.softpanorama.org)







