Sep 222003
 

Backups and serial console servers

It’s funny what keeps us awake at night. It might be the root beer and popcorn I had about 9 hours ago as I sat and watched a movie. Or it might be that I have two pet projects on the go and they are about to reach a milestone.

The first, and longest running of these projects involves Bacula on FreeBSD. The second is a serial console server.

Bacula – why?

Bacula has been around for a few years. I never heard of it early 2003, when it was mentioned to me on IRC. The FreeBSD port turned up in February, and I started playing in early May. I’ve even submitted two PRs to upgrade Bacula. I quickly came to like Bacula because:

  • it was able to backup to disk or tape
  • the server ran on various platforms
  • the clients ran on Windows as well as the above platforms
  • the ability to schedule different jobs at different times/days
  • it used a database to record backup information
  • it appeared to be well structured and laid out for expansion

As time went on, I learned that Bacula could do a few things that my other backup software (Amanda) could not:

  • backup to disk 1
  • create backups which span media 2
  • put more than one backup on a given volume (i.e. tape), also known as appending 3

1 I have been told that Amanda can dump to disk, but it is not part of the design.
2 They want to change that.
3 This is by design. See their FAQ for detail.

Granted, I had not actually used Amanda, but I had looked at it. I had installed the software and I was getting ready to deploy it. Then I found Bacula.

A few other advantages of Bacula:

  • Multiple backup jobs (but not simultaneous)
  • Job sequencing using priorities
  • Restore of a complete system starting from bare metal
  • Autochanger support
  • Support for autochanger barcodes
For complete information, see The Current State of Bacula.

Bacula – coming soon

I had been given a DAT drive with a 4-tape changer by Marius Sorteberg (thanks). I immediately started playing with Bacula on that machine. I liked the way Bacula was set up to use a database in conjunction with scheduled jobs. My immediate goal was to create a PostgreSQL port of this tool (it uses MySQL or SQLite at present). I also want to create a web interface for it. Given that the archive information is in a database, Bacula just screams out for a web application.

Let’s walk, then run. First, I wanted to test Bacula on my setup. I knew nothing about my DAT drive, and my tapes were aging. I started backing up large amounts of data and restoring them. I found a problem. If a file spanned two tapes, the restored file was not the same size as the original file.

Say what?

Kern Sibbald, the author of Bacula, has to be one of the most patient developers I know. Backup software isn’t the most glamorous of applications. You don’t hear people bragging about their latest backup app. Yet Kern has been working away on this application for years. It’s well designed, and has great potential. Kern has been very helpful with the problem I found. We have slowly tracked down the cause of the problem. The bug was difficult to isolate because the problem occurred at the end of the tape and that meant testing was very time consuming. We never thought the problem would be with the pthreads library, but it was.

With assistance from people on the FreeBSD SCSI list, we’ve found a bug in the pthreads library of FreeBSD 4.*. The problem doesn’t exist on 5.* because it does not rely on non-blocking file descriptors. On FreeBSD 5.*, Bacula runs fine, with either libkse or libthr (the two threading libraries available).

Kern and I have been able to isolate the bug, and in conjunction with advice from the freebsd-hackers and freebsd-standards mailing lists, a patch has been created. Preliminary testing has been very promising. We have to do more testing before we are satisfied that it works. Then it’ll go into -CURRENT, and after some testing there, it’ll be merged from current (MFC’d) into -STABLE.

Watch this space. [NOTE: This patch was committed on 29 Sep 2003, and was merged from current into stable on 11 Oct 2003 and therefore will be available in FreeBSD 4.9. For details, pleaes refer to the commit log.]

Serial Console Servers

Serial consoles are your friend. They make life easier when your box is not healthy. I was given a Boca 8 port serial card by David Martin. I’m trying to get it running. I’m having no success. It seems that FreeBSD just doesn’t see the card.

The FreeBSD handbook has a small blurb on multi-port serial cards within the Serial Communications section of the FreeBSD FAQ. You also want to read man sio(4). Based upon the above resources, I added the following entries to my kernel configuration file:

options         COM_MULTIPORT
device sio4  at isa? port 0x100 flags 0xb05
device sio5  at isa? port 0x108 flags 0xb05
device sio6  at isa? port 0x110 flags 0xb05
device sio7  at isa? port 0x118 flags 0xb05
device sio8  at isa? port 0x120 flags 0xb05
device sio9  at isa? port 0x128 flags 0xb05
device sio10 at isa? port 0x130 flags 0xb05
device sio11 at isa? port 0x138 flags 0xb05 irq 10

