Archive
Posts in Solaris
Breaking down system time usage in the Solaris kernel
I am frequently asked (or paged) to review system performance issues on our Solaris 10 hosts. I use the typical set of Solaris performance tools to observe what my systems are doing, and start drilling down once I know if the problem is with userland applications or in the kernel itself. When I observe issues with the Solaris kernel (these are typically represented by high system time values in vmstat), the first thing I typically do is fire up lockstat to see where the kernel is spending its time: If I see a function that stands out from the rest, I will use the lockstat '-f" option to drill down by the kernel function with that name, and use the "-s" option to print the call stack leading up this function: I use lockstat quite a bit to observe what the kernel is doing, and to help me figure out where I should look for answers in the opensolaris source code. It's also useful for determining if you are encountering a kernel bug, since you can compare the backtrace returned from lockstat with the OpenSolaris bug databases.
$ read more →Creating a bootable OpenSolaris USB thumb drive
This past week, I had the need to install opensolaris on a host using a USB thumb drive. To create a bootable USB drive, I first needed to snag the distribution constructor tools via mercurial (I ran these commands from an OpenSolaris host): The caiman slim source Mercurial repository contains a script named usbcopy, which you can use to copy a USB image from the genunix site to your USB drive: After the image was copied, I plugged the drive into my machine and it booted to the opensolaris desktop without issue. From there I did an install and everything appears to be working flawlessly! Nice.
$ read more →Fixing Solaris hosts that boot to a grub> prompt
I applied the latest recommended patch bundle this week to two X4140 servers running Solaris 10. When I rebooted, I was greeted with a grub> prompt instead of the grub menu: grub> This wasn't so good, and for some reason the stage1 / stage2 loaders weren't installed correctly (or the zpool upgrade caused some issues). To fix this issue, I booted to single user mode by inserting a Solaris 10 update 8 CD and adding "console=ttya -s" to the end of the boot line. Once my box booted, I ran 'zpool status' to verify my pool was available: To re-install the grub stage1 and stage2 loaders, I ran installgrub (you can get the device to use from 'zpool status'): To ensure that the boot archive was up to date, I ran 'bootadm update-archive': Once these changes were made, I init 6'ed the system and it booted successfully…
$ read more →Cleaning up space used by the OpenSolaris pkg utility
I've been experimenting with the new OpenSolaris package manager (pkg), and ran into an odd issue last weekend. The flash drive I was running image-update on filled up, and after poking around I noticed that /var/pkg had some large directories: In this specific case, pkg downloaded close to 900MB to the download directory, but failed to remove the downloaded files once the image was updated. :( The pkg tool currently doesn't have a purge option to remove old stuff in this directory, so I had to go in manually and remove everything in the download directory. It appears bug #2266 is open to address this, and removing the contents from the download directory is safe (at least according to a post I read on the pkg mailing list)…
$ read more →Configuring the Solaris FTP server to log extended data
I periodically use the stock Solaris FTP server on some of my servers, especially when I need to move tons of data around. Enabling the ftp service in Solaris is a snap: The default ftp configuration leaves a lot to be desired, especially when you consider that nothing is logged. To configure the FTP daemon to log logins, transferred files and the commands sent to the server, you can enter the svccfg shell and add some additional options to the in.ftpd command line: The "-a" option will enable the use of the ftpaccess file, the "-l" option will log each FTP session, the "-L" option will log all commands sent to the server, the "-X" option will cause all file acesses to be logged to syslog, and the "-w" option will record the logins to the wtmpx file. Since most of this information is logged using the daemon facility and info log level, you will need to add a daemon.info entry to /etc/syslog.conf if you want the data to be logged to a file (or to a remote log server)…
$ read more →