ndd Command
Thursday, December 20, 2007
1. To get NIC status, note root passwd password is needed
check the which instance of NIC port we are connecting to
# ndd –get /dev/qfe instance
change the NIC instance to port 0
# ndd -set /dev/qfe instance 0
check status
# ndd -get /dev/qfe link_status (0=down 1=up)
# ndd -get /dev/qfe link_mode (0=half duplex 1=full duplex)
# ndd -get /dev/qfe link_speed (0=10Mbps 1=100Mbps)
# ndd -get /dev/ce adv_autoneg_cap (check auto nego 0=false 1=true)
# ndd -set /dev/ce adv_autoneg_cap 1 (set autonego to true)
ndd help / to check option available with ndd command
# ndd –get /dev/qfe \?
Notes
for ce card use /dev/ce
for qfe card use /dev/qfe
for bge card use /dev/bge1 (instance 1, bge2 = instance2)
The configuration network card configuration file is at /kernel/drv/ce.conf if its is configured manually and forced to specific value.
check the which instance of NIC port we are connecting to
# ndd –get /dev/qfe instance
change the NIC instance to port 0
# ndd -set /dev/qfe instance 0
check status
# ndd -get /dev/qfe link_status (0=down 1=up)
# ndd -get /dev/qfe link_mode (0=half duplex 1=full duplex)
# ndd -get /dev/qfe link_speed (0=10Mbps 1=100Mbps)
# ndd -get /dev/ce adv_autoneg_cap (check auto nego 0=false 1=true)
# ndd -set /dev/ce adv_autoneg_cap 1 (set autonego to true)
ndd help / to check option available with ndd command
# ndd –get /dev/qfe \?
Notes
for ce card use /dev/ce
for qfe card use /dev/qfe
for bge card use /dev/bge1 (instance 1, bge2 = instance2)
The configuration network card configuration file is at /kernel/drv/ce.conf if its is configured manually and forced to specific value.
Check PERL version
# perl -v
fsck Command
The fsck command is required if your encounter “press CTRL + d” message during startup
# fsck -y /opt
# fsck -y /opt
set DISPLAY
This is usually required when you use X-Manager to run some GUI application on it. Example will be Veritas Manager or during Oracle installation
# DISPLAY:you.pc.ip.addr:0.0
# export DISPLAY
# DISPLAY:you.pc.ip.addr:0.0
# export DISPLAY
scstat Command
scstat (cluster command)
To move resources from one cluster A to cluster B
# scswitch -Z -g -h
example
# scswitch -Z -g scmrg1 -h server4821
To move resources from one cluster A to cluster B
# scswitch -Z -g
example
# scswitch -Z -g scmrg1 -h server4821
mount / devices operation
to mount a device, 1st make sure the device is in /etc/vfstab
# mount /rpt_data02
or
# mount /dev/vx/dsk/rptdg/rpt_data02 /rpt_data02
to kill all process / users using a specific devices, usefull when you could not umount the file system or devices that you are sure no users is accessing it
# fuser -ck /the/directory
# mount /rpt_data02
or
# mount /dev/vx/dsk/rptdg/rpt_data02 /rpt_data02
to kill all process / users using a specific devices, usefull when you could not umount the file system or devices that you are sure no users is accessing it
# fuser -ck /the/directory
Soft link
create a soft link
# ln -s /destination /source
remove soft link
# unlink /soft/link/file
# ln -s /destination /source
remove soft link
# unlink /soft/link/file
Fiber channel (FC) operation
check connected FC ports
# luxadm -e port
# luxadm -e port
Check 64 bit on Solaris
# isainfo -vk
Unix printing services
1. Below are some example of using some printer command, assuming our printer name is dcp.
to print /etc/hosts files on dcp printer
# lp -d dcp /etc/hosts
check the print queue on all connected printer
# /usr/ucb/lpq
or
# lpstat
# lpstat –o all
check print queue on dcp printer
# /usr/ucb/lpq -P dcp
delete print queue on dcp printer (root password is required)
# /usr/ucb/lprm -P dcp
2. Printer configuration
printer configuration will be stored in /etc/printer.conf
# more /etc/printer.conf
all connected printer summary
# lpstat -s
check the dcp printer server (print server)
# lpstat -v dcp
changing printer server (root password is required)
# lpadmin -p dcp -s pethsv15\!dcp
lpadmin –p -s \!
to print /etc/hosts files on dcp printer
# lp -d dcp /etc/hosts
check the print queue on all connected printer
# /usr/ucb/lpq
or
# lpstat
# lpstat –o all
check print queue on dcp printer
# /usr/ucb/lpq -P dcp
delete print queue on dcp printer (root password is required)
# /usr/ucb/lprm -P dcp
2. Printer configuration
printer configuration will be stored in /etc/printer.conf
# more /etc/printer.conf
all connected printer summary
# lpstat -s
check the dcp printer server (print server)
# lpstat -v dcp
changing printer server (root password is required)
# lpadmin -p dcp -s pethsv15\!dcp
lpadmin –p
Packages / Pacthes
1. To check installed patch
# showrev -p
# showrev –p | grep
2. To check packages info
# pkginfo -l VRTSvxvm
# showrev -p
# showrev –p | grep
2. To check packages info
# pkginfo -l VRTSvxvm
NFS Sharing resources from the server
1. Make sure the share resources is configure in /etc/df/dfstab
# vi /etc/df/dfstab
Edit the files to include the share point of the resources.
Example you are sharing /cdrom/dvd1, the file in /etc/df/dfstab should include
share -F nfs /cdrom/dvd1
Affter editing the file run this command.
# shareall
2. At the remote machine that is accessing the share resources …
To list all the share resources from main server
# dfshares
or alternatively, to show all shared mount point from NFS server
# showmount -e
Mount the share resources
# mount:/cdrom/dvd1 /mount/point/location
example
# mount taufikserver:/cdrom/dvd1 /mnt
3. To unmount dfshare
note: only apply if you could not unmount it.
# /etc/init.d/nfs.server stop
# umount /nfs/share
4. Mount nfs on vfstab
This example take from http://www.scit.wlv.ac.uk/cgi-bin/mansec?4+vfstab
The following are vfstab entries for various file system types supported in the Solaris operating environment.
Example 1: NFS and UFS Mounts
The following entry invokes NFS to automatically mount the directory /usr/local of the server example1 on the client's /usr/local directory with read-only permission:
example1:/usr/local - /usr/local nfs - yes ro
The following example assumes a small departmental mail setup, in which clients mount /var/mail from a server mailsvr. The following entry would be listed in each client's vfstab:
mailsvr:/var/mail - /var/mail nfs - yes intr,bg
# vi /etc/df/dfstab
Edit the files to include the share point of the resources.
Example you are sharing /cdrom/dvd1, the file in /etc/df/dfstab should include
share -F nfs /cdrom/dvd1
Affter editing the file run this command.
# shareall
2. At the remote machine that is accessing the share resources …
To list all the share resources from main server
# dfshares
or alternatively, to show all shared mount point from NFS server
# showmount -e
Mount the share resources
# mount
example
# mount taufikserver:/cdrom/dvd1 /mnt
3. To unmount dfshare
note: only apply if you could not unmount it.
# /etc/init.d/nfs.server stop
# umount /nfs/share
4. Mount nfs on vfstab
This example take from http://www.scit.wlv.ac.uk/cgi-bin/mansec?4+vfstab
The following are vfstab entries for various file system types supported in the Solaris operating environment.
Example 1: NFS and UFS Mounts
The following entry invokes NFS to automatically mount the directory /usr/local of the server example1 on the client's /usr/local directory with read-only permission:
example1:/usr/local - /usr/local nfs - yes ro
The following example assumes a small departmental mail setup, in which clients mount /var/mail from a server mailsvr. The following entry would be listed in each client's vfstab:
mailsvr:/var/mail - /var/mail nfs - yes intr,bg
Enable tftp services on Solaris10
Make changes active and enabled
# inetconv
# inetadm -e svc:/network/tftp/udp6
check the tftp services
# svcs | grep tftp
disable tftp
# inetadm -d svc:/network/tftp/udp6
# inetconv
# inetadm -e svc:/network/tftp/udp6
check the tftp services
# svcs | grep tftp
disable tftp
# inetadm -d svc:/network/tftp/udp6
Configuring ntpdate
1. configure /etc/inet/ntp.conf
# vi /etc/inet/ntp.conf
add the ntp server IP address in the file (ntp.conf file will only contain IP addres)
2. to sync the time base on the ntp server specified
# ntpdate
# ntpdate 111.11.1.11
# vi /etc/inet/ntp.conf
add the ntp server IP address in the file (ntp.conf file will only contain IP addres)
2. to sync the time base on the ntp server specified
# ntpdate
# ntpdate 111.11.1.11
Enable large file
Option 1
# vi /etc/vfstab (edit the last column)
# reboot
Option 2
# umount /finance
# /usr/lib/fs/vxfs/fsadm -o largefiles /dev/vx/rdsk/diskdg/finance
# mount finance
Option 3 (on the fly update)
# /usr/lib/fs/vxfs/fsadm -o largefiles /finance
# vi /etc/vfstab (edit the last column)
# reboot
Option 2
# umount /finance
# /usr/lib/fs/vxfs/fsadm -o largefiles /dev/vx/rdsk/diskdg/finance
# mount finance
Option 3 (on the fly update)
# /usr/lib/fs/vxfs/fsadm -o largefiles /finance
tar Command
tar a file and then copy it / untar in a new folder
# cd /source/directory
# tar cf - . |(cd /destination/dir; tar xvfBp -)
tar command with exclude
# tar cvf /apache.tar --exclude=/var/apache/htdocs/docu/patch/*.zip \
> --exclude=/var/apache/htdocs/docu/iplanet/*.gz /var/apache/htdocs/docu
# tar cvf /os.tar --exclude=/var --exclude=/usr --exclude=sys / Note: not working to backup OS
# cd /source/directory
# tar cf - . |(cd /destination/dir; tar xvfBp -)
tar command with exclude
# tar cvf /apache.tar --exclude=/var/apache/htdocs/docu/patch/*.zip \
> --exclude=/var/apache/htdocs/docu/iplanet/*.gz /var/apache/htdocs/docu
# tar cvf /os.tar --exclude=/var --exclude=/usr --exclude=sys / Note: not working to backup OS
The history of UNIX
Sunday, December 2, 2007
The idea of developing UNIX was born from AT&T's Bell Laboratories in the early 1970's, the success of the UNIX operating system has led to many different versions. Until today, we have numbers of UNIX varieties and versions, like HP-UX, Solaris, Redhat, Suse not forgotten CENTOS, Fedora and others.
For more interesting UNIX history fact ... http://www.computerhope.com/history/unix.htm. Its interesting, the fact shown that Linus Torvalds was actually born on the same year UNIX was being developed.
For more interesting UNIX history fact ... http://www.computerhope.com/history/unix.htm. Its interesting, the fact shown that Linus Torvalds was actually born on the same year UNIX was being developed.
