Wednesday Jun 27, 2012

Ein produktives Hobby von mir

Oops, I did it again...


Auch wenn ich seit langer Zeit Projektarbeit im Hardwaregeschäft mache, bin ich doch leidenschaftlicher Softwareentwickler. Meine ersten Programme habe ich 1981 in ein Matheheft geschrieben, noch bevor ich Zugang zu einem Rechner hatte.


Später habe ich einige Programme sogar als Shareware für Geld verkauft: Wer kennt noch ARV, das revolutionäre Dateienverwaltungsprogramm, das Dateien automatisch nach Themen soriert auf Disketten organisiert, oder T-Kal, den einfachen und benutzerfreundlichen Terminkalender?


Alle waren wirtschaftlich weniger erfolgreich, was wenig wundert. Letztendlich waren es Programme, die ich für mich geschrieben hatte, und nur aus Interesse an den betrieblichen und steuerlichen Prozessen, die mit dem Vertrieb verbunden sind, zum Verkauf angeboten habe.


 Nun habe ich es wieder getan. Wer mag, kann sich das Ergebnis unter http://www.dw-aufgaben.de  ansehen.

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.



Thursday Feb 19, 2009

Atomic flashback

I just experienced a few nostalgic hours, when I tried some of the programs I wrote 25 years ago.


Prelude


Recently, I ran across an ad offering personal computers shipping with FreeDos instead of Windows. I was suprised for the minute it took me to realize that FreeDos obviously was a placeholder, to be replaced by the buyer with the operating system of his choice.


I thought about the last time I booted a computer in dos mode; i could not really remember when, but the last time I used the dos-like command line interface of windows -- that was when I tried an emulator for a computer I used to have -- an Acorn Atom. The were a few video problems, as far as I remember, and suddenly I knew I had to try it again with a plain, real, dos environment.


Virtual DOS


Anybody remember Desqview? Before tools like these existed, you had to set up a seperate pc for every program you wanted to run simultaneously.


I have VirtualBox running on my Solaris based home pc. VirtualBox supports DOS as a guest operating system, so I did not have to set up a separate machine. I just had to download FreeDos -- that was just 8 MB in size! Setting up the virtual machine and installing FreeDos was a matter of under five minutes. How long did it take to set up MS DOS 5 from two 3.5" disks? An hour?


FreeDos comes with CD ROM drivers, doskey and editor preinstalled, so I could get right off mounting the .iso I created from the virtual Tape files I created during my last emulator sessions. The emulator I use is the Acorn Atom Emulator from Wouter Ras. It emulates the computer I did write my first BASIC programs on, the Acorn Atom. While it was a pretty basic system, with only 5K of RAM, limited graphics and almost no sound, it came with a comprehensive book, including an assembler tutorial. That was important to me, as there was no other material available in Germany for that computer (the maximum number of Acorn Atom users I knew of was three). I worked myself through this book, at first skipping the chapter on assembler because it was incomprehensible to me: When I started when I was just twelve years old. But my abilities and understanding grew with every page I read and every example I tried and re-tried, and I did not even give in when quite a few of my friends got C64s from 1983 on and played fast, colourful and noisy games that made the Atom look like a pocket calculator.


Atomic Star Trek


I had to do most of the games all by myself... Of course, Star Trek was one of them. This is a sample screen shot, with my ship ("+") being under attack by a fierce Klingon ship ("1").




It was making heavy use of the BASIC extensions the 4k SUPERBASIC extension ROM by PROGRAM POWER provided.  I remember it had to be activated using LINK 44800 or LINK #AF00...


In the end it's just...


a short trip every time I go back in time. It is nice remembering these days, but there is no way I would sit down in front of that 32x16 text mode display and doing a single line of code again.


These were just "the good old days", where I knew every zero page memory location by name....





Friday Dec 05, 2008

rsync preserving atime of source

Making rsync leave the source file's atime alone

