Friday Mar 05, 2010

Moving x86 Solaris boot disks to another server = hw box (or virtualized environment) - the SVM case


This is just a scratchpad waiting for formatting, please email me if you have any additonal comments.


This was done on Solaris 10 U8.


How would it look like for zfs root? Or for OpenSolaris?


Go!


connect disk obtained by ripping out single boot disk or single disk of mirror out of original server..


boot solaris dvd, choose option 6 "shell"


for slices not svm encapsulated, installer will ask you if you would like to have solaris slice mounted, if not, it will tell you it's svm managed and will not do it by itself. you have to do it by hand. no problem.


on the shell:


export TERM


TERM=at386


Locate boot slice


format


example: c1t0d0s3, replace by actual slice name


mount /dev/dsk/c1t0d0s3 /a


rebuld device tree


mv /a/dev /a/dev.old


mv /a/devices /a/devices.old


tar cpf - dev | ( cd /a; tar xvpf - )


tar cpf - devices | (cd /a;tar xvpf -)


Ajust system file


if root disk was mirrored:


vi /a/etc/system


delete line with rootdev:


Adjust vfstab


vi /etc/vfstab


change entry for / to point to correct slice (the one mounted as /a right now)


if unsure, move swap entries aside


Adjust bootenv.rc


ls -l /dev/rdsk/c1t0d0s3 >>/a/boot/solaris/bootenv.rc


vi  /a/boot/solaris/bootenv.rc


change bootpath to device name appended to this file by ls command, to everything after /devices. use x to delete old path J to join lines and x again to remove surplus ls output.


Adjust grub menu


vi /boot/grub/menu.lst


create entry


title active
root (hd0,0,d)
kernel /platform/i86pc/multiboot
module /platform/i86pc/boot_archive


where hd0=first disk (see bios), 0=first primary partition (see fdisk /dev/rdsk/c1t0d0p0 if necessary)),  a=slice0, b=slice1, c=slice2 d=slice3 etc


Update boot archive


bootadm update-archive -R /a


Repair grub


installgrub /boot/grub/stage1 /boot/grub/stage2 /dev/rdsk/c1t0d0s3


Done


reboot



et voila - should work now


maybe you want to interrupt boot at grub menu, e)dit boot script and add " -s" to "multiboot" line for single user startup.


Some more cleanup to be done...


ethernet interface names


zfs imports


other fs


ip address?



Another way


would be to create a flar archive and do a network based install from that -- but you would have to recreate system identity, ssh keys etc, see sys-unconfig.



Wednesday Jan 02, 2008

Sending SMS text messages

Sending birthday reminders by SMS

Since I now have a system that is running 24h again, I remembered that I once had my Linux server send me reminders to my mobile phone via modem.

On Linux, I used yaps ("Yet another pager software") to send sms text messages. During the christmas holidays, I set up yaps to send birthday reminders on my new Solaris server.

yaps is free software, see http://freshmeat.net/projects/yaps/ on what it is and where to get it.

You will have to compile it for yourself, but it is easy. To have it run side-by-side with mgetty, I had to change the include file used to determine the lock file name. There seem to be different naming conventions for SysV uucp devide locking. I changed config.h to look like this:

 

 /\*
 \* one of these is required for SysV like lockfiles
 \*/
# define        HAVE_SYS_SYSMACROS_H    0
# define        HAVE_SYS_MKDEV_H        1

 

The default is set to use sysmacros.h instead of mkev.h, which worked for me.

 

Now

yaps 0172xxxxxxx "30.01 Dirks Birthday"

will remind me of by own birthday..

That's all. A script will call my home-grown "ute" appointment reminder to extract current reminders and invoke yaps if anything's up.

 

 

 

Tuesday Nov 06, 2007

Live Upgrading

A short look at Live Upgrade


Have you ever used Solaris Live Upgrade or wondered what it looks like?


Here you go...


I just did a small demonstration and thought I share the logs with you.


Step One: Create a new boot environment


This means looking for space to accomodate the OS copy.


As we have a rather simple setup with a single file system for root (/), we just have to provide a place for this one. BTW: Live Upgrade can re-layout your file system on the fly. If I wanted to put /var in its own file system, I could just add a mount point for it (lucreate can create mirrored file systems, too).


In this case, c0t1d0s3 is an unused 10GB slice my 5GB plain Solaris will nicely fit into.


