Keep walking

Whatever you need to grow, just do it faster…

Posts Tagged ‘AIX’

IBM AIX: How to create a file system

Posted by ZyK on 11/30/2011

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 lvm
wsm
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 chlv
mklv
rmlv
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)

Posted in UNIX-LINUX | Tagged: | Leave a Comment »

SoJungle: AIX documents to share

Posted by ZyK on 11/30/2011

LVM quick reference

News

AIX Logical Volume Manager

Redbooks IBM Links Recommended Links Recommended eBooks and Papers Reference
what disks are in the root volume group How many disks are on the system Create a volume group Add a disk to the root volume group Make sure the disks are in an active state Mirror the logical volumes Create the boot image on the new disk
Extend the size of filesystem Remove a file system JFS mksysb Command Aix JFS2 snapshots Humor Etc

 

Recommended Links

Posted in Shared | Tagged: , | Leave a Comment »

Logical Volume Manager (LVM) Commands for AIX

Posted by ZyK on 11/29/2011

Glossary

Term Definition
Journaled File System (JFS) File system that uses a journaled log for faster, more reliable data recovery
Logical Partition (LP) The LV is made up of LPs.  The LP corresponds to 1 or more (in the case of mirroring) PPs.
Logical Volume (LV) The VG is subdivided into logical volumes and each LV can have  a file system on it.
Physical Partition (PP) All physical volumes are subdivided into pps.  PPs are all the same size.
Physical Volume (PV) Disk that is being managed by LVM.
Rootvg Default volume group created during installation.  The vg holds the OS filesystems ( /,/usr, /home, /proc /opt,  /tmp,  /var and swap space )
Volume Group (VG) Area of storage that consists of one or more PVs

Command Summary

Command Definition
chfs -a size=<#512 byte blocks> <file system> Increases the size of a journaled file system to the total number of  512 byte blocks specified
chfs -a size=<+512 byte blocks> <mount point> Increases the size of a journaled file system by the addional number of 512 byte blocks specified.  For example “chfs -a size=+393216 /usr”
chlv -n <newname> <oldname> Change the name of a logical volume (it must be inactive)
crfs -v jfs -m <mount point> -g <volume group> -a size=<# of 512 byte blocks>

crfs -v jfs -m <mount point> -d <logical volume>

This command makes a logical volume, mount point with a journaled file system:

creates a jfs file system on a logical volume

df -k Shows the disk usage of logical volumes on the server.
exportvg <volume group> removes a volume group from a machine
extendvg <volume group> <physical volume> Adds a new physical volume to an existing volume group
importvg -y <volume group> <physical volume> add a volume group to another machine
lslv <logical volume> [-l, m] Lists information about the logical volumes.  The -l option lists the disks in the logical volume.
lspv <physical volume> [-l, M, p] Lists the disks on the server, including the physical volume will give details about that disk.  The -l option will list the details of how the filesystems are distributed on the disk.
lsvg <volume group> [-l] Lists the volume groups on the server, including the volume group name will give details about that vg. The -l option will list the logical volumes in the volume group.
lsvpcfg Lists each vpath and the hdisks that make up the vpath
mklv -y <new lv> <vg> Makes a logical volume in a volume group
mksysb -l -f <device> makes a bootable backup of rootvg
mkvg -y <volume group> <physical volume>  . . . <physical volume> Makes a volume group out of one or more physical volumes
mount <logical volume> <file system>   or
mount <filesystem>  if it is already in /etc/filesystems
Mounts the file system for use.
reducevg <volume group> <physical volume> Removes a physical volume from a volume group
rmfs <file system> removes a file system and it’s logical volume
rmlv <lv> Removes a logical volume (it must be inactive)
savevg -l -f <device> <volume group> makes a backup copy of another volume group
umount <file system>  dismount the file system Unmounts the filesystem.

Sample LVM Procedures:

Filesystem Procedures

Procedure to create a filesystem using JFS:

  • See below the procedure for creating a logical volume and a filesystem using JFS:

Procedure to extend the size of filesystem using JFS:

  1. “df” to see the filesystem, it’s current size, % utilization and the name of it’s logical volume
  2. “lslv <logical_volume>” to show information about the logical volume including it’s volume group name.
  3. “lsvg <volume_group>” to show information about the volume group, including number of free pp’s and the pp size
  4. If there are not enough free pp’s then see below for procedure to add a disk to a volume group.
  5. “chfs -a size= +4194304 <MOUNT_POINT>” to grow the filesystem by 2 GB (4194304=2*1024*1024*1024/512)
    • NOTE:  Growing the file system will automatically grow the logical volume
  6. df” shows the file system’s current size is 2 GB more than before.

Troubleshooting extending the size of a filesystem using JFS:

  • Error Message:  0516-787 extendlv: Maximum allocation for logical volume <LV_Name> is 512.
    • Maximum number of LPs for the logical volume has been exceeded – must increase the allocation
    • Calculate the number of LPs needed = LV Size in MB / LP size in MB
    • chlv -x <new_max_lps> <logical_volume>

Procedure to remove a file system

  1. Unmount the filesystem
  2. Remove the logical volume “rmlv <lv_name>”
  3. Remove the filesystem information from /etc/filesystems

Procedure to reduce the size of a file system – shareold is 8mb and needs to be reduced to 4mb

  1. Create the file system
    1. crfs -v jfs -m /usr/sharenew -g rootvg -a size=8192
    2. this makes a logical volume in the root volume group of 4MB that uses jfs
  2. Mount the volume
    1. mount /usr/sharenew
  3. Move the files from the old file system (/usr/shareold)
    1. cd /usr/shareold
    2. tar cf – | (cd /usr/sharenew; tar xvf -)
    3. cd
  4. Unmount the file systems
    1. umount /usr/sharenew
    2. umount /usr/shareold
  5. Remove the old file system and it’s logical volume
    1. rmfs /usr/shareold
    1. chfs -m /usr/shareold /usr/sharenew
  6. Mount the new filesystem
    1. mount /usr/shareold
  7. Delete the temporary mount point
    1. rmdir /usr/share

 

Logical Volume Procedures

Procedure to create a logical volume and filesystem in a volume group using JFS:

  1. lsvg to determine the size of the PP
  2. lslv in similar logical volumes to determine if mirroring is in effect
  3. Calculate the number of PPs needed for the logical volume
    1. bc
    2. scale=2
    3. <size of lv in MB>/<size of PP in MB>
    4. quit
  4. mklv -y  “<LV_NAME>” <VG_NAME> <# of LPS>  –> creates the logical volume
  5. crfs -v jfs -d <LV_NAME> -m /<MOUNTPOINT> -A yes   –> makes the filesystem, creates the mountpoint and puts it in /etc/filesystems
  6. mount /<MOUNTPOINT>  –> mounts the new fileystem
  7. df /<MOUNTPOINT>  –> verifies the mount and the size of the new filesystem
  8. Check the ownership and permissions of the new mount point
    • ls -ld <mountpoint>
    • chown owner:group <mountpoint>
    • chmod XXX <mountpoint>
  9. If mirroring is in effect, then mirror this logical volume to another disk (original and 1 mirror):
    • mklvcopy -s y <LV_NAME> 2

Check to see if  all of the logical volumes in a volume group are mirrored

  • lsvg -l

Mirror a logical volume after the fact

  •  mklvcopy -s y <LV_NAME> 2

Volume Group Procedures

