Q.1 Explain the boot process?
Three phases available in BOOT Process
- Ros kernel init phase
- Base Device Configuration
- System boot phase
- Ros Kernel init phase (PHASE1)
A. Post (power on self test)
In this post it will do basic hardware checking
B. Then it will go to NVRAM and check the boot list for last boot device (hdisk0 or hdisk1).
C. Then it will check the BLV (hd5) in boot device.
D. Then it will check the boot image
E. Then boot image is moved to memory.
F. Then kernel will execute.
- Base Device configuration (PHASE2)
A. Here cfgmgr will run for device configuration.
- System Boot Phase (PHASE3)
A. Kernel will execute.
B. The paging space (hd6) will get start.
C. Then following file system will be mounted /, /var. /usr, /home. /tmp
D. Kernel start the init process, it will read the /etc/inittab file and execute the following process.
/etc/rc.boot,
srcmstr
/etc/rc.tcpip
/etc/rc.net
The above network related files /etc/rc.tcpip, /etc/rc.net, used to configure the ip address and routing.
E. Then it will start the system by default run level 2.
NOTE:
Run
level 2: It contains all of the terminal process and daemons that are
run in the multi user environment. This is default run level.
/etc/inittab file contains four fields, 1.Identifier, 2.Runlevel, 3.Action, 4.Command
Q.2 Explain the ODM concepts?
ODM
generally used for Maintain the System information, whenever we install
and reconfigure the hardware device and software, that information’s
added in ODM,
Mainly ODM used to store the following information’s
- Hardware vital product data information
- Software information
- Smit menu
- Nim
- TCPIP
- Error log
- Device configuration information
- Display information for SMIT (menus, selectors, and dialogs)
- Vital product data for installation and update procedures
- Communications configuration information
- System resource information.
But we cannot see any ODM information in file format, but this ODM information available in many files and different path,
- /etc/objrepos
- /usr/lib/objrepos
- /usr/share/lib/objrepos
NOTE:
For
ODM some variable entry available in /etc/environment file.U should not
edit anything in this file. If you want to check the variable entry
using command
#env
The above command is used to display the variable details
ODM has two kinds of Databases
- Pre-defined (PdDv)
- Customized(CuDv)
1. Predefined
In this predefined Database has one Object class (PdDv) and Objects i.e.
PdDv (Object class)
Object: (Physical Information’s)
Floppy drive
Harddisk drive
Mouse like this all the devices.
2. Customized
In this customized Database has one Object class (CuDv) and Objects i.e.
CuDv (Object class)
Objects: (Installed configuration information’s)
hdisk0
hdisk1
fd0
sa0
rmt0
cd0
scsi0 like this all the devices
ODM States:
What is available state and defined state for the device?
ODM has two states
- Available (device status will be 1)
- Defined (device status will be 0)
Suppose we are installing one HDD in server. That device is currently accessible this is available state.
Suppose
that installed device is removed from server or hdd has failed. This
case that device is moved to defined state. i.e. that device
configuration is available in server but currently device is not
accessible.
We can see this available and defined device status using odmget command
#odmget CuDv ( It will display the customized device status)
ODM Commands:
For object:
- odmadd
- odmchange
- odmget
- odmdelete
1. odmadd
The above command is used to manually we can add object information in ODM
2. odmchange
The above command is used to change configurations for object in ODM
3. odmget
# odmget –q name=hdisk0 CuDv
The above command is used to display the specified object hdisk0 information in ODM
We can see this available and defined device status using odmget command
# odmget CuDv (It will display the customized device status)
4. odmdelete
# odmdelete –o CuDv –q name=hdisk0
The above command is used to delete the specified object hdisk0 in ODM.
For object class:
- odmcreate
- odmdrop
- odmshow
1. odmcreate
The above command is used to manually we can add object class (PdDv) in ODM
2. odmdrop
The above command is used to stop the specified Object class in ODM
3. odmshow
The above command is used to display the specified object class in ODM
NOTE:
You should not add, delete, change, for object and object class in ODM
(100 % we don’t have permissions for ODM)
Q. 3 What are the installations available in AIX, Explain? OR
Explain the Installation procedures in AIX, and explain? OR
Difference between migration installation and preservation installation?
OS INSTALLATION
Three kinds of OS installations available in AIX
- New and Complete Overwrite
- Migration
- Preservation
- New and Complete Overwrite:
This is New installation; in this installation we have three options
- Start installation with default settings
- Change/show installation settings and install
- Start maintenance mode for recovery
- Start installation with default settings
This is normal installation
- Change/show installation settings and install
In this installation we can change the installation disk (hdisk0, or hdisk1), Desktop options.
- Start maintenance mode for recovery
This is used for recover the existing OS problems. (Boot image, Boot list, File systems problems).
- Migration:
In
this migration Installation, Operating system Updated from lower level
to higher level i.e. Aix 5.1 To Aix 5.3 or Aix 5.2 To Aix 5.3 ,
NOTE:
In
this installation System data will not be affected except the /tmp file
system. i.e. /tmp file system will be deleted and newly created.
- Preservation:
This
installation is overwriting the existing OS and user data directory
/home only persevered, rest of the directories /, /var, /tmp, /etc,
/dev, /opt will be deleted and newly created.
NOTE:
In this installation we can preserve additional directories also,
suppose if you want preserve /opt, this case u should put /opt file
system entry in /etc/preserve.list file.
Q.4 How will you configure the mirroring? OR
How will you do the mirroring in AIX? OR
How will you change the boot sequence? OR
How will you install the boot image?
The following steps will guide you trough the mirroring of an AIX rootvg.
This info is valid for AIX 4.3.3, AIX 5.1, AIX 5.2 and AIX 5.3.
- Make sure you have an empty disk, in this example its hdisk1
- Add the disk to the vg via "extendvg rootvg hdisk1
- Mirror the vg via: "mirrorvg rootvg"
- Adapt the bootlist to add the current disk, the system will then fail to hdisk1 is hdisk0 fails during startup
- do bootlist -o -m normal
- this will list currently 1 disk, in this exmaple hdisk0
- Run a bosboot on both new disks, this will install all software needed for boot on the disk
- bosboot -ad hdisk0
- bosboot -ad hdisk1
- do bootlist -m normal hdisk0 hdisk1
OR
First
select the disk which you want to use for the mirror, ideal would be an
disk which is attached to a differant scsi adapter.
Then add the disk to the datavg like:
extendvg datavg hdiskx
than you can create the mirror by using the mirrorvg command ,
mirrorvg -m datavg hdiskx
hdiskx is your destination disk !
After that Quorum will be disabled for the volumegroup ,to activate this the volumgroup must be varied off and varied on.
You can add the -S flag to the command which causes the synchronizing of the disks to happen in the background.
A more back to the basics option is to
create the mirroring by yourself by creating copies of each separate
logical volume, this can be done by using the mklvcopy command.
To remove mirroring , use the unmirrorvg command or the rmlvcopy command.
Q.5 How will you identify the mirrored VG?
# lsvg –l rootvg
PP size will be doubled than LP.
Q.6 Explain PP, LP
Physical Partition (PP):
Storage space from physical volumes is divided into physical partitions (PPs).
The size of the physical partitions is identical on all disks belonging to the
same VG.
Logical Partition (LP):
Logical volumes consist of one or more logical partitions (LPs). Each logical
partition has at least one corresponding physical partition. A logical partition
and a physical partition always have the same size. You can have up to three
copies of the data located on different physical partitions
Q.7 How will you find the logical device?
# lsvg –l [VGNAME]
Q.8 How will you add new HDD to server and explain the HDD installation Procedures? OR
How will you add PV to one VG?
First you connect hard disk and run the cfgmgr command it will detect the hdd.
# cfgmgr (It will detect the all the devices)
# lsdev –Cc disk (it will show the pv name like hdisk1, hdisk2)
# extendvg rootvg hdisk2
Q.9 How will you create the VG?
We can create VG by using mkvg commands
#mkvg –s 32 –y datavg hdisk4
The above command is creating datavg using pv hdisk4 and pp size is 32MB
Q.10 How will you increase the file system size?
Using chfs command we can rename and increase the size of the file system online
We want to increase file system size
#chfs –a size=+block size /filesystem name
#chfs –a size=+32m /filesystem name
#chfs-a size=+4g /filesystem name
+block size – We can mention the size using blocks (2048 blocks = 1MB)
+32m – We can mention the size using MB
+4g – We can mention the size using GB
Q.
How will you check the file systems size? once you have checked the
filesystem you found one of the /opt/apps filesystem is 95% how u you do
first?
# df –g (it will show the filesystem size in GB)
# find /opt/apps -xdev -size +1024 -ls |sort -r +6
Q.11 How will you rename the LV, and FS?
In
this change LV option we can change LV name and permissions for the LV
using chlv command. File system should be unmounted to change lv name.
#chlv –n newlvname oldlvname
#lslv testlv
Output is some details about testlv
#chlv –n newlv testlv
After executing the above command the testlv renamed to newlv
How to rename the FS?
Now we want to rename /newfs to /testfs then your command will be
#chfs –m /testfs /newfs (Need to remount file system for changes to take effect)
After executing the above command /newfs renamed as /testfs
Q.12 How will you convert Normal VG to Big VG?
#chvg –B
How will you convert Normal VG to Scalable VG?
#varyoffvg
#smitty chvg
1. Select VG
2. Select “Yes “ in Change to scalable VG format?
Convert Normal VG to Scalable VG
#chvg –G
Q.13 What is the difference between Normal VG and Big VG?
VG Type
|
Maximum PVs
|
Maximum LVs
|
Maximum PPs/VG
|
Maxumum PP Size
|
Normal VG
|
32
|
256
|
1016*32=32512
|
1 GB
|
Big BG
|
128
|
512
|
1016*128=130048
|
1 GB
|
Scalable VG
|
1024
|
4096
|
2097152
|
128 GB
|
Q.14
Suppose one PV fails in Mirror VG, and you have to configure new PV to
that mirror VG and mirroring has to be configured again? OR
How will you remove the failed PV in mirrored VG explain the procedures?
# lsvg -p rootvg
rootvg:
PV_NAME PV STATE TOTAL PPs FREE PPs FREE DISTRIBUTION
hdisk0 active 542 264 109..00..00..46..109
hdisk1 active 542 278 88..00..00..81..109
*Here your making sure that both disks are assigned to the volume group
# lsvg -l rootvg
rootvg:
LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINT
hd5 boot 1 2 2 closed/syncd N/A
hd6 paging 64 128 2 open/syncd N/A
hd8 jfslog 1 2 2 open/syncd N/A
hd4 jfs 6 12 2 open/syncd /
hd2 jfs 127 254 2 open/syncd /usr
hd9var jfs 4 8 2 open/syncd /var
hd3 jfs 37 74 2 open/syncd /tmp
hd1 jfs 3 6 2 open/syncd /home
hd10opt jfs 21 42 2 open/syncd /opt
dumplv sysdump 14 14 1 open/syncd N/A
*Here your checking to make sure there’s a 1:2 relationship, meaning that there are copies. Notice dumplv. It’s not copied so we need to make sure dumplv data isn’t on the failing disk. To check, run;
$ lslv -l dumplv
dumplv:N/A
PV COPIES IN BAND DISTRIBUTION
hdisk0 014:000:000 100% 000:014:000:000:000
This is telling us that the logical volume dumplv is on hdisk0. If hdisk1 is the failing disk, then we are okay. Otherwise, we would have to migrate the data over to the good drive and proceed.
# unmirrorvg rootvg hdisk1
# reducevg rootvg hdisk1
# rmdev -l hdisk1 –d
Before you power down, it’s a good idea to check the system to make sure it will boot from the good drive. Do that by performing;
# bootinfo -b
hdisk1
This tells you what drive it was last booted up. We want to change this to boot to the new drive, so;
# bosboot -ad /dev/hdisk0
And check bootlist
# bootlist –m normal –o
NOW WE CAN POWER DOWN THE BOX AND REPLACE THE DRIVE
Once disk has been replaced, power up the server. Once at command prompt, run;
# cfgmgr
This will install the new device and allow the OS to see it.
# lsdev -Cc disk
hdisk0 Available 40-60-00-4,0 16 Bit LVD SCSI Disk Drive
hdisk1 Available 40-60-00-8,0 16 Bit LVD SCSI Disk Drive
Make sure that the OS says it’s available. If it is, we can assign it to a volume group.
# extendvg rootvg hdisk1
This will assign it a PVID and assign it to the volumegroup rootvg to make it available for use. Now we can mirror;
# mirrovg rootvg
This will take a little while as it’s taking all data now on hdisk0 and making a copy to hdisk1.
# lsvg -p rootvg
rootvg:
PV_NAME PV STATE TOTAL PPs FREE PPs FREE DISTRIBUTION
hdisk0 active 542 264 109..00..00..46..109
hdisk1 active 542 278 88..00..00..81..109
Once it’s mirroring, we can make sure it’s assigned to rootvg by doing the above. We can also check to make sure there are copies;
# lsvg -l rootvg
rootvg:
LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINT
hd5 boot 1 2 2 closed/syncd N/A
hd6 paging 64 128 2 open/syncd N/A
hd8 jfslog 1 2 2 open/syncd N/A
hd4 jfs 6 12 2 open/syncd /
hd2 jfs 127 254 2 open/syncd /usr
hd9var jfs 4 8 2 open/syncd /var
hd3 jfs 37 74 2 open/syncd /tmp
hd1 jfs 3 6 2 open/syncd /home
hd10opt jfs 21 42 2 open/syncd /opt
dumplv sysdump 14 14 1 open/syncd N/A
Now we need to modify the bosboot to recreate the boot image;
# bosboot –a
Double check your bootlist to make sure hdisk1 is in there;
# bootlist –m normal –o
Q.15 How many LV’s Available in rootvg, explain the details?
#lsvg –l rootvg
Hd1 /home
Hd2 /usr
Hd3 /tmp
Hd4 /
Hd5 boot (BLV)
Hd6 paging
Hd8 jfs log
Hd9var /var
Hd10opt /opt
Default paging space resides in which LV?
Hd6 paging
Q.16 Difference between JFS and JFS2 File system?
Function
|
JFS
|
JFS2
|
Maximum File System Size
|
1 TB
|
4 PB
|
Maximum File Size
|
64 GB
|
4 PB
|
Number of Inode
|
Fixed, set at FS creation
|
Dynamic
|
Inode size
|
128 Bytes
|
512 Bytes
|
Fragement Size
|
512
|
512
|
Block Size
|
4096
|
4096
|
Directory Organization
|
Linear
|
B-tree
|
Compression
|
Yes
|
No
|
Default Ownership at creation
|
sys:sys
|
root:system
|
Quotas
|
Yes
|
Yes
|
Q.17 What is VGDA and VGSA?
VGDA:
The Volume Group Descriptor Area(VGDA) is an area on a disk that
contains information about Volume group that the physical volume belongs
to.
It
also includes the information about the properties and status of all
Physical and logical volumes that are part of the volume group.
There
is at list one VGDA per Physical volume. Information form VGDAs of all
the disks that are part of the same Volume Group must be identical. The
VGDA internal architecture and location on the disk depends on the type
of the Volume Group (Original, Big, or Scalable).
VGSA: The
Volume Group Status Area(VGSA) is used to describe the state of all
physical partitions form all physical volumes within a Volume Group. The
VGSA indicates if a partition contains accurate or stale information.
VGSA
is used for monitoring and maintained data copy synchronization. The
VGSA is essentially a bitmap and its architecture and location on the
disk is depends on the Volume Group type.
LVCB: A
Logical Volume Control Block(LVCB) contains important information about
the logical volumes. Such as number of the logical partitions or disk
allocation policy.
For standard volume groups, the LVCB resides on the first block of user data within the LV..
For Big volume groups, there is additional LVCB information in VGDA on the disk.
Q.18 How will you do the performance monitoring in AIX servers?
PERFORMANCE MONITORING
In this performance monitoring we can check following things
- Cpu bound
- Memory bound
- Network bound
- I/O bound
1. CPU bound
Using Topas command we can check the server performance monitor, the following things we can monitor.
- processor (CPU Usage)
- Network (KB in / KB out)
- Memory (Page in / Page out)
- I/O (HDD read and write)
- Top 8 process
2. Memory bound
Using vmstat command we can monitor the memory bound
#vmstat 2 3
After this command execution, it will show the memory page in and page out process. Within 2 seconds, 3 outputs is displayed
Suppose you are checking paging space usage using command lsps
#lsps –s
11% - this is normal
40% - Server running on slow performance
70% - users cannot logon the server,
Some error message will appear (fork exist failed)
3. Network bound
Using topas command we can monitor the network bound, in this network monitor we can find KB in and KB out process.
4. I/O bound
Q. How will the check the performance of the disk?
Using iostat command we can monitor the I/O bound
In
this I/O bound we can monitor the disk usage, suppose you are using two
or three heavy used file system in one PV that time that particular PV
usage will be very high
Q.19 Explain Page In and Page Out Operations?
page ins
Incremented
for each page read in by the virtual memory manager. The count is
incremented for page ins from page space and file space. Along with the
page out statistic, this represents the total amount of real I/O
initiated by the virtual memory manager.
page outs
Incremented
for each page written out by the virtual memory manager. The count is
incremented for page outs to page space and for page outs to file space.
Along with the page in statistic, this represents the total amount of
real I/O initiated by the virtual memory manager.
Q.20 Explain the paging?
PAGING SPACE
Paging
space is configured for additional system performance i.e. if real
memory is occupies some system process, that time further process is
moved to paging space temporary. If real memory is getting free, then
process moved from paging space to real memory. This paging space is
assigned from HDD space.
Normally paging space is configured double size of the real memory
If system has 512MB RAM, then paging space size will be 1GB.
In this paging space we can do following things
- List paging space
- Create paging space
- Change paging space
- Activate paging space
- Deactivate paging space
- Remove paging space
Q. How will you list the current paging space configuration and paging usage?
1. List paging space
Using lsps command we can view the paging space details
#lsps –a (It will display the paging space details)
Q. How will you create the additional paging space?
2. Create Paging space
Using mkps command we can create the paging space
#mkps –s 10 rootvg hdisk2
s- size
10 – no of LP size
Rootvg – specifying the VG
Hdisk2 – paging space created in PV hdisk2 (PP allocated from hdisk2)
Then paging space has created and name will be paging00
Using mklv command we can create paging space using different name.
Generally paging name will be paging00, paging01, paging02,
#mklv –y newpaging –t paging rootvg 10 hdisk2
#lsps –a
Paging00 , newpaging
3. Change paging space
Q. How will you increase paging space size?
Using chps command we can increase, decrease, auto on, and auto off the paging space.
#chps –s 5 newpaging (5 LP’s added with newpaging) – To increase
#chps –d 3 newpaging (3 LP’s reduced from newpaging – To Decrease
#chps -ay newpaging (To start the paging space at startup)
#chps –an newpaging (To stop the paging space automatic startup at boot)
4. Activate paging space
Using swapon command we can activate the paging space
#swapon /dev/newpaging (To activate paging space)
The paging space is active stage, and then one entry will be available in /etc/swapspaces file.
5. Deactivate paging space
Using swapoff command we can deactivate the paging space
#swapon /dev/newpaging (To deactivate paging space)
The paging space is deactivated, then that paging space entry is removed from /etc/swapspaces
6. Remove paging space
Using rmps command we can remove the paging space
#rmps newpaging
NOTE:
Before
removing the paging space, paging space should be offline, then we can
remove the paging space, otherwise it will give some errors
Q.21 Explain Sticky bit, User Id, Group Id?
Here we will discuss about the 3 special attributes other than the common read/write/execute.
Example:
drwxrwxrwt - Sticky Bits - chmod 1777
drwsrwxrwx - SUID set - chmod 4777
drwxrwsrwx - SGID set - chmod 2777
Sticky bit
Sticky bits are mainly set on directories.
If
the sticky bit is set for a directory, only the owner of that directory
or the owner of a file can delete or rename a file within that
directory.
Example:
Consider you have a directory " test ".
chmod it to " 777 ". This gives permissions for all the users to read, write and execute.
chmod +t test
Example: ls -al
drwxrwxrwt 2 a1 a1 4096 Jun 13 2008 .
-rw-rw-r-- 1 a1 a1 0 Jun 11 17:30 1.txt
-rw-rw-r-- 1 b2 b2 0 Jun 11 22:52 2.txt
From the above example a1 is the owner of the test directory.
a1 can delete or rename the files 1.txt and 2.txt.
b2 can delete or rename the file 2.txt only.
SUID - [ Set User ID ]
SUID bit is set for files ( mainly for scripts ).
The SUID permission makes a script to run as the user who is the owner of the script, rather than the user who started it.
Example:
If a1 is the owner of the script and b2 tries to run the same script, the script runs with the ownership of a1.
If
the root user wants to give permissions for some scripts to run by
different users, he can set the SUID bit for that particular script.
So if any user on the system starts that script, it will run under the root ownership.
Note:
root user much be very carefull with this.
SGID - [ Set Group ID ]
If
a file is SGID, it will run with the privileges of the files group
owner, instead of the privileges of the person running the program.
This permission set also can make a similar impact. Here the script runs under the groups ownership.
You can also set SGID for directories.
Consider
you have given 2777 permission for a directory. Any files created by
any users under this directory will come as follows.
Example:
-rw-rw-r-- 1 b2 a1 0 Jun 11 17:30 1.txt
In the above example you can see that the owner of the file 1.txt is b2 and the group owner is a1.
So both b2 and a1 will have access to the file 1.txt.
Now lets make this more intresting and complicated.
Create a directory "test". Chmod it to 2777. Add sticky bit to it.
Example:
mkdir test
chmod 2777 test
chmod +t test
ls -al test
drwxrwsrwt 2 a1 a1 4096 Jun 13 2008 test
From the above permission set you can understand that SGID and sticky bit is set for the folder "test".
Now any user can create files under the test directory.
Example:
drwxrwsrwt 2 a1 a1 4096 Jun 13 2008 .
-rw-rw-r-- 1 b2 a1 0 Jun 11 17:30 1.txt
-rw-rw-r-- 1 c3 a1 0 Jun 11 17:30 2.txt
-rw-rw-r-- 1 d4 a1 0 Jun 11 17:30 3.txt
So all the a1 user has access to all the files under the test directory. He can edit, rename or remove the file.
b2 user has access to 1.txt only, c3 has access to 2.txt only...
If
sticky bit was not set for the test directory, any user can delete any
files from the test directory, since the test directory has 777
permissions.
But now it not possible.
Example:
If d4 tries to remove 1.txt
rm -f 1.txt
rm: cannot remove `1.txt': Operation not permitted
Q.22 How will you creating users?
In this user management we can do following commands
- Create user
- List user
- Change user
- Remove user
- Set password for users
1. Create user
Using mkuser command we can create a new user, suppose you want to create new user,
#mkuser lingam
After this command execution, lingam home directory created in /home/lingam/
lingam user configuration details stored in /etc/passwd
Now you can login the terminal using lingam user name without password.
Then you have to set the password for lingam user using command passwd
#passwd lingam
Enter new password: ******
Confirm password again: ******
After
this command execution password assigned to lingam user and lingam user
password configuration entry added in /etc/security/passwd.
NOTE: user configuration data stored in /usr/lib/security/mkuser.sys
Whenever login the server that last login information’s stored in /etc/security/lastlog file.
2. List user
Using lsuser command we can list the user properties, i.e. user home directory, shell, group, etc. except password
#lsuser all (It will list all the user information’s except password)
#lsuser (It will list only user information’s except password)
3. Change user
Using chuser command we can change user properties, i.e. user home directory, shell group, etc. except password
Whenever you create a user that user home directory by default created in /home file system, and default group is staff.
Suppose we want to change the user group to system, then your command will be.
#lsuser (it will show user properties including group information)
#chuser pgrp=system (now user is assigned to primary group system and secondary group is assigned to staff)
#lsuser (It will list modified user properties, group is system, staff)
Like this we can change all the user properties
4. Remove user
Using rmuser command we can remove the user, suppose you want to remove user
#rmuser
After this command execution, particular user will be deleted.
5. Set password for Users
Using passwd command we can set password for user and root
#passwd
Enter new password: *****
Confirm password: *****
We
are changing password for user from root path, it will not ask existing
password for user, because root is administrator login.
Suppose
you are changing password from user login, it will ask existing
password, because user should know the existing password before changing
the new password. Otherwise any user can change the user password. This not recommended security.
$pwd
/home/
$passwd
Enter the old password: *****
Enter the new password: *****
Confirm password again: *****
NOTE: Suppose you are forgotten root password that time what you will do.
Answer: boot the server with BOS Cd and go to maintenance mode, access the rootvg, then you can change the password for root.
Like this we can change the password for users.
GROUP MANAGEMENT
In this group management we can do following things,
- Create group
- List group
- Change group
- Remove group
1. Create group
Using mkgroup command we can create the group, suppose you want to create oracle group.
#mkgroup oracle
After this command execution new oracle group has created and this group is added in /etc/group file.
2. List group
Using lsgroup command we can list group information’s. Suppose we want to list oracle group information
#lsgroup oracle (it will display the oracle group information’s, gname, gid, members)
#lsgroup all (It will list all group details)
3. Change group
Using chgroup command we can change the group information’s.
#chgroup options oracle
4. Remove group
Using rmgroup command we can remove a group, suppose we want to remove oracle group.
#rmgroup oracle
After this command execution oracle group removed and group configuration information removed from /etc/groups files.
Q.23 While creating the users, user attributes is taken from which file for user configuration?
User administration related files
The following files are referenced while doing user administration:
/etc/security/environ Contains the environment attributes for users.
/etc/security/lastlog Contains the last login attributes for users.
/etc/security/limits Contains process resource limits for users.
/etc/security/user Contains extended attributes for users.
/usr/lib/security/mkuser.default Contains the default attributes for new users.
/usr/lib/security/mkuser.sys Customizes new user accounts.
/etc/passwd Contains the basic attributes of users.
/etc/security/passwd Contains password information.
/etc/security/login.cfg Contains system default login parameters.
/etc/utmp Contains a record of users logged into the system.
/var/adm/wtmp Contains connect-time accounting records.
/etc/security/failedlogin Records all failed login attempts.
/etc/motd Contains the message to be displayed every time a user
logs in to the system.
/etc/environment Specifies the basic environment for all processes.
/etc/profile Specifies additional environment settings for all users.
$HOME/.profile Specifies environment settings for a specific user.
/etc/group Contains the basic attributes of groups.
/etc/security/group Contains the extended attributes of groups.
Q.24 What are the contents available in /etc/passwd file?
Name:Password:UserID:PrincipleGroup:Gecos:HomeDirectory:Shell
ora10gr2:!:207:204::/home/ora10gr2:/usr/bin/bash
Q.25 what are the entries available in /etc/security/passwd file?
Q.26 Explain the Backup types in AIX? OR
Explain the backup and restore Process?
In this chapter we can do following things using backup and restore commands
- backup
- restore
- rootvg backup
- restore rootvg backup
- non rootvg backup(other than rootvg)
- restore non rootvg backup(other than rootvg)
- rewind, eject and erase the tape
1. Backup
Using backup and tar command to we can take full backup and incremental backup.
Using tar command we can take normal backup, in this tar we cannot take day wise incremental backup
#tar –cvf destination source
#tar –cvf /dev/rmt0 /usr/sbin
#backup –if /dev/rmt0 /usr/sbin (For AIX full backup)
/usr/sbin directory files is backup to tape
Using backup command we can take incremental backup, this backup command is particularly for AIX.
In this backup command we can specify the day (0(sun) – 6(sat)).
Suppose you want to take Sunday backup then your command will be
#backup -0 –vf destination source
#backup -0 –vf /dev/rmt0 /var
#backup -6 –vf /dev/rmt0 /var (Saturday backup)
/var file system log is backup to tape
Like this we can take normal and incremental backup in AIX
2. Restore
Using tar and restore command we can restore the data in server
Using tar command we can restore data to server, this is normal restore
#tar –xvf /dev/rmt0
The tape backup is restored to /data directory.
Using restore command we can restore the data
#restore –xdf /dev/rmt0
The tape data is restored in current directory.
Like this we can restore the data in AIX
3. rootvg backup
Q. While you are taking rootvg backup you need to take only few things how will you take?
Using mksysb command we can take the rootvg (AIX OS) backup
#mksysb –i /dev/rmt0
#mksysb –ie /dev/rmt0 (exclude backup – please read NOTE message)
i option is used for crate the image.data file created in tape
This
image.data file contains all the file system information’s in rootvg
while restore the rootvg backup, before start the restore it will read
the information’s from the image.data file
After
the command execution rootvg backup created in tap, suppose OS got
corrupted, that time we can restore the os from rootvg backup.
NOTE:
While taking rootvg backup we can exclude unwanted file systems in
backup process. Suppose you not required following file systems in
mksysb backup,
That time you should put entry in /etc/exclude.rootvg,
While creating the rootvg backup, first tape is spitted in to 4 blocks (block size is 512)
First block has boot image.
The BOS boot image contains a copy of the system’s kernel and device drivers
needed to boot from the mksysb tape. It is created by the bosboot command.
Second block has following things, 1. /tapeblksize, 2. /image.data, 3. bosinst.data.
1. /tapeblksize
The /tapeblksize file contains the block size the tape drive was set to when the mksysb command was run.
2. /image.data
The /image.data file store the information about rootvg, like vg, pp, pp size, lv, lv size, FS
The image.data file resides in /var/adm/ras/image.data
3. /bosinst.data
The ./bosinst.data file allows you to specify the requirements at the target system
and how the user interacts with the target system. This file contains the
customized BOS install procedures and dictates how the BOS install program will
behave. You can customize this file before issuing the mksysb command or use a
procedure to customize this file after the image backup is done.
Third block has dummy toc file,
The dummy table of contents (TOC) is used so that the mksysb tape contains the
same number of images as a BOS install tape.
Fourth block has data, that is rootvg original data
4. Restore rootvg backup
Using restore command we can restore the rootvg backup
Boot
server with bos (base operating system) Cd, then go to maintenance mode
and access the rootvg, then run the following command
#restore –T –d –v –q –f /dev/rmt0
Or
Boot server with bos CD, then go to maintenance mode and initiate the rootvg backup (one option available in maintenance mode).
Like this we can restore the rootvg backup
5. Backup the non rootvg backup
Using savevg command we can backup the non rootvg backup
Suppose your server has 3 volume groups
#lsvg
Rootvg
Datavg
Oraclevg
#
Now you want to take datavg backup, then your command will be
#savevg –if /dev/rmt0 /datavg
#savevg –ief /dev/rmt0 /datavg
Datavg volume group is backup to tape
NOTE:
While taking restvg backup we can exclude unwanted file systems in
backup process. Suppose you not required following file systems in
mksysb backup,
/var – log files
That time you should put entry in /etc/exclude.datavg,
6. Restore the non rootvg backup
Using restvg command we can restore the non rootvg backup
#restvg –xdf /dev/rmt0
After command execution datavg backup restored to server with same name while importing vg we can change the vg name.
7. Rewind, Eject, Erase the tape
Using tctl command we can rewind, eject and erase the tape drive.
#tctl –f /dev/rmt0 rewind (To rewind the tape)
#tctl –f /dev/rmt0 eject (To eject the tape)
#tctl –f /dev/rmt0 erase (To erase the tape content)
Q.24 TL up gradation Activity on IBM AIX?
First Download the Latest ML/TL as required by your project from below link.
it
will download in c:/download director by default or you can customize
the download location. All files will be with .bff extention.
Before Up grading the TL/ML you need to do follwing activity.
1 Take two copies of mksysb
2 Take system configuration output in a file such whatever the file set installed on the machine.
3 Take approval from application team, database team and customer.
Now do the following steps.
You will put all the TL files to the AIX server using ftp or winscp. In a directory.
Suppose you have putted all the TL files in /TL directory Then log into your server go to the /TL directory
You will execute #inutoc . (. Represent current directory)
It will create a .toc file, through it you can read what are the fileset included in this TL
After that you will execute #smitty update_all
Here you will put .(dot) as current directory in input device, first check the preview only , select commit no, save base yes rest of option leave as it is .
You will get the output
It showed ok now you can move to update the TL.
Finally you press F3 to get back and change preview only option no, and Commit no
It will take 20 to 30 minute to update the TL, now you can check the file set installed successfully using #lppchk –v ,
And you check the #oslevel -s, it will show the latest level of TL.
-bash-3.00$ oslevel -s
5300-11-01-0944
Q.25 How to check the TL or ML.
# instfix –I |grep ML
Q.26 What is LPAR and DLPAR?
LPAR / DLPAR
We can configure LPAR and DLPAR in P690 Servers,
LPAR (Logical partitions)
In single server we can install multiple operating systems, like AIX 5.1, AIX 5.2, AIX 5.3, Susi Linux, AIX 4.3, using LPAR concept
The
above Os are installing in single server, before that we have to
partition the hardware resources, like processors and memory, Harddisk,
Using HMC (Hardware Management Console) we can partition and operate the LPAR servers
Suppose you have one P690 server with 16 CPU’s and 16GB Ram, in this server we can make 16 partitions,
Now each partitions has 1 CPU and 1GB Ram,
Suppose
one particular Os assigned for 500 users that time we have to assign
additional hardware resources to that partition, online we can assign
the hardware resources using HMC. No need to reboot the server, this
concept called DLPAR (dynamic Logical Partition)
Like this we can create the LPAR / DLPAR
HMC - it is a desktop pc (Linux OS) connected with P690 server through Communication (com port) cable or RJ45 Ethernet cat cable
Using HMC we can Create, Delete, and Change the Logical Partitions
This
LPAR server has hypervisor Controller, all the information’s stored in
this hypervisor, and it is used to maintain the server
Accessing methods:
- wsm (Web based system management , using this concept we can access the LPAR servers from windows desktops)
- ssh (Secured shell, using this concept we can access the LPAR servers through telnet)
Q.27 How will you configure LPAR and DLPAR?
Q. How many types of LPAR. Which type of LPAR you are using?
Q.28 How to change the kernel from 32 bit to 64 bit?
AIX Command on kernel:
Command to check the bos image.
/bin/lslpp -l bos.64bit à to see if bos.64bit is installed & committed.
-or- /bin/locale64 Ã error message if on 32bit machine such as:
Could not load program /bin/locale64:
Cannot run a 64-bit program on a 32-bit machine.
Or use:
# bootinfo -K displays the current kernel word size of "32" or "64"
# bootinfo -y tells if hardware is 64-bit capable
# bootinfo -p If it returns the string 32 it is only capable of running the
32-bit kernel. If it returns the string chrp the machine is
capable of running the 64-bit kernel or the 32-bit kernel.
Or use:
# /usr/bin/getconf HARDWARE_BITMODE
This command should return the following output:
64
HOW TO CHANGE KERNEL MODE OF IBM AIX 5L (5.1)
The AIX 5L has pre-configured kernels. These are listed below for Power
Processors:
/usr/lib/boot/unix_up 32 bit uni-processor
/usr/lib/boot/unix_mp 32 bit multi-processor kernel
/usr/lib/boot/unix_64 64 bit multi-processor kernel
Switching between kernel modes means using different kernels. This is simply
done by pointing the location that is referenced by the system to these kernels.
Use symbolic links for this purpose. During boot AIX system runs the kernel
in the following locations:
/unix
/usr/lib/boot/unix
The base operating system 64-bit runtime fileset is bos.64bit. Installing bos.64bit also installs
the /etc/methods/cfg64 file. The /etc/methods/cfg64 file provides the option of enabling or disabling
the 64-bit environment via SMIT, which updates the /etc/inittab file with the load64bit line.
(Simply adding the load64bit line does not enable the 64-bit environment).
The command lslpp -l bos.64bit reveals if this fileset is installed. The bos.64bit fileset
is on the AIX media; however, installing the bos.64bit fileset does not ensure that you will be able
to run 64-bit software. If the bos.64bit fileset is installed on 32-bit hardware, you should be able
to compile 64-bit software, but you cannot run 64-bit programs on 32-bit hardware.
The syscalls64 extension must be loaded in order to run a 64-bit executable. This is done from
the load64bit entry in the inittab file. You must load the syscalls64 extension even when running
a 64-bit kernel on 64-bit hardware.
To determine if the 64-bit kernel extension is loaded, at the command line, enter genkex |grep 64.
Information similar to the following displays:
149bf58 a3ec /usr/lib/drivers/syscalls64.ext
To change the kernel mode follow steps below:
1. Create symbolic link from /unix and /usr/lib/boot/unix to the location
of the desired kernel.
2. Create boot image.
3. Reboot AIX.
Below lists the detailed actions to change kernel mode:
To change to 32 bit uni-processor mode:
# ln -sf /usr/lib/boot/unix_up /unix
# ln -sf /usr/lib/boot/unix_up /usr/lib/boot/unix
# bosboot -ad /dev/ipldevice
# shutdown -r
To change to 32 bit multi-processor mode:
# ln -sf /usr/lib/boot/unix_mp /unix
# ln -sf /usr/lib/boot/unix_mp /usr/lib/boot/unix
# bosboot -ad /dev/ipldevice
# shutdown -r
To change to 64 bit multi-processor mode:
# ln -sf /usr/lib/boot/unix_64 /unix
# ln -sf /usr/lib/boot/unix_64 /usr/lib/boot/unix
# bosboot -ad /dev/ipldevice
# shutdown -r
IMPORTANT NOTE: If you are changing the kernel mode to 32-bit and you will run
9.2 on this server, the following line should be included in /etc/inittab:
load64bit:2:wait:/etc/methods/cfg64 >/dev/console 2>&1 # Enable 64-bit execs
This allows 64-bit applications to run on the 32-bit kernel. Note that this
line is also mandatory if you are using the 64-bit kernel.
In AIX 5.2, the 32-bit kernel is installed by default. The 64-bit kernel, along with JFS2
(enhanced journaled file system), can be enabled at installation time.
Q.29 AIX stands for what?
AIX stands for Advanced Interactive Executive.
Q.30 AIX 5L in this L stands for what?
AIX 5L in this L stands for Linux. It supports aix packages.
Q.31 How will you find the serial no. of the server?
# prtconf |pg
Q.32 How will you check no. of processor in the server?
Ans. prtconf |pg
lsdev –Cc processor
Q.33 What command you will use to check the low memory space?
Display RAM Size on AIX
# lsdev -C|grep mem
Now if memory device is mem0, then type
#lsattr -El mem0
topas
vmstat
Q.34 How will the check the performance of the disk ?
Using iostat command we can monitor the I/O bound
In
this I/O bound we can monitor the disk usage, suppose you are using two
or three heavy used file system in one PV that time that particular PV
usage will be very high
# iostat -d hdisk0 hdisk1 5 Will monitor disk activity only for physical volumes hdisk0 1
Q.35 How will you check the cluster status ?
# clstat command is used to check cluster status.
Q.36 What is smitty.script ?
The smit.script file contains the actual AIX commands that SMIT runs in order to execute a task.
Q.37 What is .netrc? What is use of this hidden file?
The $HOME/.netrc file contains information used by the automatic login feature of the rexec and ftp
commands. It is a hidden file in a user's home directory and must be
owned either by the user executing the command or by the root user. If
the .netrc file contains a login password, the file's permissions must be set to 600 (read and write by owner only).
Q.38 How will you remove the device for eg : - tape ?
Remove Device
Suppose you want to remove device from server. Suppose it is one HDD.
First you have removed the HDD from server. Then you checking device configuration details using
#lsdev –Cc disk
Or
#odmget CuDv
It will show the device status
There is two options is available in device removal
#rmdev –dl hdisk5
The above command is used to remove hdisk5 device from ODM (complete removal from OS)
After executing the above command this hdisk5 configuration is not available in ODM
#odmget CuDv | grep hdisk5
It wont display anything because device configuration is removed from ODM
Suppose you want to remove device from the server not from ODM
This case you should use the following command.
#rmdev –l hdisk5
The above command is used to remove hdisk5 device from server, this device configuration is available in ODM (not from OS)
After executing the above command this hdisk5 configuration is available in ODM and device status is defined
#odmget CuDv | grep hdisk5
It will show Hdisk5 configuration details but device status is 0
If you want install hdisk5 device again, you should run the following command
#cfgmgr
#cfgmgr scsi0 (Directly you can search device on Parent device scsi0)
After executing above commands the device hdisk5 become to Available state.
And device status is 1
Q.39 Please explain the inittab file - what is respwan and once field is used?
The /etc/inittab file controls the initialization process.
The /etc/inittab file supplies the script to the init command's role as a general
process dispatcher. The process that constitutes the majority of the init
command's process dispatching activities is the /etc/getty line process, which
initiates individual terminal lines. Other processes typically dispatched by the
init command are daemons and the shell.
The /etc/inittab file
Identifier : Run level : Action : Command
Identifier : One to fourteen character field.
Run Level : 0 to 9
Action:
§ Respawn: It the process does not exist, start the process. Do not wait for its termination. Restart the process if dies.
§ Wait: Starts the process and wait for its termination.
§ Once: Starts the process and do not wait for termination. If dies do not restart it.
§ Boot: Starts the process during system start up. Do not wait for its termination. If terminates do not restart it.
§ Bootwait
§ Powerfail
§ Powerwait
§ Off
Command: A shell command to execute.
Commands to play with /etc/inittab file.
# mkitab "xcmd:2:respawn:find / -type f > /dev/null 2>&1"
Adds record in /etc/inittab file.
# lsitab xcmd
Display new record added in /etc/inittab file.
# chitab "xcmd:2:once:find / -type f > /dev/null 2>&1"
Change the action field on the existing record in /etc/inittab file.
# rmitab xcmd
Remove entry for the /etc/inittab file.
Order of the /etc/inittab file
1. initdefault
2. sysinit
3. Power failure detection(powerfail)
4. Multiuser check(rc)
5. /etc/firstboot(fbcheck)
6. System Resource control(srcmstr)
7. Start TCP/IP daemon(rctcpip)
8. Start NFS daemon(rcnfs)
9. cron
10. pb cleanup(piobe)
11. getty for the console(cons)
Q.40 How will you enable telnet in aix?
Uncomment telnet entry from /etc/inetd.conf file.
Restart the inetd service
# startsrc –s inetd
Q.41 what is the default size of LTG?
Logical track group (LTG) size is the maximum allowed transfer size for an I/O
disk operation. You can use the lquerypv command to find the LTG size for a physical disk
# lquerypv -M hdisk0
256
Q.42 diff between shutdown and reboot?
halt(1M) brings down the machine to the PROM (on SPARC) immediately,
with very little regard to running the scripts in /etc/rc[0-6].d to
take things down cleanly. reboot(1M) is the same, except instead of
just stopping the OS, it reboots the machine.
Q.43 what is skulker?
The skulker command purges files in the /tmp directory, files older than a
specified age, a.out files, core files, and ed.hup files. It is run daily as part of
an accounting procedure run by the cron command during off peak periods
(assuming you have turned on accounting).
Q.44 how to check the default gateway?
# netstat –rn
Q.45 how to check boot log?
# alog –o –t boot
# alog –o –t console
Q.46 what is diff between mkfs and crfs?
crfs
will create a JFS/JFS2 files system as well as the logical volume
associated whereas mkfs will create a File System over an already
created Logical Volume=2E
crfs=09Adds a file system=2E The smallest file system is equal to one PP=2E
crfs -v jfs -g datavg -a size=3D32M -m /user : creates a JFS of 32 MB with /user as the mount point in VG datavg=2E
crfs -v jfs2 -g rootvg -a size=3D128M -m /data -A yes -p rw -a
agblksize=3D2048 : creates a JFS2 of 128 MB with /data as the mount
point, automatically mounted at system restart (-A), with 4K as the
smallest file system block size that can be allocated to a file=2E
mkfs=09Makes a new file system on a specified existing device (LV)=2E
mkfs -s 64M /data /dev/lvdata : creates an empty 64 MB file system on LV lvdata=2E
mkfs -o name=3D/user /dev/lvuser : creates an empty file system on the
/dev/lvuser device, with mount point /user=2E The new file system
occupies the entire device and has the default fragment size (4096
bytes) and the default nbpi ratio (4096)=2E
Q.47 what is savebase command will do?
The savebase command stores customized information for base devices for use during phase 1 of system boot. By default, the savebase command retrieves this information from the /etc/objrepos directory.
Q.48 Trouble Shooting
4.4.3 Common boot LED codes
During system initialization, servers with operator panel displays will show LED
codes that provide information about the status of the boot process. Some codes
are checkpoints that indicate which point in the boot process the server has
reached. These codes depend on the type of server.
For example, on a server with a four character display, E1F1 indicates that the
system-defined console has been activated, while FF1 indicates this on a server
with a three character display. Codes in the form of Fxx, where xx is a
hexadecimal number, are generally related to firmware.
Other codes indicate that a fault has been detected. The most common LED
codes that indicate boot problems and how to get around them to getting your
system up and running again are given in Table 4-3.
Table 4-3 Common startup LEDs and solutions
LED 201 - Damaged boot image
1. Access your rootvg by following the procedure described in 4.4.2, “Accessing a
system that will not boot” on page 105.
2. Check the / and /tmp file systems. If they are almost full, create more space.
3. Determine the boot disk by using the lslv -m hd5 command.
4. Recreate the boot image using bosboot -a -d /dev/hdiskn, where n is the disk
number of the disk containing the boot logical volume.
5. Check for CHECKSTOP errors in the error log. If such errors are found, it is
probably failing hardware.
6. Shut down and restart the system.
LED 223-229 - Invalid boot list
1. Set the key mode switch to service (F5 for systems without keylock) and power up
the machine.
2. If display continues normally, change the key mode switch to Normal and continue
with step 3. If you do not get the prompt, go to step 4.
3. When you get the login prompt, log in and follow the procedure described in 4.4.1,
“The bootlist command” on page 103 to change your bootlist. Continue with step 7.
4. Follow the procedure in 4.4.2, “Accessing a system that will not boot” on page 105
to access your rootvg and continue with step 5.
5. Determine the boot disk by using the lslv -m hd5 command.
6. Change the bootlist following the procedure given in 4.4.1, “The bootlist command”
on page 103.
7. Shut down and restart your system.
112 IBM Eserver p5 and pSeries Administration and Support for AIX 5L V5.3
LED 551, 555, and 557 - Corrupted file system, corrupted JFS log, and so on
1. Follow the procedure described in 4.4.2, “Accessing a system that will not boot” on
page 105 to access the rootvg before mounting any file systems (choice 2 on the
Volume Group Information screen).
2. Verify and correct the file systems as follows:
fsck -y /dev/hd1
fsck -y /dev/hd2
fsck -y /dev/hd3
fsck -y /dev/hd4
fsck -y /dev/hd9var
3. Format the JFS log again by using the command:
/usr/sbin/logform /dev/hd8
4. Use lslv -m hd5 to obtain the boot disk.
5. Recreate the boot image using the command:
bosboot -a -d /dev/hdiskn
Where n is the disk number of the disk containing the boot logical volume.
LED 552, 554, and 556 - Super block corrupted and corrupted customized ODM
database
1. Repeat steps 1 through 2 for LEDs 551, 555, and 557.
2. If fsck indicates that block 8 is corrupted, the super block for the file system is
corrupted and needs to be repaired. Enter the command:
dd count=1 bs=4k skip=31 seek=1 if=/dev/hdn of=/dev/hdn
where n is the number of the file system.
3. Rebuild your JFS log by using the command:
/usr/sbin/logform /dev/hd8
4. If this solves the problem, stop here; otherwise, continue with step 5.
5. Your ODM database is corrupted. Restart your system and follow the procedure
given in 4.4.2, “Accessing a system that will not boot” on page 105 to access rootvg
with choice 2 on the Volume Group Information screen.
6. Mount the root and usr file systems as follows:
mount /dev/hd4 /mnt
mount /usr
7. Copy the system configuration to a back up directory:
mkdir /mnt/etc/objrepos/backup
cp /mnt/etc/objrepos/Cu* /mnt/etc/objrepos/backup
8. Copy the configuration from the RAM file system as follows:
cp /etc/objrepos/Cu* /mnt/etc/objrepos
9. Unmount all file systems by using the umount all command.
10. Determine the boot disk by using the lslv -m hd5 command.
11. Save the clean ODM to the boot logical volume by using the command:
savebase -d/dev/hdiskn
where n is the disk number of the disk containing boot logical volume.
12. Reboot, if the system does not come up, and reinstall BOS.
LED 553 - Corrupted /etc/inittab file
1. Access the rootvg with all file systems mounted by following the procedure
described in 4.4.2, “Accessing a system that will not boot” on page 105.
2. Check for free space in /, /var, and /tmp by using the df command.
3. Check the /etc/inittab file and correct the inittab problems if there is one empty
inittab file, missing inittab file, or wrong entry in inittab file.
4. Check problems with:
/etc/environment file
/bin/sh
/bin/bsh
/etc/fsck
/etc/profile
/.profile
- Shut down the system and reboot.
To create lv of jfs2 of lp size 2
# mklv -t jfs2 -y tmplv rootvg 2
Create Filesystem
# crfs -v jfs2 -d tmplv -m /tmpmnt
Logical Volume Manager (LVM) Commands for AIX
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>
|
Increases the size of a journaled file system to the total number of 512 byte blocks specified
|
chfs -a size=<+512 byte blocks>
|
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
|
Change the name of a logical volume (it must be inactive)
|
crfs -v jfs -m -g -a size=<# of 512 byte blocks>
crfs -v jfs -m -d
|
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
|
removes a volume group from a machine
|
extendvg
|
Adds a new physical volume to an existing volume group
|
importvg -y
|
add a volume group to another machine
|
lslv [-l, m]
|
Lists information about the logical volumes. The -l option lists the disks in the logical volume.
|
lspv [-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 [-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
|
Makes a logical volume in a volume group
|
mksysb -l -f
|
makes a bootable backup of rootvg
|
mkvg -y . . .
|
Makes a volume group out of one or more physical volumes
|
mount or
mount if it is already in /etc/filesystems
|
Mounts the file system for use.
|
reducevg
|
Removes a physical volume from a volume group
|
rmfs
|
removes a file system and it's logical volume
|
rmlv
|
Removes a logical volume (it must be inactive)
|
savevg -l -f
|
makes a backup copy of another volume group
|
umount 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 " to show information about the logical volume including it's volume group name.
3. "lsvg " 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 " 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 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
Procedure to remove a file system
1. Unmount the filesystem
2. Remove the logical volume "rmlv "
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
6.
1. chfs -m /usr/shareold /usr/sharenew
7. Mount the new filesystem
1. mount /usr/shareold
8. 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. /
4. quit
4. mklv -y "" <# of LPS> --> creates the logical volume
5. crfs
-v jfs -d -m / -A yes --> makes
the filesystem, creates the mountpoint and puts it in /etc/filesystems
6. mount / --> mounts the new fileystem
7. df / --> verifies the mount and the size of the new filesystem
8. Check the ownership and permissions of the new mount point
1. ls -ld
2. chown owner:group
3. chmod XXX
9. If mirroring is in effect, then mirror this logical volume to another disk (original and 1 mirror):
1. mklvcopy -s y 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 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 "" hdisk# --> creates the volume group on the named hard disk
3. varyonvg --> activates the volume group
Procedure to add a disk to a volume group (extend the volume group)
· extendvg
· Verify the disk has been successfully added to the vg
· lsvg -p
Procedure to mirror the rootvg:
1. lspv --> determine the hdisk#
2. extendvg rootvg hdisk --> 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 " to show the total PP's available in the volume group =1250
2. "lsvg
-l " 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 " 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