root@m8000b-test # lucreate -n toms -m /:/dev/dsk/c0t1d0s3:ufs
Discovering physical storage devices
Discovering logical storage devices
Cross referencing storage devices with boot environment configurations
Determining types of file systems supported
Validating file system requests
Preparing logical storage devices
Preparing physical storage devices
Configuring physical storage devices
Configuring logical storage devices
Analyzing system configuration.
Comparing source boot environment <production> file systems with the file
system(s) you specified for the new boot environment. Determining which
file systems should be in the new boot environment.
Updating boot environment description database on all BEs.
Searching /dev for possible boot environment filesystem devices


Updating system configuration files.
The device </dev/dsk/c0t1d0s3> is not a root device for any boot environment; cannot get BE ID.
Creating configuration for boot environment <toms>.
Source boot environment is <production>.
Creating boot environment <toms>.
Creating file systems on boot environment <toms>.
Creating <ufs> file system for </> in zone <global> on </dev/dsk/c0t1d0s3>.
Mounting file systems for boot environment <toms>.
Calculating required sizes of file systems for boot environment <toms>.
Populating file systems on boot environment <toms>.
Checking selection integrity.
Integrity check OK.
Populating contents of mount point </>.
Copying.
Creating shared file system mount points.
Creating compare databases for boot environment <toms>.
Creating compare database for file system </>.
Updating compare databases on boot environment <toms>.
Updating compare databases on boot environment <kopie>.
Making boot environment <toms> bootable.
Setting root slice to </dev/dsk/c0t1d0s3>.
Population of boot environment <toms> successful.
Creation of boot environment <toms> successful.
root@m8000b-test #


This process took about ten minutes. This is the result:

root@m8000b-test # lustatus
Boot Environment           Is       Active Active    Can    Copy
Name                       Complete Now    On Reboot Delete Status
-------------------------- -------- ------ --------- ------ ----------
production                 yes      yes    yes       no     -
toms                       yes      no     no        yes    -


Step two: Do the upgrade


To upgrade, I have to provide the location of the OS install media. In this case, we copied the DVD to the installation server "iserv" which exports it via nfs.


root@m8000b-test # luupgrade -u -n toms -s /net/iserv/export/upgrade/sol10_u4/


159648 blocks
miniroot filesystem is <lofs>
Mounting miniroot at </net/iserv/export/upgrade/sol10_u4//Solaris_10/Tools/Boot>
Validating the contents of the media </net/iserv/export/upgrade/sol10_u4/>.
The media is a standard Solaris media.
The media contains an operating system upgrade image.
The media contains <Solaris> version <10>.
Constructing upgrade profile to use.
Locating the operating system upgrade program.
Checking for existence of previously scheduled Live Upgrade requests.
Creating upgrade profile for BE <toms>.
Determining packages to install or upgrade for BE <toms>.
Performing the operating system upgrade of the BE <toms>.
CAUTION: Interrupting this process may leave the boot environment unstable
or unbootable.
Upgrading Solaris: 100% completed
Installation of the packages from this media is complete.
Updating package information on boot environment <toms>.
Package information successfully updated on boot environment <toms>.
Adding operating system patches to the BE <toms>.
The operating system patch installation is complete.
INFORMATION: The file </var/sadm/system/logs/upgrade_log> on boot
environment <toms> contains a log of the upgrade operation.
INFORMATION: The file </var/sadm/system/data/upgrade_cleanup> on boot
environment <toms> contains a log of cleanup operations required.
INFORMATION: Review the files listed above. Remember that all of the files
are located on boot environment <toms>. Before you activate boot
environment <toms>, determine if any additional system maintenance is
required or if additional media of the software distribution must be
installed.
The Solaris upgrade of the boot environment <toms> is complete.


The upgrade took about 1 hour.


Step three: Reboot


Wanna boot the new OS? luactivate takes care of everything necessary.


root@m8000b-test # luactivate -n toms


\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
The target boot environment has been activated. It will be used when you
reboot. NOTE: You MUST NOT USE the reboot, halt, or uadmin commands. You
MUST USE either the init or the shutdown command when you reboot. If you
do not use either init or shutdown, the system will not boot using the
target BE.
\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
In case of a failure while booting to the target BE, the following process
needs to be followed to fallback to the currently working boot environment:
1. Enter the PROM monitor (ok prompt).
2. Change the boot device back to the original boot environment
by typing:
     setenv boot-device