Procedure to create a volume group:

  1. lsdev -C -c disk  -> lists available disks (and the hdisk#) on the server
  2. mkvg -y “<VG_NAME>” hdisk#  –> creates the volume group on the named hard disk
  3. varyonvg <VG_NAME>  –> activates the volume group

Procedure to add a disk to a volume group (extend the volume group)

  • extendvg <vg> <disk#>
    • Verify the disk has been successfully added to the vg
  • lsvg -p <vg>

Procedure to mirror the rootvg:

  1. lspv  –> determine the hdisk#
  2. extendvg rootvg hdisk<number>  –> add the hdisk to the volume group
  3. lspv  –>  verify that the hdisk has been successfully added to the volume group
  4. chvg -Q ‘n’ rootvg  –>  change the quorum so that the vg will stay active if one of the mirrors fail
  5. mirrorvg -S -c 2 rootvg  –> mirror all of the logical volumes in the volume group
  6. lsvg -l rootvg  –> verify successful mirroring (pps will appear “stale” until synchronization is complete).
  7. bosboot -a  –>  update the boot image information
  8. bootlist -m normal -o hdisk0 hdisk1  –> create a new bootlist
  9. bootlist -m normal -o  –> verify the bootlist is correct

Procedure to increase the number of LP’s available
Assume we receive an error that the maximum number of LP’s had been exceeded, and the maximum number of LP’s defined was 1100:

  1. “lsvg <volume_group>” to show the total PP’s available in the volume group =1250
  2. “lsvg -l <volume_group>” to show the total PP’s used in all logical volumes in that volume group (showed sys1log, the jfs log was using 2 PP’s)
  3. “chlv -x 1248 <logical_volume>” to change the maximum number of LP’s from 1100 to 1248 (1250 PP’s in the volume group – 2 PP’s used by the jfs log  = 1248 available)

Physical Disk Procedures

Procedure to find disks/vpaths that are unallocated

  • lsvpcfg
    • This will show disks/vpaths and the volume group they are allocated to
  • lspv|grep None
    • This will show pvs and whether they are asssociated with a volume group
    • Note:  For vpaths, the hdisks will show as none, but they may be allocated to a vpath – you must grep each hdisk with the lsvpcfg

Procedure to make a new lun available to AIX

  • Allocate the new lun on the SAN
  • Run “cfgmgr”
  • Verify the new vpatch/hdisk by running “lsvpcfg”
    • There should be a new vpath and it should be available with no volume group – if not, rerun cfgmgr

Procedure to list the PVs in a volume group:

  • lsvg -p <volume group>

(http://networktechnologist.com)

Posted in UNIX-LINUX | Tagged: | Leave a Comment »

Unmirror rootvg in AIX

Posted by ZyK on 11/29/2011

Root Volume Group (rootvg) is a volume group containing the Base Operating System (BOS). Logical volume (lv) in rootvg may be doubled or more in copies with 2 or more physical volume (hard disk) for availability and reliability of the AIX system. The following steps are to unmirror a rootvg, if for whatever reason the rootvg needs to run on single logical volume (lv) on single physical volume (pv) only.

Check and Determine if rootvg is Mirrored

In mirror mode, each logical volume in rootvg such as filesystems “/”, “/usr”, “/var”, “/tmp”, “/home”, “/opt” and default boot, paging and jfslog LVs should be mirrored. In AIX, mirrorvg will create additional copy of image for all logical volumes in the volume group.

Use the following command to check if a rootvg is mirrored:

# lsvg -l rootvg

If the output shows that for each LP there are 2 PPs then its mirrored.

Check and Determine Which Disks the Mirrored rootvg is Located

For each logical volume (LV) name listed in output of “lsvg -l rootvg” command, run the following command:

lslv -m

The output date will tell you on which disk each copy of each logical partitions for each LV.

Unmirror rootvg

Important: The following instructions have the risk of making your AIX system unbootable or corrupting the data. So make you have advanced system administration experience before running the process of unmirroring.

To unmirror the root volume group (rootvg), follow the steps below (scenario: rootvg is contained on hdisk01 and mirrored onto hdisk11, and the steps will remove the mirror on hdisk11 (regardless of the disk from which you previously booted)):

  1. To unmirror the rootvg from hdisk11, enter the following command:unmirrorvg rootvg hdisk11This command turns quorum back on for rootvg. When unmirrorvg is executed, the default COPIES value for each logical volume becomes 1.
  2. To update the booted disk link, enter the following command:ln -f /dev/rhdisk01 /dev/ipldevice
  3. To reduce the disk out of rootvg, type the following command:reducevg rootvg hdisk11
  4. To initilize the boot record of the remaining disk again, enter the following command:bosboot -a -d /dev/hdisk01bosboot command is a must to initialize the boot record on the remaining disk hdisk01 again.
  5. To modify the boot list to remove the unmirrored disk, type the following command:bootlist -m normal hdisk01bootlist command is a must so that the system only boots to the disk remaining (hdisk01) in rootvg.
  6. Restart AIX machine, as unmirroring turns quorum back on for rootvg, a reboot is required for this to take effect.

Note: The reducevg command in step 3 will fail if there are non-mirrored logical volumes such as raw logical volumes and system dump devices on the disk.

————according to smit :

CODE

                                             Remove Copies from a Logical Volume

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

[Entry Fields]
* LOGICAL VOLUME name                                 lvoracle
* NEW maximum number of logical partition             2                                                                     +
copies
PHYSICAL VOLUME name(s) to remove copies from      []
+

looks like you have to specified the on you want to removed-

 

Posted in UNIX-LINUX | Tagged: | Leave a Comment »

Useful AIX commands

Posted by ZyK on 08/30/2011

Some Common AIX-Unix Commands – Tech-Recipes.com

  • lsps –a list paging space
  • lsattr –El mem0 list current physical memory
  • extendlv hd6 16 doubled paging space from 512MB to 1024MB
    (only use with IBM direction)
  • smit lsmksysb (list files on a tape from a mksysb)
  • lsdev –Cc disk (shows all disk drives)
  • lscfg –vl hdisk1 (shows info on individual disk drives, s/n, p/n, etc…)
  • lspv shows disks installed on system
  • df –k (shows file system size information)
  • lp filename (prints file to network printer)
  • lpstat (shows print jobs)
  • cancel # (cancels print job by #, found with lpstat)
  • enq –U (restarts print que if status shows it is down–must be root)
  • enq –Q prtx -#xxx (redirects a print job to another print que)
  • ps –ef (shows current system processes)
  • errpt –a (shows system error report including power outages)
  • errclear 0 (completely clears the system errlog viewed with errpt –a)
  • errclear –N sysplanar0 0
    (clears only select items specified by the resource name, ex: sysplanar0)
  • diag (system diagnostics, use the advanced diagnostics section, this helps determine the exact cause of a problem like sysplana0, queries system errlog for info)
  • sort –o list list (stores the sorted output of list back into list)
  • sort –u list (sorts and eliminates duplicate lines)
  • grep –vxf combinedlist masterlist (lists of #’s in masterlist not found in combinedlist)
    ex: combinedlist=mulitple distribution lists containing SAs already downloaded to masterlist=list of all SA salons
    this grep will list out the salons in the masterlist that haven’t been downloaded to.
  • tail –f filename shows last ten lines of a file and monitors for any updates
  • lsattr –El sys0 | grep maxuproc shows maximum number of processes allowed for any one users (this can be increased by going into “smit system”)
  • lsvg –l rootvg (displays disk info including number of logical and physical partitions for each file system. PPs should be double that of LPs if disk is mirrored)
  • comm -12 file1 file2 shows only what lines are in both file1 and file2. (sort both files before running the command) (the -12 suppress columns 1 and 2, what is only in file1 and only in file2)
  • wc filename (lists number of lines, number of words, number of characters in file, useful for distribution lists, can use –c for characters, -w for words, or –l for lines [eg. wc –l filename, etc] )
  • df –Ik shows filesystem disk space; total, used and free (no Inodes).
  • (in vi) :r filename reads in the contents of a file.
  • (in vi) :r !command reads in the output of a command.
  • (in vi) yy p (copy and paste) – yy = yank, p = paste below line, P = paste above line.
  • (in vi) dd p (cut and paste) – dd = cut, p = paste below line, P = paste above line.
  • Ksh –n filename checks for syntax errors in korn shell programs
  • cfgmgr command to get system to recognize new hardware (can be run while system is running – a system boot runs it 3 times)
  • cfgmgr –i /dev/cd0 installs drivers from cd for new hardware (best method)
  • lscfg –vp|grep CL shows current firmware version
  • instfix –i | grep –i aix shows maintenance level for AIX
  • oslevel –r shows operating system level with maintenance level
  • nslookup server name shows the ip address of the server name as it is on the network’s DNS server via the RS6000’s /etc/resolv.conf file. If it can’t resolve the server name, either the “name server” is stopped on the RS6000 (no resolv.conf file present) or there is something wrong with the DNS.
  • /etc/netsvc.conf file containing hosts=local,bind4 this will force the RS6000 to first use the /etc/hosts file and then the DNS if it can’t find it in /etc/hosts. Other wise it will check in the DNS only (if name server is started on the RS6000) and never the hosts file. ???
  • lssrc –g nfs use to check if nfs service is currently running.
  • stopsrc –g nfs use to stop nfs service – (change rcnfs from wait to off in /etc/inittab to prevent it from starting during boo

AIX Commands

compiled by: John Flecther

COMMAND PARAMETER DESCRIPTION
bootlist -m normal <dev1> <dev2> Alters the list of boot devices (or the ordering of these devices in the list available to the system)
bosboot -a-ad /dev/rnt<x>

-b <loc of bootimage>

Create a boot image on the default boot deviceCreate a boot image at location and send to tape
cfgmgr Configures devices by running the programs in /etc/methods directory.
chcons Redirects the system console to device or file, effective next startup
chdev -l <device> -a<params> Changes a device’s characteristics.
chdisp Changes the display used by the low-function terminal (LFT subsystem.
chfont Changes the default font selected at boot time.
chfs -a size=+<blocks> /<FS> Changes attributes of a file system. This one will increase the Filesystem .
chgroup Users=x,y,z <grp name> Changes attributes for groups.
chlv -n <nlvname> <olvname> Rename logical volume from olvname to nlvname
chps -s<no. pps> <ps name> Changes attributes of a paging space.
chpv Changes the characteristics of a physical volume in a volume group.
chque -q<q name> -a’host = x’ Changes the queue name.
chssys Changes a subsystem definition in the subsystem object class.
chtcb Changes or queries the trusted computing base attribute of a file.
chtz. Changes the system time zone information
chuser rlogin=true <username> Changes attributes for the specified user.
chvfs Changes entries in the /etc/vfs file.
chvg Sets the characteristics of a volume group.
crfs -v <fstype> (jfs)-d <lvname>

-m <mount point>

-Ayes

Create a Filesystem on a pre-defined logical volume( which will automount at boot!)
crfs -v <fstype> (jfs)-g <vgname>

-a size=’<no blocks>’

-m <mount point>

-Ayes

Create a Filesystem and its logical volume (uses default lvname)
crvfs Creates entries in the /etc/vfs file.
exportvg None Export a volume group
grpck -n ALL Verifies the correctness of a group definition.
hvirprt Changes the attribute values of a virtual printer.
importvg -y <vgname><hdisk x> Import a Volume Group onto hdisk x
lpstat List print queues
lsallq Lists the names of all configured queues.
lsallqdev Lists all configured printer and plotter queue device names within a specified queue.
lsattr -El <devname> List detailed configuration for a device
lscfg List all configured devices
-v List in detail
-l scsi* List all scsi IO devices
lsdev -Cc tape List configured tape devices
-Cc disk List configured disks on devices
-C -s scsi -H List all defined scsi devices
lsdisp Lists the displays currently available on the system.
lsfont Lists the fonts available for use by the display.
lsfs -l List all filesystems in /etc/filesystems quering the LVM descriptor area and superblocks
lsfs Displays the characteristics of file systems.
lsgroup ALL Displays the attributes of groups.(checks NIS aswell!)
lsitab -a Lists the records in the /etc/inittab file.
lskbd Lists the keyboard maps currently available to the low-function terminal (LFT subsystem.
lslicense Displays the number of fixed licenses and the status of floating licensing.
lslpp -l List all installed software
lslv <lvname> List configuration details of a given Logical Volume
-l <lvname> List further configuration details of a given disk
lsprtsv -ch Shows print service information stored in the database.
lsps -a List pagaing space
lspv None List configured disks
<hdisk> List configuration details of a given disk
-l <hdisk> List Logical Volumes/Filesystems on a given disk
lsque Displays the queue stanza name.
lsquedev Displays the device stanza name.
lssrc -a List all subsystems
lsuser Displays attributes of user accounts.
lsvfs Lists entries in the /etc/vfs file.
lsvg None List configured Volume groups
<vgname> List configuration details of a given Volume group
-l <vgname> List Logical Volumes/Filesystems on a given Volume Group
mkcatdefs Preprocesses a message source file.
mkdev Adds a device to the system.
mkfont Adds the font code associated with a display to the system.
mkfontdir Creates a fonts.dir file from a directory of font files.
mkgroup Creates a new group.
mkitab Makes records in the /etc/inittab file.
mklv -y <lvname><vgname>

<no of pps>

Create a Logical Volume
mklv Creates a logical volume.
mklvcopy Adds copies to a logical volume.
mknamsv Configures TCP/IP-based name service on a host for a client.
mknotify Adds a notify method definition to the notify object class.
mkprtsv Configures TCP/IP-based print service on a host.
mkps Add an additional paging space to the system.
mkque Adds a printer queue to the system.
mkquedev Adds a printer queue device to the system.
mkserver Adds a subserver definition to the subserver object class.
mkssys Adds a subsystem definition to the subsystem object class.
mksysb. Backs up mounted file systems in the rootvg volume group for subsequent reinstallation
mkszfile. Records size of mounted file systems in the rootvg volume group for reinstallation
mktcpip Sets the required values for starting TCP/IP on a host.
mkuser Creates a new user account.
mkuser.sys Customizes a new user account.
Mkvg -y <vgname>-s <ppsize>

<hdisk x>

Create a Volume Group on hdisk x
mkvg Creates a volume group.
mkvirprt Makes a virtual printer.
odmadd Adds objects to created object classes.
odmchange Changes the contents of a selected object in the specified object class.
odmcreate Produces the .c (source and .h (include files necessary for ODM application development and creates empty objectclasses.
odmdelete Deletes selected objects from a specified object class.
odmdrop Removes an object class.
odmget Retrieves objects from the specified object classes and places them into an odmadd input file.
odmshow Displays an object class definition on the screen.
pwdck Verifies the correctness of local authentication information.
redefinevg Redefines the set of physical volumes of the given volume group in the device configuration database.
reducevg Removes physical volumes from a volume group. When all physical volumes are removed from the volume group, the volume group is deleted.
reorgvg Reorganizes the physical partition allocation for a volume group.
restbase Restores customized information from the boot image.
rmdel Removes a delta from a Source Code Control System (SCCS file.
rmdev Removes a device from the system.
rmf Removes folders and the messages they contain.
rmfs Removes a file system.
rmgroup Removes a group.
rmitab Removes records in the /etc/inittab file.
rmlv Removes logical volumes from a volume group.
rmlvcopy Removes copies from a logical volume.
rmm Removes messages.
rmnamsv Unconfigures TCP/IP-based name service on a host.
rmnotify Removes a notify method definition from the notify object class.
rmprtsv Unconfigures a print service on a client or server machine.
rmps Removes a paging space from the system.
rmque Removes a printer queue from the system.
rmquedev Removes a printer or plotter queue device from the system.
rmserver Removes a subserver definition from the subserver object class.
rmssys Removes a subsystem definition from the subsystem object class.
rmuser Removes a user account.
rmvfs Removes entries in the /etc/vfs file.
rmvirprt Removes a virtual printer.
runcat Pipes the output data from the mkcatdefs command to the gencat command.
savebase Saves base customized device data in the ODM onto the boot device.
startsrc -s <subsystem> Start a subsystem
stopsrc -s <subsystem> Stop a subsystem
syncvg Synchronizes logical volume copies that are not current.
usrck Verifies the correctness of a user definition.
varyoffvg <vgname> Takes a Volume Group offline
varyoffvg Deactivates a volume group.
varyonvg <vgname> Puts a Volume Group online
varyonvg Activates a volume group.

(http://www.softpanorama.org/Commercial_unixes/AIX/Reference/useful_aix_commands.shtml)

Posted in UNIX-LINUX | Tagged: , | 2 Comments »

 
Follow

Get every new post delivered to your Inbox.