Archive for the ‘Solaris’ Category

A quick tour to Solaris 10

Tuesday, August 30th, 2005

Probably at this point you’ve heard a lot of hype regarding Solaris 10. Well, Ben Rockwood’s blog has a quick primer on Sun Solaris 10. Enjoy this nice introduction.

Display system configuration

Saturday, August 6th, 2005

If you are new to Solaris world, don’t forget to add prtconf to your arsenal. This command provides you with information of your sistem configuration.

Simply type the following…

prtconf -v

apt-get for Solaris

Thursday, March 24th, 2005

Recently I’ve discovered what could be the equivalent of apt-get for Solaris: pkg-get. This tool can help you to download and install freeware software. It also can download dependecies if the package have such a thing.

More information…

OpenSolaris has born

Wednesday, January 26th, 2005

Sun Microsystems announced that the source code for Solaris 10 will be available as Open Source. From their website:

January 25, 2005 - Sun Microsystems, Inc. (Nasdaq: SUNW) today announced that the source code for Solaris 10 - the most advanced operating system in the industry - will be made available under the OSI (Open Source Initiative) approved Common Development and Distribution License (CDDL). The company has established a community Web site at opensolaris.org. Buildable source code for Solaris will be available at this site in the second quarter of 2005.

More info can be found in the press release and in opensolaris.org.

On the other hand Gentoo announced plans to add OpenSolaris support to Portage, being Portaris project a key component.

Basic control of the tape device

Sunday, September 26th, 2004

The mt command, magnetic tape control allows you to send commands to a magnetic tape. Next you’ll find some basic usage of this utility.

Print status information:

mt -f /dev/rmt/0n status

Rewind the tape:

mt -f /dev/rmt/0n rewind

Erase the entire tape. Be careful with this.

mt -f /dev/rmt/0n erase

Now suppose you want to back a directory called /var/backup:

tar -cvf /dev/rmt/0n /var/backup

And type the following to see its content:

tar tvf /dev/rmt/0n

Now dump a disk slice:

ufsdump 0cvf /dev/rmt/0 /dev/rdsk/c0t0d0s0

or a directory…

ufsdump 0cvf /dev/rmt/0 /var/backup

Now restore a dump:

ufsrestore rvf /dev/rmt/0

References:

Signals for kill

Friday, July 16th, 2004

Here goes a list of kill signals:


SIGHUP 1 Exit Hangup
SIGINT 2 Exit Interrupt
SIGQUIT 3 Core Quit
SIGILL 4 Core Illegal Instruction
SIGTRAP 5 Core Trace or Breakpoint Trap
SIGABRT 6 Core Abort
SIGEMT 7 Core Emulation Trap
SIGFPE 8 Core Arithmetic Exception
SIGKILL 9 Exit Killed
SIGBUS 10 Core Bus Error
SIGSEGV 11 Core Segmentation Fault
SIGSYS 12 Core Bad System Call
SIGPIPE 13 Exit Broken Pipe
SIGALRM 14 Exit Alarm Clock
SIGTERM 15 Exit Terminated
SIGUSR1 16 Exit User Signal 1
SIGUSR2 17 Exit User Signal 2
SIGCHLD 18 Ignore Child Status Changed
SIGPWR 19 Ignore Power Fail or Restart
SIGWINCH 20 Ignore Window Size Change
SIGURG 21 Ignore Urgent Socket Condition
SIGPOLL 22 Exit Pollable Event
SIGSTOP 23 Stop Stopped (signal)
SIGTSTP 24 Stop Stopped (user)
SIGCONT 25 Ignore Continued
SIGTTIN 26 Stop Stopped (tty input)
SIGTTOU 27 Stop Stopped (tty output)
SIGVTALRM 28 Exit Virtual Timer Expired
SIGPROF 29 Exit Profiling Timer Expired
SIGXCPU 30 Core CPU time limit exceeded
SIGXFSZ 31 Core File size limit exceeded
SIGWAITING 32 Ignore Concurrency signal reserved by threads library
SIGLWP 33 Ignore Inter-LWP signal reserved by threads library
SIGFREEZE 34 Ignore Check point Freeze
SIGTHAW 35 Ignore Check point Thaw

Adding static routes to Solaris

Monday, July 12th, 2004

From the Sun FAQ on routing:

Static routes are usually only used in conjunction with a /etc/defaultrouter. You might do so if you had a couple of networks which you did not want to go through your defaultrouter. In that case, you will probably want to make the routes permanent, by adding the route commands to the /etc/init.d/inetinit file.

You can not use the above method to add static routes if you are running in.routed, as in.routed will automatically remove them after 90 seconds. If you are using in.routed, but want to include a few static routes, you can do this with the /etc/gateways file.

A simpler approach to this question would be to create an init script and add your routes:

vi /etc/rc2.d/S76static-routes

route add net 192.168.10.0 netmask 255.255.255.0 192.168.10.1 1

Lost Solaris password?

Monday, June 7th, 2004

If you forget your root password follow this procedure to erase the current password and specify a new one.

Let’s start by inserting the Solaris installation CD-ROM and then shutting down the system. Press…

Stop-A

This will bring you the OK prompt. Now type:

boot cdrom -s

and after a few minutes you will automatically be logged in as root in single user mode. It is possible that you get messages from your system claiming that some partitions were not cleanly unmounted. If this is the case check the partition as follows (assuming that your root partition is mounted on /dev/dsk/c0t0d0s0):

fsck -y /dev/dsk/c0t0d0s0

Now mount your root partition…

mount /dev/dsk/c0t0d0s0 /a

and edit /a/etc/shadow. Find root’s entry in this file and remove the second field (encrypted root password) so it looks like…

root::98765::::::

After making your change, save the file and reboot the system.

reboot

You are now able to log into the system without a password for root. So now use the passwd command to set root’s password.

Unable to boot a Solaris box

Saturday, March 27th, 2004

A few days ago one of my Solaris box’s filesystem got full of space so I was unable to get the system working properly and I was unable to boot it. This tip will show you how I got rid of this issue.

First of all insert the Solaris installation CD-ROM and boot your machine. Then press STOP-a and type the following in the prompt:

boot cdrom -s

After a few minutes you’ll get a prompt where you could start your job. In my case I did the following to free some space:

mount /dev/c0t0d0s0 /mount_point
find /mount_point -size +1000000 | sort -nr | more

Once you’ve done…

reboot

Note that this tip is also valid in other circumstances where you are unable to boot your system.

Interrupting the boot sequence

Tuesday, March 16th, 2004

This trick is useful if you have problems booting your SPARC machine.

To interrupt the boot sequence, use the key combination Stop-A or L1-A on a Sun keyboard. If your system uses a serial console (i.e. minicom) send a BREAK. For example in minicom use CTRL-A F.