/pci@20,600000/pci@0/scsi@1/disk@0,0:a
3
. Boot to the original boot environment by typing:
     boot
\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
Activation of boot environment <toms> successful.


Ok, there we go...


Rebooting with command: boot
Boot device:
/pci@20,600000/pci@0/scsi@1/disk@1,0:d  File and args:
SunOS Release 5.10 Version Generic_120011-14 64-bit
Copyright 1983-2007 Sun Microsystems, Inc.  All rights reserved.
Use is subject to license terms.
Hostname: m8000b-test
Configuring devices.
Loading smf(5) service descriptions: 29/33
Nov  6 13:46:23 svc.startd[7]: svc:/system/rcap:default: Method ":kill -SIGHUP" failed with exit status 1.
Nov  6 13:46:23 svc.startd[7]: svc:/system/rcap:default: Method ":kill -SIGHUP" failed with exit status 1.
Nov  6 13:46:23 svc.startd[7]: svc:/system/rcap:default: Method ":kill -SIGHUP" failed with exit status 1.
Nov  6 13:46:23 svc.startd[7]: system/rcap:default failed: transitioned to maintenance (see 'svcs -xv' for details)  33/33


m8000b-test console login: root
Password:
Last login: Mon Nov  5 17:15:15 from 10.67.213.111
Nov  6 13:48:44 m8000b-test login: ROOT LOGIN /dev/console
Sun Microsystems Inc.   SunOS 5.10      Generic January 2005


TERM=vt100


root@m8000b-test # lustatus
Boot Environment           Is       Active Active    Can    Copy
Name                       Complete Now    On Reboot Delete Status
-------------------------- -------- ------ --------- ------ ----------
production                 yes      no     no        yes    -
toms                       yes      yes    yes       no     -


Step four (there and back again...) (optional)


Is everything ok with the Upgrade?
If not, switching back is a matter of minutes:


root@m8000b-test # luactivate -n production



\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
The target boot environment has been activated. It will be used when you
reboot. NOTE: You MUST NOT USE the reboot, halt, or uadmin commands. You
MUST USE either the init or the shutdown command when you reboot. If you
do not use either init or shutdown, the system will not boot using the
target BE.


\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
In case of a failure while booting to the target BE, the following process
needs to be followed to fallback to the currently working boot environment:
1. Enter the PROM monitor (ok prompt).
2. Change the boot device back to the original boot environment by typing:
     setenv boot-device /pci@20,600000/pci@0/scsi@1/disk@1,0:c
3. Boot to the original boot environment by typing:
     boot
\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*


Activation of boot environment <production> successful.
root@m8000b-test # init 6
root@m8000b-test #
Nov  6 13:49:10 m8000b-test ip: ip_create_dl: hw addr length = 0
svc.startd: The system is coming down.  Please wait.
svc.startd: 98 system services are now being stopped.
Nov  6 13:49:56 m8000b-test agent[2249]: syslog   Nov 06 13:49:56 agent         {received software termination signal}
Nov  6 13:49:56 m8000b-test agent[2249]: syslog   Nov 06 13:49:56 agent         \*\*\* terminating execution \*\*\*
Nov  6 13:50:01 m8000b-test ip: ipsec_check_inbound_policy: Policy Failure for the incoming packet (not secure); Source 192.168.224.001, Destination 192.168.224.003.
Nov  6 13:50:02 m8000b-test ip: ip_create_dl: hw addr length = 0
Nov  6 13:50:02 m8000b-test rpc.metad: Terminated
Nov  6 13:50:02 m8000b-test syslogd: going down on signal 15
Nov  6 13:51:35 svc.startd[7]: svc:/application/management/sunmcagent:default: Method or service exit timed out.  Killing contract 52.
Nov  6 13:51:35 svc.startd[7]: application/management/sunmcagent:default failed: transitioned to maintenance (see 'svcs -xv' for details)
svc.startd: The system is down.
syncing file systems... done
rebooting...
Resetting...
..POST Sequence 01
POST Sequence 02
..
POST Sequence 1A
POST Sequence Complete.
ChassisSerialNumber xxxxxxxx


Sun SPARC Enterprise M8000 Server, using Domain console
Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
Copyright 2007 Sun Microsystems, Inc. and Fujitsu Limited. All rights reserved.
OpenBoot 4.24.1, 16384 MB memory installed, Serial #xxxxxxxxx.
Ethernet address 0:xx:xx:xx:xx:x, Host ID: xxxxxxxxx.

