August 20, 2008

Find the DVD containing those files with VVV

Author: Ben Martin

The Virtual Volumes View (VVV) project lets you index your data DVDs and perform searches to figure out whether a given file is backed up and what disc contains it. If you routinely back up a large amount of data onto DVDs, you can simply number your discs and keep them in numerically sorted order. When it comes time to find an image or digital video you burned to DVD, just use VVV to figure out the disc number and quickly locate the right disc in the pile.

There are no VVV packages in the Ubuntu, openSUSE, or Fedora repositories. For this article I'll build the application from source on a 64-bit Fedora 9 machine. The build instructions cover the dependencies for VVV and how to build it with KDevelop. The dependencies are wxWidgets and wxGTK for the GUI, the Firebird relational database to store your DVD index, and id3lib to extract and index ID3 information. The source distribution contains a copy of id3lib 3.8.3 that includes a bug fix for VVV, so I'll link against that id3lib in the build. The build instructions also mention options to build a statically linked executable that is less reliant on other libraries on the system. Building such an executable might be handy if you plan to store the application on a USB flash key that you might use on many systems.

As wxGTK is dependent on wxWidgets, you can use your distribution's dependency tracker to install both at once. wxGTK is available for Ubuntu Hardy, as a 1-Click for openSUSE 11, and in the standard Fedora 9 repositories. You will need to get version 2.0.x of Firebird in its Classic build, which is designed to allow applications to directly open the relational database, so no separate database server is required. Firebird is packaged for Ubuntu Hardy and as a 1-Click install for openSUSE 11, but not in the Fedora 9 repositories. I'll use the 64-bit build of Firebird version 2.0.4.

Version 2.0.4 of Firebird uses the standard C++ shared library, and you must have the correct version installed. Fedora 9 has moved to version /usr/lib64/, but Firebird needs On Fedora 9 the older version of the standard C++ library is contained in the compat-libstdc++ package. Installation (as well as the error message you see if you do not have the correct stdc++ library version) is shown below:

# tar xzvf /FromWeb/FirebirdCS-
# cd FirebirdCS*
FirebirdCS-]# ./

Firebird classic Installation
/opt/firebird/bin/gsec: error while loading shared libraries: cannot open shared object file: No such file or directory

FirebirdCS-]# yum install compat-libstdc++
FirebirdCS-]# ./
Please enter new password for SYSDBA user: himitsu
Install completed

$ sudo vi /usr/include/wx-2.8/wx/string.h
... about line 822 ...

wxChar& operator[](int n)
{ return wxStringBase::at(n); }
// wxChar& operator[](size_type n)// { return wxStringBase::at(n); }

src]$ export LDFLAGS="$(wx-config --libs --debug=no) -lid3 -L/opt/firebird/lib -lfbembed "
src]$ export CXXFLAGS="$(wx-config --cxxflags --debug=no) -DIBPP_LINUX"
src]$ g++ -c *.cpp $CXXFLAGS $LDFLAGS
src]$ cd ./data_interface
data_interface]$ g++ -c *.cpp $CXXFLAGS $LDFLAGS
$ cd ../ibpp/
ibpp]$ cd ./core
core]$ vi _ibpp.h

#include <string.h>

#ifndef __INTERNAL_IBPP_H__
#define __INTERNAL_IBPP_H__

core]$ g++ -c all_in_one.cpp $CXXFLAGS $LDFLAGS
core]$ cd ../../
src]$ gcc `find . -name "*.o"` -o vvv $CXXFLAGS $LDFLAGS
src]$ mkdir ~/vvv-catalogs
src]$ cp -av ./vvv ~/vvv-catalogs
`./vvv' -> `/home/ben/vvv-catalogs/vvv'
src]$ cd ..
VVV-0.9-src]$ cp -av VVV.fbk ~/vvv-catalogs
`VVV.fbk' -> `/home/ben/vvv-catalogs/VVV.fbk'

