Monday, April 22, 2013
SAN Management - HBA, LUN, ..
Here are some commands used to manage HBA, SAN LUNs, etc...
To show the connectivity and WWN of a FC adapter :
# fcmsutil /dev/fcd0
To show the VPD (incl firmware) of a FC adapter :
# fcmsutil /dev/fcd1 vpd
To disable a HBA :
# fcmsutil /dev/fcd1 -f disable
To enable a HBA :
# fcmsutil /dev/fcd1 enable
To show the WWN of the SAN Tape Drives:
# fcmsutil /dev/td0 get remote all
To show details for a hardware path :
# ioscan -fnkH 1/0/8/1
To list the EVA Array LUNs:
# evainfo -al
To list the XP Array LUNs:
# xpinfo -al
To list all the devices attached to all the HBAs:
# tdlist
# fcdlist
To list all the tape drives:
# ioscan -funC tape
To list all the tape drives:
# tdlist
To list all the drives (along with their WWN) attached to a specific HBA:
# tdutil /dev/td9 get remote all
# fcmsutil /dev/fcd1 get remote all
To replace WWID:
# scsimgr replace_wwid -C lunpath -I 826 dsf
Friday, April 13, 2012
Backup and Recovery
1. To backup a filesystem :
# fbackup -f /dev/rmt/0m -i /home
2. To list the contents of the tape media and store it in a file :
# frecover -I /tmp/indexfile -f /dev/rmt/0m
3. To do level 0 (full) backup of a filesystem and also update the file /var/adm/fbackupfiles/dates :
# fbackup -f /dev/rmt/0m -0 -u /home
4. To do a level 1 backup using a graph file to specify which files will be included/excluded :
# fbackup -f /dev/rmt/2m -1 -u -g /var/adm/fbackupfiles/graphs/g0
Graph file content may look like
i /data
e /data/tmp
5. To backup to the tape drive on the remote server :
# fbackup -f host1:/dev/rmt/0m -v -i /home
6. To backup data to two tape drives (one by one) :
# fbackup -f /dev/rmt/0m -f /dev/rmt/1m -i /data
7. To restore all the files from the tape media
# frecover -v -r -f /dev/rmt/0m
8. To show the tape drive status :
# mt -f /dev/mt/0mnb status
9. To eject a tape :
# mt -f /dev/mt/0mnb offline
10. To rewind the tape media :
# mt -f /dev/rmt/0mnb rewind
# fbackup -f /dev/rmt/0m -i /home
2. To list the contents of the tape media and store it in a file :
# frecover -I /tmp/indexfile -f /dev/rmt/0m
3. To do level 0 (full) backup of a filesystem and also update the file /var/adm/fbackupfiles/dates :
# fbackup -f /dev/rmt/0m -0 -u /home
4. To do a level 1 backup using a graph file to specify which files will be included/excluded :
# fbackup -f /dev/rmt/2m -1 -u -g /var/adm/fbackupfiles/graphs/g0
Graph file content may look like
i /data
e /data/tmp
5. To backup to the tape drive on the remote server :
# fbackup -f host1:/dev/rmt/0m -v -i /home
6. To backup data to two tape drives (one by one) :
# fbackup -f /dev/rmt/0m -f /dev/rmt/1m -i /data
7. To restore all the files from the tape media
# frecover -v -r -f /dev/rmt/0m
8. To show the tape drive status :
# mt -f /dev/mt/0mnb status
9. To eject a tape :
# mt -f /dev/mt/0mnb offline
10. To rewind the tape media :
# mt -f /dev/rmt/0mnb rewind
Wednesday, January 19, 2011
Managing Printers in HP-UX
Configuration File:
/etc/rc.config.d/lp
Commands:
To stop LP Spooler:
# lpshut
To restart LP Spooler :
# lpshed
To accept print requests :
# accept printerA
To reject future print requests :
# reject -r"Use alternate printer - PrinterB" printerA
To cancel print requests :
# lpcancel printerA
To enable the printer to process requests :
# enable printerA
To disable the printer from processing requests :
# disable -r"PrinterA is disabled" printerA
To view jobs in a print queue :
# lpstat -o printerA
To move the jobs between printers :
# lpmove printerA printer B
To remove the printer :
# lpadmin -xprinterA
To remove a printer from a class :
# lpadmin -pprinterA -rclass1
To set the printer's fence priority (use a value from 0 to 7) :
# lpfence printerA
To cancel a print job :
# cancel job#
To list request ids of all the print jobs:
# lpstat -o
To view view the status of printers and their jobs :
# lpstat
To check the functionality of a printer :
# lpstat -t
/etc/rc.config.d/lp
Commands:
To stop LP Spooler:
# lpshut
To restart LP Spooler :
# lpshed
To accept print requests :
# accept printerA
To reject future print requests :
# reject -r"Use alternate printer - PrinterB" printerA
To cancel print requests :
# lpcancel printerA
To enable the printer to process requests :
# enable printerA
To disable the printer from processing requests :
# disable -r"PrinterA is disabled" printerA
To view jobs in a print queue :
# lpstat -o printerA
To move the jobs between printers :
# lpmove printerA printer B
To remove the printer :
# lpadmin -xprinterA
To remove a printer from a class :
# lpadmin -pprinterA -rclass1
To set the printer's fence priority (use a value from 0 to 7) :
# lpfence printerA
To cancel a print job :
# cancel job#
To list request ids of all the print jobs:
# lpstat -o
To view view the status of printers and their jobs :
# lpstat
To check the functionality of a printer :
# lpstat -t
Friday, December 17, 2010
HP-UX Kernel
Kernel files are stored under /stand.
Commands :
1. To display detailed information about a kernel module :
# kcmodule -v autofs
2. To load a module :
# kcmodule autofs=best
3. To unload a module :
# kcmodule autofs=unused
4. To view the values of tunables :
# kctune acctresume
5. To view the values of tunables with description :
# kctune -d acctresume
6. To view the values of tunables with detailed information :
# kctune -v acctresume
7. To change a tunable's value to the default :
# kctune nproc=Default
8. To change the value of a tunable :
# kctune nproc=3500
9. To view the list of module changes for next boot :
# kcmodule -D
10. To view the list of tunable changes for next boot :
# kctune -D
11. To view the list of module and tunable changes for next boot :
# kconfig -D
12. To view the list of module settings that are set to non-default :
# kcmodule -S
13. To view the list of tunable settings that are set to non-default :
# kctune -S
14. To view the list of module and tunable settings that are set to non-default :
# kconfig -S
15. To unhold all the module and tunable settings being held for next boot :
# kconfig -H
Points to remember :
Different states of kernel modules :
unused - This module is not used, but installed in the system.
static - This module will be statically bound to the kernel executable
loaded - This module will be dynamically bound to the kernel while booting
auto - The module will be dynamically loaded into the kernel when it is first needed after each boot.
Commands :
1. To display detailed information about a kernel module :
# kcmodule -v autofs
2. To load a module :
# kcmodule autofs=best
3. To unload a module :
# kcmodule autofs=unused
4. To view the values of tunables :
# kctune acctresume
5. To view the values of tunables with description :
# kctune -d acctresume
6. To view the values of tunables with detailed information :
# kctune -v acctresume
7. To change a tunable's value to the default :
# kctune nproc=Default
8. To change the value of a tunable :
# kctune nproc=3500
9. To view the list of module changes for next boot :
# kcmodule -D
10. To view the list of tunable changes for next boot :
# kctune -D
11. To view the list of module and tunable changes for next boot :
# kconfig -D
12. To view the list of module settings that are set to non-default :
# kcmodule -S
13. To view the list of tunable settings that are set to non-default :
# kctune -S
14. To view the list of module and tunable settings that are set to non-default :
# kconfig -S
15. To unhold all the module and tunable settings being held for next boot :
# kconfig -H
Points to remember :
Different states of kernel modules :
unused - This module is not used, but installed in the system.
static - This module will be statically bound to the kernel executable
loaded - This module will be dynamically bound to the kernel while booting
auto - The module will be dynamically loaded into the kernel when it is first needed after each boot.
NFS in HP-UX
There has been a vast difference between HP-UX 11i v3 with the older versions.Prior to v3, HP-UX used NFS concepts (commands and files) a like AIx. From v3, it following Solaris-like environment.
Configuration Files :
/etc/exports - Contains a list of exportable file systems. This file is available in upto HP-UX 11i v2
/etc/dfs/dfstab - Contains a list of sharable file systems. This file is available from HP-UX 11i v3
/etc/rc.config.d/nfsconf - NFS server configuration file contains the nfs, autofs and mountd daemons startup
Command :
1. To start NFS server daemons :
# /sbin/init.d/nfs.server start
2. To stop NFS server daemons :
# /sbin/init.d/nfs.server stop
3. To start NFS daemons on system boot,
Change the value of NFS_SERVER to "1" in /etc/rc.config.d/nfsconfig file.
For Ex,
NFS_SERVER=1
4. To export or share a file system :
# exportfs /data <--- Upto HP-UX 11i v2
# share /data <--- From HP-UX 11i v3
5. To unexport or unshaer a file system :
# exportfs -u /data <--- Upto HP-UX 11i v2
# unshare /data <--- From HP-UX 11i v3
6. To export or share all the filesystems defined in /etc/exports or /etc/dfs/dfstab :
# exportfs -a <--- Upto HP-UX 11i v2
# shareall <--- From HP-UX 11i v3
Configuration Files :
/etc/exports - Contains a list of exportable file systems. This file is available in upto HP-UX 11i v2
/etc/dfs/dfstab - Contains a list of sharable file systems. This file is available from HP-UX 11i v3
/etc/rc.config.d/nfsconf - NFS server configuration file contains the nfs, autofs and mountd daemons startup
Command :
1. To start NFS server daemons :
# /sbin/init.d/nfs.server start
2. To stop NFS server daemons :
# /sbin/init.d/nfs.server stop
3. To start NFS daemons on system boot,
Change the value of NFS_SERVER to "1" in /etc/rc.config.d/nfsconfig file.
For Ex,
NFS_SERVER=1
4. To export or share a file system :
# exportfs /data <--- Upto HP-UX 11i v2
# share /data <--- From HP-UX 11i v3
5. To unexport or unshaer a file system :
# exportfs -u /data <--- Upto HP-UX 11i v2
# unshare /data <--- From HP-UX 11i v3
6. To export or share all the filesystems defined in /etc/exports or /etc/dfs/dfstab :
# exportfs -a <--- Upto HP-UX 11i v2
# shareall <--- From HP-UX 11i v3
Network Configuration in HP-UX
Configuration File :
/etc/rc.config.d/netconf - Contains the hostname, ip address, default route
/etc/hosts - Contains the hsotname to IP address mapping
/etc/resolv.conf - Contains DNS server details
/etc/inetd.conf - Internet daemon configuration file
Configuration Files used for DNS Client:
/etc/nsswitch.compat
/etc/nsswitch.nis
/etc/nsswitch.ldap
/etc/nsswitch.conf
/etc/nsswitch.files
/etc/nsswitch.hp_defaults
Scripts :
/sbin/init.d/net start - To start network services
/sbin/init.d/net stop - To stop network services
Commands :
1. To set the hostname :
# set_parms hostname
2. To set primary ip address :
# set_parms ip_address
3. To set the default gateway, DNS/NIS server details :
# set_parms addl_netwrk
4. To restart inetd daemon :
# inetd -c
5. To display the ip address configuration details :
# netstat -i
6. To set the IP details of lan0 :
# ifconfig lan0
7. To display all the network adapters :
# lanscan
8. To display routing table :
# netstat -rn
9. To add a route :
# route add default 192.168.1.254 1
10. To enable a network interface :
# ifconfig lan0 up
11. To disable a network interface :
# ifconfig lan0 down
12. To change NIC settings like speed, duplex,..
# lanadmin
/etc/rc.config.d/netconf - Contains the hostname, ip address, default route
/etc/hosts - Contains the hsotname to IP address mapping
/etc/resolv.conf - Contains DNS server details
/etc/inetd.conf - Internet daemon configuration file
Configuration Files used for DNS Client:
/etc/nsswitch.compat
/etc/nsswitch.nis
/etc/nsswitch.ldap
/etc/nsswitch.conf
/etc/nsswitch.files
/etc/nsswitch.hp_defaults
Scripts :
/sbin/init.d/net start - To start network services
/sbin/init.d/net stop - To stop network services
Commands :
1. To set the hostname :
# set_parms hostname
2. To set primary ip address :
# set_parms ip_address
3. To set the default gateway, DNS/NIS server details :
# set_parms addl_netwrk
4. To restart inetd daemon :
# inetd -c
5. To display the ip address configuration details :
# netstat -i
6. To set the IP details of lan0 :
# ifconfig lan0
7. To display all the network adapters :
# lanscan
8. To display routing table :
# netstat -rn
9. To add a route :
# route add default 192.168.1.254 1
10. To enable a network interface :
# ifconfig lan0 up
11. To disable a network interface :
# ifconfig lan0 down
12. To change NIC settings like speed, duplex,..
# lanadmin
Thursday, December 9, 2010
Managing vPars in SuperDome 2
1. To start a vpar from MON> prompt,
MON> vparload -p vPar_name
2. To boot a vpar from command line,
# vparload -p vPar_name
3. To show vpar info from MO> prompt,
MON> vparinfo
4. To show vpar status from command prompt,
# vparstatus
Under Construction.
MON> vparload -p vPar_name
2. To boot a vpar from command line,
# vparload -p vPar_name
3. To show vpar info from MO> prompt,
MON> vparinfo
4. To show vpar status from command prompt,
# vparstatus
Under Construction.
Managing nPartitions in SuperDome 2
Following commands are to executed by logging (telnet/h) into Onboard Administrator's CLI.
1. To display all the blades and enclosures in a superdome 2 machine,
> parstatus
2. To display all the nPars,
> parstatus -P
3. To allow an operating system running in a npar to perform partition configuration operations on other partitions,
> parperm npar on 1
4. To create a nPar using blade 1/2 and IO bay 5/1,
> parcreate -P nPar0002 -a blade:1/2:::: -a io:5/1::
5. To create a nPar using blades 1 and 3 from enclosure 1 and IO lot in IOX enclosure 5, bay 1,
> parcreate -p nextPartition -a blade:1/1:::: -a blade:1/3:::: -a io:5/1:
6. To display the details on a specific nPar,
> parstatus –Vp1
or
> parstatus –Vp nPar0001
7. To remove a nPar,
> parremove -p 2
or
> parremove -p nPar0002
8. To rename a nPar,
> parmodify -p1 -PnPar0005
9. To add the blade in enclosure 1, slot 5 to the existing nPartition 1,
> parmodify -p 1 -a blade:1/5:base:y:ri:50%
10. To add I/O bay 2 in enclosure 3 to the existing nPartition3,
> parmodify -p 3 -a io:3/2:
11 To remove the blade in enclosure 1, slot 5 from nPartition 1,
> parmodify -p 1 -d blade:1/5
12. To remove I/O bay 2 in enclosure3 from nPartition3,
> parmodify -p 3 -d io:3/2
13. To power on nPar ID 1,
> poweron partition 1
Note: You can also use the legacy bo or pe command(menu based) to power on a nPartition.
14. To view the powr status of nPars,
> parstatus -P
15. To open the console of nPartition id 1,
> connect partition 1
Note: You can also use the legacy co command to get the console.
16.
1. To display all the blades and enclosures in a superdome 2 machine,
> parstatus
2. To display all the nPars,
> parstatus -P
3. To allow an operating system running in a npar to perform partition configuration operations on other partitions,
> parperm npar on 1
4. To create a nPar using blade 1/2 and IO bay 5/1,
> parcreate -P nPar0002 -a blade:1/2:::: -a io:5/1::
5. To create a nPar using blades 1 and 3 from enclosure 1 and IO lot in IOX enclosure 5, bay 1,
> parcreate -p nextPartition -a blade:1/1:::: -a blade:1/3:::: -a io:5/1:
6. To display the details on a specific nPar,
> parstatus –Vp1
or
> parstatus –Vp nPar0001
7. To remove a nPar,
> parremove -p 2
or
> parremove -p nPar0002
8. To rename a nPar,
> parmodify -p1 -PnPar0005
9. To add the blade in enclosure 1, slot 5 to the existing nPartition 1,
> parmodify -p 1 -a blade:1/5:base:y:ri:50%
10. To add I/O bay 2 in enclosure 3 to the existing nPartition3,
> parmodify -p 3 -a io:3/2:
11 To remove the blade in enclosure 1, slot 5 from nPartition 1,
> parmodify -p 1 -d blade:1/5
12. To remove I/O bay 2 in enclosure3 from nPartition3,
> parmodify -p 3 -d io:3/2
13. To power on nPar ID 1,
> poweron partition 1
Note: You can also use the legacy bo or pe command(menu based) to power on a nPartition.
14. To view the powr status of nPars,
> parstatus -P
15. To open the console of nPartition id 1,
> connect partition 1
Note: You can also use the legacy co command to get the console.
16.
Superdome OA - User Management commands
1. Add user,
ADD USER jack password
2. Disable User,
DISABLE USER jack
3. Enable User,
ENALE USER jack
4. Remove User,
REMOVE USER jack
5. Show History,
HISTORY
6. Set paword for the currently logged in user id,
SET PASSWORD
7. To set admin priviliage to an user,
SET USER ACCESS jack ADMINISTRATOR
ADD USER jack password
2. Disable User,
DISABLE USER jack
3. Enable User,
ENALE USER jack
4. Remove User,
REMOVE USER jack
5. Show History,
HISTORY
6. Set paword for the currently logged in user id,
SET PASSWORD
7. To set admin priviliage to an user,
SET USER ACCESS jack ADMINISTRATOR
HP BLADE MANAGEMENT COMMANDS
1. To open the console of a blade,
> CONNECT BLADE bay_number
2. To poweroff all the blades,
> POWEROFF BLADE ALL
3. To poweroff a specific blade,
> POWEROFF BLADE bay_number
4. To forcefully poweroff a specific blade,
> POWEROFF BLADE bay_number FORCE
5. To poweron all the blades,
> POWERON BLADE ALL
6. To poweron a specific blade,
> POWERON BLADE bay_number
7. To Reboot all the blades,
> REBOOT BLADE ALL
8. To Reboot a specific blade,
> REBOOT BLADE bay_number
9. To Forcefully Reboot a specific blade,
> REBOOT BLADE bay_number FORCE
10. To set hard disk as the bootdevice for the next boot of the blade,
> SET BLADE ONCE HDD bay_number
11. To set PXE (N/w) as the bootdevice for the next boot of the blade,
> SET BLADE ONCE PXE bay_number
12. To set hard disk as the bootdevice for he blade,
> SET BLADE ONCE HDD bay_number
13. To set PXE (N/w) as the bootdevice for the blade,
> SET BLADE ONCE PXE bay_number
14. To turn on/off the Blade UID LED,
> SET BLADE UID ALL ON
> SET BLADE UID bay_number OFF
15. To show the boot settings for a specific blade,
> SHOW BLADE BOOT bay_number
16. To show the blade information,
> SHOW BLADE INFO bay_number
17. To show the list of blades,
> SHOW BLADE LIST
18. To show the blade names,
> SHOW BLADE NAMES
19. To show the blade status of bay number 2,
> SHOW BLADE STATUS 2
20. To show the blade temperature of bay 2,
> SHOW BLADE TEMP 2
21. To show syslog of bay 2,
> SHOW SYSLOG BLADE 2
> CONNECT BLADE bay_number
2. To poweroff all the blades,
> POWEROFF BLADE ALL
3. To poweroff a specific blade,
> POWEROFF BLADE bay_number
4. To forcefully poweroff a specific blade,
> POWEROFF BLADE bay_number FORCE
5. To poweron all the blades,
> POWERON BLADE ALL
6. To poweron a specific blade,
> POWERON BLADE bay_number
7. To Reboot all the blades,
> REBOOT BLADE ALL
8. To Reboot a specific blade,
> REBOOT BLADE bay_number
9. To Forcefully Reboot a specific blade,
> REBOOT BLADE bay_number FORCE
10. To set hard disk as the bootdevice for the next boot of the blade,
> SET BLADE ONCE HDD bay_number
11. To set PXE (N/w) as the bootdevice for the next boot of the blade,
> SET BLADE ONCE PXE bay_number
12. To set hard disk as the bootdevice for he blade,
> SET BLADE ONCE HDD bay_number
13. To set PXE (N/w) as the bootdevice for the blade,
> SET BLADE ONCE PXE bay_number
14. To turn on/off the Blade UID LED,
> SET BLADE UID ALL ON
> SET BLADE UID bay_number OFF
15. To show the boot settings for a specific blade,
> SHOW BLADE BOOT bay_number
16. To show the blade information,
> SHOW BLADE INFO bay_number
17. To show the list of blades,
> SHOW BLADE LIST
18. To show the blade names,
> SHOW BLADE NAMES
19. To show the blade status of bay number 2,
> SHOW BLADE STATUS 2
20. To show the blade temperature of bay 2,
> SHOW BLADE TEMP 2
21. To show syslog of bay 2,
> SHOW SYSLOG BLADE 2
Thursday, August 5, 2010
Device Management
All the devices are communicated by HP-UX using their device files which are located under /dev directory. Basically each device will have 2 type of device file - block and character(raw) device files. Most of the devices and their device files are configured automatically during the system boot. At the time of boot, HP-UX probes all devices and executes /sbin/ioinit.rc script to create new device files if needed. If any device file is not created you can always create them manually using some commands.
How to list and identify various devices connected to your system ?
1. To show all the configured devices:
# ioscan -f
2. To list the available disk/CD Drives along with their device file details:
# ioscan -funC disk
3. To list the tape drives:
# ioscan -funC tape
4. To list the lan adapters:
# ioscan -funC lan
5. To show the details of a device file:
# lssf /dev/rmt/c2t0d0BEST
How to configure newly connected devices ?
To configured the recently connected tape drive:
# insf -C tape
Same way to configure newly connected CDrom or disk,
# insf -C disk
This is similar to devfsadm in solaris and cfgmgr in AIX. It will configure new devices but not the already configured devices.
How to create specific device file if you have accidentally deleted any of them ?
1. To create the device file for a CD-ROM which is attached to hardware path 0.2.0 :
# insf -H 0.2.0 -e
2. To create a raw (character) device file for a disk attached to hardware address 1.2.0 :
# mksf -H 1.2.0 -r
3. To create a block device file for a disk attached to hardware addres 1.2.0 :
# mksf -H 1.2.0 -b
4. To create raw device file for a device with major number 243 and minor number 0x040012 :
# mknod /dev/rmt/1m c 243 0x040012
5. To create block device file for a device with major number 243 and minor number 0x040012 :
# mknod /dev/rmt/1m b 243 0x040012
How to list and identify various devices connected to your system ?
1. To show all the configured devices:
# ioscan -f
2. To list the available disk/CD Drives along with their device file details:
# ioscan -funC disk
3. To list the tape drives:
# ioscan -funC tape
4. To list the lan adapters:
# ioscan -funC lan
5. To show the details of a device file:
# lssf /dev/rmt/c2t0d0BEST
How to configure newly connected devices ?
To configured the recently connected tape drive:
# insf -C tape
Same way to configure newly connected CDrom or disk,
# insf -C disk
This is similar to devfsadm in solaris and cfgmgr in AIX. It will configure new devices but not the already configured devices.
How to create specific device file if you have accidentally deleted any of them ?
1. To create the device file for a CD-ROM which is attached to hardware path 0.2.0 :
# insf -H 0.2.0 -e
2. To create a raw (character) device file for a disk attached to hardware address 1.2.0 :
# mksf -H 1.2.0 -r
3. To create a block device file for a disk attached to hardware addres 1.2.0 :
# mksf -H 1.2.0 -b
4. To create raw device file for a device with major number 243 and minor number 0x040012 :
# mknod /dev/rmt/1m c 243 0x040012
5. To create block device file for a device with major number 243 and minor number 0x040012 :
# mknod /dev/rmt/1m b 243 0x040012
Thursday, January 28, 2010
HP Service Guard Cluster
How to setup a Two-Node cluster:
1. Modify /etc/hosts on both the nodes to include stationary and heartbeat IP addresses.
2. Create volume groups, logical volumes, filesystems on the first node and then import on the second node
3. Configure /.rhosts & /etc/cmcluster/cmclnodelist on both the nodes
Example:
/.rhosts
node1 root
node2 root
/etc/cmcluster/cmclnodelist
node1 root
node2 root
4. Configure stationary and heartbeat IP addresses on both the nodes
a. Modify /etc/rc.config.d/netconf
b. /sbin/init.d/net stop
c. /sbin/init.d/net start
5. Modify /etc/lvmrc to disable auto-activation of volume groups
6. Create the cluster configuration file on the first node
# cmquerycl -v -C /etc/cmcluster/mycluster.conf -n node1 -n node2
7. Modify the configuration file include your needs
8. Verify the configuration file
# cmcheckconf -v -C /etc/clcluster/mycluster.conf
9. Create the cluster binary file and distribute to all the nodes across the cluster
# cmapplyconf -v -C /etc/clcluster/mycluster.conf
10. To view the cluster configuration
# cmviewcl -v
11. Start the cluster
# cmruncl -v
12. Halt the cluster
# cmhaltcl -v
13. You're done.
Execution sequence for starting a package :
1. Master control script
2. External pre-scripts
3. Volume Groups
4. File Systems
5. Package IPs
6. External Scripts
7. Services
Frequently used commands :
To start the entire cluster : # cmruncl –v
To stop the entire cluster : # cmhaltcl
To view the status of cluster : # cmviewcl
To view the cluster, node, package status : # cmviewcl -v
To start a node in the cluster : # cmrunnode -v nodename
To stop a node in the cluster : # cmhaltnode -f -v nodename
To see the configuration : # cmgetconf -C config_name
To start a package : # cmrunpkg pkg1
To start a package on a node : # cmrunpkg -n ndoename pkg1
To halt a package : # cmhaltpkg pkg1
Configuration Files :-
/etc/cmcluster/cmclnodelist – Contains the list of nodes in the cluster
/etc/cmcluster/cluster_config.ascii - cluster configuration file.
/etc/cmcluster/package_name/package_config.ascii - package configuration file
/etc/cmcluster/package_name/package.cntl - package control script
1. Modify /etc/hosts on both the nodes to include stationary and heartbeat IP addresses.
2. Create volume groups, logical volumes, filesystems on the first node and then import on the second node
3. Configure /.rhosts & /etc/cmcluster/cmclnodelist on both the nodes
Example:
/.rhosts
node1 root
node2 root
/etc/cmcluster/cmclnodelist
node1 root
node2 root
4. Configure stationary and heartbeat IP addresses on both the nodes
a. Modify /etc/rc.config.d/netconf
b. /sbin/init.d/net stop
c. /sbin/init.d/net start
5. Modify /etc/lvmrc to disable auto-activation of volume groups
6. Create the cluster configuration file on the first node
# cmquerycl -v -C /etc/cmcluster/mycluster.conf -n node1 -n node2
7. Modify the configuration file include your needs
8. Verify the configuration file
# cmcheckconf -v -C /etc/clcluster/mycluster.conf
9. Create the cluster binary file and distribute to all the nodes across the cluster
# cmapplyconf -v -C /etc/clcluster/mycluster.conf
10. To view the cluster configuration
# cmviewcl -v
11. Start the cluster
# cmruncl -v
12. Halt the cluster
# cmhaltcl -v
13. You're done.
Execution sequence for starting a package :
1. Master control script
2. External pre-scripts
3. Volume Groups
4. File Systems
5. Package IPs
6. External Scripts
7. Services
Frequently used commands :
To start the entire cluster : # cmruncl –v
To stop the entire cluster : # cmhaltcl
To view the status of cluster : # cmviewcl
To view the cluster, node, package status : # cmviewcl -v
To start a node in the cluster : # cmrunnode -v nodename
To stop a node in the cluster : # cmhaltnode -f -v nodename
To see the configuration : # cmgetconf -C config_name
To start a package : # cmrunpkg pkg1
To start a package on a node : # cmrunpkg -n ndoename pkg1
To halt a package : # cmhaltpkg pkg1
Configuration Files :-
/etc/cmcluster/cmclnodelist – Contains the list of nodes in the cluster
/etc/cmcluster/cluster_config.ascii - cluster configuration file.
/etc/cmcluster/package_name/package_config.ascii - package configuration file
/etc/cmcluster/package_name/package.cntl - package control script
Tuesday, January 5, 2010
LVM - Logical Volume
Naming Convention:
Logical Volume's can have a name of max. 255 chars.
It can be assigned by the admin or done by the system.
Default names of the form /dev/vgxx/lvoln (for block device) and /dev/vgxx/rlvoln (for raw device).
Few Points to remember :
1. A logical volume can be used for swap, dump, raw data or a file system.
Here are the mostly used commands for managing LV's :
To create a LV :
# lvcreate
To change the characteristics of a LV :
# lvchange
To display info about LVs :
# lvdisplay
To increase the size of a LV :
# lvextend
To decrease the size of a LV :
# lvreduce
To remove a LV :
# lvremove
To prepare a LV to be a root, primary swap or dump volume, updating the boot info on a boot PV :
# lvlnboot
To remove the link that makes a LV a root, primary swap or dump volume :
# lvrmboot
To split a mirrored LV into 2 LVs :
# lvsplit
To merge 2 LVs into 1 mirrored LV :
# lvmerge
To sync the mirrored copies of a mirrored LV :
# lvsync
Few Examples,
1. To display the properties of a LV :
# lvdisplay /dev/vg01/lvol8
2. To display the detailed properties of a LV :
# lvdisplay -v /dev/vg01/lvol8
3. To create a LV of size 100MB in vg01 :
# lvcreate -L 100 /dev/vg01
4. To create a LV named myvol in vg01 of size 100MB :
# lvcreate -n myvol -L 100 /dev/vg01
5. To extend the size of a LV to 200MB :
# lvextend -L 200 /dev/vg01/lvol8
6. To extend the size of a LV by 12 LE's from disk8 :
# lvextend -l 12 /dev/vg01/myvol /dev/disk/disk8
7. To extend the size of a LV to 120MB by taking space from disk8 :
# lvextend -L 120 /dev/vg01/myvol /dev/disk/disk8
8. To list out the processes using a LV :
# fuser -cu /dev/vg01/myvol
9. To add additional copy (mirror) for a LV :
# lvextend -m 1 /dev/vg01/myvol
10. To do the same as above but using a specific PV :
# lvextend -m 1 /dev/vg01/myvol /dev/disk/disk9
11. To remove the mirror copies from a LV :
# lvreduce -m 0 /dev/vg01/myvol
This will remove all the mirror copies. I mean only the original copy is left on the LV.
12. To do the same as above but mentioning a specific PV where to remove the copy :
# lvreduce -m 0 /dev/vg01/myvol /dev/disk/disk9
13. To rename a LV :
a. Rename both the block and raw device files of the LV :
# mv /dev/vg01/myvol /dev/vg01/newvol
# mv /dev/vg01/rmyvol /dev/vg01/rnewvol
b. Finally change the lv names in other config files like /etc/fstab
14. To remove a logical volume :
First of all make sure the LV is not in use.I mean if it got any file system, then unmount the file system.
Then remove the lv using the below command.
# lvremove /dev/vg01/myvol
Logical Volume's can have a name of max. 255 chars.
It can be assigned by the admin or done by the system.
Default names of the form /dev/vgxx/lvoln (for block device) and /dev/vgxx/rlvoln (for raw device).
Few Points to remember :
1. A logical volume can be used for swap, dump, raw data or a file system.
Here are the mostly used commands for managing LV's :
To create a LV :
# lvcreate
To change the characteristics of a LV :
# lvchange
To display info about LVs :
# lvdisplay
To increase the size of a LV :
# lvextend
To decrease the size of a LV :
# lvreduce
To remove a LV :
# lvremove
To prepare a LV to be a root, primary swap or dump volume, updating the boot info on a boot PV :
# lvlnboot
To remove the link that makes a LV a root, primary swap or dump volume :
# lvrmboot
To split a mirrored LV into 2 LVs :
# lvsplit
To merge 2 LVs into 1 mirrored LV :
# lvmerge
To sync the mirrored copies of a mirrored LV :
# lvsync
Few Examples,
1. To display the properties of a LV :
# lvdisplay /dev/vg01/lvol8
2. To display the detailed properties of a LV :
# lvdisplay -v /dev/vg01/lvol8
3. To create a LV of size 100MB in vg01 :
# lvcreate -L 100 /dev/vg01
4. To create a LV named myvol in vg01 of size 100MB :
# lvcreate -n myvol -L 100 /dev/vg01
5. To extend the size of a LV to 200MB :
# lvextend -L 200 /dev/vg01/lvol8
6. To extend the size of a LV by 12 LE's from disk8 :
# lvextend -l 12 /dev/vg01/myvol /dev/disk/disk8
7. To extend the size of a LV to 120MB by taking space from disk8 :
# lvextend -L 120 /dev/vg01/myvol /dev/disk/disk8
8. To list out the processes using a LV :
# fuser -cu /dev/vg01/myvol
9. To add additional copy (mirror) for a LV :
# lvextend -m 1 /dev/vg01/myvol
10. To do the same as above but using a specific PV :
# lvextend -m 1 /dev/vg01/myvol /dev/disk/disk9
11. To remove the mirror copies from a LV :
# lvreduce -m 0 /dev/vg01/myvol
This will remove all the mirror copies. I mean only the original copy is left on the LV.
12. To do the same as above but mentioning a specific PV where to remove the copy :
# lvreduce -m 0 /dev/vg01/myvol /dev/disk/disk9
13. To rename a LV :
a. Rename both the block and raw device files of the LV :
# mv /dev/vg01/myvol /dev/vg01/newvol
# mv /dev/vg01/rmyvol /dev/vg01/rnewvol
b. Finally change the lv names in other config files like /etc/fstab
14. To remove a logical volume :
First of all make sure the LV is not in use.I mean if it got any file system, then unmount the file system.
Then remove the lv using the below command.
# lvremove /dev/vg01/myvol
LVM - Physical Volume
Naming Convention:
Here is a set of examples for pv naming convention.
/dev/disk/disk1 - Persistent block device file for disk1
/dev/disk/disk1_p1 - Persistent block device file for partition 2 belonging to disk1
/dev/rdisk/disk1 - Persistent character/raw device file for disk1
/dev/rdisk/disk1 - Persistent character/raw device file for partition 2 belonging to disk1
/dev/dsk/c1t1d1 - Legacy block device file for disk1 located in target 1 of controller 1
/dev/dsk/c1t1d1s1 - Legacy block device file for the partition 1 belonging to the above disk
/dev/rdsk/c1t1d1 - Legacy character/raw device file for disk1 located in target 1 of controller 1
/dev/rdsk/c1t1d1s1 - Legacy character/raw device file for the partition 1 belonging to the above disk
Here are the mostly used commands for managing PV's :
To create a PV:
# pvcreate
To change the characteristics :
# pvchange
To display the info on PV :
# pvdisplay
To move data between PVs :
# pvmove
To remove a PV from LVM control :
# pvremove
To check or repair a PV :
# pvck
To check if a disk is under LVM control :
# lvmchk
Few Examples,
1. To initialize a disk for LVM [ To create a PV out of a disk] :
# pvcreate /dev/rdisk/disk12
2. To initialize a disk for LVM to use as a boot device :
# pvcreate -B /dev/rdisk/disk2_p2
3. To display the properties of a PV :
# pvdisplay /dev/disk/disk12
4. To display the detailed properties of a PV :
# pvdisplay -v /dev/disk/disk12
5. To move the data between PVs :
# pvmove /dev/disk/disk12:2 /dev/disk/disk13
Here is a set of examples for pv naming convention.
/dev/disk/disk1 - Persistent block device file for disk1
/dev/disk/disk1_p1 - Persistent block device file for partition 2 belonging to disk1
/dev/rdisk/disk1 - Persistent character/raw device file for disk1
/dev/rdisk/disk1 - Persistent character/raw device file for partition 2 belonging to disk1
/dev/dsk/c1t1d1 - Legacy block device file for disk1 located in target 1 of controller 1
/dev/dsk/c1t1d1s1 - Legacy block device file for the partition 1 belonging to the above disk
/dev/rdsk/c1t1d1 - Legacy character/raw device file for disk1 located in target 1 of controller 1
/dev/rdsk/c1t1d1s1 - Legacy character/raw device file for the partition 1 belonging to the above disk
Here are the mostly used commands for managing PV's :
To create a PV:
# pvcreate
To change the characteristics :
# pvchange
To display the info on PV :
# pvdisplay
To move data between PVs :
# pvmove
To remove a PV from LVM control :
# pvremove
To check or repair a PV :
# pvck
To check if a disk is under LVM control :
# lvmchk
Few Examples,
1. To initialize a disk for LVM [ To create a PV out of a disk] :
# pvcreate /dev/rdisk/disk12
2. To initialize a disk for LVM to use as a boot device :
# pvcreate -B /dev/rdisk/disk2_p2
3. To display the properties of a PV :
# pvdisplay /dev/disk/disk12
4. To display the detailed properties of a PV :
# pvdisplay -v /dev/disk/disk12
5. To move the data between PVs :
# pvmove /dev/disk/disk12:2 /dev/disk/disk13
LVM - Physical Extent
Few Points to remember :
1. Default size of PE is 4MB
It can take a value from 1 MB to 256 MB.
2. PE size can be set when you create the volume group.
If you want to change it the only way is to recreate the VG with a newer PE value.
1. Default size of PE is 4MB
It can take a value from 1 MB to 256 MB.
2. PE size can be set when you create the volume group.
If you want to change it the only way is to recreate the VG with a newer PE value.
LVM - Volume Group
Naming Convention:
Volume group's name is unique and can have a max. 255 chars.
Default names of the form /dev/vgxx
Few Points to remember :
1. Max VGs per system can be changed thru the kernel tunable 'maxvgs'.
Minimum value is 0
Default Value is 16
Maximum value is 256
This tunable has been removed in version 11.31.
2. A Volume group can contain minimum 1 PV and maximum 255 PVs.
3. A VG can contain maximum 255 LVs.
Here is the list of mostly used commands for managing VG's :
To create a volume group :
# vgcreate
To remove a volume group :
# vgremove
To activate, deactivate, change the chars of a VG :
# vgchange
To modify the config parameters of a VG :
# vgmodify
To backup the VG config details :
# vgcfgbackup
To restore the VG config details from a config file :
# vgcfgrestore
To display the info for all or a particular VG :
# vgdisplay
To export a VG and its associated LVs:
# vgexport
To import a VG into the system as well as adding an existing VG into /etc/lvmtab :
# vgimport
To scan all PV s looking for LVs and VGs :
# vgscan
To add a PV to a VG :
# vgextent
To remove a PV from a VG :
# vgreduce
To sync all the mirrored LVs in a VG :
# vgsync
To modify the VGID on a PV :
# vgchgid
To migrate a VG from legacy to persistent device files :
# vgdsf
Here are few Examples,
1. To create a volume group :
a. Create a directory under /dev,
# mkdir /dev/vg01
b. Create a group device file
# mknod /dev/vg01/group c 64 0xnn0000
where
c -> to mention group is a character device file
64 -> is the major number for the group file. It should be always 64
0xnn0000 -> is the monir number for the group file in hexadecimal and nn is the unique vg number
c. Finally create the vg using a pv
# vgcreate /dev/vgname /dev/disk/disk12
2. To display all the volume groups :
# vgdisplay
3. To display the properties of a volume group :
# vgdisplay vg00
4. To display the detailed properties of a volume group :
# vgdisplay -v vg00
5. To add a PV to a VG :
# vgextend /dev/vg01 /dev/disk/disk13
6. To remove a PV from a VG :
# vgreduce /dev/vg01 /dev/disk/disk13
Before executing this command, make sure the PV disk13 doesnot hold any LV.
Otherwise vgreduce command wont work.
7. To deactivate a VG :
# vgchange -a n vg01
8. To activate a VG :
# vgchange -a y vg01
9. To export a VG :
# vgexport -s -v -m /tmp/vg01.map vg01
where /tmp/vg01.map is the map file whicj will hold PE-LE mappings and other config details.
10. To import a VG :
You need to create the VG dir and the group device file as like in the VG creation process.
Then you can import the VG using the below command,
# vgimport -s -v -N -m /tmp/vg01.map /dev/vg01
11. To change the "Max PV" attribtue to 255 for a VG :
# vgchange -a n vg01
# vgmodify -p 255 -n vg01
# vgchange -a y vg01
12. To change the "Max PE per PV" attribtue to 8128 for a VG :
# vgchange -a n vg01
# vgmodify -e 8128 -n vg01
# vgchange -a y vg01
13. To hold the write operation on a VG for 400 secs :
# vgchange -Q w -t 400 vg01
This operation is called as quiescing a VG.
14. To hold both read and write operation on a VG untill it is explicitly resumed :
# vgchange -Q rw vg01
15. To resume a quiesced VG :
# vgchange -R vg01
16. To rename a VG :
a. Deactivate the VG :
# vgchange -a n vg01
b. Find out the minor number of the Vg's group file :
# ls -l /dev/vg01/group
c. Export the VG :
# vgexport -m /tmp/vg01.map vg01
d. Create the vg dir in the new name and create its group file with the same minor number
# mkdir /dev/dbvg
# mknod /dev/dbvg/group c 64 0x010000
e. Import the VG
# vgimport -m /tmp/vg01.map /dev/dbvg
f. Backup the VG config info :
# vgcfgbackup /dev/dbvg
g. Activate the VG :
# vgchange -a y /dev/dbvg
h. Remove the saved conf information file for the old vg name :
# rm /etc/lvmconf/vg01.conf
i. Modify all the references in other config files like /etc/fstab
Volume group's name is unique and can have a max. 255 chars.
Default names of the form /dev/vgxx
Few Points to remember :
1. Max VGs per system can be changed thru the kernel tunable 'maxvgs'.
Minimum value is 0
Default Value is 16
Maximum value is 256
This tunable has been removed in version 11.31.
2. A Volume group can contain minimum 1 PV and maximum 255 PVs.
3. A VG can contain maximum 255 LVs.
Here is the list of mostly used commands for managing VG's :
To create a volume group :
# vgcreate
To remove a volume group :
# vgremove
To activate, deactivate, change the chars of a VG :
# vgchange
To modify the config parameters of a VG :
# vgmodify
To backup the VG config details :
# vgcfgbackup
To restore the VG config details from a config file :
# vgcfgrestore
To display the info for all or a particular VG :
# vgdisplay
To export a VG and its associated LVs:
# vgexport
To import a VG into the system as well as adding an existing VG into /etc/lvmtab :
# vgimport
To scan all PV s looking for LVs and VGs :
# vgscan
To add a PV to a VG :
# vgextent
To remove a PV from a VG :
# vgreduce
To sync all the mirrored LVs in a VG :
# vgsync
To modify the VGID on a PV :
# vgchgid
To migrate a VG from legacy to persistent device files :
# vgdsf
Here are few Examples,
1. To create a volume group :
a. Create a directory under /dev,
# mkdir /dev/vg01
b. Create a group device file
# mknod /dev/vg01/group c 64 0xnn0000
where
c -> to mention group is a character device file
64 -> is the major number for the group file. It should be always 64
0xnn0000 -> is the monir number for the group file in hexadecimal and nn is the unique vg number
c. Finally create the vg using a pv
# vgcreate /dev/vgname /dev/disk/disk12
2. To display all the volume groups :
# vgdisplay
3. To display the properties of a volume group :
# vgdisplay vg00
4. To display the detailed properties of a volume group :
# vgdisplay -v vg00
5. To add a PV to a VG :
# vgextend /dev/vg01 /dev/disk/disk13
6. To remove a PV from a VG :
# vgreduce /dev/vg01 /dev/disk/disk13
Before executing this command, make sure the PV disk13 doesnot hold any LV.
Otherwise vgreduce command wont work.
7. To deactivate a VG :
# vgchange -a n vg01
8. To activate a VG :
# vgchange -a y vg01
9. To export a VG :
# vgexport -s -v -m /tmp/vg01.map vg01
where /tmp/vg01.map is the map file whicj will hold PE-LE mappings and other config details.
10. To import a VG :
You need to create the VG dir and the group device file as like in the VG creation process.
Then you can import the VG using the below command,
# vgimport -s -v -N -m /tmp/vg01.map /dev/vg01
11. To change the "Max PV" attribtue to 255 for a VG :
# vgchange -a n vg01
# vgmodify -p 255 -n vg01
# vgchange -a y vg01
12. To change the "Max PE per PV" attribtue to 8128 for a VG :
# vgchange -a n vg01
# vgmodify -e 8128 -n vg01
# vgchange -a y vg01
13. To hold the write operation on a VG for 400 secs :
# vgchange -Q w -t 400 vg01
This operation is called as quiescing a VG.
14. To hold both read and write operation on a VG untill it is explicitly resumed :
# vgchange -Q rw vg01
15. To resume a quiesced VG :
# vgchange -R vg01
16. To rename a VG :
a. Deactivate the VG :
# vgchange -a n vg01
b. Find out the minor number of the Vg's group file :
# ls -l /dev/vg01/group
c. Export the VG :
# vgexport -m /tmp/vg01.map vg01
d. Create the vg dir in the new name and create its group file with the same minor number
# mkdir /dev/dbvg
# mknod /dev/dbvg/group c 64 0x010000
e. Import the VG
# vgimport -m /tmp/vg01.map /dev/dbvg
f. Backup the VG config info :
# vgcfgbackup /dev/dbvg
g. Activate the VG :
# vgchange -a y /dev/dbvg
h. Remove the saved conf information file for the old vg name :
# rm /etc/lvmconf/vg01.conf
i. Modify all the references in other config files like /etc/fstab
Friday, December 18, 2009
Software & Patch Management in HP-UX - Part 2
Points to remember :
1. Patch names always start with the characters PH.
2. Next 2 characters show the patch type.
Here are the types ...
a. Command Patches - CO
b. Kernel Patches - KL
c. Network Patches - NE
d. Subsystem Patches - SS
3. After this, there is an underscore and a 4 or 5 digit patch number
4. You have to reboot the system after the kernel patch installation.
Few Examples,
PHSS_14526
PHCO_16253
PHKL_16542
How to download the patches ?
1. You can download the patches from the the below ftp server
ftp://us-ffs.external.hp.com/hp-ux_patches
Or you can order a patch cd-rom from HP
2. HP-UX patches are distributed as shar files. So after thhe download, you have to use 'sh' command to unshar it to get 2 files with extensions .text and .depot.
3. The .text file is the patch description file which contains
a. Patch name, description
b. Date of creation and general availalibity
c. Hardware Platforms
d. Automatic Reboot : To findout whether the system will be reooted after the patch installation
e. Status : Shows whether it is a general or special release
f. a lot more
4. The .depot file the actual patch file.
How to list the applied patches ?
To show all the applied patches :
#swlist -l patch
To show all categories of available patches that includes category objects in their definition :
# swlist -l category
How to copy the patches to the software depot ?
To copy the patches to the software depot :
# swcopy -a PHKL_14235.depot PHKL_14235 @ /var/spool/sw
How to install the patches ?
You can install patches using swinstall command using the same way like we isntall the regular softwares.
How to remove the patches ?
To remove the applied patches :
# swremove -d PHCO_45879
To remove the patches located in a software depot in a remote machine :
# swremove -d PHKL_45879 @ server1:/depots/
Software Depot Management :
To register a software depot :
# swreg -l depot /depot/hp-ux11i-v3/
To unregister a software depot :
# swreg -u -l depot /depot/hp-ux11i-v3/
1. Patch names always start with the characters PH.
2. Next 2 characters show the patch type.
Here are the types ...
a. Command Patches - CO
b. Kernel Patches - KL
c. Network Patches - NE
d. Subsystem Patches - SS
3. After this, there is an underscore and a 4 or 5 digit patch number
4. You have to reboot the system after the kernel patch installation.
Few Examples,
PHSS_14526
PHCO_16253
PHKL_16542
How to download the patches ?
1. You can download the patches from the the below ftp server
ftp://us-ffs.external.hp.com/hp-ux_patches
Or you can order a patch cd-rom from HP
2. HP-UX patches are distributed as shar files. So after thhe download, you have to use 'sh' command to unshar it to get 2 files with extensions .text and .depot.
3. The .text file is the patch description file which contains
a. Patch name, description
b. Date of creation and general availalibity
c. Hardware Platforms
d. Automatic Reboot : To findout whether the system will be reooted after the patch installation
e. Status : Shows whether it is a general or special release
f. a lot more
4. The .depot file the actual patch file.
How to list the applied patches ?
To show all the applied patches :
#swlist -l patch
To show all categories of available patches that includes category objects in their definition :
# swlist -l category
How to copy the patches to the software depot ?
To copy the patches to the software depot :
# swcopy -a PHKL_14235.depot PHKL_14235 @ /var/spool/sw
How to install the patches ?
You can install patches using swinstall command using the same way like we isntall the regular softwares.
How to remove the patches ?
To remove the applied patches :
# swremove -d PHCO_45879
To remove the patches located in a software depot in a remote machine :
# swremove -d PHKL_45879 @ server1:/depots/
Software Depot Management :
To register a software depot :
# swreg -l depot /depot/hp-ux11i-v3/
To unregister a software depot :
# swreg -u -l depot /depot/hp-ux11i-v3/
Software & Patch Management in HP-UX - Part 1
Software and patch management in HP-UX is done using HP Software Distributor called SD-UX. This is a set of commads, utilities, also the definitions of software packages, bundles. It got a several set of commands for the installation, removal, listing and the verification of softwares and patches. You can even setup a server as a central software server so that client HP-UX machines can do software installtion thru the network.
Few Common Terms in SD-UX :
Fileset:
It is the smalled installable software unit. It consists of files and control scripts. It can belong to only 1 product, but can be included multiple subproducts and bundles.
Here is an example: Keyshell.KEYS-END-A-MAN B.11.30
where
1st field is the fileset name
2nd field is the fileset version
Sub-Product:
Subproduct is nothing but the logically related filesets.
Here is an example:
X11.MessagesByLang X11 Localized Messages
This subproduct contains the filesets for X11 messages in several languages.
Product:
It is nothing but a set of filesets. In another words, it is a superset of filesets / subproducts.
Here is an example ,
X11 B.11.30 HP-UX X Windows Software
where
X11 is the product name
B.11.30 is the product version
third field is the product description
Bundle:
It contains filesets that may belong to different products. Bundles are usually packaged by HP for the software distribution.
Here is an example,
OnlineDiag B.11.20.06 HP-UX 11.0 Support Tools Bundle
Software Depot:
It is the place where filesets, products and bundles are kept. It can be a directory or cd-rom or tape. By default, the software depot is /var/spool/sw. You can also maintain software depot on a central server for the installtion over the network. You can have multiple software depots in a server for different purposes or applications. You can add new softwares to the depot and install them whenever required.
Points to remember:
1. SD-UX keeps stores all the information about the installed software and catalog files for software in depots in a database called Installed Product Database (IPD).
2. SD-UX commands create, modify the IPD and cataog files.
3. IPD is located in /var/adm/sw/products.
What is Protected Software and How to install it ?
HP provides certain software in protected mode. HP will provide you the codeword and your customer id for installing that software. codeword is based on the customer id, product id and the part number of the software storage medium.
You need to mention the customer id and codeword for the firsttime you install the software. At that time, the codeword gets stored in /var/adm/sw/.codewords file. After this, you dont have to mention the codeword for installing that software (from that particular cd-rom media) in that machine.
Software Agent Daemon :
Software installtion is controlled by the daemon called "swagentd". You need to have this daemon running for the installation of the software in HP-UX.
Whenever you execute swinstall command, it contacts the swagentd daemon which starts a software agent called swagent. If the installation over the network, the local swagentd daemon contacts the daemon running on the other machine.
This daemon gets started at runlevel 2. Hence its not possible to install the software in single-user or maintenance mode. If you need to install software in single-user mde, first you have to manually start this daemon.
To start swagentd :
# /sbin/init.d/swagentd start
To stop swagentd :
# /sbin/init.d/swagentd stop
How to list the softwares ?
To list the installed bundles :
# swlist -l bundle
To list the installed products :
# swlist -l product
To list the installed subproducts :
# swlist -l subproduct
To list the installed filesets alone :
# swlist -l fileset
To list the softwares in depot /var/spool/sw :
# swlist -d @ /var/spool/sw
To list the softwares in depot /var/spool/sw located in a remote server :
# swlist -d @ server1:/var/spool/sw
To list all the files belonging to the product X11 :
# swlist -l file X11
To list softwares in a tape drive :
# swlist -d @ /dev/rmt/0m
To list softwares available in a cd-rom drive :
# swlist -d @ /SD_CDROM
To open swlist in GUI mode :
# swlist -i
To open swlist in GUI mode for software depot :
# swlist -i -d
To view the readme file for a product :
# swlist -a readme OS-Core
To show whether software available on cd-rom requrie a codeword or not :
# swlist -d -a is_protected @ /SD_CDROM
How to install software ?
You can use swinstall command to install the softwares available in the cd-rom, tape, local software depot or software depot on a remote server. All the activities of swinstall command are logged in the /var/adm/sw/swinstall.log file.
To install software from a local tape drive :
# swinstall -s /dev/rmt/0m
To install software from a local cd-rom drive :
# swinstall -s /SD_CDROM
Note: If you're using HP-UX 11.2 and earlier versions, you have to mount the cd-rom on /SD_CDROM before using the above command.
How to remove the installed softwares ?
You can use swremove command to remove the installed softwares. All the activities of swremove command are logged in the /var/adm/sw/swremove.log file.
How to verify the installed softwares ?
You can use swverify command to verify the consistency of the software installed in the system or in the software depot. All the activities of swremove command are logged in the /var/adm/sw/swremove.log file.
How to manage softwares in the software depot ?
To copy softwares from a tape to the default depot :
# swcopy -s /dev/rmt/0m @ /var/spool/sw
To copy softwares from a cd-rom drive to the default depot :
# swcopy -s /SD_CDROM @ /var/spool/sw
To remove softwares from a depot :
# swremove -d * @ /var/spool/sw
To list softwares in a depot :
# swlist -d @ /var/spool/sw
We will look at the patch management in the next part.
Few Common Terms in SD-UX :
Fileset:
It is the smalled installable software unit. It consists of files and control scripts. It can belong to only 1 product, but can be included multiple subproducts and bundles.
Here is an example: Keyshell.KEYS-END-A-MAN B.11.30
where
1st field is the fileset name
2nd field is the fileset version
Sub-Product:
Subproduct is nothing but the logically related filesets.
Here is an example:
X11.MessagesByLang X11 Localized Messages
This subproduct contains the filesets for X11 messages in several languages.
Product:
It is nothing but a set of filesets. In another words, it is a superset of filesets / subproducts.
Here is an example ,
X11 B.11.30 HP-UX X Windows Software
where
X11 is the product name
B.11.30 is the product version
third field is the product description
Bundle:
It contains filesets that may belong to different products. Bundles are usually packaged by HP for the software distribution.
Here is an example,
OnlineDiag B.11.20.06 HP-UX 11.0 Support Tools Bundle
Software Depot:
It is the place where filesets, products and bundles are kept. It can be a directory or cd-rom or tape. By default, the software depot is /var/spool/sw. You can also maintain software depot on a central server for the installtion over the network. You can have multiple software depots in a server for different purposes or applications. You can add new softwares to the depot and install them whenever required.
Points to remember:
1. SD-UX keeps stores all the information about the installed software and catalog files for software in depots in a database called Installed Product Database (IPD).
2. SD-UX commands create, modify the IPD and cataog files.
3. IPD is located in /var/adm/sw/products.
What is Protected Software and How to install it ?
HP provides certain software in protected mode. HP will provide you the codeword and your customer id for installing that software. codeword is based on the customer id, product id and the part number of the software storage medium.
You need to mention the customer id and codeword for the firsttime you install the software. At that time, the codeword gets stored in /var/adm/sw/.codewords file. After this, you dont have to mention the codeword for installing that software (from that particular cd-rom media) in that machine.
Software Agent Daemon :
Software installtion is controlled by the daemon called "swagentd". You need to have this daemon running for the installation of the software in HP-UX.
Whenever you execute swinstall command, it contacts the swagentd daemon which starts a software agent called swagent. If the installation over the network, the local swagentd daemon contacts the daemon running on the other machine.
This daemon gets started at runlevel 2. Hence its not possible to install the software in single-user or maintenance mode. If you need to install software in single-user mde, first you have to manually start this daemon.
To start swagentd :
# /sbin/init.d/swagentd start
To stop swagentd :
# /sbin/init.d/swagentd stop
How to list the softwares ?
To list the installed bundles :
# swlist -l bundle
To list the installed products :
# swlist -l product
To list the installed subproducts :
# swlist -l subproduct
To list the installed filesets alone :
# swlist -l fileset
To list the softwares in depot /var/spool/sw :
# swlist -d @ /var/spool/sw
To list the softwares in depot /var/spool/sw located in a remote server :
# swlist -d @ server1:/var/spool/sw
To list all the files belonging to the product X11 :
# swlist -l file X11
To list softwares in a tape drive :
# swlist -d @ /dev/rmt/0m
To list softwares available in a cd-rom drive :
# swlist -d @ /SD_CDROM
To open swlist in GUI mode :
# swlist -i
To open swlist in GUI mode for software depot :
# swlist -i -d
To view the readme file for a product :
# swlist -a readme OS-Core
To show whether software available on cd-rom requrie a codeword or not :
# swlist -d -a is_protected @ /SD_CDROM
How to install software ?
You can use swinstall command to install the softwares available in the cd-rom, tape, local software depot or software depot on a remote server. All the activities of swinstall command are logged in the /var/adm/sw/swinstall.log file.
To install software from a local tape drive :
# swinstall -s /dev/rmt/0m
To install software from a local cd-rom drive :
# swinstall -s /SD_CDROM
Note: If you're using HP-UX 11.2 and earlier versions, you have to mount the cd-rom on /SD_CDROM before using the above command.
How to remove the installed softwares ?
You can use swremove command to remove the installed softwares. All the activities of swremove command are logged in the /var/adm/sw/swremove.log file.
How to verify the installed softwares ?
You can use swverify command to verify the consistency of the software installed in the system or in the software depot. All the activities of swremove command are logged in the /var/adm/sw/swremove.log file.
How to manage softwares in the software depot ?
To copy softwares from a tape to the default depot :
# swcopy -s /dev/rmt/0m @ /var/spool/sw
To copy softwares from a cd-rom drive to the default depot :
# swcopy -s /SD_CDROM @ /var/spool/sw
To remove softwares from a depot :
# swremove -d * @ /var/spool/sw
To list softwares in a depot :
# swlist -d @ /var/spool/sw
We will look at the patch management in the next part.
Thursday, December 17, 2009
Startup and Shutdown of HP-UX
Here we are going to take a look at the boot sequence of HP-UX.
It is basically divided into 2 main parts,
a. Boot PROM Startup - Same like other systems
b. HP-UX Startup - Included ISL, SSL (hpux), kernel (/stand/vmunix), swapper, init and /etc/inittab
Here is the boot sequence given in steps ,
1. Power On the system or Reboot the System
2. Processor Dependent Code
- PDC gets executed and it performs the initial self-test include processor, memory and also detects
peripherals attached to the system.
- If auto boot is disabled, it displays a menu list, something like smsin aix, bios in your pc.
3. PDC initializes the console to display boot messages and any errors. Then it looks for the primary boot path.
Note: boot path is nothing but the hardware path to the bood disk
4. Initial System Loader from the boot dick gets loaded into the memory and executed by PDC
5. Secondary System Loader 'hpux' gets loaded into the memory by the ISL. "hpux" is stored in the boot sector of the boot disk.
6. SSL hpux loads the kernel "/stand/vmunix" into the memory and from here kernel takes over the control.
7. Kernel then loads the device drivers and starts the process "swapper"
8. Swapper process (PID = 0) then intiates a shell process to execute commands from /sbin/pre_init_rc
9. Finally kernel loads the system's first process called "init". Hence init pid is always 1.
10. The init process processes the /etc/inittab file and runs the startup scripts to start other daemons and processes based on the default run level set. This will take the system to the default run level and from now on users can login to the system.
Few Points:
Stable Storage:
Primary / alternate boot paths, console, autoboot mode, autosearch values are stored in the stable storage. This information is used by the PDC. To change any of these values, you can use "configure" command.
Few PDC commands:
1. To boot in single-user mode for maintenance purpose :
> boot pri -is
Few ISL Commands:
1. To boot in single-user mode :
ISL > hpux -is
2. To boot from alternate kernel :
ISL > hpux /stand/vmunix.old
3. To boot in single-user mode using an alternate kernel :
ISL > hpux -is /stand/vmunix.old
4. To display the version of hpux utility :
ISL > hpux -v
5. To display the files in the /stand directory (mostly used to find the alternate kernel file name) :
ISL > hpux ll /stand
Contents of Boot Area:
Boot disk contains a boot area and a root partition plus swap space and other file systems.
Boot area contains the below stuff :
a. An LIF volume header that indentifies the LIF volume
b. A file containing a HP-UX volume name
c. A directory that contains a list of files contained in this area
d. Initial System Loader (ISL)
e. A secondary System Loader (hpux)
f. A file named AUTO - Contains the hpux utility name and any arguments to be passed onto hpux.
To list the contents of the boot area:
# lifls -l /dev/dsk/c0t0d0
where cotod0 is the boot disk ie., controller 0, target 0, disk 0
Few Boot list commands :
1. To view the current primary, alternate bootpaths, autoboot and autosearch :
# setboot
2. What is the command to install files in the LIF area :
# mkboot
3. What is the command to delete files in the LIF area :
# rmboot
Available Run Levels:
0 - Terminates all the processes by going to the lower run levels and finally shuts down the system
s - Single User Mode. Only one physical console can be used. Only the root file system is mounted. Only the processes (daemons) those having keyword sysinit in the /etc/inittab are started and any other daemon started by the kernel.
S - It is functionally same as ‘s’ with the exception that the current terminal will be considered as console (virtual).
1 - It is above run level ‘s’. The system is dedicated to one user but all the file systems are mounted, with a process known as ‘syncer’ running.
2 - Multiuser run level with no NFS
3 - Functionally same as “2”, with Network daemons, NFS, Web-base administration, graphical presentation managers running.
4 - Currently not available. You can customize this as per your environment.
5 - Currently not available. You can customize this as per your environment.
6 - Currently not available. You can customize this as per your environment.
You can use 'init' command to change the run level.
For Ex., to goto run level 3 from single-user mode
# init 3
Few Commands:
1. To display the current run level :
# who -r
2. To immediately shutdown a system with no interactive response :
# shutdown -h -y 0
Note: You can use "reboot" command if you're running in a single user mode. It normally kills all the daemons instead of gracefull terminating them. So its not recommended in multi-user mode.
3. To shutdown a system with no interative response after 60 seconds :
# shutdown -h -y 60
4. To shutdown a system immediately and to reboot :
# shutdown -r -y 0
5. How to view the shutdown and reboot times for the system :
# cat /etc/shutdown.log
6. How to allow an user called joe from a remote machine (workstation1) to shutdown the system server1 :
Just add the below lines to /etc/shuwdown.allow
workstation joe
For Ex., # echo "workstation joe" >> /etc/shutdown.allow
7. To shutdown a server to a single user mode :
# shutdown
Last but not least, you must obtain approval from the business before shutting down a server. If not, just get ready to face the music.
It is basically divided into 2 main parts,
a. Boot PROM Startup - Same like other systems
b. HP-UX Startup - Included ISL, SSL (hpux), kernel (/stand/vmunix), swapper, init and /etc/inittab
Here is the boot sequence given in steps ,
1. Power On the system or Reboot the System
2. Processor Dependent Code
- PDC gets executed and it performs the initial self-test include processor, memory and also detects
peripherals attached to the system.
- If auto boot is disabled, it displays a menu list, something like smsin aix, bios in your pc.
3. PDC initializes the console to display boot messages and any errors. Then it looks for the primary boot path.
Note: boot path is nothing but the hardware path to the bood disk
4. Initial System Loader from the boot dick gets loaded into the memory and executed by PDC
5. Secondary System Loader 'hpux' gets loaded into the memory by the ISL. "hpux" is stored in the boot sector of the boot disk.
6. SSL hpux loads the kernel "/stand/vmunix" into the memory and from here kernel takes over the control.
7. Kernel then loads the device drivers and starts the process "swapper"
8. Swapper process (PID = 0) then intiates a shell process to execute commands from /sbin/pre_init_rc
9. Finally kernel loads the system's first process called "init". Hence init pid is always 1.
10. The init process processes the /etc/inittab file and runs the startup scripts to start other daemons and processes based on the default run level set. This will take the system to the default run level and from now on users can login to the system.
Few Points:
Stable Storage:
Primary / alternate boot paths, console, autoboot mode, autosearch values are stored in the stable storage. This information is used by the PDC. To change any of these values, you can use "configure" command.
Few PDC commands:
1. To boot in single-user mode for maintenance purpose :
> boot pri -is
Few ISL Commands:
1. To boot in single-user mode :
ISL > hpux -is
2. To boot from alternate kernel :
ISL > hpux /stand/vmunix.old
3. To boot in single-user mode using an alternate kernel :
ISL > hpux -is /stand/vmunix.old
4. To display the version of hpux utility :
ISL > hpux -v
5. To display the files in the /stand directory (mostly used to find the alternate kernel file name) :
ISL > hpux ll /stand
Contents of Boot Area:
Boot disk contains a boot area and a root partition plus swap space and other file systems.
Boot area contains the below stuff :
a. An LIF volume header that indentifies the LIF volume
b. A file containing a HP-UX volume name
c. A directory that contains a list of files contained in this area
d. Initial System Loader (ISL)
e. A secondary System Loader (hpux)
f. A file named AUTO - Contains the hpux utility name and any arguments to be passed onto hpux.
To list the contents of the boot area:
# lifls -l /dev/dsk/c0t0d0
where cotod0 is the boot disk ie., controller 0, target 0, disk 0
Few Boot list commands :
1. To view the current primary, alternate bootpaths, autoboot and autosearch :
# setboot
2. What is the command to install files in the LIF area :
# mkboot
3. What is the command to delete files in the LIF area :
# rmboot
Available Run Levels:
0 - Terminates all the processes by going to the lower run levels and finally shuts down the system
s - Single User Mode. Only one physical console can be used. Only the root file system is mounted. Only the processes (daemons) those having keyword sysinit in the /etc/inittab are started and any other daemon started by the kernel.
S - It is functionally same as ‘s’ with the exception that the current terminal will be considered as console (virtual).
1 - It is above run level ‘s’. The system is dedicated to one user but all the file systems are mounted, with a process known as ‘syncer’ running.
2 - Multiuser run level with no NFS
3 - Functionally same as “2”, with Network daemons, NFS, Web-base administration, graphical presentation managers running.
4 - Currently not available. You can customize this as per your environment.
5 - Currently not available. You can customize this as per your environment.
6 - Currently not available. You can customize this as per your environment.
You can use 'init' command to change the run level.
For Ex., to goto run level 3 from single-user mode
# init 3
Few Commands:
1. To display the current run level :
# who -r
2. To immediately shutdown a system with no interactive response :
# shutdown -h -y 0
Note: You can use "reboot" command if you're running in a single user mode. It normally kills all the daemons instead of gracefull terminating them. So its not recommended in multi-user mode.
3. To shutdown a system with no interative response after 60 seconds :
# shutdown -h -y 60
4. To shutdown a system immediately and to reboot :
# shutdown -r -y 0
5. How to view the shutdown and reboot times for the system :
# cat /etc/shutdown.log
6. How to allow an user called joe from a remote machine (workstation1) to shutdown the system server1 :
Just add the below lines to /etc/shuwdown.allow
workstation joe
For Ex., # echo "workstation joe" >> /etc/shutdown.allow
7. To shutdown a server to a single user mode :
# shutdown
Last but not least, you must obtain approval from the business before shutting down a server. If not, just get ready to face the music.
Swap Space Management
Types of Swap Space :
1. Device Swap Space :
An entire disk or a partition in a disk or a logical volume in a volume group can be used as swap space. This type is called as device swap.
2. File System Swap Space:
You can allocate a specific amount of space in an existing file system. This will create a directory called paging on that file system. This type of swap space can coexist with the files in the file system. This type is called as file system swap space.
Daemon used to manage memory and swap :
a. swapper
b. vhand
Swap Space Priority:
a. There are priority levels from number 0 to 10.
b. Number 0 is the highest and 10 is the lowest level of priority.
c. When the highest priority swap space is full, then the next level swap will be used.
d. If 2 or more swap spaces have the same priority, then the round robin mechanism will be used.
e. If the disk and file system swaps have the same priority, then the disk swap will get the preference.
Let us now look the way to create the swap space,
To create swap space in an entire disk :
# swapon /dev/dsk/c1t2d4
To create swap space in a logical volume :
# swapon /dev/vg01/lvol1
To create swap space in an entire disk with a priority of 2 :
# swapon -p 2 /dev/dsk/c1t2d4
To create a file system swap of size 300MB :
# swapon -l 300M /swapdir
This will create a directory called paging on that file system and puts a maximum limit of 300MB on that swap area.
How to activte all the swap spaces on every reboot ?
For automatic activation of swap spaces, you have to put the entry for each and every swap space in /etc/fstab file. When you reboot the system, /sbin/init.d/swap_start script gets executed in run level 1. This script will execute the below command to activate all the swap spaces.
# swapon -a
Sample /etc/fstab entry for disk based swap space,
/dev/dsk/c0t1d0 . swap defaults 0 0
Sample /etc/fstab entry for file system based swap space,
. /swapdir swapfs lim=300M 0 0
How to monitor the swap space ?
"swapinfo" command will show the statistics on device, LV and file system swaps.
To show only the device swap areas,
# swapinfo -d
To show only the file system swap areas,
# swapinfo -f
To show all the device and file system swaps in megabytes instead of kilebytes :
# swapinfo -m
To show all the device and file system swaps with a total details at the last line :
# swapinfo -t
1. Device Swap Space :
An entire disk or a partition in a disk or a logical volume in a volume group can be used as swap space. This type is called as device swap.
2. File System Swap Space:
You can allocate a specific amount of space in an existing file system. This will create a directory called paging on that file system. This type of swap space can coexist with the files in the file system. This type is called as file system swap space.
Daemon used to manage memory and swap :
a. swapper
b. vhand
Swap Space Priority:
a. There are priority levels from number 0 to 10.
b. Number 0 is the highest and 10 is the lowest level of priority.
c. When the highest priority swap space is full, then the next level swap will be used.
d. If 2 or more swap spaces have the same priority, then the round robin mechanism will be used.
e. If the disk and file system swaps have the same priority, then the disk swap will get the preference.
Let us now look the way to create the swap space,
To create swap space in an entire disk :
# swapon /dev/dsk/c1t2d4
To create swap space in a logical volume :
# swapon /dev/vg01/lvol1
To create swap space in an entire disk with a priority of 2 :
# swapon -p 2 /dev/dsk/c1t2d4
To create a file system swap of size 300MB :
# swapon -l 300M /swapdir
This will create a directory called paging on that file system and puts a maximum limit of 300MB on that swap area.
How to activte all the swap spaces on every reboot ?
For automatic activation of swap spaces, you have to put the entry for each and every swap space in /etc/fstab file. When you reboot the system, /sbin/init.d/swap_start script gets executed in run level 1. This script will execute the below command to activate all the swap spaces.
# swapon -a
Sample /etc/fstab entry for disk based swap space,
/dev/dsk/c0t1d0 . swap defaults 0 0
Sample /etc/fstab entry for file system based swap space,
. /swapdir swapfs lim=300M 0 0
How to monitor the swap space ?
"swapinfo" command will show the statistics on device, LV and file system swaps.
To show only the device swap areas,
# swapinfo -d
To show only the file system swap areas,
# swapinfo -f
To show all the device and file system swaps in megabytes instead of kilebytes :
# swapinfo -m
To show all the device and file system swaps with a total details at the last line :
# swapinfo -t
Subscribe to:
Posts (Atom)