Solaris Tips
Just a few tips & tricks for Solaris...
Contents |
Networking
Enable DHCP
Enabling DHCP is, thanks to the Solaris startup scripts, pretty straightforward. Simply create a file (using touch
) in /etc
called dhcp.interfaceName
where interfaceName is the name of the interface that you want configured with DHCP, such as "eri0".
Set MAC address
When I got my SunBlade workstations, they both had passwords set so they wouldn't boot from CD. I was able to clear the NVRAM password on one of them, but this corrupted the IDprom - the only problematic result was that the system was detecting a MAC address of "00:00:00:00:00:00".
I could rectify this by using ifconfig
to set a MAC address, but DHCP is assigned at boot, so I was ending up with a random DHCP lease, instead of the specific IP that I had specified.
To rectify this, edit the hostname file for your interface, i.e. if you want interface "eri0", edit /etc/hostname.eri0
. Simply add a line like:
ether 01:02:03:04:05:06
specifying the MAC (ethernet) address that you want.
I found this information from Sun Docs here.
Common Tasks
Directory Size
The Solaris implementation of the du
utility differs from the common GNU/Linux implementation, most importantly in that it lacks the --max-depth
option. A (not very) easy replacement is to use: /usr/bin/ls -l | grep "^d" | awk '{print $9}' | xargs du -skh
(omit the last h for machine-readable sizes as opposed to human-readable).