Rebooting with command: boot
Boot device:
/pci@20,600000/pci@0/scsi@1/disk@0,0:a  File and args:
SunOS Release 5.10 Version Generic_120011-11 64-bit
Copyright 1983-2007 Sun Microsystems, Inc.  All rights reserved.
Use is subject to license terms.
Hostname: m8000b-test


m8000b-test console login: root
Password:
Last login: Mon Nov  5 17:15:15 from 10.67.213.111
Nov  6 13:56:02 m8000b-test login: ROOT LOGIN /dev/console
Sun Microsystems Inc.   SunOS 5.10      Generic January 2005

TERM=vt100


root@m8000b-test # lustatus
Boot Environment           Is       Active Active    Can    Copy
Name                       Complete Now    On Reboot Delete Status
-------------------------- -------- ------ --------- ------ ----------
production                 yes      yes    yes       no     -
toms                       yes      no     no        yes    -


root@m8000b-test # init 6


And so on...


It is an easy, unattended, quick and safe way to do OS upgrades with Live Upgrade.


You can use it to create a copy of your system before you do an oracle upgrade, too. Just tell Live Upgrade to copy your Oracle binaries as well (see man lucreate on how to do that). Look at lumake, too.

 

Update Nov 23, 2007: "bbr" reminded me that I should have upgraded Live Upgrade Packages before doing the actual upgrade. Correct. This is done by removing lu Packages and re-installing them from the version you want to upgrade to (or newer).

Friday Sep 07, 2007

Solaris@Home

Finally, I have my Solaris based homeserver up and running. It took me quite some time to decide which hardware to buy, as I found it difficult to judge which compontents will work out of the box and which would need drivers from third party sources which I wanted to avoid. There is a lot of information available, including the Hardware compatibility list, but some information is outdated or incomplete. This is why I thought I should share my experience.

If you have any questions, just write me a mail: dirk.wriedt@sun.com.

Before

Old setup

I had been running my home production system on Red Hat Linux 9 for a few years. This is what I was running and had to be moved to Solaris:

  • StarOffice
  • Agfa Snapscan Touch USB scanner with SANE/xsane.
  • evolution mail client
  • digital photo repository keeping family's photos
  • gqview to view photos
  • amavisd-new email Virus/SPAM scanner with Avira/SpamAssassin
  • ldap directory service for address book running on openldap
  • mozilla/firefox web browser
  • grip to rip CDs
  • xmms to play ripped CDs...
  • mgetty & sendfax to receive and send faxes

New Features I wanted to have

  • Sun Ray Server to run three Sun Rays I had bought, thinking about how I could provide my wife and children with their own workstations without having to administer ten PCs.
  • Big fat secure hassle-free file system to keep my photos in a safe place

The new way

Server Hardware

I bought the following:

  • Asus M2NPV-VM Mainboard for approx EUR 80. This board has disk connectors for 2x2 channels IDE and 4 SATA and onboard video.
  • AMD x2 dual core processor, the small one.
  • 2 GB of Kingston Memory @ EUR 45 each
  • three 500 GB Samsung SATA disks @ EUR 100 each
  • a rack-mountable case with power supply, fans and space for eight disks (6x5.25", 2x3.5")
  • cheap DVD Burner @ 30 EUR

I used a spare IBM Deskstar Disk as a boot disk and an old realtek pci network card for a second network interface facing the internet. After putting everything together, I was delighted to see that

  • I did not need a third-party driver for the on-board nge0 network interface (although the hcl report said so)
  • The SATA disks were accessible (although in pata compatiblity mode)
  • the Firewire interface was recognized I did not care about audio and video (nvidia), although the latter worked out of the box.

 

Sun Rays

I had already bought three Sun Rays on ebay at about 50 EUR each.

After

Software

Well, of course it took me a few nights to set everything up.

  • StarOffice and evolution worked as before
  • gqview, mozilla, firefox, sane were available from Blastwave.
  • I installed a load of other packages from Blastwave, xpdf and evince amongst them (I like xpdf better for pdf viewing that evince)

Connecting the Scanner

