Thursday, May 24, 2007

Backing up 2: TSM

TSM is IBM's backup solution. It is a really nice setup when you have a large mixed network whose workstations and server you want to backup. As in many backup packages, we have two parts: server and client. All the important configuration details -- when to backup and what -- is stored in the server; the client does not know much about besides how to authenticate and such stuff. The best way to have it working is when the server contacts each client at the scheduled time and start pulling the files out. This way the server can keep a grip on the load while there is not much work to be done in the client.

In this installment we will talk about the client, which in TSMese is known as a node.

Client setup and install

First thing we need to do is to install the TSM client in the machine we want to backup. The client is freely available at the IBM website. You probably want to get the latest version. Also do notice they have clients for OSX, Linux, Windows, and Solaris, just to name a few operating systems. Installation varies with the client OS. In the case of Linux, you would download and install a few rpms, so you may want to make sure you know how to install an rpm. The proper thing to do is to read up on it, say, its manpage. The quick-and dirty way is to try something like this:

# rpm -i package.rpm

and hope it will work. YMMV. The ones you really really need to install are the ones for the TSM B/A client and the API. During install they may ask for a library they depend on; just go and get it and make it happy. If you install it in a Linux or Solaris box, the packages will be placed in /opt/tivoli/tsm/client/.

Once you have the packages installed, you need to configure the client. Before we continue, we are assuming that we are back in our favorite kitcar company, Cannelloni LLC, and want to backup the fileserver, obelix. The TSM server is assurancetourix.cannelloni.com. So, we should by now have told the TSM server that obelix is a new node and associated a schedule with this node. The client configuration file is called dsm.sys and is usually found in /opt/tivoli/tsm/client/ba/bin. A typical dsm.sys file looks like something like this:

************************************************************************
* IBM Tivoli Storage Manager                                           *
*                                                                      *
* Sample Client System Options file for UNIX (dsm.sys.smp)             *
************************************************************************

*  This file contains the minimum options required to get started
*  using ITSM.  Copy dsm.sys.smp to dsm.sys.  In the dsm.sys file,
*  enter the appropriate values for each option listed below and
*  remove the leading asterisk (*) for each one.

*  If your client node communicates with multiple ITSM servers, be
*  sure to add a stanza, beginning with the SERVERNAME option, for
*  each additional server.

************************************************************************

SErvername  tsm
   COMMmethod         TCPip
   TCPPort            1609
   TCPServeraddress   backup.cannelloni.com
   passwordaccess     generate
   nodename           obelix
   managedservices    schedule
   memoryefficientbackup yes

where:

  • SErvername Name of the TSM server
  • TCPServeraddress FQDN (or IP) for the TSM server. We would think that is a bit important so the client knows where to find the TSM server (and probably to know which servers it should accept commands from).
  • nodename The name of this node as defined in the TSM server. You can call it anything you want. It can be the FQDN of this machine or some silly name. TSM does not care while you use the right one. That also means you can backup to one machine and restore to another machine and TSM will not be any wiser; it only cares about authentication. Note: In this example, the true name of this machine is assurancetourix.cannelloni.com. backup.cannelloni.com is a CNAME we created to make it easier to find it. Also, it sounds very official and functional.
  • COMMmethod Which protocols we will use to talk to the TSM server.
  • TCPPort This is the port the TSM client will open in obelix so the server can connect and talk to it. We may have to be sure the firewall in obelix has that port open (per COMMmethod, for tcp traffic only, not udp).
  • managedservices

    can be used to tell the client which tasks it should run. If you leave it blank, it will run a webserver that will allow others to connect to this machine to run the TSM client. By saying schedule we tell it only to run the scheduler.

Running the client

If this is the first time the tsm client is run in this machine, obelix, we need to do a full backup. That is done by issuing the command

# dsmc incr

and waiting for a while. A long while depending on how much stuff you have. To give you an idea, backing up some 300GB took about 8h in a connection that was supposed to be gigabit all the way between TSM client and server. So, either run this in the background and go dome something fun in the outside or use the time to read up on stuff you have been avoiding.

Once that is finished and there are no errors or funny business, we then start the normal incremental backup, which is done by typing

# dsmc sched &

Of course the next step would be to write a startup script to run that command whenever the node boots up.

Restoring

Bare Metal Restore

Tuesday, May 01, 2007

Installing OSX 10.4 without DVD player

Ok, so have here a 12" ibook that did not come with a DVD player. To its left I have the OSX 10.4 DVDs. I have to install 10.4 in the iBook. How to make them play together? Good question. Well, Apple does have a tradeup program in which you send out your 10.4 DVDs, proof of purchase, and a check of $9.95 or thereabouts and, in a few weeks, you get a 10.4 CD set. Kinda nice but this is not what we are going to do. I do not want to have to wait for a few weeks to get this taken care of. I want it now!

