Index: trunk/Nebulous-Server/bin/neb-voladm
===================================================================
--- trunk/Nebulous-Server/bin/neb-voladm	(revision 24842)
+++ trunk/Nebulous-Server/bin/neb-voladm	(revision 26292)
@@ -23,4 +23,5 @@
     $allocate,
     $available,
+    $mounted,
     $db,
     $dbhost,
@@ -31,4 +32,5 @@
     $vname,
     $xattr,
+    $cab_id,
 );
 
@@ -41,4 +43,5 @@
     'allocate=i'        => \$allocate,
     'available=i'       => \$available,
+    'mounted'           => \$mounted,
     'db|d=s'            => \$db,
     'debug'             => \$debug,
@@ -48,4 +51,5 @@
     'vhost=s'           => \$vhost,
     'vname|n=s'         => \$vname,
+    'cab_id|c=i'        => \$cab_id,
     'xattr=i'           => \$xattr,
 ) || pod2usage( 2 );
@@ -56,6 +60,6 @@
 
 # are we listing the volumes or updating?
-if (defined $allocate or defined $available or defined $xattr) {
-    pod2usage( -msg => "Options: --allocate, --available, and --xattr Require options --vhost or --vname", -exitval => 2 )
+if (defined $allocate or defined $available or defined $xattr or defined $cab_id) {
+    pod2usage( -msg => "Options: --allocate, --available, --xattr, and --cab_id Require options --vhost or --vname", -exitval => 2 )
         unless defined $vhost or defined $vname;
     pod2usage( -msg => "Options: --allocate, --available, and --xattr Must be 0 or 1", -exitval => 2)
@@ -84,4 +88,5 @@
 $set{'v.available'} = $available if defined $available;
 $set{'v.xattr'} = $xattr if defined $xattr;
+$set{'v.cab_id'} = $cab_id if defined $cab_id;
 
 if (%set) {
@@ -97,4 +102,17 @@
         die $@;
     }
+    if ($mounted) {
+	eval {
+	    my ($q, @bind) = sql_interp("UPDATE mountedvol AS v SET", \%set, "WHERE", \%constraint);
+	    warn "$q\n" if $debug;
+	    my $query = $dbh->prepare($q);
+	    $query->execute(@bind);
+	    $dbh->commit;
+	};
+	if ($@) {
+	    $dbh->rollback;
+	    die $@;
+	}
+    }
 } 
 
@@ -132,4 +150,5 @@
     neb-voladm [--vname <volume name>] [--vhost <volume host>]
     [--allocate <0|1>] [--available <0|1>] [--xattr <0|1>]
+    [--cab_id <cab_id>]
     [--host <database host> ] [--db <database name>]
     [--user <database username>] [--pass <database password>]
@@ -164,4 +183,10 @@
 
 Enables/Disables these flags on the storage volume.
+
+Requires either the C<--vname> or c<--vhost> options.
+
+=item * --cab_id <cab_id>
+
+Sets the cabinet id for this storage volume.
 
 Requires either the C<--vname> or c<--vhost> options.
