UNIX Questions and Answers
Most answers refer to Solaris 2.x systems
Hardware Issues
- How can I configure new devices
without rebooting? - What hardware diagnostic programs are
there? - Why am I having problems mounting a
floppy? - How do I connnect a Zip or JAZZ Drive?
- How can I play audio CDs and MP3 on my system?
- Show hardware configuration
- How do i get non sun cdrom drives to work
- Info on old sun hardware
- How can I change the hostid?
- How much memory does my system have?
- How to check foir disk errors
- Connecting a Sun Monitor to a PC
- Connecting a PC Monitor ta a Sun
- Cable pinouts, scsi, video, audio, serial, parallel
- Throughput MB/MHZ RPM rule of thumb
- Perl script to extract network information
Configuration Issues
- How do I solve Keyboard Translation
Errors? - Preventin stack overflow security problems
- How can i run jobs in background during light loading
- How do I configure DTLogin for other window managers?
- How do I configure CDE?
- Configuring 2 headed systems
- How to prevent CDROM popup under CDE
- How can I increase swap space?
- How can I find out and set shared memory?
- How to find out how many inodes are free and used
- What is the block size on my filesystem
- How do I dual host a system?
- How do I stop colour flashing?
- How do I make a file system bootable after a restore?
- What patches are on a system?
- What version of bind am I running?
- How do i view and set the open boot prom settings
- How do i stop people logging in ?
- Have FTP users that cannot login
- What is my screen rolosution, etc
- Jumpstart configuration files (exmples of)
- Online & Offline processors, What is ran on a processor etc
- translate disk c*t*d*s* to sd* names
NFS Issues
- Why do I get the error Stale NFS
Handle? - What does the error RPC Program not
registered mean? - How do I carry out NFS performance tuning?
- Why do I get .nfsxxxx files on NFS mounted
filesystems? - How do I find out which clients are NFS mounting
a server?
General Issues
- How to create solaris pkg's
- How to tell if you are running 32 or 64 bit under Solaris 7
- How can i run jobs in background during light loading
- What useful Solaris commands are there for finding out what's going on?
- How do I find out the speed of my machine?
- Security issues and solaris
- How do I get rid of defunct processes?
- How do i find out what a running process is doing
- How do I tar to a remote system?
- How do I copy directory structures using cpio?
- How do I stop printing a banner page?
- How do i communicate via two systems using sockets
- What is the Xerox toner for a NeWSprinter20
- How do i boot over the net via a different interface
- What is the solaris unix command on ? unix system
- Upper to lover case translation using tr
Software issues
- Jumpstart setup and configuration (currently unavailable - being re-written)
- Veritas command line arguments
- Legato command line commands
- Raid Manager 6.22 and A1000
- Solstice Disksuite (SDS) setup and configuration
- Solstace Disksuite (SDS) mirror root disk
- Samba setup and config
- SSH steup (currently unavailable - being re-written)
- clearcase checkin
- Read audio player for Solaris
- how can i build a html page of system configurations
- Graphical FTP programs for X
- What X windows Managers are there
- Free X server for 95/98/2000/NT"
- Microsoft Internet explorrer and outlook express for solaris
Networking issues
- X25 Packet Overhead Modulo 8 LAPB) or Modulo 128 (LAPBE)
- Perl script to get the tunable tcpip parameters (uses ndd)
Security issues
Firewall issues
Performance tuning issues
E10000
How do i view and set the open boot prom settings
From the unix prompt use eeprom
. From the ok prompt use devaliases
, printenv, nvedit
and nvalias
.
How do i stop people logging in ?
If the file /etc/nologin
exists then only root can login. Whatever the contents of the file are are displayed to whoever is attempting a login.
How do i boot over the net via a different interface
From the ok prompt type
show-nets
This will display the possible interfaces. Select an interface then type
nvalias net ^Y
This will set the selected interface to the alias net.
Back to Contents
How do I solve Keyboard Translation
Errors?
The most likely cause of this is an incorrect XKeysymDB
file or an
incorrect pointer to it. Try looking in /usr/openwin/lib
or/usr/openwin/lib/X11
. The Installation and Administration
manual for the application should have some information about this.
If logged in as root from another system try/usr/openwin/bin/kbd-mode -a
Why do I get the error Stale NFS
Handle?
This was probably caused by a directory being deleted while another
system was NFS mounted into it. The best action is to cd
out of the directory and perform a umount
. Sometimes
halting and restarting the automount daemon is reqired, for example:/etc/rc2.d/S74autofs [stop/start]
. or /etc/init.d/nfs.server [stop/start]
.
If none of these work, then it might have to be a reboot.
How can I configure new devices without
rebooting?
It is advisable to halt and power off the system whenever you attach new
scsi devices. However, if this is not possible try this:
- If possible stop the system with < STOP > < A >, connect the device and
typego
- Type:
drvconfig
devlinks
tapes / disks
(depending on the device attached)
Back to Contents
What does the error RPC Program not registered
mean?
Probably the NFS server has got itself a little confused. Check there is
an entry in /etc/dfs/dfstab
Try stopping and restarting the daemon, for example:/etc/init.d/nfs.server [stop/start]
If this doesn't work, try a reboot.
How do I tar to a remote system?
Tar to a remote drive:tar cvfb - 20 filenames | rsh host dd of=/dev/rmt0 obs=20b
Tar from a remote drive:rsh -n host dd if=/dev/rmt0 bs=20b | tar xvBfb - 20
filenames
Copying directory trees: cd fromdir; tar cf - . | (cd todir; tar xfBp -)
Copy directory tree to another host:cd fromdir; tar cf - * | rsh host "cd todir ; tar xf -"
How do I copy directory structure with cpio?
Use find and cpiocd fromdir; find . -name -print | cpio -pmd /todir
Back to Contents
How can I increase swap space?
Swapping onto a file system is faster than swapping to a file. If
possible, partition an area of disk as the additional swap area.
Otherwise, create a swap file with the command mkfile
(see
man page), for example: mkfile 100m swappy
Add the swap area with the command swap
(see man page) for
example:swap -a swappy
Cetting a non sun cdrom to work
The main secret is to get the cdrom to talk in 512 byte sectors. If the cdrom does this then it will work.
Saturn.tlug.org This is a good FAQ to start with or try the Sun CD FAQ. or of course your manafacturs instruction book.
How do I find out the speed of my machine?
Use the command psrinfo -v
How do I carry out NFS performance tuning?
Start with the SMCC NFS Server Performance and Tuning Guide
This is a pkgadd of SUNWabhdw and adds the guide to answerbook
SUNWadhdw is on the "Software Supplement for the Solaris 2.6 Operating
Environment" CD.
Use the command /usr/bin/nfsstat
to view the NFS statistics
What hardware diagnostic programs are
there?
Use SunVTS. This is available on the Software Supplement for the Solaris
2.6 Operating Environment CD.
If you have a fibre problem then try STORtools. You will probably need
a fibre loopback cable in order to get the most out of this.
How do I make a file system bootable after a
restore?
If you have reinstalled the / file system from backup (ieufsdump
) then you will need to recreate the boot block on
the boot disk. This is done using the installboot
command (
read the man page ), for example:
installboot
/usr/platform/`uname -i`/lib/fs/ufs/bootblk /dev/rdsk/c?t?d?s?
How do I dual host a system?
- Install the network card and cable it up. Make sure that any
jumpersettings are set. - Add the second interface name and IP to the hosts file and Name
Service. - Edit the file
/etc/hostname.interface
whereinterface
is the type, for example,le1 hme1
- Reboot the sysyem or manually set it up with
ifconfig
(see manual page)ifconfig hmse1 plumb
ifconfig hmse1 IP-Address
You may also need to perform an add route (see manual page)
route add net destination gateway metric
Back to Contents
How do I find out what patches are on a
system?
Use the command showrev -p
Use the command patchdiag -l
this also lists patches you should install.
You
will need do download a copy from sun. If you have access try
downloading from http://sunsolve.sun.com.sunsolve/patchdiag this is a
tar compressed file.
There is a tar file of patchdiag on this site but i have not set up ftp at the moment of writing this page.
How much memory does my system have?
Use the command prtconf
and grep
for the
memory, for example: prtconf |grep Memory
If you need to know what memory sims are in what slot use the perl script from Micron. A sample script is.
Sample of Memcom Script Remeber to get an official copy.
How can I play audio CDs and MP3 on my system?
For CD
Download a copy of Workman from Midwinter.com
If you have problems with sound then it might be that you cannot use
the internal sound card and will have to plug speekers int the cd
plater itself.
However this might work
edit /etc/rmmount.conf and add
action cdrom action_workman.so
/usr/local/bin/workman
try this before any other cdrom actions
For MP3 files look to the following site
Opensound
If you wish to read an audio cd under solaris and copy the files to
wav, mpeg, etc then you need the program galette available from Galette
Once you have the files stored as wav files you need to convert them to MP3 using Blade
What useful Solaris commands are there
for finding out what's going on?
This is a definite RTFM, but start with these:ps
, iostat
, nfsstat
,sar
, netstat
, snoop
,mpstat
, rpcinfo
, truss
,prtdiag
, crash
, psrinfo
,prtconf
, arp
and uptime
try looking at the enclosed perl script to get an idea of wht to look for.
Perl script to look at how the system is performing
How do I connnect a Zip Drive?
Helpful info from Iomega at
Zip Drives on Sun
basically edit /etc/format.dat and add :-
disk_type = "Zip" \
: ctlr = SCSI\
: ncyl = 2046 : acyl = 2 : pcyl = 2048 : nhead = 2\
: nsect = 40 : rpm : bpt = 20480
partition = "Zip" \
: disk = "Zip" : ctlr = SCSI \
: 2 = 0, 192480 : 2 = 0, 1159168
Jazz Drives on Sun
Back to Contents
Why do I get .nfsxxxx files on NFS mounted
filesystems?
These are temporary files used by the system to guarantee data
reliability over the unreliable nfs mount. These can be left behind by
an application or process that has terminated abnormally.
How do I stop printing a banner page?
If this is for just one print, use the -o
option, for
example:lp -o nobanner name
Otherwise, edit the file /etc/lp/interfaces/printername
and
change the option nobanner
to yes
.
How can I find out and set shared memory?
Use the command ipcs
to view what is set.
If you wish to change them, edit /etc/systems
and reboot
with -r
.
Typically, you would edit one or more of msgsys
,semsys
, shmsys
.
Check out the sun docunemt on shared memory sunworld document on shared memory
Number of inodes used and free
use the command df -F ufs -o i
What block size is my file system
use the command mkfs -m /dev/dsk/c?t?d?s?
look at the bsize value (you need to be root to run this)
How do I find out which clients are NFS mounting
a server?
Use the command dfmounts
How do I get rid of defunct processes?
These are caused by an application or process crashing, terminating
abnormally, getting confused
etc. Look for the parent process of these and kill or refresh it.
What version of bind am I running?
try /usr/ccs/bin/what /usr/sbin/in.named |grep named
Solaris 2.6 bind 4.9.4-P1
Solaris 2.5.1 bind 4.9.3-P1
Back to Contents
How can I change the hostid?
There are several ways to do this, try:
Squirrel
FAQ
Why am I having problems mounting a floppy?
How do I configure dtlogin for other window managers?
You need to create an Xresourses file to start the window manager.
cd /usr/dt/config/C/Xresources.d
copy Xresources.ow to a new name of your window manager ie Xresourses.kde.
Now edit your Xresources.kde file. Making the changes for your window manager
I.e.
Dtlogin*altDtsIncrement: True
Dtlogin*altDtName: KDE Desktop
Dtlogin*altDtKey: /usr/local/kde/bin/startkde
Dtlogin*altDtStart: /usr/local/kde/bin/startkde
Dtlogin*altDtLogo: KDElogo
copy the KDE logo KDElogo.pm to /usr/dt/appconfig/icons/C/KDElogo.pm
Dual headed sun system
Try looking at infodoc 11669.
OPenwin
openwin -dev /dev/cgsix0 left -dev /dev/cgsix1 right
CDE
edit Xservers with
:0 Local local_uid@console root /usr/openwin/bin/Xsun :0 -dev /dev/cgsix0 -dev /dev/cgsix1 right
How do I configure CDE?
The control panel
In this example I will add the workman cd player to the control panel.
Copy the CDE config file dtwm.fp from /usr/dt
to your homedirectory/.dt/types
Create an icon and place it in ~.dt/icons
. it should have a .m.pm extension. ie. Player.m.pm
Edit the dtwm.fp
file
and add following. In this case I am adding it between the help and
trash areas. the position hints is 13 so it should appear towards the
right between the help (book) icon and the trash (waste bin) icon.
CONTROL cdplayer
{
TYPE icon
CONTAINER_NAME Top
CONTAINER_TYPE BOX
POSITION_HINTS 13
PUSH_ACTION cdplayer
ICON Player
}
Create a file for what to do when the button is pushed. In the example
it is called cdplayer. The file has a .dt extension IE cdplayer.dt. The
contents of this file are.
ACTION cdplayer
{
LABEL cdplayer
TYPE COMMAND
EXEC_STRING /usr/local/bin/workman
ICON somename
WINDOW_TYPE NO_STDIO
DESCRIPTION starts cdplayer
}
The mouse menu
copy the mouse menu from /usr/dt/config/C/sys.dtwmrc to you home directory ~/.dt/types/dtwmrc.Back to Contents
edit the dtwnrc file adding or removing mouse options. In this case we will create an applications submenu and put the cdplayer in that submenu.
Firstly add the applications menu to the main menu by instering a line like this
"Applications" f.menu apps
in the DtRootMenu section. approx line 38
then hgo to the botton of the file and create the application menu. ie.
Menu apps
{
APPLICATIONS" f.title
"CD Player" f.exec "/usr/local/bin/workman"
}
How do I stop colour flashing?
Back to Contents
How do i communicate between systems using scokets
There are several ways to do this. Below is an example of a perl program that sends the string
"hey now hey now now. Sing this corrosion to me " to port 1250 on a system called mission.
On the mission server there is a program which is called via inetd that picks up this incomming
line and writes it to a file /tmp/outfile. the program is called read-socket.pl
Sample /etc/inetd.conf entry
read-socket stream tcp nowait neville /export/home/neville/read-socket.pl
Sample /etc/services entry
read-socket 1250/tcp
Sample sending program (send-line.pl)
#!/usr/bin/perl
use IO::Socket;
$sock = new IO::Socket::INET (PeerAddr => 'mission',
PeerPort => 1250,
Proto => 'tcp',
);
die "Socket could not be created. Reason $! \n" unless $sock;
print $sock "hey now hey now now. Sing this corrosion to me\n";
close ($sock);
Sample sending program (send-file.pl)
#!/usr/bin/perl
use IO::Socket;
my $FILETOSEND = "/tmp/crappy";
open (INFILE, $FILETOSEND) || die "cannot open file: $FILETOSEND \n";
$sock = new IO::Socket::INET (PeerAddr => 'mission',
PeerPort => 1250,
Proto => 'tcp',
);
die "Socket could not be created. Reason $! \n" unless $sock;
#now do the sending
select ($sock);
while (< INFILE > )
{
print $_;
}
close ($sock);
close ($INFILE);
Sample reading program (read-socket.pl)
#!/usr/bin/perl
open (OUT, ">/tmp/outfile") || die "cannot open output file \n";
print OUT < STDIN >
close (OUT);
Sample reading program as a deamon (not using /etc/system and /etc/services)
#!/usr/bin/perl
use IO::Socket;
$sock = new IO::Socket::INET (PeerPort => 1250,
Proto => 'tcp',
Listen => 10,
Reuse => 1,
);
die "Cannot start deamon on socket Reason $! \n" unless $sock;
while ($this_connection = $server->accept())
{
print $this_connection;
}
close ($sock);
Back to Contents
How do i find out what resources a running process is using
Use the proc commands below and others.
/usr/proc/bin/pmap -x $PID (see what memory is used)
/usr/proc/bin/pldd $PID (see what shared libraries are used)
/usr/proc/bin/pwdx $PID (see what the working directory is)
Download a copy of memtool from Sun. ftp://playground.sun.com/pub/memtool
Back to Contents
How can i program in curses?
If you plan to use curses to do an interface try looking at this site. It might make life easier for you
SCRMGR curses interface
Back to Contents
Get system hardware configuration
Run the command /usr/platform/arch-type/sbin/prtdiag -V
Run jobs in background during times of light system loading
Try this site
Idalize program
System stats in html format
Get a copy of DHTMLR (Do HTML Report) forom the belew site.
this is a shell script that gets system info and builds web pages.
DHTMLR program from the Sunsolve site Belgium
Graphical FTP front ends for X
There are quite a few graphical front ends for ftp available. Below are
a couple of them. Also try looking at the KDE and GNOME sites.
GNU licenses Graphical ftp
llnl xdir
Security issues and Solaris
Um yes well probably quite a few bits to add here. lets try
Back to Contents
Info on old sun hardware
This is a 7 part document
Back to Contents
Microsoft Internet Explorer and Outlook express for Solaris
Download it from
Internet Explorer
Back to Contents
How to prevent stack overflow
add noexec_user_stack to the file /etc/system
How to tell if you are in 32 or 64 bit mode
use the command isainfo -v
Disable CDROM popup under CDE
comment out the stdvolcheck stuff from
/usr/dt/config/sessionetc
Stop FTP users from logging in
Set their shell in /etc/passwd to /bin/false. Then edit /etc/shells and add a line /bin/false.
Check for disk errors
Use the commands
iostat -e or iostst -E or netstat -k
Firewall information
Probably a lot to say here lets start with
Back to Contents
Performance tuning information
Probably a lot to say here lets start with
Back to Contents
Xerox NeWSprinter20 Toner
As far as i can tell this is the toner Xerox XP 15/20
Connecting a Sun Monitor to a PC
You will need to get a fixed frequency card. Look at this site.
Monitor world
Back to Contents
Connecting a PC Monitor to a Sun
You will need to get a 13W3 to VGA connector.
Some monitors (Notably Sony based ones) will just work. Plug it it and reboot.
If not you will need to set up your monitor configurations at the NVRAM.
To set the NVRAM you need the following info.
Back to Contents
Pinouts for Scsi, Video, Audio, Parallel, serial, etc
A good site to start looking at is:
Pinouts.com
Back to Contents
What is my screen resolution, etc
Under the X11 environment run the command xdpyinfo. If not running X
then you will need to look at one of the frame buffer config commands.
Unfortunatly these are framebuffer specific but try
System/Framebuffer Command
Sparc4, Sparcx5 tcx tcxconfig
x86 kdmconfig
Ultra creator ffbconfig
Ultra PGX/M64 m64config
sparc ZX/TZX leoconfig
sparc SX cg14config
If you do not have the OS running but are at the OK pronpt try using nvedit.
Back to Contents
Upper to lower case traanslation using tr
#!/bin/sh
#translate filenames in uppercase to lowercase
for FILE in `ls`
do
NEWNAME=`echo $FILE |tr [A-Z] [a-z]`
mv $FILE $NEWNAME
done
Back to Contents
How to create solaris pkg'd
read this good article.
creating solaris packages
Back to Contents
Mb/Mhz rpm rule of thumb
A vague rule of thumb when looking at disk arrays is MB transfered is 10% of Mhz
for every 1000 rpm of disk you will get about 9 I/O's second therefore a 10,000rpm disk will have 90 I/O second
If these are in a stripe configuration of 5 working disks the the throughput
could be 400 I/O second
At the time of writing a fully populated D1000 could yeald up to 3000 I/O second
Back to Contents
Online & Offline processors and what running on a processor
useful commnads are mpstat, psrinfo, psrset, pbind
Back to Contents
Rename an e10000 domain
Take a look at this page to show how to remane a domain. The main thing
to remember is to rename the domain on the ssp as well as the domain
itself.
Renaming an E1000 Domain
Back to Contents
Powered by ScribeFire.