Skip to content


Major difference between Linux and Solaris

Introduction



Most readers coming here are more familiar with Linux than Solaris. This little page is designed to give those users some tips for running a Solaris box.
It is in no way intended as a definitive guide, and there may be lot better ways of doing things. Feel free to contribute.

ps



ps -ef on Linux will give the full command line, but with Solaris you don’t get it all.
This is particularly critical when looking at java processes.
Fortunately Solaris retains the BSD style binaries in /usr/ucb, so execute:

 /usr/ucb/ps wwaux|grep java

instead

bash



/bin/sh on Solaris is a POSIX complaint bourne shell. If you have written bash-centric scripts, replace #!/bin/sh with #!/bin/bash

NFS


Starting of NFS daemon

Instead of

# service nfsserver start

one does:

# svcadm enable network/nfs/server

Exports



Instead of the file /etc/exports, under Solaris the file /etc/dfs/dfstab needs to be edited.

Sharing with zfs

Nowadays, you would probably use zfs sharenfs eg:

# zfs set sharenfs=on zpool/sharedfolder

# zfs sharenfs=rw=server.fqdn.ch,rw=otherserver.fqdn.ch zpool/sharedfolder

An attempt at a matrix

Linux command Solaris similar command Comments
top prstat You can compile top on Solaris, but you can’t rely on it’s accuracy
free vmstat
cat /proc/meminfo prtconf | grep Memory
cat /proc/cpuinfo psrinfo -v you can also use prtconf
netstat -p lsof -i lsof is not a default command. You need the package
uname -a isainfo -b to determine how many bits your os is
java -d64 java -d64 Start java with a default of 64 bit. Linux seems to do this by default though.
cat /etc/redhat-release cat /etc/release
sysdef sysdef holds a lot of system info including kernel tunables
lsmod modinfo
strace truss

Another matrix

RHEL Solaris
Shutdown
shutdown -h now (or) poweroff shutdown -y -g0 -i5 (or) init 5
reboot reboot (or) shutdown -y -g0 -i6 (or) init 6
halt halt
Kernel
/sbin/lsmod modinfo
/sbin/insmod modload
/sbin/rmmod modunload
scanpci /usr/X11/bin/scanpci (or) prtconf -v
Printing
lp (or) lpr lp (or /usr/ucb/lpr)
lpstat (or) lpq lpstat (or /usr/ucb/lpq)
Services
/sbin/service –status-all svcs -a
/sbin/service sendmail stop svcadm disable sendmail
/sbin/service sendmail start svcadm enable sendmail
/sbin/service sendmail status svcs sendmail
/sbin/chkconfig –list svcs -a
/sbin/chkconfig –add /etc/rc3.d/f00 svccfg import f00.xml
/sbin/chkconfig sendmail on svcadm enable sendmail
Monitoring
top prstat
cat /proc/cpuinfo psrinfo -v
cat /proc/meminfo prtconf
NFS
exportfs exportfs (or) share
(edit /etc/exports) share /home (or) zfs sharenfs=on
(edit /etc/exports) unshare /home (or) zfs sharenfs=off
Networking
/sbin/mii-tool ndd (or) /sbin/dladm show-dev
ifconfig ifconfig -a
/sbin/ethtool ndd
/sbin/dhclient dhcpagent
iptables ipfilter
Storage
fdisk fdisk (and) format
parted format
mkfs -t ext3 /dev/hda1 mkfs -F ufs /dev/rdsk/c0t0d0s0 (or) newfs /dev/rdsk/c0t0d0s0
cdrecord dev=2,0 f00.iso cdrw -i f00.iso
tar xfvj f00.tar.bz2 gtar xfvj f00.tar.bz2
lvm/pv*/lv*/vg* meta*
Dev
(edit /etc/ld.so.conf) crle
gcc /opt/csw/bin/gcc
ld /usr/ccs/bin/ld

One Response

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.

  1. Akinsola says

    This is quite resourceful,it really helped me.



Some HTML is OK

or, reply to this post via trackback.



I'm happy to use Increase Sociability.