Friday, June 6, 2008

Rebinding TSM archives so they do not expire

I have some TSM archives on an AIX host with a short expiration period of 14 days that I needed to extend for an unknown amount of time, I thought this would be an easy task but it took me a minute to figure out exactly how to quickly and efficiently get this done. To stop expiration on an archive you have to use the 'set event type=hold' command in from 'dsmc', the documentation on the command is complete but sparse with few examples so I had play with it to understand it. The most important thing I learned was that you cannot use a '*' to specify all files in an archive having a specific description - but you can specify just the base directory (in TSM terms 'filespace_name' from the archives table) and append a '/' (example: '/directory/) and it will pick up all of the files in the archive under the base directory.

First build the file list, this can be done easily a sql select statement from within dsmadmc :
select distinct(filespace_name) from archives where node_name='node name' and description='archive description here' > outfile
Then I needed to add a '/' character to the end of each line from the command line using awk:
# cat outfile | awk '{ print $1"/"}' > filelist.out

Alternately you could have selected filespace_name and hl_name and used awk to print both columns without a space between, either way the results should be the same...
Now I had a file that looked similar to this:

each entry is a seperate mount point for a filesystem which is why /db/ would not have worked correctly.

Load this file into dsmc using the set event command:
set event -type=hold -filelist=filelist.out -description="Some unique description here"

output like:
ANS1899I ***** Examined 35,000 files *****
ANS1899I ***** Examined 36,000 files *****
ANS1899I ***** Examined 37,000 files *****
ANS1899I ***** Examined 38,000 files *****
ANS1899I ***** Examined 39,000 files *****

Total number of objects archived: 0
Total number of objects failed: 0
Total number of objects rebound: 82781
Total number of bytes transferred: 0 B
Data transfer time: 0.00 sec
Network data transfer rate: 0.00 KB/sec
Aggregate data transfer rate: 0.00 KB/sec
Objects compressed by: 0%
Elapsed processing time: 00:04:26

After the files were rebound I jumped onto dsmadmc to make sure I had gotten every file rebound, I did this by selecting the number of objects from the archive and comparing it to the number of objects rebound:
select count(*) as "# of archived objects" from archives where description='Some unique description here' and node_name='node_name'

# of archived objects

Looks good!
This was by far the fastest way to rebind all these objects. I also tried selecting each individual object from the tsm database and loading that as the filelist into dsmc (a file with 82781 lines), after about 10 hours of processing dsmc core dumped. My other thought was to use the filelist containing every object and running it in a for loop so each object was processed individually - this would have worked but the time for completion would have been much longer.

Thursday, June 5, 2008

Installing projectM with amarok support on Fedora 8

I wanted projectM to work with amarok on my Fedora 8 box... I had done it before but didn't remember the exact steps...

Dependencies: projectM isn't in the standard fedora or livna repos so we have to compile, because compiling doesn't automagically install requisite software like yum does we need to have some packages pre-installed. This list is probably not complete but it's what I had to add (plus dependencies for these packages which are handled by yum):
pulseaudio-libs-devel amarok-visualisation, qt4-devel, cmake, ftgl-devel, glew-devel and subversion

# sudo yum -y install pulseaudio-libs-devel amarok-visualisation qt4-devel cmake ftgl-devel glew-devel subversion

Next we need to download projectM from sourceforge, I like to install the latest bleeding edge software since it generally causes me more pain so I chose the to go with the latest branch from subversion:

# mkdir ~/Download/projectM && cd ~/Download/projectM
# svn co projectM-Trunk
# cd projectM-Trunk/src
# ccmake .
cmake loads. press 'c' to configure: change CMAKE_BUILD_TYPE to 'Release' and CMAKE_INSTALL_PREFIX to /usr/
press 'c' again to configure and g to generate makefile

Time to compile:
# make && sudo make install

Now 'projectM-pulseaudio' should be in your Applications ->Video menu (if your using gnome) and it will bump along to any sounds that are playing through pulse. If you have amarok open just restart it and you can launch it from the visualizations menu!

I can't get it to play nice with compiz on an ati card running dual monitors, but with compiz turned off it's fine.

I ripped off a bunch of this from the ubuntu forum (thanks!):
as well as the projectM page itself: