Tuesday, December 18, 2007

Solaris 10 adaptive_mutex.d Mutex Locking

#!/usr/sbin/dtrace -qs
lockstat:::adaptive-block
{
printf( "%4s %4s %9s %9s %20s\t%s\n",
"CPU", "TID", "PID", "UID", "Wait time", "Command" );
/* dump data*/
printf( "%4d %4d %9d %9d %20d\t%s\n",
curcpu->cpu_id,
curlwpsinfo->pr_lwpid,
curpsinfo->pr_pid,
curpsinfo->pr_uid,
arg1,
curpsinfo->pr_psargs );
/* show stack */
stack();
}

Solaris 10 Kernel parameters with Dtrace

#!/usr/sbin/dtrace -qs
BEGIN
{
/*
header code coming
strings
*/
printf( "%12s %12s %12s\n", "Processes", "Threads", "Freemem" );
}
tick-3sec
{
/*
updating info lines coming
kvals in decimal numbers and free memory in bytes
*/
printf( "%12d %12d %12d\n", `nproc,`nthread,`freemem*8 );
}

Friday, December 14, 2007

Changing IP Address and Hostname

Changing hostname and IP Address on Solaris 10
1. Edit /etc/inet/hosts
127.0.0.1 localhost
192.168.100.2 newhostname loghost yourdomain.com
< >

2. Edit /etc/inet/ipnodes
newhostname

3. Edit /etc/nodenae
newhostname

4. Edit /etc/hostname.
newhostname
or
NewIP

5. Configure Name services ( Optional ). This case: configure to DNS client
5.1 Edit /etc/resolv.conf
search yourdomain.com
nameserver DNS-Server IP address
nameserver DNS-server IP address

5.2 Edit /etc/nsswitch.conf
Modify hosts: files to
hosts: files dns


==============================================

Changing IP Address, Hostname and DNS client with Scripts


#################################################
# Free Script for Change hostname, IP address and DNS client
# chhostip) by wihok
#!/usr/bin/ksh
read host?"Enter hostname : "
read ip?"Enter IP Address : "
read dns?"Enter DNS server IP [ 192.168.1.253 ] : "
read dnsdom?"Enter DNS Domain [ yourdomain.com ] : "
dns=${dns:="192.168.1.253"}
dnsdom=${dnsdom:="yourdomain.com"}
nic=`/usr/sbin/ifconfig -a grep -v lo0 grep ":" head -1 cut -d: -f1`
read if?"Enter Network Interface Card name or just Enter for default ==> [ $nic ] : "
if=${if:=$nic}
# Make backup files
cp /etc/nodename /etc/org_nodename
cp /etc/hostname.$if /etc/org_hostname.$if
cp /etc/inet/hosts /etc/org_hosts
cp /etc/inet/ipnodes /etc/org_ipnodes
cp /etc/resolv.conf /etc/org_resolv.conf
cp /etc/nsswitch.conf /etc/org_nsswitch.conf
echo "$host" > /etc/nodename
echo "$host" > /etc/hostname.$if
cat > /etc/inet/hosts <127.0.0.1 localhost
$ip $host loghost $dnsdom
EOT
cat > /etc/inet/ipnodes <::1 localhost
127.0.0.1 localhost
$ip $host loghost
EOT
cat > /etc/resolv.conf <search $dnsdom
nameserver $dns
EOT
#Uncomment line below for use Dynamic route
#Comment line below for user Static route
#rm /etc/defautrouter 2>&-
uname -S $host
ifconfig $if $ip/24 broadcast + up
read reboot?"Reboot now ..... [ yes ] : "
case $reboot in
nN[Nn][Oo])
pkill Xsession 2> /dev/null
rm -r /.dt /.dtprofile
;;
*)
reboot
esac
#################################################

Sunday, December 9, 2007

CDRW Command

Search CDROM

$ cdrw -l # list a system's CD or DVD writers
$ cdrw -M # get the blanking status and table of contents

Data CD and DVD

-i Specifies the image file for creating data CDs or DVDs. When creating data CDs, cdrw uses the Track-At-Once (TAO) mode of writing. If you don't specify this option, cdrw reads data from standard input.

cdrw can create single-session data DVDs on DVD or DVD-RW devices using images generated from mkisofs. When making data DVDs, cdrw uses Disk-At-Once (DAO) mode of writing, which closes the media when writing is completed and prevents any further sessions from being added. The image should be prepared in advance when writing an image to the DVD media since DAO mode requires that the size of the image be known in advance.

$ cdrw -i /data/iso_image #Creating a data CD or DVD

$ cdrw -S -I /data/iso-image

$ cdrw -d c1t6d0s2 -i /data/iso-image

# priocntl -e -p 60 [–c RT] cdrw -i /data/iso-image

$ mkisofs -r /data 2>/dev/null ; cdrw -i -p 24 # Create a CD from the directory /data.

$ cdrw -O -i /data/iso-image # Creating multi-session disk, recording without closing disk

Additional sessions can be added to an open disk by creating an image with mkisofs using the session start and next writable address reported by cdrw.

$ cdrw -M
Track No. Type Start address
----------+-------+------------
1 Data 0
Leadout Data 166564
Last session start address: 162140
Next writable address: 173464

$ mkisofs -o /tmp/image2 -r -C 0,173464 -M /dev/rdsk/c0t2d0s2 /data/foo



Audio CDs

-a Creates an audio disk. 1 to 99 audio-file name specified. The maximum audio data that can be written to the media by default is 74 minutes, unless -C is specified. All of the audio files should be in a supported audio format. Currently approved formats are:
· sun .au files with data in Red Book CDDA form
· wav .wav files with data in Red Book CDDA form
· cda .cda files having raw CD audio data
· Aur .aur files having raw CD data in big-endian byte order

If no audio format is specified, cdrw tries to identify the audio file format based on the file extension. The case of the characters in the extension is ignored. If a format is specified using the -T option, it is assumed to be the audio file type for all the files specified. Also, using the -c option closes the session after writing the audio tracks. Therefore, the tracks to be written should be specified in a single command line.

$ cdrw -a song1.wav song2.wav song3.wav song4.wav


Copying CDs

-c Copies a CD. cdrw can be used to copy single session data CD-ROMs audio CDs. When copying a CD, cdrw looks for a specified source device. If no source device is specified when using the -c option, the current CD writer is assumed to be the source. cdrw extracts the track or tracks into a temporary file and looks for a blank writable CD-R/RW media inthe current CD writer. If no media is found, insert a blank writable CD media in the current CD writer. If the default temporary directory does not have enough space, an alternate directory can be specified by using the -m option.

$ cdrw -c [-m /tmp ] [-s src-device]
$ cdrw -c -p 56 –S -s cdrom1


Erasing CD-RW or DVD-RW

-b Blanks CD-RW or DVD-RW media. Users have to erase the CD-RW media before it can be rewritten.
· session Erases the last session.
· fast Minimally erases the media.
· all Erases the entire media.

$ cdrw -b fast





The session erasing type is used, cdrw erases the last session. If there is only one session recorded on the CD-RW (for example, a data or audio CD-RW created by this tool), then session erasing only erases the portion that is recorded, leaving behind a blank disk. This is faster than erasing the entire media. For DVD media, using the -b session erases the whole media.

The fast erasing type minimally erases the entire media by removing the PMA and TOC of the first session. It does not erase the user data and subsequent tracks on the media, but the media is treated as if it were a blank disk. If a complete erase is of the media is necessary, use the all option.

The all erasing type should be used if it is a multisession disk, the last session is not closed, or disk status is unknown, and you want to erase the disk. With this type oferasing, cdrw erases the entire disk.

DVD media does not support erasing. To re-use DVD media, simply write a new image onto the media. cdrw formats and overwrites the existing media automatically.

Extracting Audio

-T Audio format to use for extracting audio files or for reading audio files for audio CD creation. The audio-type can be sun, wav, cda, or aur.
-x Extracts audio data from an audio track.

$ cdrw -x -T wav 1 ~/song1.wav # Extract audio track 1 to ~/song1.wav.


Other Option

-d /dev/rdsk/c0t6d0s0 cdrom cdrom0

-C Uses stated media capacity. Without this option, cdrw uses a default value for writable CD media, which is 74 minutes for an audio CD, 681984000 bytes for a data CD, or 4.7 Gbytes for a DVD.

-L Closes the disk. This operation can only be done on CD-RW media.

-O Keeps the disk open. cdrw closes the session, but it keeps the disk open so that another session can be added later on to create a multi-session disk.

-m Uses an alternate temporary directory.

-p Sets the CD writing speed. For example, -p 4

-s Specifies the source device for copying a CD or DVD.

-S Simulation mode. In this mode, cdrw operates with the drive laser turned off.

-v Verbose mode.

Friday, December 7, 2007

JumpStart Post-Script

# Post Shell Script for Solaris Jumpstart Install
# set root Password ( copy from /etc/shadow)
# and enter domain name to /etc/inet/hosts

#!/bin/sh
PASSWD=Cb8aoSNHNbIBM #===> root
domain=wihok.blogspot.com

####### password for root #######
cp /a/etc/shadow /a/etc/shadow.orig

nawk -F: '{
if ( $1 == "root" )
printf"%s:%s:%s:%s:%s:%s:%s:%s:%s\n",$1,passwd,$3,$4,$5,$6,$7,$8,$9
else
printf"%s:%s:%s:%s:%s:%s:%s:%s:%s\n",$1,$2,$3,$4,$5,$6,$7,$8,$9
}' passwd="$PASSWD" /a/etc/shadow.orig > /a/etc/shadow

rm -f /a/etc/shadow.orig
sed -e 's/0 # root/1 # root/' ${SI_SYS_STATE} > /tmp/state.$$
mv /tmp/state.$$ ${SI_SYS_STATE}

###### set name service to NONE
cp /a/etc/nsswitch.files /a/etc/nsswitch.conf

###### disable auto shutdown
touch /a/noautoshutdown

###### edit /etc/inet/hosts
sed "/loghost/d" /a/etc/inet/hosts > /a/etc/inet/hosts.tmp
grep loghost /a/etc/inet/hosts awk '{print $1"\t" $2"\t" $3"\t test.domain.com"}' >> /a/etc/inet/hosts.tmp
mv /a/etc/inet/hosts.tmp /a/etc/inet/hosts




Jumpstart rules file

The rules file is a text configuration file used to associate a machine profile and pre- and post-install scripts with a particular machine to perform an unattended installation. The rules file consists of at least one line containing five entries of the following type:

  • Keywords
  • Values
  • Begin (pre-script)
  • Class profile
  • Post (finish scripts)

Line Format :

[!] keyword value [&& [!] keyword value ] [begin_script] [profile] [finish_script]

Where:

  • The keyword(s) and value(s) are matched to the client. Multiple keyword - value pairs may be specified for a single rule. Once a match is made, no further processing of the rules file is done. Logical operations for keyword - value paris are allowed.
  • Lines beginning with # are treated as comments.
  • The pre- and post-install scripts are Bourne shell scripts, run before and after the installation, respectively, which can be used to save and restore files, install additional packages and perform site-specific customization.
  • The profile is a configuration file for the installation containing information about the disk layout, the installation type and the packages to be installed.

The pre-install script, profile and post-install script names are given relative to the directory containing the rules file. The begin script, profile and finish script are all optional, but must be replaced with a hyphen if there is no value.


Examples of valude keywords are:

  • any -
    matches any machine
  • arch sparc
    from output of uname -p (sparc or i386)
  • disksize c0t1d0 600-800
    disk is in the form c#t#d#, and size range is specified in MB
  • hostname wihok
    hostname from output of uname -n
  • karch sun4u
    platform group from output of uname -m (sun4m, i86pc,...)
  • memsize 16-32
    range of physical RAM on the machine (in MB)
  • network 192.168.100.0
    logical AND between IP and subnet mask

Sample profiles, rules and begin/finish scripts can be found in the following directories:

  • Misc/.install_config
  • Misc/jumpstart_sample


Some examples of rules are as follows (split over lines for readability, this may be done in the rules file as well:

hostname wihok begin-sc class-wihok end-sc
network 192.168.100.0 - classnet finish-sc
karch sun4u && disksize c0t0d0 100-800 small_begin small_class small_finish

After changes have been made to the rules, they must be verified by running the check script. This creates a rules.ok file, which is the file actually used by jumpstart.



<

Solaris Jupmstart Sparc

The Jumpstart mechanism was developed by Sun in order to simplify installations on large networks of mostly similar hardware. The basic idea is that system configuration information is stored on a central server. When new clients are added to the network, the client boots from the central configuration server and then runs an automated install program which partitions the client's disk(s), installs the operating system, and makes appropriate local configuration changes (setting network parameters, hostname, etc.). Creating the configuration server requires a fair amount of System Administration expertise.

The Jumpstart process also allows the local administrator to create custom scripts that are run either before ("pre-install") or after ("post-install") the Jumpstart process (or both). This allows sites to create even more finely customized install routines for their particular site.

Jumpstart provides for unattended installation of Solaris machines. Supports multiple OS releases. Supports multiple architectures (Sparc and Intel). Supports multiple configurations for hosts based on a variety of criteria.

JumpStart Server

  • Boot Server - Uses RARP and bootp or DHCP to set the basic network parameters. Uses tftp to load a boot kernel to perform the more complex task of mounting the appropriate directories used to install the Solaris packages. Boot server must exist on same network as client.
  • Install Server - Contains Solaris packages, copied from the Solaris installation DVD, to be installed. Contains a Solaris miniroot the client mounts via NFS. The OS install is performed while running from this miniroot. Multiple Install servers can be used to distribute the load.
  • Configuration Server - Contains site-specific information used for a custom jumpstart installation. sysidcfg file used to set basic network configuration; this is needed to perform an unattended install. A different sysidcfg file is needed for each architecture and OS release. Typically only have a single Configuration server for administrative ease. Load is rarely a factor. ( sysidcfg, rules.ok, class files, pre-install and post-install files share via NFS mount.)

JumpStart Configure

Easy to configuration All in one server

1. # mkdir /export/install

2. # mkdir /export/config

3. # cd /cdrom/cdrom0/Solaris_10/Misc/jumpstart_sample

4. # cp -r * /export/config

5. # cd /cdrom/cdrom0/Solaris_10/Tools

6. # ./setup_install_server /export/install
# not recommened, but read images from DVD is very slow.

7. # ./setup_install_server -b /export/install
# This case for boot server only

8. # vi /etc/ethers
8:0:20:11:22:33 client1 # one client per one line

9. # vi /etc/hosts
192.168.1.101 client1 # one client per one line

10. # cd /export/config

11. # vi rules
#keyword value [begin_script] [profile] [finish_script]
#keyword value [&& [!] keyword value ] [begin_script] [profile] [finish_script]
#
#hostname client1 - client1_class client1-post
any - - client_class post_script


12. # vi client_class
install_type initial_install
system_type standalone
partitioning explicit
cluster SUNWCXall
filesys c0t0d0s0 1024 /
filesys c0t0d0s1 1024 swap
filesys c0t0d0s3 4096 /usr
filesys c0t0d0s4 1024 /opt
filesys c0t0d0s5 free /export
filesys c0t0d0s7 200 /export/home
filesys c1t1d0s0 all /data

13. # vi post_script
#!/bin/sh
####### password for root #######
PASSWD=
Cb8aoSNHNbIBM # ==> root
cp /a/etc/shadow /a/etc/shadow.orig

nawk -F: '{
if ( $1 == "root" )
printf"%s:%s:%s:%s:%s:%s:%s:%s:%s\n",$1,passwd,$3,$4,$5,$6,$7,$8,$9
else
printf"%s:%s:%s:%s:%s:%s:%s:%s:%s\n",$1,$2,$3,$4,$5,$6,$7,$8,$9
}' passwd="$PASSWD" /a/etc/shadow.orig > /a/etc/shadow

rm -f /a/etc/shadow.orig
sed -e 's/0 # root/1 # root/' ${SI_SYS_STATE} > /tmp/state.$$
mv /tmp/state.$$ ${SI_SYS_STATE}

14. # ./check

15. # echo " share -o ro,anon=0 /export/config " >> /etc/dfs/dfstab

16. # svcadm restart nfs/server #==> or shareall

17. # cd /export/install/Solaris_10/Tools

18. # ./add_install_client -c `uname -n`:/export/config \
-p `uname -n`:/export/config \
-s `uname -n`:/export/install client sun4u

19. # ./add_install_client -c `uname -n`:/export/config \
-p `uname -n`:/export/config \
-s `uname -n`:/export/install client1 sun4u

20. # dfshares server #confirm for /export/install and /export/config are shared

21. # ls /tftpboot # confirm ready for TFTP enable

22. # /export/install/Solaris_10/Tools/rm_install_client client # for remove client

--------------------------------------------------

Client

ok boot net - install

or

ok boot net - install nowin




Thursday, December 6, 2007

Solaris Jumpstart x86/x64

1. Table of Contents

  1. Table of Contents
  2. Setup Jumpstart Server
  3. Configure TFTP
  4. Configure Name Service
  5. Setup DHCP server
  6. Configure GRUB menu
  7. PXE boot client
  8. Troubleshooting PXE boot
  9. A more flexible setup

2. Setup Jumpstart Server

  • Create jumpstart server environment

    In this document we copy the contents of the Solaris DVD or CDROM's to a hard disk. This requires that you creaete the /jumpstart directory in a slice with enough disk space. On my test system my configuration and images took 3GB.

    Instead of creating a directory in an existing partition, you can also create a new slice and use /jumpstart as the mountpoint. It's your pick :-)

server # mkdir -p /jumpstart/config
server # mkdir -p /jumpstart/x86

  • Create jumpstart image

Using DVD

server # cd /cdrom/cdrom0/Solaris_10/Tools
server #
./setup_install_server /jumpstart/x86
... output skipped ...

Copy check command to config directory.
server # cd /jumpstart/image/Solaris_10/Misc/jumpstart_sample
server #
cp check /jumpstart/config


Using CDROM

Insert CDROM 1
server # cd /cdrom/cdrom0/s0/Solaris_10/Tools
server # ./setup_install_server /jumpstart/x86

... output skipped ...

Insert CDROM 2 to CDROM 5
server # cd /cdrom/cdrom0/Solaris_10/Tools
server #
./add_to_install_server /jumpstart/x86
... output skipped ...

Copy check command to config directory.
server # cd /jumpstart/image/Solaris_10/Misc/jumpstart_sample
server #
cp check /jumpstart/config

  • Setup NFS server

server # echo "share -F nfs -o ro,anon=0 /jumpstart" >> /etc/dfs/dfstab
server #
svcadm enable nfs/server
server # svcs nfs/server

STATE STIME FMRI
online 14:52:25 svc:/network/nfs/server:default

server # share
- /jumpstart ro,anon=0 ""

  • Create sysidcfg file

    Create the following sysidcfg file with an available editor.

server # cd /jumpstart/config
server # cat sysidcfg

system_locale=en_US
timezone=MET
name_service=NONE
terminal=dtterm
timeserver=localhost
root_password=WybF.D5GwZnz2
network_interface=primary{ protocol_ipv6=no }
security_policy=NONE
nfsv4_domain= dynamic
keyboard= workaround:Unknown
display= workaround:Unknown
pointer= workaround:Unknown
monitor=workaround:Unknown

If you are running Solaris 10u2 you can add nfs4_domain=dynamic to your sysidcfg too. If you do, then you don't have to put the touch /a/etc/.NFS4inst_state.domain line in your after script.

  • Create profile aka class file

    Create the following profile aka. class file, again with an editor.

server # cat std_profile
install_type initial_install
system_type standalone
partitioning explicit
filesys any 1024 swap
filesys any free /
filesys any 1024 /var
cluster SUNWCreq

  • Create pre script file

    The profile above will create a new partition table with 3 slices (/, /var & swap). This will only work if the disk to install to already contains a solaris parition. If the system you want to install Solaris on wasn't installed with Solaris before, changes are great that the disk will not contain a Solaris partition.

    You can use fdisk -B /dev/rdsk/ in a pre script to create the Solaris partition first.

server # cat std_pre
fdisk -B /dev/rdsk

  • Create after script file

    Create a script that is run on the client after the installation succeeds. Output of this afterscript is automatically saved on the jumpstart client in /var/sadm/sys/logs/finish.log. Your afterscript should match the following output:

server # cat std_after
echo "Begin afterscript"
touch /a/noautoshutdown
# touch /a/etc/.NFS4inst_state.domain
echo "Finish afterscript"

If you are running Solaris 10u2 or later you can skip the touch /a/etc/.NFS4inst_state.domain and place nfs4_domain=dynamic in the sysidcfg file.

  • Create rules file

    Then we need a rules file with the following contents.

server # cat rules
any - - std_profile std_after

server # ./check
Validating rules...
Validating profile std_profile...
The custom JumpStart configuration is ok.

3. Configure TFTP

Depending on you system, the tftp service is already available or not. When the tftp service is not available, you will have to uncomment the service in the /etc/inetd.conf file and run the inetconv command.

server # svcs tftp/udp6
svcs: Pattern 'tftp/udp6' doesn't match any instances
STATE STIME FMRI


server # grep tftp /etc/inetd.conf
# TFTPD - tftp server (primarily used for booting)
#tftp dgram udp6 wait root /usr/sbin/in.tftpd in.tftpd -s /tftpboot

Uncomment the "#tftp dgram udp6 ..." line in the /etc/inetd.conf file.

server # grep tftp /etc/inetd.conf
# TFTPD - tftp server (primarily used for booting)
tftp dgram udp6 wait root /usr/sbin/in.tftpd in.tftpd -s /tftpboot

server # inetconv
inetconv: Notice: Service manifest for 100235/1 already generated as
/var/svc/manifest/network/rpc/100235_1-rpc_ticotsord.xml, skipped
inetconv: Notice: Service manifest for 100083/1 already generated as
/var/svc/manifest/network/rpc/100083_1-rpc_tcp.xml, skipped
inetconv: Notice: Service manifest for 100068/2-5 already generated as
/var/svc/manifest/network/rpc/100068_2-5-rpc_udp.xml, skipped
tftp -> /var/svc/manifest/network/tftp-udp6.xml Importing tftp-udp6.xml ...Done

server # svcs tftp/udp6
STATE STIME FMRI
online 12:56:05 svc:/network/tftp/udp6:default

4. Configure Name Service

In this document the DHCP server will fetch the hostname for clients from a name service (/etc/inet/hosts). We therefore have to add the jumpstart client to the /etc/inet/hosts file.

server # echo "10.0.0.100 client1" >> /etc/inet/hosts


5. Setup DHCP server

  • Configure DHCP service

server # dhcpconfig -D -r SUNWfiles -p /var/dhcp
Created DHCP configuration file.
Created dhcptab. Added "Locale" macro to dhcptab.
Added server macro to dhcptab - voyin. DHCP server started
.

The -r option defines what file type should be used for storing the dhcp tables (network and tab). SUNWfiles creates ascii files. The advantage of SUNWfiles is that these files are easy to debug. SUNbinfiles creates the dhcp tables as binary files. The advantage of binary files is the increase in perfomance for the DHCP server.

  • Check DHCP Service

server# svcs "*dhcp*"
STATE STIME FMRI
online 14:16:10 svc:/network/dhcp-server:default

  • Add symbols to DHCP configuration

server # dhtadm -A -s SrootIP4 -d 'Vendor=SUNW.i86pc,2,IP,1,1'
server #
dhtadm -A -s SrootNM -d 'Vendor=SUNW.i86pc,3,ASCII,1,0'
server #
dhtadm -A -s SrootPTH -d 'Vendor=SUNW.i86pc,4,ASCII,1,0'
server #
dhtadm -A -s SinstIP4 -d 'Vendor=SUNW.i86pc,10,IP,1,1'
server #
dhtadm -A -s SinstNM -d 'Vendor=SUNW.i86pc,11,ASCII,1,0'
server #
dhtadm -A -s SinstPTH -d 'Vendor=SUNW.i86pc,12,ASCII,1,0'
server #
dhtadm -A -s SsysidCF -d 'Vendor=SUNW.i86pc,13,ASCII,1,0'
server # dhtadm -A -s SjumpsCF -d 'Vendor=SUNW.i86pc,14,ASCII,1,0'

server # dhtadm -P
Name Type Value
==================================================
server Macro :Include=Locale
:Timeserv=10.0.0.10:LeaseTim=86400:LeaseNeg
:DNSdmain="edu.sun.com":DNSserv=4.2.2.2:
Locale Macro :UTCoffst=3600:
SjumpsCF Symbol Vendor=SUNW.i86pc,14,ASCII,1,0
SsysidCF Symbol Vendor=SUNW.i86pc,13,ASCII,1,0
SinstPTH Symbol Vendor=SUNW.i86pc,12,ASCII,1,0
SinstNM Symbol Vendor=SUNW.i86pc,11,ASCII,1,0
SinstIP4 Symbol Vendor=SUNW.i86pc,10,IP,1,1
SrootPT Symbol Vendor=SUNW.i86pc,3,ASCII,1,0
SrootNM Symbol Vendor=SUNW.i86pc,3,ASCII,1,0
SrootIP4 Symbol Vendor=SUNW.i86pc,2,IP,1,1

  • Configure jumpstart client

server # cd /jumpstart/x86/Solaris_10/Tools/
server # ./add_install_client -d SUNW.i86pc i86pc
copying boot file to /tftpboot/pxegrub.I86PC.Solaris_10-1

If not already configured, enable PXE boot by creating
a macro named PXEClient:Arch:00000:UNDI:002001 with:
Boot server IP (BootSrvA) : 10.0.0.10
Boot file (BootFile) : SUNW.i86pc


server # ls /tftpboot
I86PC.Solaris_10-1
nbp.SUNW.i86pc
SUNW.i86pc
pxegrub.I86PC.Solaris_10-1
boot rm.SUNW.i86pc

server # mount -p grep boot
/jumpstart/x86/boot - /tftpboot/I86PC.Solaris_10-1 lofs - no ro

  • Enable PXE boot

server # dhtadm -A \
> -m PXEClient:Arch:00000:UNDI:002001 \
> -d ':BootFile="SUNW.i86pc":BootSrvA=10.0.0.10:'

server # dhtadm -P
Name Type Value
================================================== PXEClient:Arch:00000:UNDI:002001 Macro :BootFile="SUNW.i86pc":BootSrvA=10.0.0.10:
server Macro :Include=Locale: Timeserv=10.0.0.10
:LeaseTim=86400:LeaseNeg
:DNSdmain="edu.sun.com"
:DNSserv=4.2.2.2: Locale Macro
:UTCoffst=3600:
SrootPTH Symbol Vendor=SUNW.i86pc,3,ASCII,1,0
SjumpsCF Symbol Vendor=SUNW.i86pc,14,ASCII,1,0
SsysidCF Symbol Vendor=SUNW.i86pc,13,ASCII,1,0
SinstPTH Symbol Vendor=SUNW.i86pc,12,ASCII,1,0
SinstNM Symbol Vendor=SUNW.i86pc,11,ASCII,1,0
SinstIP4 Symbol Vendor=SUNW.i86pc,10,IP,1,1
SrootNM Symbol Vendor=SUNW.i86pc,3,ASCII,1,0
SrootIP4 Symbol Vendor=SUNW.i86pc,2,IP,1,1

  • Create client in DHCP server

server # dhtadm -A \
> -m 0100E0815F2BB5 \
> -d ':SinstNM="server1"\
> :SinstIP4=10.0.0.10:\
> SinstPTH="/jumpstart/x86":\
> SrootNM="server1":\
> SrootIP4=10.0.0.10:\
> SrootPTH="/jumpstart/x86/Solaris_10/Tools/Boot":\
> SjumpsCF="10.0.0.10:/jumpstart/config":\
> SsysidCF="10.0.0.10:/jumpstart/config":'

server # dhtadm -P
Name Type Value
==================================================
0100E0815F2BB5 Macro :SinstNM="server1"
: SinstIP4=10.0.0.10
: SinstPTH="/jumpstart/x86"
: SrootNM="server1"
: SrootIP4=10.0.0.10
: SrootPTH="/jumpstart/x86/Solaris_10/Tools/Boot"
: SjumpsCF="10.0.0.10:/jumpstart/config"
: SsysidCF="10.0.0.10: /jumpstart/config":

PXEClient:Arch:00000:UNDI:002001 Macro :BootFile="SUNW.i86pc":BootSrvA=10.0.0.10:

server Macro :Include=Locale
: Timeserv=10.0.0.10
: LeaseTim=86400
: LeaseNeg
: DNSdmain="edu.sun.com"
: DNSserv=4.2.2.2
: Locale Macro
: UTCoffst=3600:
SrootPTH Symbol Vendor=SUNW.i86pc,3,ASCII,1,0
SjumpsCF Symbol Vendor=SUNW.i86pc,14,ASCII,1,0
SsysidCF Symbol Vendor=SUNW.i86pc,13,ASCII,1,0
SinstPTH Symbol Vendor=SUNW.i86pc,12,ASCII,1,0
SinstNM Symbol Vendor=SUNW.i86pc,11,ASCII,1,0
SinstIP4 Symbol Vendor=SUNW.i86pc,10,IP,1,1
SrootNM Symbol Vendor=SUNW.i86pc,3,ASCII,1,0
SrootIP4 Symbol Vendor=SUNW.i86pc,2,IP,1,1

  • Assign permanent addresses to clients

server # pntadm -C 10.0.0.0
server # pntadm -A client1 \
> -f PERMANENT \
> -i 0100E0815F2BB5 \
> -m 0100E0815F2BB5 \
> -s server1 \
> 10.0.0.0

server # pntadm -L
10.0.0.0

server # pntadm -P 10.0.0.0
Client ID Flags Client IP Server IP Lease Expiration Macro Comment
0100E0815F2BB5 01 10.0.0.100 10.0.0.10 Forever 0100E0815F2BB5

6. Configure GRUB menu

In this step we have to edit the grub menu used by the install clients. In this grub menu we have to make the system is boot with the install keyword.

!!!! Watch Out !!!!
The output shown below only contains 5 lines. Make sure that the lines starting with kernel and - install are actually one line.

server # cat /tftpboot/boot/grub/menu.lst
default=0
timeout=10
title Install Solaris10 6/06 X86/X64
kernel /I86PC.Solaris_10-1/multiboot kernel/unix -
install - B install_media=10.0.0.10:/jumpstart/solaris10
module /I86PC.Solaris_10-1/x86.miniroot

7. PXE boot client

Now you can (re)boot your client. On the Ultra 20 workstations you can press F12 during boot (Sun logo) to force the client into a PXE boot (DHCP). When you have other clients you need to check the manual which keys to use on your hardware.

8. Troubleshooting PXE boot

A typo is made within a blink of an eye and then your client is not booting from the network. Here are some pointers how to debug your environment.

  • DHCP server in debug mode

It can be very handy to have the DHCP server running in debig mode. This enables you to see requests are maed by clients, what the server sends back to the client, etc.

server # svcadm disable dhcp-server
server # /usr/lib/inet/in.dhcpd -dv
... output skipped ...

  • Capture network traffic

With snoop you can look into network packets and see what data is them.
server # snoop -v grep -i dhcp
... output skipped ...

  • DHCP configuration files / directories

/etc/dhcp/inittab DHCP symbol list
/etc/init/dhcpsvc.conf DHCP server parameters.
/var/dhcp/SUNWfiles1_10_0_0_0 Network table containing ip addresses for lease.
/var/dhcp/SUNWfiles1_dhcptab DHCP environment configuration.
/usr/lib/inet/in.dhcpd The actual DHCP daemon.

  • Jumpstart log files

During installation on client
/tmp/begin.log
/tmp/finish.log
/tmp/install_log
/var/sadm/system/logs/sysidtool.log


After installation (after reboot) on client
/var/sadm/system/logs/begin.log
/var/sadm/system/logs/finish.log
/var/sadm/system/logs/install_log
/var/sadm/system/logs/sysidtool.log

9. A more flexible setup

The configuration outlined above can be made more flexible by adding specific macro's. What we basically did is create a macro for a client (Identifier is 0100E0815F2BB5) and define all settings with this client. Now imagine have 1,000 systems that you need to setup with the same settings: a lot of work. Or having setup 1,000 systems and one of your settings changes: even more work.
By placing all the settings in one macro and then link clients to this macro it means less work and changing settings is easier as well.

  • Extra exercise

If you feel lucky, try to get the following setup and try to install your client again.

server # dhtadm -P
Name Type Value
==================================================
0100E0815F2BB5 Macro :Include=std_config:
std_config Macro :SinstNM="server1"
: SinstIP4=10.0.0.10
: SinstPTH="/jumpstart/x86"
: SrootNM="server1"
: SrootIP4=10.0.0.10
: SrootPTH="/jumpstart/x86/Solaris_10/Tools/Boot"
: SjumpsCF="10.0.0.10
: /jumpstart/config"
: SsysidCF="10.0.0.10
: /jumpstart/config":

PXEClient:Arch:00000:UNDI:002001 Macro :BootFile="SUNW.i86pc":BootSrvA=10.0.0.10:

server Macro :Include=Locale
: Timeserv=10.0.0.10
: LeaseTim=86400
: LeaseNeg
: DNSdmain="edu.sun.com"
: DNSserv=4.2.2.2
: Locale Macro
: UTCoffst=3600:

SrootPTH Symbol Vendor=SUNW.i86pc,3,ASCII,1,0
SjumpsCF Symbol Vendor=SUNW.i86pc,14,ASCII,1,0
SsysidCF Symbol Vendor=SUNW.i86pc,13,ASCII,1,0
SinstPTH Symbol Vendor=SUNW.i86pc,12,ASCII,1,0
SinstNM Symbol Vendor=SUNW.i86pc,11,ASCII,1,0
SinstIP4 Symbol Vendor=SUNW.i86pc,10,IP,1,1
SrootNM Symbol Vendor=SUNW.i86pc,3,ASCII,1,0
SrootIP4 Symbol Vendor=SUNW.i86pc,2,IP,1,1


This Post Credit by http://www2.petervg.nl

DNS Server Configuration

BIND is an implementation of the Domain Name System (DNS) protocols and provides an openly redistributable reference implementation of the major components of the Domain Name System, including:

  • a Domain Name System server (named)
  • a Domain Name System resolver library
  • tools for verifying the proper operation of the DNS server

The BIND DNS Server is used on the vast majority of name serving machines on the Internet, providing a robust and stable architecture on top of which an organization's naming architecture can be built. The resolver library included in the BIND distribution provides the standard APIs for translation between domain names and Internet addresses and is intended to be linked with applications requiring name service.


More Detail

Click Here for Download Korn Shell Script for Configure DNS Server



Solaris and Java Training

At present IT operating systems and tools like UNIX, JAVA or Web development increasingly becomes an indispensable tool in today’s business। Acquiring fundamental skills on these ‘tools of trade’ is vital to successful business applications। Realizing the importance of providing IT knowledge, skill and training to customers and the public, First Logic Training Center and Authorized Prometric Testing Center have been established and run by the Education Department.

For more detail click here.