How to do that? Well, let's go over the different steps I tried and figure out, hopefully, why they went boink.

Boot from the built-in CD drive

Well, that one did not work out. We knew that because that is the entire reason I am writing this. This ibook has a built-in CD player, not a DVD player. If this was a desktop, chances are you could easily swap the drives. That is what I did before with a B&W Powermac G3.

Boot from an external USB DVD drive

I have an external USB dual layer DVD burner; why not use it? Well, possibly the reason is that it does not work. At least it did not work for me. I tried it and it cheerfully ignored the drive. I tried booting and holding the key sequences to boot from the cd -- I think it thought I wanted to boot from its built-in drive -- and to ignore its internal drive. Either way it did not; it kept cheerfully trying to boot from the internal hard drive.

Boot the ibook at a firewire device attached to my other ibook.

Now we are getting fancy here. From experience, I know I can make my Cube and my 14" iBook G4 to, at boot, become external hard drives that can be then connected to another machine through the firewire port. Ok, the Cube books in FW mode but right now I am having a few problems seeing its hard drive, but that is another story and I am digressing here.

External firewire drive.

Since the 12" ibook does not want to be a firewire device, what if we give it a firewire device, say, another hard drive? Well, I happen to have a USB2/Firewire case and a 10GB ATA (IDE for you old school crowd) doing nothing. So, I put the drive in the case and connect it to my 14" ibook, not to the 12" ibook just yet. There is reason behind my madness, believe it or not. So, I then boot the 14" ibook from the OSX dvd (remember this machine has a dvd player) and tell it to install tiger on the 10GB HD. After that is done, I then connect the drive to the 12" ibook and boot it. As the internal drive had no OS (I deleted it some time ago) installed, it went and found the external drive and booted from it! It seems I am on the right track.

Now let's make life more interesting. Once again I booted my 14" ibook and then connected the external drive and inserted the osx dvd. I then unmounted but not removed the firewire drive. That is an important step. I made a point to write down the firewire drive was being seen as /dev/disk2s10 and the dvd player is /dev/disk3s3. Now, there is probably a clever more Mac-like way to do this next step. But I do not know how to do it. So, I did it the unix way: I started a terminal session and entered the following command:

Mireille:~ dalek$ dd if=/dev/disk3s3 of=/dev/disk2s10
11712744+0 records in
11712744+0 records out
5996924928 bytes transferred in 11166.592623 secs (537042 bytes/sec)
Mireille:~ dalek$

I then connected the drive to the 12" ibook and rebooted. It thought the external firewire hard drive was the OSX dvd disc 1 and started the installation process! What about the disc 2? Well, I just put it in the external DVD burner and connected it to an available usb port in the 12" ibook. It happily continued installing from it.

Problem solved!

One day, when I am really bored I will try to put a dvd player in the firewire case and see if it can boot like that. In the mean time, I finished getting that 12" ibook running tiger and that is all I wanted to do for now. Next time perhaps I will have a quiet talk with a certain cube...

Monday, April 30, 2007

The case of the SunPCI 2 card

I have sunpci 2 pro card. Ok, I have a sunpci 1, a sunpci 2, and a sunpci 2 pro cards. Why, you would ask. Well, I thought the idea was clever: make a PC in a card (the predecessor of the blades?) and slap it inside a computer. The hardware approach has its benefits -- what would be better emulator than a complete computer? -- compared to emulated ones, specially if the host hardware is completely different. Many manufacturers have done similar things one time or another, but the tendency now if of course software-based emulation since modern machines seem to have the horsepower to make it work. Still I like to have that card as it has its own serial, parallel, VGA, ethernet, and usb ports.

And, as it turns out, its own IDE port.

Come again? Yes, it has an IDE port. I've always looked at the card during the boot process, and when checking its cmos, that it did check for IDE drives. But, it did not have a place to connect the cable to it. Well, there is an place on the board that does not have a connector in it. Upon checking it, I realize it has 40 pins. Hmmm, what if it was an IDE connector? After all, if you boot the card it seems to have everything it needs to use an IDE disk.

So I soldered a connector on it and then installed the card in a Ultra 60 running Solaris 10. I then boot the machine up as it was, just to make sure I did not screw anything up. So far so good. I then connected a 4.3GB IDE Hard drive I had doing nothing to it and rebooted. As you can see from the attached screen captures, the hard drive was seen by the card.

It would probably be a good time to find a way to mount a drive in the case; if you opened it you will remember that it really does not have much free space. For now I will leave it in one of the empty 3 1/2" drive bays; I may later make a bracket to put the drive somewhere else. Now the big question in my mind is can I boot the sunpci card off the ide hard drive? I don't know yet, but it would sure open a lot of nice possibilities. First we need to answer a few other questions. If I install, say, XP in the card, would it see the hard drive and be able to format and mount it? Also, would it be any limitations on the size of the hard drive or which devices I can slap to the ide cable? How about a cd burner or dvd player? Finally, would it be possible to slap a cdrom to that cable and install the OS off it (as opposite from the U60's dvd player)?

