Index: /trunk/Nebulous-Server/Build.PL
===================================================================
--- /trunk/Nebulous-Server/Build.PL	(revision 20154)
+++ /trunk/Nebulous-Server/Build.PL	(revision 20155)
@@ -38,8 +38,9 @@
     },
     script_files        => [qw(
-        bin/neb-voladd
         bin/neb-admin
         bin/neb-fsck
         bin/neb-initdb
+        bin/neb-voladd
+        bin/neb-voladm
         bin/nebdiskd
     )],
Index: /trunk/Nebulous-Server/Changes
===================================================================
--- /trunk/Nebulous-Server/Changes	(revision 20154)
+++ /trunk/Nebulous-Server/Changes	(revision 20155)
@@ -32,4 +32,5 @@
     - change nebdiskd to not do things that might imply a table level lock on
       the mount table
+    - add neb-voladm util
 
 0.15 Thu Sep 11 13:00:59 HST 2008
Index: /trunk/Nebulous-Server/bin/neb-voladm
===================================================================
--- /trunk/Nebulous-Server/bin/neb-voladm	(revision 20154)
+++ /trunk/Nebulous-Server/bin/neb-voladm	(revision 20155)
@@ -3,5 +3,5 @@
 # Copyright (C) 2008  Joshua Hoblitt
 #
-# $Id: neb-voladm,v 1.3 2008-10-14 21:56:04 jhoblitt Exp $
+# $Id: neb-voladm,v 1.4 2008-10-15 01:56:00 jhoblitt Exp $
 
 use strict;
@@ -118,16 +118,17 @@
 =head1 NAME
 
-neb-voladm - manage Nebulous server storage volumes
+neb-voladm - manage Nebulous storage volumes
 
 =head1 SYNOPSIS
 
-    neb-addvol --volume <volume name> --uri <volume uri>
-        [--db <database>] [--user <username>] [--pass <password>]
+    neb-addvol [--vname <volume name>] [--vhost <volume host>]
+    [--allocate <0|1>] [--available <0|1>] [--xattr <0|1>]
+    [--host <db host> ] [--db <db name>] [--user <username>] [--pass <password>]
 
 =head1 DESCRIPTION
 
-This program initialize a database for use by L<Nebulous::Server> by creating
-the appropriate set of tables.  Any pre-existing tables with conflicting names
-are first removed.
+This program manages a Nebulous server's list of known storage volumes.  the
+appropriate set of tables.  Any pre-existing tables with conflicting names are
+first removed.
 
 =head1 OPTIONS
@@ -135,13 +136,27 @@
 =over 4
 
-=item * --volume <volume name>
-
-Symbolic name of volume being added.
-
-=item * --uri|-u <volume uri>
-
-URI to the volume being added.
-
-=item * --db|-d <database>
+=item * --vname <volume name>
+
+Symbolic name of the storage volume.
+
+Optional.
+
+=item * --vhost <volume host>
+
+Name of the host on which the storage volume(s) reside.
+
+Optional.
+
+=item * --allocate <0|1>
+
+=item * --available <0|1>
+
+=item * --xattr <0|1>
+
+Enables/Disables these flags on the storage volume.
+
+Requires either the C<--vname> or c<--vhost> options.
+
+=item * --db|-d <db name>
 
 Name of database (C<namespace>) to create tables in.
@@ -149,4 +164,10 @@
 Optional if the appropriate environment variable is set.
 
+=item * --host <db host>
+
+Host name where the database resides.
+
+Defaults to C<localhost>.
+
 =item * --user|-u <username>
 
@@ -162,4 +183,33 @@
 
 =back
+
+=head1 EXAMPLE USAGE
+
+=head2 Listing all volumes
+
+    $ neb-voladm
+    host            name            mounted    allocate   available  xattr     
+    ipp004          ipp004.0        1          0          1          0         
+    ipp005          ipp005.0        1          0          1          0         
+    ipp006          ipp006.0        1          1          1          0
+    ...
+
+=head2 Listing just the volumes on host C<ipp025>
+
+    $ neb-voladm --vhost ipp025
+    host            name            mounted    allocate   available  xattr     
+    ipp025          ipp025.0        1          1          0          0     
+
+=head2 Listing just the volume symbolicly named C<ipp006.0>
+
+    $ neb-voladm -vname ipp006.0
+    host            name            mounted    allocate   available  xattr     
+    ipp006          ipp006.0        1          1          1          0    
+
+=head2 Turning the C<available> flag off for all volumes on the host named C<ipp012>
+
+    $ neb-voladm --vhost ipp012 --available 0
+    host            name            mounted    allocate   available  xattr     
+    ipp012          ipp012.0        0          1          0          
 
 =head1 ENVIRONMENT
@@ -203,5 +253,5 @@
 =head1 COPYRIGHT
 
-Copyright (C) 2005-2008  Joshua Hoblitt.  All rights reserved.
+Copyright (C) 2008  Joshua Hoblitt.  All rights reserved.
 
 This program is free software; you can redistribute it and/or modify it under
@@ -223,5 +273,5 @@
 =head1 SEE ALSO
 
-L<Nebulous::Server>, L<neb-initdb>, L<neb-df>, L<nebdiskd>
+L<Nebulous::Server>, L<neb-initdb>, L<neb-voladd>, L<nebdiskd>
 
 =cut
Index: /trunk/Nebulous-Server/lib/Nebulous/Server/SQL.pm
===================================================================
--- /trunk/Nebulous-Server/lib/Nebulous/Server/SQL.pm	(revision 20154)
+++ /trunk/Nebulous-Server/lib/Nebulous/Server/SQL.pm	(revision 20155)
@@ -1,5 +1,5 @@
 # Copyright (c) 2004  Joshua Hoblitt
 #
-# $Id: SQL.pm,v 1.73 2008-10-14 20:35:07 jhoblitt Exp $
+# $Id: SQL.pm,v 1.74 2008-10-15 01:56:00 jhoblitt Exp $
 
 package Nebulous::Server::SQL;
@@ -277,6 +277,14 @@
     },
     get_volumes => qq{
-        SELECT v.vol_id, v.name, v.host, v.path, v.allocate, v.available, v.xattr, mountedvol.vol_id > 0 as mounted
-        FROM volume as v
+        SELECT
+            v.vol_id,
+            v.name,
+            v.host,
+            v.path,
+            v.allocate,
+            v.available,
+            v.xattr,
+            mountedvol.vol_id IS NOT NULL as mounted
+        FROM volume AS v
         LEFT JOIN mountedvol
             USING(vol_id)
