when i try to install software on aix box it gives me error of bosboot verification failed.
i check and found that /dev/ipldevice was not present. this file is a symlink of /dev/hdisk0 ( boot disk ).
so recreate the file /dev/ipldevice and make a hardlink of /dev/hdisk0
ln /dev/hdisk0 /dev/ipldevice
and then do bosboot -ad /dev/hdisk0
and then i tried to install software it works.
Thursday, January 15, 2009
Tuesday, December 16, 2008
Procedure for exchanging a "Hot Swap" mirrored rootvg disk.
In the following example, an RS6000 has 3 disks, 2 of which have the AIX
filesystems mirrored on. The boolist contains both hdisk0 and hdisk1.
There are no other logical volumes in rootvg other than the AIX system
logical volumes. hdisk0 has failed and need replacing, both hdisk0 and hdisk1
are in "Hot Swap" carriers and therefore the machine does not need shutting
down.
lspv
hdisk0 00522d5f22e3b29d rootvg
hdisk1 00522d5f90e66fd2 rootvg
hdisk2 00522df586d454c3 datavg
lsvg -l rootvg
rootvg:
LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINT
hd6 paging 4 8 2 open/syncd N/A
hd5 boot 1 2 2 closed/syncd N/A
hd8 jfslog 1 2 2 open/syncd N/A
hd4 jfs 1 2 2 open/syncd /
hd2 jfs 12 24 2 open/syncd /usr
hd9var jfs 1 2 2 open/syncd /var
hd3 jfs 2 4 2 open/syncd /tmp
hd1 jfs 1 2 2 open/syncd /home
1, Reduce the logical volume copies from both disks to hdisk1 only :-
rmlvcopy hd6 1 hdisk0
rmlvcopy hd5 1 hdisk0
rmlvcopy hd8 1 hdisk0
rmlvcopy hd4 1 hdisk0
rmlvcopy hd2 1 hdisk0
rmlvcopy hd9var 1 hdisk0
rmlvcopy hd3 1 hdisk0
rmlvcopy hd1 1 hdisk0
2, Check that no logical volumes are left on hdisk0 :-
lspv -p hdisk0
hdisk0:
PP RANGE STATE REGION LV ID TYPE MOUNT POINT
1-101 free outer edge
102-201 free outer middle
202-301 free center
302-401 free inner middle
402-501 free inner edge
3, Remove the volume group from hdisk0
reducevg -df rootvg hdisk0
4, Recreate the boot logical volume on hdisk1, and reset bootlist:-
bosboot -a -d /dev/hdisk1
bootlist -m normal rmt0 cd0 hdisk1
5, Check that everything has been removed from hdisk0 :-
lspv
hdisk0 00522d5f22e3b29d None
hdisk1 00522d5f90e66fd2 rootvg
hdisk2 00522df586d454c3 datavg
6, Delete hdisk0 :-
rmdev -l hdisk0 -d
7, Remove the failed hard drive and replace with a new hard drive.
8, Configure the new disk drive :-
cfgmgr
9, Check new hard drive is present :-
lspv
10, Include the new hdisk in root volume group :-
extendvg rootvg hdisk? (where hdisk? is the new hard disk)
11, Re-create the mirror :-
mirrorvg rootvg hdisk? (where hdisk? is the new hard disk)
12, Syncronise the mirror :-
syncvg -v rootvg
13, Reset the bootlist :-
bootlist -m normal rmt0 cd0 hdisk0 hdisk1
14, Turn off Quorum checking on rootvg :-
chvg -Q n rootvg
filesystems mirrored on. The boolist contains both hdisk0 and hdisk1.
There are no other logical volumes in rootvg other than the AIX system
logical volumes. hdisk0 has failed and need replacing, both hdisk0 and hdisk1
are in "Hot Swap" carriers and therefore the machine does not need shutting
down.
lspv
hdisk0 00522d5f22e3b29d rootvg
hdisk1 00522d5f90e66fd2 rootvg
hdisk2 00522df586d454c3 datavg
lsvg -l rootvg
rootvg:
LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINT
hd6 paging 4 8 2 open/syncd N/A
hd5 boot 1 2 2 closed/syncd N/A
hd8 jfslog 1 2 2 open/syncd N/A
hd4 jfs 1 2 2 open/syncd /
hd2 jfs 12 24 2 open/syncd /usr
hd9var jfs 1 2 2 open/syncd /var
hd3 jfs 2 4 2 open/syncd /tmp
hd1 jfs 1 2 2 open/syncd /home
1, Reduce the logical volume copies from both disks to hdisk1 only :-
rmlvcopy hd6 1 hdisk0
rmlvcopy hd5 1 hdisk0
rmlvcopy hd8 1 hdisk0
rmlvcopy hd4 1 hdisk0
rmlvcopy hd2 1 hdisk0
rmlvcopy hd9var 1 hdisk0
rmlvcopy hd3 1 hdisk0
rmlvcopy hd1 1 hdisk0
2, Check that no logical volumes are left on hdisk0 :-
lspv -p hdisk0
hdisk0:
PP RANGE STATE REGION LV ID TYPE MOUNT POINT
1-101 free outer edge
102-201 free outer middle
202-301 free center
302-401 free inner middle
402-501 free inner edge
3, Remove the volume group from hdisk0
reducevg -df rootvg hdisk0
4, Recreate the boot logical volume on hdisk1, and reset bootlist:-
bosboot -a -d /dev/hdisk1
bootlist -m normal rmt0 cd0 hdisk1
5, Check that everything has been removed from hdisk0 :-
lspv
hdisk0 00522d5f22e3b29d None
hdisk1 00522d5f90e66fd2 rootvg
hdisk2 00522df586d454c3 datavg
6, Delete hdisk0 :-
rmdev -l hdisk0 -d
7, Remove the failed hard drive and replace with a new hard drive.
8, Configure the new disk drive :-
cfgmgr
9, Check new hard drive is present :-
lspv
10, Include the new hdisk in root volume group :-
extendvg rootvg hdisk? (where hdisk? is the new hard disk)
11, Re-create the mirror :-
mirrorvg rootvg hdisk? (where hdisk? is the new hard disk)
12, Syncronise the mirror :-
syncvg -v rootvg
13, Reset the bootlist :-
bootlist -m normal rmt0 cd0 hdisk0 hdisk1
14, Turn off Quorum checking on rootvg :-
chvg -Q n rootvg
Monday, December 8, 2008
Fix a Full / Filesystems
Use the Following steps:
1. Use the who command to read the contents of the /etc/security/failedlogin file:
# who /etc/security/failedlogin
The condition of TTYs respawning too rapidly can create failed login entries.
To clear the file after reading or saving the output, execute the following
command:
# cp /dev/null /etc/security/failedlogin
2. Check for very large files that might be removed using the find command. For
example, to find all files in the root (/) directory larger than 1 MB, use the
following command:
# find / -xdev -size +2048 -ls |sort -r +6
Before removing any files, use the command fuser to ensure a file is not
currently in use by a user process:
fuser filename
1. Use the who command to read the contents of the /etc/security/failedlogin file:
# who /etc/security/failedlogin
The condition of TTYs respawning too rapidly can create failed login entries.
To clear the file after reading or saving the output, execute the following
command:
# cp /dev/null /etc/security/failedlogin
2. Check for very large files that might be removed using the find command. For
example, to find all files in the root (/) directory larger than 1 MB, use the
following command:
# find / -xdev -size +2048 -ls |sort -r +6
Before removing any files, use the command fuser to ensure a file is not
currently in use by a user process:
fuser filename
Fix a full /var Filsystem
You have to do the following Steps:
1. You can use the find command to look for large files in the /var directory. For
example:
# find /var -xdev -size +2048 -ls| sort -r +6
2. Check for obsolete or leftover files in /var/tmp.
3. Check the size of the /var/adm/wtmp file, which logs all logins, rlogins and
telnet sessions. The log will grow indefinitely unless system accounting is
running. System accounting clears it out nightly. The /var/adm/wtmp file can
be cleared out or edited to remove old and unwanted information. To clear it,
use the following command:
# cp /dev/null /var/adm/wtmp
4. Clear the error log in the /var/adm/ras directory using the following procedure.
The error log is never cleared unless it is manually cleared.
a. Stop the error daemon using the following command:
# /usr/lib/errstop
b. Remove or move to a different file system the error log file by using one of
the following commands:
# rm /var/adm/ras/errlog
or
# mv /var/adm/ras/errlog filename
c. Restart the error daemon using the following command:
# /usr/lib/errdemon
5. Check whether the trcfile file in this directory is large.
If it is large and trace is not currently being run,
you can remove the file using the following
command:
# rm /var/adm/ras/trcfile
6. If your dump device is set to hd6 (which is the default), there might be a
number of vmcore* files in the /var/adm/ras directory. If their file dates are old
or you do not want to retain them, you can remove them with the rm
command.
7. Check the /var/spool directory, which contains the queuing subsystem files.
Clear the queuing subsystem using the following commands:
# stopsrc -s qdaemon
0513-044 The qdaemon Subsystem was requested to stop.
# rm /var/spool/lpd/qdir/*
# rm /var/spool/lpd/stat/*
# rm /var/spool/qdaemon/*
# startsrc -s qdaemon
0513-059 The qdaemon Subsystem has been started. Subsystem PID is 291042.
#
8. Check the /var/adm/acct directory, which contains accounting records. If
accounting is running, this directory may contain several large files.
9. Modify the /var/tmp/snmpd.log, which records events from the snmpd daemon.
If the file is removed it will be recreated by the snmpd daemon.
10. Modify the /var/adm/sulog file, which records the number of attempted uses of
the su command and whether each was successful. This is a flat file and can
be viewed and modified with a favorite editor. If it is removed, it will be
recreated by the next attempted su command
1. You can use the find command to look for large files in the /var directory. For
example:
# find /var -xdev -size +2048 -ls| sort -r +6
2. Check for obsolete or leftover files in /var/tmp.
3. Check the size of the /var/adm/wtmp file, which logs all logins, rlogins and
telnet sessions. The log will grow indefinitely unless system accounting is
running. System accounting clears it out nightly. The /var/adm/wtmp file can
be cleared out or edited to remove old and unwanted information. To clear it,
use the following command:
# cp /dev/null /var/adm/wtmp
4. Clear the error log in the /var/adm/ras directory using the following procedure.
The error log is never cleared unless it is manually cleared.
a. Stop the error daemon using the following command:
# /usr/lib/errstop
b. Remove or move to a different file system the error log file by using one of
the following commands:
# rm /var/adm/ras/errlog
or
# mv /var/adm/ras/errlog filename
c. Restart the error daemon using the following command:
# /usr/lib/errdemon
5. Check whether the trcfile file in this directory is large.
If it is large and trace is not currently being run,
you can remove the file using the following
command:
# rm /var/adm/ras/trcfile
6. If your dump device is set to hd6 (which is the default), there might be a
number of vmcore* files in the /var/adm/ras directory. If their file dates are old
or you do not want to retain them, you can remove them with the rm
command.
7. Check the /var/spool directory, which contains the queuing subsystem files.
Clear the queuing subsystem using the following commands:
# stopsrc -s qdaemon
0513-044 The qdaemon Subsystem was requested to stop.
# rm /var/spool/lpd/qdir/*
# rm /var/spool/lpd/stat/*
# rm /var/spool/qdaemon/*
# startsrc -s qdaemon
0513-059 The qdaemon Subsystem has been started. Subsystem PID is 291042.
#
8. Check the /var/adm/acct directory, which contains accounting records. If
accounting is running, this directory may contain several large files.
9. Modify the /var/tmp/snmpd.log, which records events from the snmpd daemon.
If the file is removed it will be recreated by the snmpd daemon.
10. Modify the /var/adm/sulog file, which records the number of attempted uses of
the su command and whether each was successful. This is a flat file and can
be viewed and modified with a favorite editor. If it is removed, it will be
recreated by the next attempted su command
Sunday, December 7, 2008
Aix Tunable parameter settings
Parameters Commands Expected Results.
Operating system Command oslevel -r 5.3.0.0 - 02, or Latest Level with Latest ML
Output
Command lppchk -c No Errors
Output
OS Settings Command date Date and Time
Output
Command date -u Diff 5:30 Hrs
Output
Command cat /etc/enviorment | grep TZ TZ=IST-5:30,, or TZ=IST-5:30
Output
Command lsattr -El mem0 As per the config
Output
Command lsps -a 2xMemory Size, if the memory Size is less than 8GB. If it s more than 8 GB Then 1.5 Times and if it s more than 16GB, same as much as Physical memory. Also note that If the paging space is in the rootvg only then make one paging space only.
Output
Command lsattr -El sys0 | grep maxuproc Value must be more 2048, ( minimus or as per the customer requirement)
Output
Command lsattr -El sys0 | grep maxpout Value must 32 ( If there is Cluster only)
Output
Command lsattr -El sys0 | grep minpout Value must be 24 ( If there is Cluster only)
Output
Command ulimit -a Ulimited for all except core size.
Output
RootVG Settings Command df -k / more than 512 MB
Output
Command df -k /var More than 1GB
Output
Command df -k /tmp More than 1 GB
Output
Command df -k /usr More than 2.5GB
Output
Command df -k /opt More than 512MB
Output
Command df -k /home More than 512MB
Output
Command lsvg -l rootvg All Lvs mirrored and syncd except
Output lg_dumplv
Command sysdumpdev -l always allow dump true, dump compression on
Output
Command sysdumpdev -e as per the memory size
Output
Command lslv lg_dumplv above value x 1.2
Output
Virtual Memory Settings Command vmo -L | grep grep maxfree 128*No CPUs
Output
Command vmo -L | grep minfree 120* No CPUs
Output
Command vmo -L | grep maxperm 20% Pages
Output
Command vmo -L | grep minperm 10 % pages
Output
Network Parameters Command no -L | grep sb_max value 1310720
Output
Command no -L | grep rfc1323 value 1
Output
Command no -L | grep tcp_sendspace value 221184
Output
Command no -L | grep tcp_recievespace value 221184
Output
Command no -L | grep udp_sendspace value 65536
Output
Command no -L | grep udp_recievespace. value 655360
Output
Command no -L | grep ipqmaxlen Value=512
Output Needs reboot.
IO Parameters Command ioo -L | grep sync_release_ilock Value 1
Output
Error Report Command errpt NO Permanent Hardware Errors
Output
Command diag NO Problem found in system Verification mode
Output after selecting all the resources
Operating system Command oslevel -r 5.3.0.0 - 02, or Latest Level with Latest ML
Output
Command lppchk -c No Errors
Output
OS Settings Command date Date and Time
Output
Command date -u Diff 5:30 Hrs
Output
Command cat /etc/enviorment | grep TZ TZ=IST-5:30,, or TZ=IST-5:30
Output
Command lsattr -El mem0 As per the config
Output
Command lsps -a 2xMemory Size, if the memory Size is less than 8GB. If it s more than 8 GB Then 1.5 Times and if it s more than 16GB, same as much as Physical memory. Also note that If the paging space is in the rootvg only then make one paging space only.
Output
Command lsattr -El sys0 | grep maxuproc Value must be more 2048, ( minimus or as per the customer requirement)
Output
Command lsattr -El sys0 | grep maxpout Value must 32 ( If there is Cluster only)
Output
Command lsattr -El sys0 | grep minpout Value must be 24 ( If there is Cluster only)
Output
Command ulimit -a Ulimited for all except core size.
Output
RootVG Settings Command df -k / more than 512 MB
Output
Command df -k /var More than 1GB
Output
Command df -k /tmp More than 1 GB
Output
Command df -k /usr More than 2.5GB
Output
Command df -k /opt More than 512MB
Output
Command df -k /home More than 512MB
Output
Command lsvg -l rootvg All Lvs mirrored and syncd except
Output lg_dumplv
Command sysdumpdev -l always allow dump true, dump compression on
Output
Command sysdumpdev -e as per the memory size
Output
Command lslv lg_dumplv above value x 1.2
Output
Virtual Memory Settings Command vmo -L | grep grep maxfree 128*No CPUs
Output
Command vmo -L | grep minfree 120* No CPUs
Output
Command vmo -L | grep maxperm 20% Pages
Output
Command vmo -L | grep minperm 10 % pages
Output
Network Parameters Command no -L | grep sb_max value 1310720
Output
Command no -L | grep rfc1323 value 1
Output
Command no -L | grep tcp_sendspace value 221184
Output
Command no -L | grep tcp_recievespace value 221184
Output
Command no -L | grep udp_sendspace value 65536
Output
Command no -L | grep udp_recievespace. value 655360
Output
Command no -L | grep ipqmaxlen Value=512
Output Needs reboot.
IO Parameters Command ioo -L | grep sync_release_ilock Value 1
Output
Error Report Command errpt NO Permanent Hardware Errors
Output
Command diag NO Problem found in system Verification mode
Output after selecting all the resources
Problem Determination Server hungs at 546 LED due to bosboot failure
1. As server had not booted in normal mode. Once server gets hung & stucked on 546 LED during booting.It means its bosboot command to re-create boot image failed on server. Boot server in maintainence mode via CD. Access shell whithout mounting filesystem.
1. Check file system consistency
fsck /dev/hd4
fsck /dev/hd2
fsck /dev/hd3
fsck /dev/hd9var
fsck /dev/hd1
2. Format JFS log
/usr/sbin/logform /dev/hd8
3. Check disk in root vg
lsvg -p vg --> hdisk0, hdisk3
4. Check boot partitions
lslv -m hd5 --> hdisk0
5. Check bootlist in normal mode.
bootlist -m normal -o --> hdiks0
cd /dev, ls -l | grep ipl --> nothing comes back as there is proble,
Actual output should be if every thing is ok
# cd /dev
# ls -l | grep ipl
crw-rw---- 2 root system 10, 1 Aug 04 18:21 ipl_blv
crw------- 2 root system 17, 0 Aug 04 18:19 ipldevice
#
6. Create link as mentioned below
ln rhd5 ipl_blv -->ok
ln hdisk0 ipldevice -->ok
7. Set bootlist
bootlist -m normal hdisk0 -->ok
bootlist -m normal -o -->
8. Re-create boot image
bosboot -ad /dev/ipldevice --> 0301-162 save base failed /dev/hdisk0
0301-165 bosboot failed do not attempt to boot device
savebase -->ok
bosboot -ad /dev/ipldevice --> 0301-162 save base failed /dev/hdisk0
0301-165 bosboot failed do not attempt to boot device
9. List hd5 in rootvg.
lsvg -l rootvg --> hd5 has 1 pp and not mirrored
10. Remove hd5
rmlv hd5
11. Clear boot image
chpv -c hdisk0
chpv -c hdisk3
11. Create hd5
mklv -t boot -y hd5 -ae -c 1 rootvg 1 hdisk0 -->savebase failed
savebase -d /dev/hdisk0 -->ok
mklv -t boot -y hd5 -ae -c 1 rootvg 1 hdisk0 -->savebase failed
synclvodm -Pv rootvg
savebase -d /dev/hdisk0
mklv -t boot -y hd5 -ae -c 1 rootvg 1 hdisk0 -->savebase failed
lsvg -l rootvg --> hd5 was there
savebase -d /dev/hdisk0
ln /dev/rhd5 /dev/ipl_blv
ls -al | grep ipl -> make sure his has ipldevice and ipl_blv
bosboot -ad /dev/ipldevice
ipl_varyon -i --> yes in front of hdisk0
bootlist -m normal -o --> hdisk0 blv=hd5
sync;sync;sync;reboot --> worked we are booted up
1. Check file system consistency
fsck /dev/hd4
fsck /dev/hd2
fsck /dev/hd3
fsck /dev/hd9var
fsck /dev/hd1
2. Format JFS log
/usr/sbin/logform /dev/hd8
3. Check disk in root vg
lsvg -p vg --> hdisk0, hdisk3
4. Check boot partitions
lslv -m hd5 --> hdisk0
5. Check bootlist in normal mode.
bootlist -m normal -o --> hdiks0
cd /dev, ls -l | grep ipl --> nothing comes back as there is proble,
Actual output should be if every thing is ok
# cd /dev
# ls -l | grep ipl
crw-rw---- 2 root system 10, 1 Aug 04 18:21 ipl_blv
crw------- 2 root system 17, 0 Aug 04 18:19 ipldevice
#
6. Create link as mentioned below
ln rhd5 ipl_blv -->ok
ln hdisk0 ipldevice -->ok
7. Set bootlist
bootlist -m normal hdisk0 -->ok
bootlist -m normal -o -->
8. Re-create boot image
bosboot -ad /dev/ipldevice --> 0301-162 save base failed /dev/hdisk0
0301-165 bosboot failed do not attempt to boot device
savebase -->ok
bosboot -ad /dev/ipldevice --> 0301-162 save base failed /dev/hdisk0
0301-165 bosboot failed do not attempt to boot device
9. List hd5 in rootvg.
lsvg -l rootvg --> hd5 has 1 pp and not mirrored
10. Remove hd5
rmlv hd5
11. Clear boot image
chpv -c hdisk0
chpv -c hdisk3
11. Create hd5
mklv -t boot -y hd5 -ae -c 1 rootvg 1 hdisk0 -->savebase failed
savebase -d /dev/hdisk0 -->ok
mklv -t boot -y hd5 -ae -c 1 rootvg 1 hdisk0 -->savebase failed
synclvodm -Pv rootvg
savebase -d /dev/hdisk0
mklv -t boot -y hd5 -ae -c 1 rootvg 1 hdisk0 -->savebase failed
lsvg -l rootvg --> hd5 was there
savebase -d /dev/hdisk0
ln /dev/rhd5 /dev/ipl_blv
ls -al | grep ipl -> make sure his has ipldevice and ipl_blv
bosboot -ad /dev/ipldevice
ipl_varyon -i --> yes in front of hdisk0
bootlist -m normal -o --> hdisk0 blv=hd5
sync;sync;sync;reboot --> worked we are booted up
Thursday, November 13, 2008
Crontab Example
Crontab file
___________
Crontab syntax :-
A crontab file has five fields for specifying day , date and time followed by the command to be run at that interval.
* * * * * command to be executed
- - - - -
| | | | |
| | | | +----- day of week (0 - 6) (Sunday=0)
| | | +------- month (1 - 12)
| | +--------- day of month (1 - 31)
| +----------- hour (0 - 23)
+------------- min (0 - 59)
___________
Crontab syntax :-
A crontab file has five fields for specifying day , date and time followed by the command to be run at that interval.
* * * * * command to be executed
- - - - -
| | | | |
| | | | +----- day of week (0 - 6) (Sunday=0)
| | | +------- month (1 - 12)
| | +--------- day of month (1 - 31)
| +----------- hour (0 - 23)
+------------- min (0 - 59)
Run-levels in AIX
Run-level Description
0-1 Reserved for the future use of operating system.
2 Contains all of the terminal process and daemons that are run in the multiuser environment. This is the default run-level.
3-9 Can be defined according to the user-preferences.
a,b,c,h These are not true run levels; they differ from run levels in that the init command cannot request the entire system to enter these run-levels.
S,s,M,m Maintainance mode. When the system enters maintainance made from another run-level, only the system console is used as the terminal.
0-1 Reserved for the future use of operating system.
2 Contains all of the terminal process and daemons that are run in the multiuser environment. This is the default run-level.
3-9 Can be defined according to the user-preferences.
a,b,c,h These are not true run levels; they differ from run levels in that the init command cannot request the entire system to enter these run-levels.
S,s,M,m Maintainance mode. When the system enters maintainance made from another run-level, only the system console is used as the terminal.
Wednesday, October 15, 2008
How to convert a rootvg from jfs to jfs2
1. Create an /image.data file
# mkszfile
2. Edit the /image.data file to create JFS2 filesystems
I edited each of the fsdata stanzas converting
fs_data:
FS_NAME= /opt
FS_SIZE= 131072
FS_MIN_SIZE= 12320
FS_LV= /dev/hd10opt
FS_FS= 512
FS_NBPI= 4096
FS_COMPRESS= no
FS_BF= false
FS_AGSIZE= 8
to
fs_data:
FS_NAME= /opt
FS_SIZE= 131072
FS_MIN_SIZE= 12320
FS_LV= /dev/hd10opt
FS_JFS2_BS= 4096
FS_JFS2_SPARSE= yes
FS_JFS2_INLINELOG= no
FS_JFS2_SIZEINLINELOG= 0
I edited each jfs lv, changing "TYPE = jfs" to "TYPE = jfs2".
I also edited the jfslog to be TYPE = jfs2log.
3. Edit /etc/filesystems and for each jfs filesystem in rootvg, change
"jfs" to "jfs2" in the vfs line. Check that each filesystem has
options = rw.
Here's an excerpt from my edited /etc/filesystems file.
/:
dev = /dev/hd4
vfs = jfs2
log = /dev/hd8
mount = automatic
check = false
type = bootfs
vol = root
free = true
account = true
options = rw
/home:
dev = /dev/hd1
vfs = jfs2
log = /dev/hd8
mount = true
check = true
free = false
account = true
options = rw
/usr:
dev = /dev/hd2
vfs = jfs2
log = /dev/hd8
mount = automatic
check = false
type = bootfs
free = false
account = true
options = rw
4. Take the mksysb, but without the -i flag (since that will create a
new /image.data file, overwriting your amended one).
5. Restore the mksysb as normal.
# mkszfile
2. Edit the /image.data file to create JFS2 filesystems
I edited each of the fsdata stanzas converting
fs_data:
FS_NAME= /opt
FS_SIZE= 131072
FS_MIN_SIZE= 12320
FS_LV= /dev/hd10opt
FS_FS= 512
FS_NBPI= 4096
FS_COMPRESS= no
FS_BF= false
FS_AGSIZE= 8
to
fs_data:
FS_NAME= /opt
FS_SIZE= 131072
FS_MIN_SIZE= 12320
FS_LV= /dev/hd10opt
FS_JFS2_BS= 4096
FS_JFS2_SPARSE= yes
FS_JFS2_INLINELOG= no
FS_JFS2_SIZEINLINELOG= 0
I edited each jfs lv, changing "TYPE = jfs" to "TYPE = jfs2".
I also edited the jfslog to be TYPE = jfs2log.
3. Edit /etc/filesystems and for each jfs filesystem in rootvg, change
"jfs" to "jfs2" in the vfs line. Check that each filesystem has
options = rw.
Here's an excerpt from my edited /etc/filesystems file.
/:
dev = /dev/hd4
vfs = jfs2
log = /dev/hd8
mount = automatic
check = false
type = bootfs
vol = root
free = true
account = true
options = rw
/home:
dev = /dev/hd1
vfs = jfs2
log = /dev/hd8
mount = true
check = true
free = false
account = true
options = rw
/usr:
dev = /dev/hd2
vfs = jfs2
log = /dev/hd8
mount = automatic
check = false
type = bootfs
free = false
account = true
options = rw
4. Take the mksysb, but without the -i flag (since that will create a
new /image.data file, overwriting your amended one).
5. Restore the mksysb as normal.
Steps required to replace a failing PV from a non-root VG
--> Backup all filesystems found on the failing PV.
--> lspv -l (lspv -l hdisk2) To determine which filesystem(s) are found on the PV in question.
--> Find out how the LVs are laid-out on the PV so you will know how to re-create them when the time comes.
lslv -m (lslv -m oracle) You will use the output of the lslv command to serve as a template for creating a map file for this LV later on.
--> Unmount all filesystems on that PV. umount to unmount each filesystem from the PV in question.
--> Remove all LVs found on that PV. rmlv (rmlv /oracle)
--> Remove the questionable PV from the system. reducevg
--> Remove the PV entry from the ODM database. rmdev -l -d (rmdev -l hdisk2 -d)
--> Shutdown the system: Shutdown -F
--> Remove the bad PV and install the new PV
--> Add the new PV to the VG in question. extendvg (eg., extendvg datavg hdisk2)
--> Re-create the LVs removed from the OLD PV to the NEW PV.
mklv -y -m (mklv -y oracle -m oracle.map oraclevg 200 hdisk2)
The map file is assembled from the output generated from the lslv -m command in step 2 above. Do this for each LV that existed on the removed PV.
--> Re-size the filesystems on the new PV. mkfs /dev/ (mkfs /dev/oracle) Do this for each file system that existed on the removed PV.
--> Perform a filesystem check before mounting it. fsck -f /dev/ (fsck -f /dev/oracle)
--> Mount all filesystems on that PV. mount (mount /oracle)
--> Now restore the data you backed up
--> lspv -l
--> Find out how the LVs are laid-out on the PV so you will know how to re-create them when the time comes.
lslv -m
--> Unmount all filesystems on that PV. umount
--> Remove all LVs found on that PV. rmlv
--> Remove the questionable PV from the system. reducevg
--> Remove the PV entry from the ODM database. rmdev -l
--> Shutdown the system: Shutdown -F
--> Remove the bad PV and install the new PV
--> Add the new PV to the VG in question. extendvg
--> Re-create the LVs removed from the OLD PV to the NEW PV.
mklv -y
The map file is assembled from the output generated from the lslv -m command in step 2 above. Do this for each LV that existed on the removed PV.
--> Re-size the filesystems on the new PV. mkfs /dev/
--> Perform a filesystem check before mounting it. fsck -f /dev/
--> Mount all filesystems on that PV. mount
--> Now restore the data you backed up
Tuesday, September 30, 2008
Regaining root's password
1) Boot from a cd-rom or a bootable Tape.
2) Press F5 or 5.
3) Select option 3 from installation and maintanance menu: Start maintanance menu for system recovery.
4) Follow the option to activate the root vg and obtain the shell.
5) Once a shell is available then run the passwd command to reset the password for root.
6) sync
7) Reboot the system.
2) Press F5 or 5.
3) Select option 3 from installation and maintanance menu: Start maintanance menu for system recovery.
4) Follow the option to activate the root vg and obtain the shell.
5) Once a shell is available then run the passwd command to reset the password for root.
6) sync
7) Reboot the system.
REMOVING UNWANTED FILES
Removing Obsolete Files
Occasionally, you need to remove unwanted and unneeded files from your system. AIX provides you with the skulker command, which allows you to automatically track and remove obsolete files. This facilityworks on candidate files located in the /tmp directory, executable a.out files, core files, and ed.hup files.
To run the skulker command, type
# skulker -p
You can automate the skulker command by setting up the cron facility to perform this task regularly.
Removing Unowned Files
When a user ID is removed, that user’s files then have no owner assigned to them. To identify files that have no owner, you can use the find command as follows:
# find / -nouser -ls
After identifying files that have no owners, determine whether the files are needed. If they are needed, assign them to a different user. Otherwise, you can remove those files from the system.
Managing Unauthorized Remote Host Access
Some programs use the .rhosts file to gain access to a system. In some cases, access can be granted to unauthenticated users. To avoid this situation, remove the .rhosts file from your system.
For HACMP clusters, .rhosts files are required. Instead of removing them from these configurations, set the permissions to 600 and assign ownership of the files to root.system.
To find .rhosts files, run the following command:
# find / -name .rhosts -ls
Monitoring Executable Files
To monitor the activity of critical executable files, you need a good understanding of how these files are being used. The executable files that you need to monitor are those that are owned by root and have either their SUID or SGID bits set.
After carefully monitoring these files during normal system activity, you can generate a report that includes a list of files that are normally executed. You can then contrast that report with subsequent reports that show new files with these attributes that were set without your knowledge. To create the baseline report, run the following commands:
# find / -perm -4000 -user 0 -ls
# find / -perm -2000 -user 0 -ls
Occasionally, you need to remove unwanted and unneeded files from your system. AIX provides you with the skulker command, which allows you to automatically track and remove obsolete files. This facilityworks on candidate files located in the /tmp directory, executable a.out files, core files, and ed.hup files.
To run the skulker command, type
# skulker -p
You can automate the skulker command by setting up the cron facility to perform this task regularly.
Removing Unowned Files
When a user ID is removed, that user’s files then have no owner assigned to them. To identify files that have no owner, you can use the find command as follows:
# find / -nouser -ls
After identifying files that have no owners, determine whether the files are needed. If they are needed, assign them to a different user. Otherwise, you can remove those files from the system.
Managing Unauthorized Remote Host Access
Some programs use the .rhosts file to gain access to a system. In some cases, access can be granted to unauthenticated users. To avoid this situation, remove the .rhosts file from your system.
For HACMP clusters, .rhosts files are required. Instead of removing them from these configurations, set the permissions to 600 and assign ownership of the files to root.system.
To find .rhosts files, run the following command:
# find / -name .rhosts -ls
Monitoring Executable Files
To monitor the activity of critical executable files, you need a good understanding of how these files are being used. The executable files that you need to monitor are those that are owned by root and have either their SUID or SGID bits set.
After carefully monitoring these files during normal system activity, you can generate a report that includes a list of files that are normally executed. You can then contrast that report with subsequent reports that show new files with these attributes that were set without your knowledge. To create the baseline report, run the following commands:
# find / -perm -4000 -user 0 -ls
# find / -perm -2000 -user 0 -ls
Monday, September 29, 2008
Changing the CDE login screen
This security issue also affects the Common Desktop Environment (CDE) users. The CDE login screen also displays, by default, the host name and the operating system version. To prevent this information frombeing displayed, edit the /usr/dt/config/$LANG/Xresources file, where $LANG refers to the local language installed on your machine.
In the Example assuming that $LANG is set to C, copy this file into /etc/dt/config/C/Xresources. Next, open the /usr/dt/config/C/Xresources file and edit it to remove welcome messages that include the host name and operating system version.
In the Example assuming that $LANG is set to C, copy this file into /etc/dt/config/C/Xresources. Next, open the /usr/dt/config/C/Xresources file and edit it to remove welcome messages that include the host name and operating system version.
Securing unattended Terminals
Always lock your terminal when it is not being attended to prevent unauthorized access. Leaving system terminals unsecure poses a potential security hazard. To lock your terminal, use the lock command.
Changing the login screen welcome message
To prevent displaying certain information on login screens, edit the herald parameter in the
/etc/security/login.cfg file. The default herald contains the welcome message that displays with your login prompt. To change this parameter, you can either use the chsec command or edit the file directly.
The following example uses the chsec command to change the default herald parameter:
# chsec -f /etc/security/login.cfg -a default -herald "Unauthorized use of this system is Prohibited.\n\nlogin: "
To edit the file directly, open the /etc/security/login.cfg file and update the herald parameter as follows:
default:
herald ="Unauthorized use of this system is prohibited\n\nlogin:"
sak_enable = false
logintimes =
logindisable = 0
logininterval = 0
loginreenable = 0
logindelay = 0
/etc/security/login.cfg file. The default herald contains the welcome message that displays with your login prompt. To change this parameter, you can either use the chsec command or edit the file directly.
The following example uses the chsec command to change the default herald parameter:
# chsec -f /etc/security/login.cfg -a default -herald "Unauthorized use of this system is Prohibited.\n\nlogin: "
To edit the file directly, open the /etc/security/login.cfg file and update the herald parameter as follows:
default:
herald ="Unauthorized use of this system is prohibited\n\nlogin:"
sak_enable = false
logintimes =
logindisable = 0
logininterval = 0
loginreenable = 0
logindelay = 0
Friday, September 26, 2008
ssh without password
This Procedure for do the ssh for without asking password only for One server
a@A:~> ssh-keygen -t rsa
Now use ssh to create a directory ~/.ssh as user b on B. (The directory may already exist, which is fine):a@A:~> ssh b@localhost mkdir -p .sshb@localhost's password:
Finally append a's new public key to b@B:.ssh/authorized_keys and enter b's password one last time:a@A:~> cat .ssh/id_rsa.pub ssh b@B 'cat >> .ssh/authorized_keys'b@B's password:
From now on you can log into B as b from A as a without password:a@A:~> ssh b@B hostnameB
=====================================================================================
Login in ServerA
Go to Home dircetory of user.
scp /home/oracle/.ssh/id_rsa.pub ServerB:/home/oracle/.ssh/authorized_keys
Then you will able to login without asking password to SerevrB.
You can login ServerB
run the command
ssh-keygen -t rsa
scp /home/oracle/.ssh/id_rsa.pub ServerA:/home/oracle/.ssh/authorized_keys
Then you will able to login without asking password to SerevrA
a@A:~> ssh-keygen -t rsa
Now use ssh to create a directory ~/.ssh as user b on B. (The directory may already exist, which is fine):a@A:~> ssh b@localhost mkdir -p .sshb@localhost's password:
Finally append a's new public key to b@B:.ssh/authorized_keys and enter b's password one last time:a@A:~> cat .ssh/id_rsa.pub ssh b@B 'cat >> .ssh/authorized_keys'b@B's password:
From now on you can log into B as b from A as a without password:a@A:~> ssh b@B hostnameB
=====================================================================================
Login in ServerA
Go to Home dircetory of user.
scp /home/oracle/.ssh/id_rsa.pub ServerB:/home/oracle/.ssh/authorized_keys
Then you will able to login without asking password to SerevrB.
You can login ServerB
run the command
ssh-keygen -t rsa
scp /home/oracle/.ssh/id_rsa.pub ServerA:/home/oracle/.ssh/authorized_keys
Then you will able to login without asking password to SerevrA
File Systems
# File Systems Types:
JFS, EJFS, NFS, CD-ROM File systems
# File Systems Structure:
1. Superblock ==> it contains control information about file systems such as a) Size of the file systems b) Name of the file systems c) The System log device d) The version number e) The number of inodes f) List of free inodes and data-bocks g) Date and time of creation of file system and also file system state.
IMP: Corruption of data may render the file system unusable. This is wny system keeps a second copy of superblock on logical block 31.
2. Allocation Group ==> it consists of inodes and it corresponding data blocks. An allocation group spans multiple adjacent disk blocks and it improves the speed of i/o operation. Booth jfs and jfs2 file systems use allocation group.
3. Inodes ===> it contains control information about file such as a) Type, Size, Owner, and the date and time when the file was created, modified, last accessed. b) it also contains the pointers to data blocks that store the actula data of file. Every File has a corresponding inode. c) The jfs restricts all file systems to 16 MB inodes.
4. Data Blocks ==> it stores the actucal data of the file or pointers to other data blocks. Default value for disk block size is 4 kb.
5. Fragments ===> Fragments of logical blocks can be used to support files smaller than the standard size of the logical boock ( 4 kb ). This rules applies only to last block of a file smaller than 32 kb.
############### File Systems Differences ########################################
Function JFS JFS2
Architectural maximum file system size 1 TB 4 PB
Architectural maximum file size 64 GB 4 PB
No of inodes Fixed, set at Dynamic system creation
Inode size 128 bytes 512 bytes
Fragment size 512 512
Block size 4096 4096
Directory organization Linear B-tree
Compression Yes No
Default ownership at creation sys.sys root.system
SGID of default file mode SGID=on SGID=off
Quotas Yes Yes
####################### Example of file system creation #####################################################
Creating file systems without specifying logical volumes
# lsvg -l testvg
testvg:LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINT
# crfs -v jfs -g testvg -a size=10M -m /fs1
Based on the parameters chosen, the new /fs1 JFS file systemis limited to a maximum size of 134217728 (512 byte blocks)New File System size is 262144
# crfs -v jfs2 -g testvg -a size=10M -p ro -m /fs2
File system created successfully.130864 kilobytes total disk space.New File System size is 262144
# lsvg -l testvg
testvg:LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINTloglv00 jfslog 1 1 1 closed/syncd N/Alv00 jfs 1 1 1 closed/syncd /fs1loglv01 jfs2log 1 1 1 closed/syncd N/Afslv00 jfs2 1 1 1 closed/syncd /fs2
# lslv lv00
LOGICAL VOLUME: lv00 VOLUME GROUP: testvgLV IDENTIFIER: 00c478de00004c0000000107d96de510.2 PERMISSION:read/writeVG STATE: active/complete LV STATE: closed/syncdTYPE: jfs WRITE VERIFY: offMAX LPs: 512 PP SIZE: 128 megabyte(s)COPIES: 1 SCHED POLICY: parallelLPs: 1 PPs: 1STALE PPs: 0 BB POLICY: relocatableINTER-POLICY: minimum RELOCATABLE: yesINTRA-POLICY: middle UPPER BOUND: 32MOUNT POINT: /fs1 LABEL: /fs1MIRROR WRITE CONSISTENCY: on/ACTIVEEACH LP COPY ON A SEPARATE PV ?: yesSerialize IO ?: NO
# lslv fslv00
LOGICAL VOLUME: fslv00 VOLUME GROUP: testvgLV IDENTIFIER: 00c478de00004c0000000107d96de510.4 PERMISSION:read/writeVG STATE: active/complete LV STATE: closed/syncdTYPE: jfs2 WRITE VERIFY: offMAX LPs: 512 PP SIZE: 128 megabyte(s)COPIES: 1 SCHED POLICY: parallelLPs: 1 PPs: 1STALE PPs: 0 BB POLICY: relocatableINTER-POLICY: minimum RELOCATABLE: yesINTRA-POLICY: middle UPPER BOUND: 32MOUNT POINT: /fs2 LABEL: /fs2MIRROR WRITE CONSISTENCY: on/ACTIVEEACH LP COPY ON A SEPARATE PV ?: yesSerialize IO ?: NO
# cat /etc/filesystemsgrep -ip fs1
/fs1:dev = /dev/lv00 vfs = jfslog = /dev/loglv00mount = falseaccount = false
# Mount -a ===> mount all the file systems
# mount ===> Disply mounted file systems
# mount node mounted mounted over vfs date options-------- --------------- --------------- ------ ------------ ---------------/dev/hd4 / jfs2 Nov 27 12:36 rw,log=/dev/hd8/dev/hd2 /usr jfs2 Nov 27 12:36 rw,log=/dev/hd8/dev/hd9var /var jfs2 Nov 27 12:36 rw,log=/dev/hd8/dev/hd3 /tmp jfs2 Nov 27 12:36 rw,log=/dev/hd8/dev/hd1 /home jfs2 Nov 27 12:36 rw,log=/dev/hd8/proc /proc procfs Nov 27 12:36 rw/dev/hd10opt /opt jfs2 Nov 27 12:36 rw,log=/dev/hd8/dev/testlv /test jfs2 Nov 28 19:54
# lsfs ===> Shows the characteristics of a file systems
# rmfs ===> removes the file systems
# lsvg -l testvg
testvg:LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINTloglv00 jfslog 1 1 1 closed/syncd N/Alv00 jfs 1 1 1 closed/syncd /fs1loglv01 jfs2log 1 1 1 open/syncd N/Afslv00 jfs2 1 1 1 closed/syncd /fs2testlv jfs2 1 1 1 open/syncd /test
########################### Removing the file Systems ###############################################################
# rmfs /test
rmfs: 0506-921 /test is currently mounted.
# umount /test
# rmfs /test
rmlv: Logical volume testlv is removed.
# lsvg -l testvg
testvg:LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINTloglv00 jfslog 1 1 1 closed/syncd N/Alv00 jfs 1 1 1 closed/syncd /fs1loglv01 jfs2log 1 1 1 closed/syncd N/Afslv00 jfs2 1 1 1 closed/syncd /fs2
# cat /etc/filesystemsgrep test#
###### Changing the attributes of file systems ####################################
# chfs -a size=250M -p rw /fs2
Filesystem size changed to 524288
# fsck ===> Checks the Systems consistency and interactively repairs the file systems. Always run the fsck command on the mounted file systems.
################ if 1st superblock corrupted then how to recover #############################################
If you receive one of the following errors from the fsck or mount commands, theproblem may be a corrupted superblock:
fsck: Not an AIX3 file systemfsck: Not an AIXV3 file systemfsck: Not an AIX4 file systemfsck: Not an AIXV4 file systemfsck: Not a recognized file system typemount: invalid argument
The problem can be resolved by restoring the backup of the superblock over theprimary superblock using one of the following commands:
# dd count=1 bs=4k skip=31 seek=1 if=/dev/lv00 of=/dev/lv00
############ Not able to umount the file systems ###############################
# Files are open within a file system. Close these files before the file system can be unmounted. The fuser command is often the best way to determine the process IDs for all processes that have open references within a specified file system. The process having an open reference can be killed by using the kill command and the unmount can be accomplished.
# If the file system is still busy and not getting unmounted, this could be due to a kernel extension that is loaded, but exists within the source file system. The fuser command will not show these kinds of references, because a user process is not involved. However, the genkex command will report on all loaded kernel extensions.
# find /home -type d -exec fuser -u {} \;/home:/home/lost+found:/home/guest:/home/kenzie: 3548c(kenzie)
JFS, EJFS, NFS, CD-ROM File systems
# File Systems Structure:
1. Superblock ==> it contains control information about file systems such as a) Size of the file systems b) Name of the file systems c) The System log device d) The version number e) The number of inodes f) List of free inodes and data-bocks g) Date and time of creation of file system and also file system state.
IMP: Corruption of data may render the file system unusable. This is wny system keeps a second copy of superblock on logical block 31.
2. Allocation Group ==> it consists of inodes and it corresponding data blocks. An allocation group spans multiple adjacent disk blocks and it improves the speed of i/o operation. Booth jfs and jfs2 file systems use allocation group.
3. Inodes ===> it contains control information about file such as a) Type, Size, Owner, and the date and time when the file was created, modified, last accessed. b) it also contains the pointers to data blocks that store the actula data of file. Every File has a corresponding inode. c) The jfs restricts all file systems to 16 MB inodes.
4. Data Blocks ==> it stores the actucal data of the file or pointers to other data blocks. Default value for disk block size is 4 kb.
5. Fragments ===> Fragments of logical blocks can be used to support files smaller than the standard size of the logical boock ( 4 kb ). This rules applies only to last block of a file smaller than 32 kb.
############### File Systems Differences ########################################
Function JFS JFS2
Architectural maximum file system size 1 TB 4 PB
Architectural maximum file size 64 GB 4 PB
No of inodes Fixed, set at Dynamic system creation
Inode size 128 bytes 512 bytes
Fragment size 512 512
Block size 4096 4096
Directory organization Linear B-tree
Compression Yes No
Default ownership at creation sys.sys root.system
SGID of default file mode SGID=on SGID=off
Quotas Yes Yes
####################### Example of file system creation #####################################################
Creating file systems without specifying logical volumes
# lsvg -l testvg
testvg:LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINT
# crfs -v jfs -g testvg -a size=10M -m /fs1
Based on the parameters chosen, the new /fs1 JFS file systemis limited to a maximum size of 134217728 (512 byte blocks)New File System size is 262144
# crfs -v jfs2 -g testvg -a size=10M -p ro -m /fs2
File system created successfully.130864 kilobytes total disk space.New File System size is 262144
# lsvg -l testvg
testvg:LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINTloglv00 jfslog 1 1 1 closed/syncd N/Alv00 jfs 1 1 1 closed/syncd /fs1loglv01 jfs2log 1 1 1 closed/syncd N/Afslv00 jfs2 1 1 1 closed/syncd /fs2
# lslv lv00
LOGICAL VOLUME: lv00 VOLUME GROUP: testvgLV IDENTIFIER: 00c478de00004c0000000107d96de510.2 PERMISSION:read/writeVG STATE: active/complete LV STATE: closed/syncdTYPE: jfs WRITE VERIFY: offMAX LPs: 512 PP SIZE: 128 megabyte(s)COPIES: 1 SCHED POLICY: parallelLPs: 1 PPs: 1STALE PPs: 0 BB POLICY: relocatableINTER-POLICY: minimum RELOCATABLE: yesINTRA-POLICY: middle UPPER BOUND: 32MOUNT POINT: /fs1 LABEL: /fs1MIRROR WRITE CONSISTENCY: on/ACTIVEEACH LP COPY ON A SEPARATE PV ?: yesSerialize IO ?: NO
# lslv fslv00
LOGICAL VOLUME: fslv00 VOLUME GROUP: testvgLV IDENTIFIER: 00c478de00004c0000000107d96de510.4 PERMISSION:read/writeVG STATE: active/complete LV STATE: closed/syncdTYPE: jfs2 WRITE VERIFY: offMAX LPs: 512 PP SIZE: 128 megabyte(s)COPIES: 1 SCHED POLICY: parallelLPs: 1 PPs: 1STALE PPs: 0 BB POLICY: relocatableINTER-POLICY: minimum RELOCATABLE: yesINTRA-POLICY: middle UPPER BOUND: 32MOUNT POINT: /fs2 LABEL: /fs2MIRROR WRITE CONSISTENCY: on/ACTIVEEACH LP COPY ON A SEPARATE PV ?: yesSerialize IO ?: NO
# cat /etc/filesystemsgrep -ip fs1
/fs1:dev = /dev/lv00 vfs = jfslog = /dev/loglv00mount = falseaccount = false
# Mount -a ===> mount all the file systems
# mount ===> Disply mounted file systems
# mount node mounted mounted over vfs date options-------- --------------- --------------- ------ ------------ ---------------/dev/hd4 / jfs2 Nov 27 12:36 rw,log=/dev/hd8/dev/hd2 /usr jfs2 Nov 27 12:36 rw,log=/dev/hd8/dev/hd9var /var jfs2 Nov 27 12:36 rw,log=/dev/hd8/dev/hd3 /tmp jfs2 Nov 27 12:36 rw,log=/dev/hd8/dev/hd1 /home jfs2 Nov 27 12:36 rw,log=/dev/hd8/proc /proc procfs Nov 27 12:36 rw/dev/hd10opt /opt jfs2 Nov 27 12:36 rw,log=/dev/hd8/dev/testlv /test jfs2 Nov 28 19:54
# lsfs ===> Shows the characteristics of a file systems
# rmfs ===> removes the file systems
# lsvg -l testvg
testvg:LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINTloglv00 jfslog 1 1 1 closed/syncd N/Alv00 jfs 1 1 1 closed/syncd /fs1loglv01 jfs2log 1 1 1 open/syncd N/Afslv00 jfs2 1 1 1 closed/syncd /fs2testlv jfs2 1 1 1 open/syncd /test
########################### Removing the file Systems ###############################################################
# rmfs /test
rmfs: 0506-921 /test is currently mounted.
# umount /test
# rmfs /test
rmlv: Logical volume testlv is removed.
# lsvg -l testvg
testvg:LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINTloglv00 jfslog 1 1 1 closed/syncd N/Alv00 jfs 1 1 1 closed/syncd /fs1loglv01 jfs2log 1 1 1 closed/syncd N/Afslv00 jfs2 1 1 1 closed/syncd /fs2
# cat /etc/filesystemsgrep test#
###### Changing the attributes of file systems ####################################
# chfs -a size=250M -p rw /fs2
Filesystem size changed to 524288
# fsck ===> Checks the Systems consistency and interactively repairs the file systems. Always run the fsck command on the mounted file systems.
################ if 1st superblock corrupted then how to recover #############################################
If you receive one of the following errors from the fsck or mount commands, theproblem may be a corrupted superblock:
fsck: Not an AIX3 file systemfsck: Not an AIXV3 file systemfsck: Not an AIX4 file systemfsck: Not an AIXV4 file systemfsck: Not a recognized file system typemount: invalid argument
The problem can be resolved by restoring the backup of the superblock over theprimary superblock using one of the following commands:
# dd count=1 bs=4k skip=31 seek=1 if=/dev/lv00 of=/dev/lv00
############ Not able to umount the file systems ###############################
# Files are open within a file system. Close these files before the file system can be unmounted. The fuser command is often the best way to determine the process IDs for all processes that have open references within a specified file system. The process having an open reference can be killed by using the kill command and the unmount can be accomplished.
# If the file system is still busy and not getting unmounted, this could be due to a kernel extension that is loaded, but exists within the source file system. The fuser command will not show these kinds of references, because a user process is not involved. However, the genkex command will report on all loaded kernel extensions.
# find /home -type d -exec fuser -u {} \;/home:/home/lost+found:/home/guest:/home/kenzie: 3548c(kenzie)
How to set up a quota
######### Procedure to set up the disk quota ############################
To set up the disk quota system, use the following procedure:
1. Log in with root authority.
2. Determine which file systems require quotas.
3. Use the chfs command to include the userquota and groupquota quota configuration attributes in the /etc/filesystems file.
The following example uses the chfs command to enable user quotas on the /home file system:
# chfs -a "quota = userquota" /home
To enable both user and group quotas on the /home file system, type:
# chfs -a "quota = userquota,groupquota" /home
The corresponding entry in the /etc/filesystems file is displayed as follows:
/home: dev = /dev/hd1 vfs = jfs log = /dev/hd8 mount = true check = true quota = userquota,groupquota options = rw
4. The following example uses the chfs command to establish user and group quotas for the /home file system and names the myquota.user and myquota.group quota files:
# chfs -a "userquota = /home/myquota.user" -a "groupquota = /home/myquota.group" /home
# The following example entry shows quota limits for the gpsilva user:
Quotas for user gpsilva:
/home: blocks in use: 30, limits (soft = 100, hard = 150) inodes in use: 73, limits (soft = 200, hard = 250)
This user has used 30 KB of the maximum 100 KB of disk space. Of the maximum 200 files, gpsilva has created 73. This user has buffers of 50 KB of disk space and 50 files that can be allocated to temporary storage.
5. To duplicate the quotas established for user gpsilva for user tneiva, type:
# edquota -p gpsilva tneiva
6. Enable the quota system with the quotaon command. The quotaon command enables quotas for a specified file system or for all file systems with quotas (as indicated in the /etc/filesystems file) when used with the -a flag.
7. Use the quotacheck command to check the consistency of the quota files against actual disk usage.
# very IMP
To enable this check and to turn on quotas during system startup, add the following lines at the end of the /etc/rc file:
echo " Enabling filesystem quotas "
/usr/sbin/quotacheck -a /usr/sbin/quotaon -a
########## Some examples #################
There are related commands, namely the edquota command, quotacheckcommand, and repquota command.
The following examples show the commands in typical uses:
1. To enable user quotas for the /usr/Tivoli/tsm/server/db file system,
# quotaon -u /usr/Tivoli/tsm/server/db
2. To disable user and group quotas for all file systems in the /etc/filesystems and print a message, enter:
# quotaoff -v -a
3. To display your quotas as user neivac, type:
$ quota
The system displays the following information:
User quotas for user neivac (uid 502):
Filesystem blocks quota limit grace Files quota limit grace
/u 20 55 60 20 60 65
4. To display quotas as the root user for user gpsilva, type:
quota -u gpsilva
The system displays the following information:
User quotas for user gpsilva (uid 2702):
Filesystem blocks quota limit grace files quota limit grace
/u 48 50 60 7 60 60
# To disable the quota use the command
# quotaoff -a ===> it disables the quota for all file systems.
# quotaoff -u username ===> it disables the quota for the users.
# Quotaoff -g groupname ===> it disables the quota for the groups.
To set up the disk quota system, use the following procedure:
1. Log in with root authority.
2. Determine which file systems require quotas.
3. Use the chfs command to include the userquota and groupquota quota configuration attributes in the /etc/filesystems file.
The following example uses the chfs command to enable user quotas on the /home file system:
# chfs -a "quota = userquota" /home
To enable both user and group quotas on the /home file system, type:
# chfs -a "quota = userquota,groupquota" /home
The corresponding entry in the /etc/filesystems file is displayed as follows:
/home: dev = /dev/hd1 vfs = jfs log = /dev/hd8 mount = true check = true quota = userquota,groupquota options = rw
4. The following example uses the chfs command to establish user and group quotas for the /home file system and names the myquota.user and myquota.group quota files:
# chfs -a "userquota = /home/myquota.user" -a "groupquota = /home/myquota.group" /home
# The following example entry shows quota limits for the gpsilva user:
Quotas for user gpsilva:
/home: blocks in use: 30, limits (soft = 100, hard = 150) inodes in use: 73, limits (soft = 200, hard = 250)
This user has used 30 KB of the maximum 100 KB of disk space. Of the maximum 200 files, gpsilva has created 73. This user has buffers of 50 KB of disk space and 50 files that can be allocated to temporary storage.
5. To duplicate the quotas established for user gpsilva for user tneiva, type:
# edquota -p gpsilva tneiva
6. Enable the quota system with the quotaon command. The quotaon command enables quotas for a specified file system or for all file systems with quotas (as indicated in the /etc/filesystems file) when used with the -a flag.
7. Use the quotacheck command to check the consistency of the quota files against actual disk usage.
# very IMP
To enable this check and to turn on quotas during system startup, add the following lines at the end of the /etc/rc file:
echo " Enabling filesystem quotas "
/usr/sbin/quotacheck -a /usr/sbin/quotaon -a
########## Some examples #################
There are related commands, namely the edquota command, quotacheckcommand, and repquota command.
The following examples show the commands in typical uses:
1. To enable user quotas for the /usr/Tivoli/tsm/server/db file system,
# quotaon -u /usr/Tivoli/tsm/server/db
2. To disable user and group quotas for all file systems in the /etc/filesystems and print a message, enter:
# quotaoff -v -a
3. To display your quotas as user neivac, type:
$ quota
The system displays the following information:
User quotas for user neivac (uid 502):
Filesystem blocks quota limit grace Files quota limit grace
/u 20 55 60 20 60 65
4. To display quotas as the root user for user gpsilva, type:
quota -u gpsilva
The system displays the following information:
User quotas for user gpsilva (uid 2702):
Filesystem blocks quota limit grace files quota limit grace
/u 48 50 60 7 60 60
# To disable the quota use the command
# quotaoff -a ===> it disables the quota for all file systems.
# quotaoff -u username ===> it disables the quota for the users.
# Quotaoff -g groupname ===> it disables the quota for the groups.
Nfs configuration and Auto mount
Server Side.
We want to mount the /backup NFS directory from 10.0.128.114 to 10.0.252.88 server
# mknfsexp -d /backup -t ro -h 10.0.252.88-----------------------------------------------------------------------------------------------------------------
Client Side
# mknfsmnt -f /backup1 -d /backup -h 10.0.128.114
The above command mount the /backup to /backup1 on 10.0.252.88 server
############### Using AutoFS to automatically mount a file system #############
AutoFS relies on the use of the automount command to propagate the automatic mount configuration information to the AutoFS kernel extension and start the automountd daemon. Through this configuration propagation, the extension automatically and transparently mounts file systems whenever a file or a directory within that file system is opened. The extension informs the automountd daemon of mount and unmount requests, and the automountd daemon actually performs the requested service.
Because the name-to-location binding is dynamic within the automountd daemon, updates to a Network Information Service (NIS) map used by the automountd daemon are transparent to the user. Also, there is no need to premount shared file systems for applications that have hard-coded references to files and directories, nor is there a need to maintain records of which hosts must be mounted for particular applications.
AutoFS allows file systems to be mounted as needed. With this method of mounting directories, all file systems do not need to be mounted all of the time; only those being used are mounted.
For example, to mount an NFS directory automatically:
Verify that the NFS server has exported the directory by entering:
# showmount -e ServerName
where ServerName is the name of the NFS server. This command displays the names of the Directories currently exported from the NFS server.
Create an AutoFS master file and map file. AutoFS mounts and unmounts the directories specified in these map files.
For example, suppose you want AutoFS to mount the /local/dir1 and /local/dir2 directories as needed from the serve1 server onto the /remote/dir1 and /remote/dir2 directories, respectively. The auto_master file entry would be as follows:
/remote /tmp/mount.map
The /tmp/mount.map file entry would be as follows:
dir1 -rw serve1:/local/dir1dir2 -rw serve1:/local/dir2
Ensure that the AutoFS kernel extension is loaded and the automountd daemon is running.
This can be accomplished in two ways: Using the automount command: Issue
/usr/bin/automount -v.
Using SRC: Issue lssrc -s automountd. If the automountd subsystem is not running, issue
startsrc -s automountd.
Note: Starting the automountd daemon with the startsrc command will ignore any changes that have been made to the auto_master file.
To stop the automount daemon, issue the stopsrc -s automountd command. If, for some reason, the automountd daemon was started without the use of SRC, issue:
kill automountd_PID
where automountd_PID is the process ID of the automountd daemon. (Running the ps -e command displays the process ID of the automountd daemon.) The kill command sends a SIGTERM signal to the automountd daemon
We want to mount the /backup NFS directory from 10.0.128.114 to 10.0.252.88 server
# mknfsexp -d /backup -t ro -h 10.0.252.88-----------------------------------------------------------------------------------------------------------------
Client Side
# mknfsmnt -f /backup1 -d /backup -h 10.0.128.114
The above command mount the /backup to /backup1 on 10.0.252.88 server
############### Using AutoFS to automatically mount a file system #############
AutoFS relies on the use of the automount command to propagate the automatic mount configuration information to the AutoFS kernel extension and start the automountd daemon. Through this configuration propagation, the extension automatically and transparently mounts file systems whenever a file or a directory within that file system is opened. The extension informs the automountd daemon of mount and unmount requests, and the automountd daemon actually performs the requested service.
Because the name-to-location binding is dynamic within the automountd daemon, updates to a Network Information Service (NIS) map used by the automountd daemon are transparent to the user. Also, there is no need to premount shared file systems for applications that have hard-coded references to files and directories, nor is there a need to maintain records of which hosts must be mounted for particular applications.
AutoFS allows file systems to be mounted as needed. With this method of mounting directories, all file systems do not need to be mounted all of the time; only those being used are mounted.
For example, to mount an NFS directory automatically:
Verify that the NFS server has exported the directory by entering:
# showmount -e ServerName
where ServerName is the name of the NFS server. This command displays the names of the Directories currently exported from the NFS server.
Create an AutoFS master file and map file. AutoFS mounts and unmounts the directories specified in these map files.
For example, suppose you want AutoFS to mount the /local/dir1 and /local/dir2 directories as needed from the serve1 server onto the /remote/dir1 and /remote/dir2 directories, respectively. The auto_master file entry would be as follows:
/remote /tmp/mount.map
The /tmp/mount.map file entry would be as follows:
dir1 -rw serve1:/local/dir1dir2 -rw serve1:/local/dir2
Ensure that the AutoFS kernel extension is loaded and the automountd daemon is running.
This can be accomplished in two ways: Using the automount command: Issue
/usr/bin/automount -v.
Using SRC: Issue lssrc -s automountd. If the automountd subsystem is not running, issue
startsrc -s automountd.
Note: Starting the automountd daemon with the startsrc command will ignore any changes that have been made to the auto_master file.
To stop the automount daemon, issue the stopsrc -s automountd command. If, for some reason, the automountd daemon was started without the use of SRC, issue:
kill automountd_PID
where automountd_PID is the process ID of the automountd daemon. (Running the ps -e command displays the process ID of the automountd daemon.) The kill command sends a SIGTERM signal to the automountd daemon
A script which is used to recove a rootvg when rootvg failed
# cat rvgrecover
VG=rootvg
PV=hdisk0
cp /etc/objrepos/CuAt /etc/objrepos/CuAt.orig cp /etc/objrepos/CuDep /etc/objrepos/CuDep.orig cp /etc/objrepos/CuDv /etc/objrepos/CuDv.orig cp /etc/objrepos/CuDvDr /etc/objrepos/CuDvDr.orig
lqueryvg -Lp hdisk0 awk '{print $2}'while read LVname;
do
odmdelete -q "name=$LVname" -o CuAt
odmdelete -q "name=$LVname" -o CuDv
odmdelete -q "name=$LVname" -o CuDvDr
done
odmdelete -q "name=$VG" -o CuAt
odmdelete -q "parent=$VG" -o CuDv
odmdelete -q "name=$VG" CuDep
odmdelete -q "dependency=$VG" -o CuDep
odmdelete -q "value1=10" -o CuDvDr
odmdelete -q "value3=$VG" -o CuDvDr
importvg -y $VG $PV #Ignore lvaryoffvg errors
varyonvg $VG
VG=rootvg
PV=hdisk0
cp /etc/objrepos/CuAt /etc/objrepos/CuAt.orig cp /etc/objrepos/CuDep /etc/objrepos/CuDep.orig cp /etc/objrepos/CuDv /etc/objrepos/CuDv.orig cp /etc/objrepos/CuDvDr /etc/objrepos/CuDvDr.orig
lqueryvg -Lp hdisk0 awk '{print $2}'while read LVname;
do
odmdelete -q "name=$LVname" -o CuAt
odmdelete -q "name=$LVname" -o CuDv
odmdelete -q "name=$LVname" -o CuDvDr
done
odmdelete -q "name=$VG" -o CuAt
odmdelete -q "parent=$VG" -o CuDv
odmdelete -q "name=$VG" CuDep
odmdelete -q "dependency=$VG" -o CuDep
odmdelete -q "value1=10" -o CuDvDr
odmdelete -q "value3=$VG" -o CuDvDr
importvg -y $VG $PV #Ignore lvaryoffvg errors
varyonvg $VG
Subscribe to:
Posts (Atom)