After Replace the failed disk or added new root disk on Itanium server ..We need to mirror the disk and also we need to copy HPSP partition and its information.
Normally while Mirror the DIAG utilities not gettting copied to new disk. This we need to copy using below DD command only.
First check DIAG utilities are there on existing disk
# efi_ls -d /dev/rdisk/disk3_p3 /EFI/HP
Then run the below command to copy the Files to new disk
#dd if=/dev/rdisk/disk3_p3 of=/dev/rdisk/disk2_p3 bs=1024k
(disk3 - old disk and disk2 - new disk)
==================================================
Note : If the DIAG utilities are there means u will get the o/p like below..
# efi_ls -d /dev/rdisk/disk3_p3 /EFI/HP
FileName Last Modified Size
. 3/10/2010 0
.. 3/10/2010 0
DIAG/ 3/10/2010 0
TOOLS/ 3/10/2010 0
total space 418598912 bytes, free space 379895808 bytes
Wednesday, 23 November 2011
GREP command : How to use ??
GREP : Three version of grep command in UNIX `grep, fgrep, egrep'. `fgrep' stands for Fixed `grep', `egrep' Extended `grep'
1. To find relevant word and exclusion irrelevant word.
# grep Exception logfile.txt | grep -v ERROR
2.If you want to count of a particular word in log file you can use grep -c option to count the word.
# grep -c "Error" logfile.txt
3. grep --context option allows us to print lines around matching pattern. Below example of grep command in UNIX will print 6 lines around matching line of word "successful" in logfile.txt
# grep --context=6 successful logfile.txt
# grep -C 2 'hello' *
Prints two lines of context around each matching line.
4. egrep stands for extended grep and it is more powerful than grep command in Unix and allows more regular exception
# egrep 'Error|Exception' logfile.txt
5. If you want to do case insensitive search than use -i option from grep command in UNIX. Grep -i will find occurrence of both Error, error and ERROR
# grep -i Error logfile
6. Below command will print all files which have "Error" on them. ZGREP used to perform same operation as grep does but with .gz files
# zgrep -i Error *.gz
7. Above grep command in UNIX searches only for instances of 'ERROR' that are entire words; it does not match `SysERROR'.
# grep -w ERROR logfile
# grep 'ERROR>' *
Searches only for words ending in 'ERROR', so it matches the word `SysERROR'.
8. "grep -l" which display only the file names which matches the given pattern. Below command will only display file names which have ERROR
# grep -l ERROR *.log
9. If you want to see line number of matching lines you can use option "grep -n" below command will show on which lines Error has appeared.
# grep -n ERROR log file.
10. If you want to do recursive search using grep command in Unix there are two options either use "-R" command line option or increase directory one by one as shown below.
1. To find relevant word and exclusion irrelevant word.
# grep Exception logfile.txt | grep -v ERROR
2.If you want to count of a particular word in log file you can use grep -c option to count the word.
# grep -c "Error" logfile.txt
3. grep --context option allows us to print lines around matching pattern. Below example of grep command in UNIX will print 6 lines around matching line of word "successful" in logfile.txt
# grep --context=6 successful logfile.txt
# grep -C 2 'hello' *
Prints two lines of context around each matching line.
4. egrep stands for extended grep and it is more powerful than grep command in Unix and allows more regular exception
# egrep 'Error|Exception' logfile.txt
5. If you want to do case insensitive search than use -i option from grep command in UNIX. Grep -i will find occurrence of both Error, error and ERROR
# grep -i Error logfile
6. Below command will print all files which have "Error" on them. ZGREP used to perform same operation as grep does but with .gz files
# zgrep -i Error *.gz
7. Above grep command in UNIX searches only for instances of 'ERROR' that are entire words; it does not match `SysERROR'.
# grep -w ERROR logfile
# grep 'ERROR>' *
Searches only for words ending in 'ERROR', so it matches the word `SysERROR'.
8. "grep -l" which display only the file names which matches the given pattern. Below command will only display file names which have ERROR
# grep -l ERROR *.log
9. If you want to see line number of matching lines you can use option "grep -n" below command will show on which lines Error has appeared.
# grep -n ERROR log file.
10. If you want to do recursive search using grep command in Unix there are two options either use "-R" command line option or increase directory one by one as shown below.
Steps to change the hostname on HP-UX:
1. #hostname newname
2. # uname –S newname ( Ths is to change the node name)
3. # vi /etc/rc.config.d/netconf
HOSTNAME="newname"
4. # /sbin/init.d/net stop
# /sbin/init.d/net start
5. Now u can check the hostname
# uname -a
or
# hostname
2. # uname –S newname ( Ths is to change the node name)
3. # vi /etc/rc.config.d/netconf
HOSTNAME="newname"
4. # /sbin/init.d/net stop
# /sbin/init.d/net start
5. Now u can check the hostname
# uname -a
or
# hostname
fsadm: You don't have a license to run this program : how to fix??
If u got the below error
fsadm -b 1024M /home/user1
fsadm: /etc/default/fs is used for determining the file system type
fsadm: You don't have a license to run this program
1. # /usr/sbin/vxlicrep -e
Check the valid Liscense
2. # vxlicense -p vxlicrep
Check the valid license from running server and install it on this server
License location : # /etc/vx/elm
# ll /etc/vx/elm
total 32
-rw-r--r-- 1 root sys 171 Nov 4 14:43 50.lic
-r--r--r-- 1 bin bin 291 Nov 14 2000 README
Copy the 50.lic file to the required server and install it
3. # vxlicinst -k 010449565889805115946465 (install the license)
4. # sbin/fs/vxfs/vxenablef -a (Enable that license)
Now u can try to extend the FS
# fsadm -b 1024M /home/user1
fsadm -b 1024M /home/user1
fsadm: /etc/default/fs is used for determining the file system type
fsadm: You don't have a license to run this program
1. # /usr/sbin/vxlicrep -e
Check the valid Liscense
2. # vxlicense -p vxlicrep
Check the valid license from running server and install it on this server
License location : # /etc/vx/elm
# ll /etc/vx/elm
total 32
-rw-r--r-- 1 root sys 171 Nov 4 14:43 50.lic
-r--r--r-- 1 bin bin 291 Nov 14 2000 README
Copy the 50.lic file to the required server and install it
3. # vxlicinst -k 010449565889805115946465 (install the license)
4. # sbin/fs/vxfs/vxenablef -a (Enable that license)
Now u can try to extend the FS
# fsadm -b 1024M /home/user1
Locate the failed disk on RACK : How to ??
dd if=/dev/rdsk/disk2 of=/dev/null
or
dd if=/dev/rdsk/disk2 of=/dev/null bs=4096 count=50000
We can run this above DD command on the disk and we can make the LED to glow for that disk. Then we can identify the failed disk easily while replace.
or
dd if=/dev/rdsk/disk2 of=/dev/null bs=4096 count=50000
We can run this above DD command on the disk and we can make the LED to glow for that disk. Then we can identify the failed disk easily while replace.
lbolt error : how to find the device in HP-UX?
1. # dmesg | grep lbolt | grep dev
SCSI: Request Timeout -- lbolt: 74105435, dev: 1f000000
SCSI: Abort Tag -- lbolt: 74105435, dev: 1f000000, io_id: 4ead34
2. # printf "%#d\n" 0x1f
Character Block Driver Class
31 -1 fcd fc
188 31 sdisk disk
3. # lsdev 31
4. ll -R /dev/ | grep 31 | grep 0x000000
5. lssf /dev/dsk/c?t?d?
SCSI: Request Timeout -- lbolt: 74105435, dev: 1f000000
SCSI: Abort Tag -- lbolt: 74105435, dev: 1f000000, io_id: 4ead34
2. # printf "%#d\n" 0x1f
Character Block Driver Class
31 -1 fcd fc
188 31 sdisk disk
3. # lsdev 31
4. ll -R /dev/ | grep 31 | grep 0x000000
5. lssf /dev/dsk/c?t?d?
Buffer cache ON/OFF for file system in HP UX:How to ??
Why buffer cache ?
Buffer cache stores recently read data in memory to help reduce the amount of I/O to physical disks. This is advantageous when the same data is accessed many times as the data can be served directly from memory.
How to Turn ON /OFF ?
File systems use Buffer cache by default. To stop a file system using Buffer cache the following mount options are used:
mincache=direct,convosync=direct
These options can be changed on the fly without umounting the filesystem by using the remount option to the mount command.
mount -F vxfs -o remount,
To make the file system use buffer cache again, remount the file system without the mincache and convosync options.
Buffer cache stores recently read data in memory to help reduce the amount of I/O to physical disks. This is advantageous when the same data is accessed many times as the data can be served directly from memory.
How to Turn ON /OFF ?
File systems use Buffer cache by default. To stop a file system using Buffer cache the following mount options are used:
mincache=direct,convosync=direct
These options can be changed on the fly without umounting the filesystem by using the remount option to the mount command.
mount -F vxfs -o remount,
To make the file system use buffer cache again, remount the file system without the mincache and convosync options.
Subscribe to:
Posts (Atom)