Professional Documents
Culture Documents
This page has been specially put up for the begineers of Solaris this contains all the important
commands used in Solaris
Monday, Nove mber 9 , 2009
TERM=Vt100
Export=TERM
TAPE DRIVE
#mt f /dev/rmt/0 stat
#format
#select disk
#selects "type"
#select 0 (AUTO CONFIGURE)
#ok
ALOM CONFIGURATION:
sc> setsc if_network true - this command enables the port
sc> setsc netsc_dhcp false - this command should be set to false
sc> setsc netsc_ipaddr 129.148.173.27
sc> setsc netsc_ipnetmask 255.255.255.0
sc> setsc netsc_ipgateway 129.148.173.253
sc> resetsc y
You can now verify the settings with the "shownetwork" command
Note - There is also an interactive configuration process possible
through the use of the "setupsc" command,
2) Power on the server via the front power button. Once POST has
completed,you will need to wait 1 to 2 minutes for a timeout to occur
and the system to drop to the "ok>" prompt.
If you do not get the "Please login:" prompt (you will likely see the SC
prompt) then you must power the system off
Remove the battery from the LOM board, wait a minute, and re-install
everything).
Below is an example of what you might see on the console:
Please login:
SC Alert: Host System has reset
[Wait one two minutes]
NVRAM COMMANDS:
nvalias alias <device-path> - Store the command "devalias alias devicepath" in NVRAMRC. The alias persists until the nvunalias or set-defaults
commands are executed.
nvedit - Enter the NVRAMRC editor. If data remains in the temporary
buffer from a previous nvedit session, resume editing those previous
contents. If not, read the contents of NVRAMRC into the temporary
buffer and begin editing them.
nvquit -Discard the contents of the temporary buffer, without writing it
to NVRAMRC. prompt for confirmation.
nvrecover - Recover the contents of NVRAMRC if they have been lost as
a result of the execution of setdefaults
Activating nvram:
ok> nvedit
<enter commands>
Type Control-C to get out of the editor and back to the ok prompt.
ok> nvstore
ok> setenv use-nvramrc? true
ok> reset
BOOT OPTIONS:
-a
Ask the user for configuration information, such as where to find the
system file, where to mount root, and even override the name of the
kernel itself. Default responses will be contained in square brackets
and the user may simply enter <RETURN> to use the default response.
To help repair a damaged /etc/system file, enter /dev/null at the
prompt that asks for the pathname of the system configuration file.
-v Boot with verbose messages enabled.
-s Boot only to init level 's' Single User Mode. All local file systems are
mounted. Only a small set of essential kernel processes are left
running. This mode is for administrative tasks such as installing
optional utility packages. All files are accessible and no users are
logged in on the system.
-x Do not boot in clustered mode. This option only has an effect when
a version of Sun Cluster software that supports this option has been
installed.
-r Reconfiguration boot. The system will probe all attached hardware
devices and assign nodes in the file system to represent only those
devices actually found.
SERVER:
Sun V210
IP: 137.202.217.104
CLIENT:
T1000
IP: 137.202.216.163
-----------------------------------------------------------------------------------PART I: COPY CDS TO HARD DRIVE
On the server you are making the install server, make a directory to
store the CD
contents:
# mkdir /export/home/export/install
Put in the Solaris 10 sparc DVD and goto the Tools folder
(/cdrom/cdrom0/s2/Solaris_10/Tools),
run:
# ./setup_install_server /export/home/export/install
This will see if you have enough space there, and if so copy the DVD
image to the disk. It will take a while. Eject the DVD when it's done:
# eject
-------------------------------------------------------------------------------PART II: JUMPSTART CONFIG
We now need to setup the jumpstart directory and put the necessary
files in it to perform a custom jumpstart install.
# mkdir /export/home/export/config
system_type
system.
cluster
SUNWcxgl delete - This tells it to not install package
SUNWcxgl.
filesys
slice
any 500 swap - This tells it to place the swap slice on any
with size 500MB.
This is how mine looks, but you can modify the settings to specify your
needs, check:
http://docs.sun.com/app/docs/doc/817-5506/6mkv6ki9s?
a=view#preparecustom-97
for a good explanation of every option, you can even setup RAID
configuration during
install.
Now that the profile is done, we need to create the sysidcfg file. This
file answers all of the network, timezone, name service questions. It
won't be in the jumpstart directory so we have to create it.
# vi /export/home/export/config/sysidcfg
system_locale=en_US
timezone=US/Central
timeserver=192.168.1.201
network_interface=primary {netmask=255.255.255.0}
terminal=dtterm
name_service=NONE
Check http://docs.sun.com/app/docs/doc/817-5504/6mkv4nh20?
a=view
for an explanation of all the options.
Now we need to setup the rules file. This is a text file used to create
the "rules.ok" file. This is a look up table that has rules defining how
install clients are installed based on their system attributes. It is
already in the directory, you need to edit it and make sure it only
contains the line "any - - any_machine -" and all other lines are
commented out.
After that, in the jumpstart directory, run:
# ./check
Validating rules...
Validating profile any_machine...
The custom JumpStart configuration is ok.
Now on to setting up the client.
-------------------------------------------------------------------------------PART III: CLIENT SETUP & NFS
Add the client to the hosts file.
# echo "137.202.216.163
# cd /export/home/export/install/Solaris_10/Tools
We need to use the ./add_install_client to add clients to the jumpstart
Here's the options:
-e = mac address of client
-s = ip/host:dir of server with installation image
-c = ip/host:dir of jumpstart server configuration
-p = ip/host:dir of sysidcfg file
sparc = client name
sun4u = platform group
# ./add_install_client -e 8:0:20:b0:c5:b8 -s
137.202.217.104:/export/hom
e/export/install -c 137.202.216.163:/export/home/export/config -p
137.202.216.104:/export/home/export/config innsun10 sun4v
making /tftpboot
updating /etc/bootparams
copying inetboot to /tftpboot
To make sure they are both sharing:
# dfshares
RESOURCE SERVER ACCESS TRANSPORT
innsun3:/export/home/export/install innsun3 - innsun3:/export/home/export/config innsun3 - -------------------------------------------------------------------------------PART IV: CLIENT BOOT
After all is setup correctly, tell your client to boot off the network card
and
watch it go into the Solaris install process.
# boot net - install
-------------------------------------------------------------------------------PART V: PROBLEMS we RAN IN TO:
On jumpstart install, it errored with:
cat: cannot open /cdrom/.cdtoc
cat: cannot open /cdrom/.cdtoc
expr: syntax error
Patch Management
Patch add Error Codes (Solaris 2.6, 7, 8,9)
0 No error
1 Usage error
2 Attempt to apply a patch that's already been applied
3 Effective UID is not root
4 Attempt to save original files failed
5 pkgadd failed
6 Patch is obsoleted
7 Invalid package directory
8 Attempting to patch a package that is not installed
9 Cannot access /usr/sbin/pkgadd (client problem)
10 Package validation errors
11 Error adding patch to root template
12 Patch script terminated due to signal
13 Symbolic link included in patch
14 NOT USED
15 The prepatch script had a return code other than 0.
16 The postpatch script had a return code other than 0.
1 Usage error
2 Attempt to backout a patch that hasn't been applied
3 Effective UID is not root
4 No saved files to restore
5 pkgrm failed
6 Attempt to back out an obsoleted patch
7 Attempt to restore CPIO archived files failed
8 Invalid patch id format
9 Prebackout script failed
10 Postbackout script failed
11 Suspended due to administrative defaults
12 Backoutpatch could not locate the backout data
13 The relative directory supplied can't be found
14 Installpatch has been interrupted, re-invoke installpatch
PATCH INSTALLATION
Get OK prompt, through Console
Install the OS initially (Solaris 9 version 12/02) on c1t1d0s0.(If pre OE is
not present)
Install patches through EIS installation DVD.
# cd /cdrom/cdrom0/sun/install
# ./setup_standard.sh or # sh setup_standard.sh
Selections for menu to be made as follows :
# cd /var/tmp/9
# ./install_all_patches
NOTE: after the patches are installed, install extra patches for
Storage.
# mkdir /var/tmp/storagepatches
# cd /cdrom/cdrom0/sun/patch/SAN/9
# unpack-patches q /var/tmp/storagepatches
# cd /var/tmp/storagepatches
# ./install_all_patches
NOTE:- Here after packages related to storage needs to be installed.
# mkdir /var/tmp/packages
# cp /cdrom/cdrom0/sun/progs/sunwqus/SUNWqus_9_all.tar.gz \
/var/tmp/packages
# cd /var/tmp/packages
# gunzip SUNWqus_9_all.tar.gz
# tar xvf SUNWqus_9_all.tar
# ls l here we see four packages which needs to be installed
Note: use the command as given below, do not try to add the package
individually as it provides error.
# pkgadd d .
Note: - on providing the pkgadd command, we get a menu where we
need to specify the package number to be added.
# init 0 reboot the system to OK prompt
Here the patches and required programs are installed.
CD BURNING (WRITING)
Cdrw Syntax:
cdrw -i [-vSCO] [-d device] [-p speed] [image-file]
Listing cd devices:
# cdrw -lv
Looking for CD devices...
Node Connected Device Device type
---------------------+--------------------------------+----------------/dev/rdsk/c8t5d0s2 | YAMAHA CRW8824S 1.00 | CD Reader/Writer
Copying from cd to cd:
# cdrw -c -d <target-drive> -s <source-drive> -v
# cdrw -c -d /dev/rdsk/c1t5d0s2 -s cdrom0 -v
Copying from a directory to a cd:
# mkisofs -r <dir-name> 2>/dev/null | cdrw -i -p 4
# mkisofs -r /home/rfox/tmp 2>/dev/null | cdrw -i -p 4
Copying an iso image to a cd:
# cdrw -i -C -p 4 <iso-image-file-name>
Copying a compressed iso image to a cd:
# gzip -dc acrobat4.iso.gz | cdrw -i -C -p 4
Creating an iso image:
# mkisofs -r -o <iso-image-file-name> <path-to-files>
Some common mkisofs options:
INSTALL BOOT
Installs the boot block onto a disk to make it bootable.
# installboot /usr/platform/`uname -i`/lib/fs/ufs/bootblk
/dev/rdsk/c0t0d0s0
MOUNT
Remounting a Read-only File System
# mount -o remount,rw /dev/dsk/c0t0d0s0
How to mount an ISO image:
# lofiadm -a /<path-to-iso-file-image>
Note: lofiadm will return the device name:
/dev/lofi/1
Mount the iso image/device name just returned to your favorite mount
point.
# mount -F hsfs -o ro /dev/lofi/1 /mnt
Afterward, unmount the device and delete the iso device
# umount /mnt
# lofiadm -d /dev/lofi
SWAP
Creating Swap Space:
DHCP SERVER
Configure the dhcp server:
Create the dhcp resource file:
# vi /etc/default/dhcp
RUN_MODE=server
RESOURCE=files
PATH=/var/dhcp
Update the hosts file with dhcp client ip addresses and names:
# vi /etc/hosts
128.50.1.50 dhcpclient-1
Create the subnet for the clients:
# pntadm -C 128.50.1.0
Add clients
# pntadm -A 128.50.1.50 128.50.1.0
# pntadm -A 128.50.1.51 128.50.1.0
Create the rules database
# dhtadm -C
Create the rules
# dhtadm -A -m <rule-name> -d ':router= lettuce fluke yak:
subnet=255.255.255.0:
LeaseNeg=1:
DNSdmain=comcast.net:
DNSserv=60.8.0.6:'
Note: a list of all possible keywords can be found in /etc/dhcp/inittab.
Associate rules with dhcp clients:
# pntadm -m 128.50.1.50 -m <rule-name> 128.50.1.0
# pntadm -m 128.50.1.51 -m <rule-name> 128.50.1.0
Start dhcp daemon:
# /etc/init.d/dhcp start
Configure a dhcp client
a. Edit /etc/hostname.hme0 and remove all contents
b. Create /etc/dhcp.hme0
# touch /etc/dhcp.hme0
c. Reboot
# init 6
DNS
Configuring the Master DNS Server
A. Edit /etc/named.boot
# named.boot 2/22/2002 rfox
localhost in a 127.0.0.1
F. Edit the host-IP resoultion file (veggie.rzone)
# veggie.rzone 2/22/2002 rfox
$ORIGIN 1.50.128.in-addr.arpa.
1.50.128.in-addr-arpa. in soa lettuce.veggie.edu.
root.lettuce.veggie.edu.
( 1 43200 3600 604800 86400 )
1.50.128.in-addr.arpa. in ns lettuce.veggie.edu.
1 in ptr carrot.veggie.edu.
2 in ptr cabbage.veggie.edu.
3 in ptr lettuce.veggie.edu.
4 in prt corn.veggie.edu.
G. Edit loopback file (loopback)
# loopback 2/22/2002 rfox
$ORIGIN 0.0.127.in-addr.arpa.
0.0.127.in-addr-arpa. in soa lettuce.veggie.edu.
root.lettuce.veggie.edu. ( 1
43200 3600 604800 86400 ) 0.0.127.in-addr.arpa. in ns
lettuce.veggie.edu.
1 in ptr localhost.veggie.edu.
H. Start the daemon
# /usr/sbin/in.named
Configuring the DNS Client
A. Create the /etc/resolv.conf file:
NFS
How to NFS share/mount a CD-ROM:
Share the resource on the NFS server (the system with the CDROM locally).
1.
Network Troubleshooting