rsync (see http://rsync.samba.org/) is a sophisticated file tree replication tool with great perfomance. 

Some people want to create exact copies of an existing file system, with all file attributes and timestamps preserved. The baseline rsync distribution replicates modification times, but not access times. There is a patch available with the patch collection distributed with rsync that enriches its functionality adding the -U command line switch to make rsync replicate atimes as well.

Still, the source file's access time is changed when rsync reads the file for replication, when the source file has been changed. This may be considered harmful, as rsync should preserve file properties.

There is a solution: Set the replication file system to read-only mode, or better, use a read-only snapshot.

Example:

There are two machines, "here" and "there", with the directory /rsynctest being replicated from here to there.

-bash-3.00#  ls -lu /rsynctest; ssh there ls -lu /rsynctest

total 36
-rw------T   1 root     root        1024 Dec  5 10:18 file-1
-rw------T   1 root     root        1024 Dec  5 10:18 file-2
-rw------T   1 root     root          12 Dec  5 10:26 file-3
-rw------T   1 root     root          12 Dec  5 10:16 file-4
-rw------T   1 root     root        1024 Dec  5 10:16 file-5
-rw------T   1 root     root        1024 Dec  5 10:16 file-6
-rw------T   1 root     root        1024 Dec  5 10:16 file-7
-rw------T   1 root     root        1024 Dec  5 10:16 file-8
-rw------T   1 root     root        1024 Dec  5 10:16 file-9
total 34
-rw------T   1 root     root        1024 Dec  5 10:16 file-1
-rw------T   1 root     root        1024 Dec  5 10:18 file-2
-rw------T   1 root     root          12 Dec  5 10:26 file-3
-rw------T   1 root     root          12 Dec  5 10:16 file-4
-rw------T   1 root     root        1024 Dec  5 10:16 file-5
-rw------T   1 root     root        1024 Dec  5 10:16 file-6
-rw------T   1 root     root        1024 Dec  5 10:16 file-7

ls -u lists access times instead of modification times.
Both file sets are identical. Now lets change a file:

-bash-3.00# echo "new content" >/rsynctest/file-5
total 36
-rw------T   1 root     root        1024 Dec  5 10:26 file-1
-rw------T   1 root     root        1024 Dec  5 10:26 file-2
-rw------T   1 root     root          12 Dec  5 10:26 file-3
-rw------T   1 root     root          12 Dec  5 10:16 file-4
-rw------T   1 root     root          12 Dec  5 10:16 file-5
-rw------T   1 root     root        1024 Dec  5 10:16 file-6
-rw------T   1 root     root        1024 Dec  5 10:16 file-7
-rw------T   1 root     root        1024 Dec  5 10:16 file-8
-rw------T   1 root     root        1024 Dec  5 10:16 file-9
total 34
-rw------T   1 root     root        1024 Dec  5 10:16 file-1
-rw------T   1 root     root          12 Dec  5 10:18 file-2
-rw------T   1 root     root          12 Dec  5 10:26 file-3
-rw------T   1 root     root        1024 Dec  5 10:16 file-4
-rw------T   1 root     root        1024 Dec  5 10:16 file-5
-rw------T   1 root     root        1024 Dec  5 10:16 file-6
-rw------T   1 root     root        1024 Dec  5 10:16 file-7
-rw------T   1 root     root        1024 Dec  5 10:16 file-8
-rw------T   1 root     root        1024 Dec  5 10:16 file-9

Note the access time did not change when updating the file. To keep rsync from changing atime when reading file-5 to send a copy to "there", lets snapshot the file system.

-bash-3.00# zfs snapshot rsynctest@atimesaver

do sync from "here" to "there":

-bash-3.00#  /usr/local/bin/rsync  -rsync-path /usr/local/bin/rsync --delete \\
--archive -U /rsynctest/.zfs/snapshot/atimesaver/ root@there:/rsynctest/

And voila, atime still intact:

-bash-3.00#  ls -lu /rsynctest; ssh there ls -lu /rsynctest
total 36
-rw------T   1 root     root        1024 Dec  5 10:16 file-1
-rw------T   1 root     root        1024 Dec  5 10:18 file-2
-rw------T   1 root     root          12 Dec  5 10:26 file-3
-rw------T   1 root     root          12 Dec  5 10:16 file-4
-rw------T   1 root     root          12 Dec  5 10:16 file-5
-rw------T   1 root     root        1024 Dec  5 10:16 file-6
-rw------T   1 root     root        1024 Dec  5 10:16 file-7
-rw------T   1 root     root        1024 Dec  5 10:16 file-8
-rw------T   1 root     root        1024 Dec  5 10:16 file-9
total 31
-rw------T   1 root     root        1024 Dec  5 10:16 file-1
-rw------T   1 root     root        1024 Dec  5 10:18 file-2
-rw------T   1 root     root          12 Dec  5 10:26 file-3
-rw------T   1 root     root          12 Dec  5 10:16 file-4
-rw------T   1 root     root          12 Dec  5 10:16 file-5
-rw------T   1 root     root        1024 Dec  5 10:16 file-6
-rw------T   1 root     root        1024 Dec  5 10:16 file-7
-rw------T   1 root     root        1024 Dec  5 10:16 file-8
-rw------T   1 root     root        1024 Dec  5 10:16 file-9

Now we can get rid of that snapshot:

-bash-3.00#  zfs destroy rsynctest@atimesaver

Note: ctime (time of last change to the inode entry) is still not replicated. Does anybody know about a fix? Then again, I can not even think of anybody/any program who needs ctimes...

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.

 

 

 

Friday Sep 07, 2007

Why?

I never wanted to start a blog.

I just thought with a job, three children and a home, I could not afford one.

However, sometimes I want to be heard. After being told frequently that Linux is better for personal use, and running my own (wife certified) Linux home production system for a few years, I decided to go for Solaris and did the migration within a few days.

I want to share this experience

  • to show people who ported software to Solaris that it's actually used and say thank you to them this way.
  • to show people that it is fun to have at home.
  • to share my experience with people who gave adviceto me

 


That's why.

Do not expect new entries each day or even week, but on occasions like this one...

 

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
« April 2014
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
   
       
Today
Bookmarks
Software for Solaris
Favourite blogs
Dirks Bookmarks

No bookmarks in folder