This was were I expected to spend quite a bit of time on. I did a proof of concept with my notebook, where I had to recompile sane-backend as it was lacking usb support, and still had to manually integrate the backend for my scanner. I took the sane-backends from csw, too, but used the libusb that came with Solaris. I learned that my Scanned (niash chipset) is now natively supported by sane-backend, and thus, to my astonishment, the scanner connected to the Sun Ray worked out of the box.

The libusb plugin for Sun Ray worked instantly:

scanimage -L did show my scanner!

It is somewhat slower than before now, as the scanner is now connected to the Sun Ray which supports usb1.1 only, compared directly attaching to the server's usb2.0 port.

Mail

Configuring amavisd-new in the dual sendmail setup was time-consuming but not really difficult, as there is a pretty good walkthough in the documentation. I use Avira AntiVir PersonalEdition Classic for Virus Scans and SPAMassassin to fight SPAM.

I am running the cyrus imapd I got from Blastwave. Mail is being fetched by fetchmail, running as root, every five minutes. My email provider is doing "pop before smtp" and this way, I get my mail almost instantly, and sendmail can send mail all the time.

Sun Rays

The Sun Rays worked as expected, with two minor issues left:

  •  Every now and then, when rebooting, the dhcp server will not start up, claiming it can not access its configuration. As the Sun Rays rely on a working dhcp server, this is really annoying to me.
  • As expected, the Sun Ray is not really capable of displaying full-screen videos. However, did you know there is an mplayer version with support for Sun Rays? With that player, watching videos at 800x600 is feasible. Flash-Based video with low res, low size and low frame rate (Youtube) is not a problem at all.
  • Listening to music (xmms) is working perfectly.

ZFS

ZFS is just great for home use, as you do not have to worry about file system sizes. To have raidz feels a lot better that running in an unprotected fashion.I still have to invest in a hot spare disk.

And, while a power spark may just fry all of your disks at once, snapshots can at least protect you from the consequences of "rm -rf".

ZFS eats lots of RAM. I had seen reports on that behaviour before and I feel inclined to do something about it. I have a TV set top box (Siemens Gigaset M740AV) that records to ZFS via NFS, and doing so, it trashes my file system cache. When I log in after watching tv, starting the gnome session takes ages as the cache is rebuilt slowly. I know about the way to change cache usage with mdb, but maybe I am just going to add memory.

Squid

I am using the squid proxy cache. As for sendmail and amavisd-new, I did my own SMF Manifests to have it being managed by smf. SquidGuard implementation is pending.

LDAP

I now run the Sun Directory Server. Migrating from the crappy openldap export took quite some time and a few scripts.

Recovery

After migrating all data to the new server, I had some more spare disks, and decided to replace that deskstar boot drive with a faster one. Somehow I managed to trash my root file system when preparing the Live Upgrade.

Lucky me, I had created a flash archive two days earlier, as LiveUpgrade lucreate trashed by root file system. I have no clue why. Anyway, with that flash on a different server, I booted from the Solaris DVD, selected installation from flash, and after two hours (including some testing afterwards) the system was back up.

DVD Authoring

I would like burn video DVDs, but there is no decent cutting or dvd authoring software that runs on Solaris. Any hints?

Performance

In my setup, the limiting factor is disk performance. When starting applications, the (single and slow) boot disk was at 97%. The cpu load barely went above 30%, even when doing mencoder- (video) oder lame- (audio) encoding. I have never seen a system load of above 1. That said, I wonder why I rarely see disk read rates above 5 MB/s. ZFS pool scrubs show rates of 50 MB/s on the SATA disks, but even when the boot disk is 100% busy, read rates look slow to me.

Now that I have the new disk in place, I expect them to increase.

Power consumption

With four disks, no overclocking, no ata spindown, power consumption is at 110 Watts. I will try and enable ata spindown, and see if it changes significantly. I just have to get a new wattmeter, mine just died after a power outage.

Conclusion

All in all, I did not expect the migration to run as smoothly as it did. There were absolutely no driver issues (I have not checked audio yet). I have most applications I need, and all that I had on Linux. Hmm. Not quite. Gnometoaster is missing. Still, Solaris lacks support for DVD authoring, first person shooters, and support by ISVs for childrens' games. 

About

Dirk Wriedt

Search

Categories
Archives
« March 2015
SunMonTueWedThuFriSat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
    
       
Today
Bookmarks
Software for Solaris
Favourite blogs
Dirks Bookmarks

No bookmarks in folder