But dmesg doesn’t show anything for sio4..11. What am I missing?

  10 Responses to “Backups and serial console servers”

  1. The page linked in the article for the Boca serial card doesn’t have a picture to enlarge 🙂

    • OOOO!

      Fixed. I didn’t commit something I should have….

      Thank you.


      The Man Behind The Curtain

    • Also in Boca serial page, the jumpers link photo is pointing to the jacks photo and the jacks link one is pointing to the jumpers photo.

      [%sig%]

    • Under OpenBSD, one must also uncomment the following line from the kernel config (its not enabled by defaut in the GENERIC):
      boca0 at isa? port 0x100 irq 5 # BOCA 8-port serial cards

      My guess, is that while you have created eight potential com ports, you don’t have boca support compiled into your kernel.

      [%sig%]

      • kilo wrote:

        > Under OpenBSD, one must also uncomment the following line from
        > the kernel config (its not enabled by defaut in the GENERIC):
        > boca0 at isa? port 0x100 irq 5 # BOCA 8-port serial
        > cards
        >
        >
        > My guess, is that while you have created eight potential com
        > ports, you don’t have boca support compiled into your kernel.

        [dan@polo:/usr/src/sys/i386/conf] $ grep -i boca *
        [dan@polo:/usr/src/sys/i386/conf] $

        It appears that FreeBSD has no such option.


        The Man Behind The Curtain

        • Dan wrote:

          > [dan@polo:/usr/src/sys/i386/conf] $ grep -i boca *
          > [dan@polo:/usr/src/sys/i386/conf] $
          >
          > It appears that FreeBSD has no such option.

          So let me ask a dumb question… how do you know that the boca card is actually supported by FreeBSD?

          I used to run a cluster of servers with a Cyclades-powered serial console server, and it required the insertion of a "cy" driver statement into the kernel config in addition to the other statements you listed above.

          – Julian

          [%sig%]

          • julian wrote:

            > Dan wrote:
            >
            > > [dan@polo:/usr/src/sys/i386/conf] $ grep -i boca *
            > > [dan@polo:/usr/src/sys/i386/conf] $
            > >
            > > It appears that FreeBSD has no such option.
            >
            > So let me ask a dumb question… how do you know that the boca
            > card is actually supported by FreeBSD?

            http://www.freebsd.org/releases/4.8R/hardware-i386.html
            Look for 3.8 Multi-port Serial Interfaces


            The Man Behind The Curtain

          • Dan wrote:

            > http://www.freebsd.org/releases/4.8R/hardware-i386.html
            > Look for 3.8 Multi-port Serial Interfaces

            Well, what’s in your kernel log when you tried to verbose (boot -v at loader prompt or boot_verbose="YES" line at /boon/loader.conf) boot?

            I suspect wrong setting of base address, which will be shown in verbose boot log and normally hidden in non-verbose booting…

            Also, are you sure of bit 4 in flags? (I personally have no experience with BOCA cards, but…)

            [%sig%]

    • I’ve had a similar card setup under FreeBSD 4.x on an old PII for a year or so now; works great as a console/logging/debug host for my stack of BSD machines. I use tip and null modem as is suggested in the other serial console articles here, and have a screen session multiplexing hosts between my physical terminals. In case anyone is wondering here is my kernel configs and dmesg:

      # BocaBoard BB1008 8-port serial card
      #device sio4 at isa? port 0x300 flags 0xB05
      options COM_MULTIPORT #code for shared IRQs
      device sio4 at isa? port 0x300 flags 0xB15
      device sio5 at isa? port 0x308 flags 0xB05
      device sio6 at isa? port 0x310 flags 0xB05
      device sio7 at isa? port 0x318 flags 0xB05
      device sio8 at isa? port 0x320 flags 0xB05
      device sio9 at isa? port 0x328 flags 0xB05
      device sio10 at isa? port 0x330 flags 0xB05
      device sio11 at isa? port 0x338 flags 0xB05 irq 11
      —–

      sio0 at port 0x3f8-0x3ff irq 4 flags 0x10 on isa0
      sio0: type 16550A
      sio1 at port 0x2f8-0x2ff irq 3 on isa0
      sio1: type 16550A
      sio4 at port 0x300-0x307 flags 0xb15 on isa0
      sio4: type 16550A (multiport)
      sio5 at port 0x308-0x30f flags 0xb05 on isa0
      sio5: type 16550A (multiport)
      sio6 at port 0x310-0x317 flags 0xb05 on isa0
      sio6: type 16550A (multiport)
      sio7 at port 0x318-0x31f flags 0xb05 on isa0
      sio7: type 16550A (multiport)
      sio8 at port 0x320-0x327 flags 0xb05 on isa0
      sio8: type 16550A (multiport)
      sio9 at port 0x328-0x32f flags 0xb05 on isa0
      sio9: type 16550A (multiport)
      sio10 at port 0x330-0x337 flags 0xb05 on isa0
      sio10: type 16550A (multiport)
      sio11 at port 0x338-0x33f irq 11 flags 0xb05 on isa0
      sio11: type 16550A (multiport master)

      If you come across one it’s usually a good find (got mine for ~$20 w/cables+adapters); the challenge will soon be finding a MB with an ISA slot. I used to have an ISA modem in there too at sio2. sio4 is configured as a console port (0x10). Before the BocaBoard I had a big long PC/4 DigiBoard (from Computer Recyclers here in Ottawa) but it literally went up in smoke. I would like to move to a PortMaster II some day if I ever have the need for anything more elaborate, but you can’t beat the price on these.

      – Allan