Posts Tagged ‘var’
Steps To Reduce /var or /tmp File System
This post will discuss about the various commands used in AIX to reduce /var or /tmp file systems.
Default size of /var file system is 4 MB and for /tmp is 8 MB for AIX Version 4 and Version 5.
The various steps involved are:
1. Backup the data:
# cd /
# tar –cvf /dev/rmt0 /var
OR
# tar –cvf /dev/rmt0 /tmp
You can read about the tar command in previous posts published under Backup and Restore Commands.
2. Boot into maintenance mode:
After the backup is done, you need to boot into the maintenance mode.
3. Choose ‘Start Maintenance Mode for System Recovery’
4. Choose Access Root Volume Group
5. Select the root volume group by number
6. Start a shell
7. Unmount the file system by running the following commands:
# umount /var
# umount /tmp
8. Remove the file system:
Run the following commands:
# rmfs /var
# rmfs /tmp
9. Determine the PP size of rootvg by running the following command:
# lsvg –p rootvg
10. Create a new LV on rootvg:
Run the following command:
# mklv –y hd9var rootvg <number of LPs>
You can refer to previous post on how to create a new LV.
This command will create a new LV for /var
# mklv –y hd3 rootvg <number of LPs>
This command will create a new LV for /tmp
How to determine number of LPs: if PP size is 4 MB for /var and you want /var size to be 8 MB then number of LPs should be 2.
11. Check file system using crfs command:
# crfs –v jfs –d hd9var –m /var –A yes
You can refer to crfs command in previous posts.
12. Mount /var file system:
# mount /var
# mount /tmp
13. Restore the backup /var:
# cd /
# tar –xvf /dev/rmt0
A step or command may be missing in these steps. This post is written with an intention to give a general idea on how to reduce /var or /tmp file system size.
P.S: Most of the commands and text written in this post is referred from various IBM Red Hat Books and pdfs.
Default (Standard) File Systems
Default (Standard) File Systems:
Default AIX file system during OS installation:
/ – 1GB
/usr – 4 GB
/var – 4GB
/tmp – 4GB
/opt – 1GB
/home – 1GB
Paging Space:
1. Ideally, paging space should be double the ram size
2. If RAM >= 256MB then PS should be 512MB
3. If RAM < 256MG then PS is twice of RAM
4. If RAM is 8GB paging space should be 16GB
5. Only 1 PS per disk
6. Use disk with least activity for paging space
7. Do not extend PS to multiple PV
8. Paging Space should be backed by hardware redundancy technology
9. Should not delete system’s default paging space on hd6
10. Should not reduce size of hd6 below 32MB. Should not be less than 64MB for AIX 4.3 and above
11. Paging Space should not take more than 20% of disk space
12. Divide paging space into multiple PS for greater flexibility
13. /etc/swapspaces contains list of PS that is activated at system start-up
Additional Information On AIX System Administration – IV
# lsfs command gives the following output:
Hd1 – home
Hd2 – USR
HD3 – TMP
HD4 – Root
HD5 – BLV
HD6 – Paging Space (2 types: primary, secondary)
HD7 – Not Found
HD8 – JFS
HD9 – VAR
HD10 – MNT
HD11 – admin (available in AIX V 6.1)
LED code 0c0 means successful completion of dump.
To view extended permissions, command used is:
# ls –e <filename>
Command used to set tty port for bidirectional mode:
# share <port attributes>
Commands used to setup quota for file system for end users are:
# vi /etc/<file system>
# edquota /<file system> <username>
# quotaon <file system>
# quotaon /<file system>
To initiate system dump, command used is:
# sysdumpstart –P (for primary)
# sysdumpstart –S (for secondary)
SNAP is generally used to gather system information.
Some of the SNAP commands are:
# snap –a
# snap –g
# snap –D
Image.data contains information about VG’s and LV’s.
Bosinst.data contains information about installation flow control.
To view mksysb tape and to restore particular file from mksysb tape, commands used are:
# tctl –f /dev/<tape drive name>
# restore –tvf /dev/<tape drive name>
# restore –xvf /dev/<tape drive name>
For eg:
# tctl –f /dev/rmt0
# restore – tvf /dev/rmt0
# restore – xvf /dev/rmt0
Tctl command is basically used to rewind the tape drive.
To list NIM objects, command used:
# lsnim
NIM stands for network installation management.
To see NIM log, command used is:
# nim –o showlog –a full_log = yes –a log_type = logtype NIMclient
Logtype can be boot, script etc.
NIMClient is the hostname / ip address of the client machine.
Sources of this command : IBM AIX Forum
# smit system command is used to change the server time.
# smit date command is used to change system date.
Time synchronization is either done by running time demon or ntp demon.
P5 family:
- Entry :
i. P5 510
ii. P5 520
iii. P5 550
- Mind Range :
i. P5 570
- High End :
i. P5 575
ii. P5 590
iii. P5 595
Physical Volume (PV) id can be found in Cuat ODM class.
Device in defined state means there is an entry in ODM class CuDV.
Procedure to change bootlist from hdisk0 to hdisk1:
Go to SMS mode by pressing F1 and change the bootlist by running the following command:
# bootlist –m normal hdisk0 hdisk1
If a machine keeps rebooting and repeating POST, it means either there is invalid bootlist or corrupted BLV or hardware failure of boot device.
More we will discuss about AIX System Administration in the coming posts.
Till then,
Happy Learning !
Additional Information On AIX System Administration – I
This post will discuss about some additional information about AIX OS that can be used in production environment.
If the admin wants to filescan the root file system:
- Admin must go into the maintenance mode after booting from the disk.
- Type the following command:
- # /etc/continue <bootdisk> exit
- For eg:
- # /etc/continue hdisk0 exit
- # fsck /dev/hd4
To filescan the /usr directory:
- To do this, /usr should be unmounted. Unmounting is not an easy process as /bin directory is linked to /usr directory in /usr/bin. So admin must go into the maintenance mode first and then run
- # getrootfs <bootdisk> sh
- For eg:
- # getrootfs hdisk0 sh
- After running this command, next command user needs to run is:
- # fsck /dev/hd2
To change the parameters (for eg: number of processes per user run), command used is:
- # lsattr –EH –l sys0 –a maxuproc
- # chdev –EH –l sys0 –a maxuproc = 200
To list all the virtual printers a print queue is using, command used is:
- # lsvirprt
To check if AIX has a PTF applied to it or not, command used is:
- # lslpp –B1 UXXXXXXX
- Where
- UXXXXXXX is the PTF number
PTF stands for program temporary fix.
Click cancel or F10 to exit from SMIT menu.
To check inode statistics, command used is:
- # istat /etc/passwd
Various degraf commands are:
- # defrag –q
Or
- # defrag –r
Or
- # defrag –s
Alog information is available in /var/adm/ras directory.
- # smit alog_show
- Command can also be used for the same output on smit screen as that of alog command.
Fileset Revision Level Identification (FRLI)
- XX.XX.XXXX.XXXX
- XX stands for Version (0-2)
- XX stands for release (0-2)
- XXXX stands for modification (1-4)
- XXXX stands for Fix level (1-4)
- # smit update_all command can also be used for modification and fix level information.
JFS stands for journeled file system.
File system:
- Hd1 : Home
- Hd2 : USR
- Hd3 : TMP
- Hd4 : ROOT
- Hd5 : BLV
- Hd6 : Paging Space
- Hd7 : Not Found
- Hd8 : JFS / JFS2
- Hd9 : VAR
- Hd10 : OPT
Happy Learning!
AIX Basics Continued…
AIX Command Basics Continues:
GREP stands for global search for regular expression and print.
- # grep ^D: will search for directories in the current path
- # grep ^B: will search for files starting with B character
- # grep 5$: will search for files ending with 5 in the name
- # grep ^A.*0$: will search for files starting with character A and ending with 0 in the end. For eg : output will be Antonie389-2000
- # grep <word to be searched> <filename> command will search that particular word in the filename mentioned
- # cat file1 | grep <word> command will search the word in file1
Here (|) pipeline symbol is used inorder to make output of one file as input of other.
- # crontab –l: will list all the jobs scheduled by administrator at various times using at, batch or crontab command
- Command to reduce the size of unwanted files for eg: /var/adm/wtmp:
# > /var/adm/wtmp
Or
# cat /dev/null > /var/adm/wtmp
- Telinit command is used to change the run level of the OS
- # telinit 5 command: will change the run level to 5
- # telinit q: will re-read /etc/inittab every 60 seconds
- # telinit s|S|m|M: will put the system into single user maintenance mode
- # shutdown: will shutdown the OS
- # shutdown –f: is used for forced shutdown
- # shutdown –r: is used for rebooting the server. # shutdown -fr command can also be used to forced restart the machine.
- # shutdown –m: is used to put the OS into single user maintenance mode
- To create an empty file, command used is # touch <filename>
# cat > <filename> if the filename does not exist, it will create a filename. If it exists, it will add contents to the file.
CAT stands for concatenation.
For eg:
# cat file1
Hii there, welcome to abcofaix.com
<CNTL-D>
This will save the contents of the file and exit
You can view the contents by # cat file1 or # cat < file1
- # cat –b /etc/passwd command will number the lines in the file /etc/passwd
- # head file1 command will show first 10 lines of the file file1.
- # tail file1 command will show the last 10 lines of the file file1.
- # sort /etc/passwd command will sort the contents of the file in alphabetical order.
- # sort –r file1 will reverse the sorting order.
Source: Introduction to UNIX by P. Sudarshan