Tuesday, January 30, 2007

Commands I need to remember

This will be a bit of a work-in-progress post. The idea is that I sometimes find neat commands I really should know because, let's be quite honest, they can save a lot of time and aggravation. I am going to make this a series of articles -- one specifically for linux, another for OSX, another for Solaris, another for Windows, one for generic unix stuff, and whatever else I can think of -- to keep things organized in my demented mind. So, let's start with linux:

Boot> linux dd

This is entered when you boot the machine up, whether by a CD or its own hard drive or whatever. You know, when the machine asks you if you want to change the boot options. I used that during a centos install and booting a (once again) centos liveCD distro. What it does is ask you during the boot process to insert a disk/cd/floppy/whatever with extra drivers it needs to know about. Made setting up a certain supermicro's onboard SATA raid controller possible right at boot time, because centos 4.4 was not aware of that raid controller.

Finding OS Version

I do not know about you but every so often I need to find out which version of OS I am running. Originally I thought all Linuces were the same, but I was wrong. In fact, that is the reason I started writing that down. Then, I decided to expand for the different unices and other operating systems I mess with. So, we have.

  • Redhat (RHES4 box in this example):

    $ cat /etc/redhat-release
    Red Hat Enterprise Linux ES release 4 (Nahant)
    $

  • ubuntu

    raub@keg:~$ ls /etc/issue*
    /etc/issue  /etc/issue.net
    raub@keg:~$ cat /etc/issue
    Ubuntu 7.04 \n \l
    
    raub@keg:~$ cat /etc/issue.net 
    Ubuntu 7.04
    raub@keg:~$ cat /etc/issue.net 
    Ubuntu 7.04
    raub@keg:~$ lsb_release -a
    No LSB modules are available.
    Distributor ID: Ubuntu
    Description:    Ubuntu 7.04
    Release:        7.04
    Codename:       feisty
    raub@keg:~$ cat /etc/lsb-release
    DISTRIB_ID=Ubuntu
    DISTRIB_RELEASE=7.04
    DISTRIB_CODENAME=feisty
    DISTRIB_DESCRIPTION="Ubuntu 7.04"
    raub@keg:~$ 
  • AIX

    $ oslevel
    5.3.0.0
    $ oslevel -r
    5300-05
    $ 
  • Solaris

boot {disk, cdrom, net} {-r}

open boot command to start the boot process. Normally you have the machine configured such that when it turns on it knows where to boot from, but if you are doing things to the machine and want to specify which device to boot from, you would use this command. I am not going to go over all its details but it suffice to say if you type disk it would boot off its default disk. The same goes for cdrom. Now, the -r option is used to tell it to scan for new hardware devices, which is important if you added/removed devices and drives and little cards from the machine.

Where does the scripts to strt files during the startup hide?
  • Redhat

    /etc/rc.d/init.d/ssh
  • BSD, Debian

    /etc/init.d/ssh
pkgadd

pkgadd is one of the most common ways to install packages in a Solaris box. It is similar in certain ways to rpm in Linux. Incidentally, if you want something more on the lines of apt-get, you want to look into pkg-get, which I shall talk about later on. But, for now, we spend a bit of time with pkgadd.

Let's say, for the sake of argument, that you decided to get a sunpci 2 pro card for your trusty Solaris box. So, after you install the card and reboot the machine (we will talk about the entire process in another blog entry), you go to the sun website and get the file SUNWspci2.3.2.tar.Z.

raub@nassau-25>ls
SUNWspci2.3.2.tar.Z
raub@nassau-26>

Then you untar/uncompress the file:

raub@nassau-26>zcat SUNWspci2.3.2.tar.Z | tar xf -
raub@nassau-27>ls
SUNWspci2  SUNWspci2.3.2.tar.Z
raub@nassau-28>

As you can see, you ended up with a new directory, SUNWspci2. Now the next step is to run pkgadd itself:

root@nassau-19>pkgadd -d .

The following packages are available:
 1  SUNWspci2     SunPCi II
                  (sparc) 2.3.2

Select package(s) you wish to process (or 'all' to process
all packages). (default: all) [?,??,q]:
[...]

You will notice that I entered a dot (.) as the name of the package. What that means is every package in the current directory. I could specify which package but I am lazy. Also, I am given the option of which packages to install anyway. As you probably guesses, -i stands for install package.

After careful consideration, I decided not to include AIX in this entry; since it is so different from the other Unix flavours, I've decided to make its own entry. Keep an eye for it!