The simplest way to use VVV with Firebird is to set up Firebird to be used in embedded mode. This means that Firebird does not run as a separate database server -- instead, VVV accesses the database using the shared libraries of Firebird. This way you don't have to deal with relational database users and permissions or have the server running somewhere. Unfortunately the configuration files to run Firebird in this way are not part of the source distribution. The simplest way to get going is to download VVV's binary distribution and copy the database configuration files from it together with the shared libraries of Firebird from your local installation, as shown below:

~]$ cd /tmp
tmp]$ tar xzf /.../VVV-0.9.tar.gz
tmp]$ cd ./VVV*
VVV-0.9]$ mkdir ~/vvv-catalogs/firebird
VVV-0.9]$ cp -av firebird.log firebird.conf ~/vvv-catalogs
VVV-0.9]$ cp -av firebird/security2.fdb ~/vvv-catalogs/firebird
VVV-0.9]$ mv vvv vvv.bin
VVV-0.9]$ vi vvv

export FIREBIRD=~/vvv-catalogs

VVV-0.9]$ su -l
/root]# cd /opt/firebird
firebird]# cp -av lib/* bin intl /home/ben/vvv-catalogs/firebird
firebird]# chown -R ben.ben /home/ben/vvv-catalogs/firebird

As you can see, installing VVV from source is nowhere near as simple is it should be. Not having makefiles in the source tree and having to swipe firebird.conf and security2.fdb from the binary distribution makes working out how to get things going quite a task. There is also no hint in the installation instructions about how you might like to use a wrapper script like the vvv script I created above, to start VVV with the Firebird environment variable set appropriately.

At this stage you should be able to execute ~/vvv-catalogs/vvv and have VVV start using an embedded version of Firebird. You do not need to start any servers or create any database users. The first thing you should do is click the New button in the toolbar to create a new VVV catalog to store your disc indexes in. If you can create the catalog then your installation of VVV can use the embedded version of Firebird correctly.

VVV is starting to get internationalization support. If VVV does not select your language automatically, you can explicitly set it in the Preferences window> From that window you can also uncheck the default option to reopen the last used catalog at startup, specify which ID3 tags should be extracted from audio files as they are being cataloged, and specify your location and login credentials if you are using Firebird as a standalone server.

The Volumes menu allows you to add a directory to the catalog and give it a volume name. Clicking on the Catalog button in the toolbar does the same thing. I added a directory containing the Linux HOWTO files in both HTML and PDF formats (a total of 8,119 files and 313 directories). Using a cold disk cache, the cataloging took about 25 seconds.

There are three main views in VVV -- Physical, Virtual, and Search -- all available by those names in the toolbar, as shown here. This screenshot shows that, along with the HOWTO directory, I cataloged two subdirectories as individual volumes.

Clicking on Search in the toolbar lets you find which volumes contain the files you are after. Search mode is shown in the second screenshot. The first part of the physical path shows the volume that contains the result. By clicking on each column header you can sort the view in ascending or descending order by that column. For each file, you can manually enter a description, which is what is displayed in the rightmost column in the screenshot.

The third mode, Virtual, takes some getting used to. Using virtual folders lets you organize your DVD catalog more logically. Suppose you have six discs that contain the digital photos of your last trip all indexed inside a single "Japan 2008 images" virtual folder. If you edit some of the images, for example removing some red eye, and burn the updated images to a new disc later, you can then add those images to the same Japan 2008 images virtual folder, even though they might be on a DVD you burn two years later.

You can create new root folders by right-clicking on the leftmost list. To add a tree to a virtual directory you have to go back to Physical mode, right-click on a file or directory, and select "Add to Virtual Folder." You will then be shown a tree view in which you can select which virtual folder you want to add to. You can add a physical file or directory to multiple virtual folders.

VVV can index a directory quickly. Its ability to perform "starts with" and "contains" searches lets you find which disc contains a file you are after. The ability to search for files based on a regular expression would be a welcome addition for power users.


  • Tools & Utilities
  • Desktop Software
Click Here!