Allow passing in human-readable units for specifying amounts of space
[openafs.git] / src / volser / vos.c
index 8a0fb3d..2078e19 100644 (file)
 #include <afsconfig.h>
 #include <afs/param.h>
 
-RCSID
-    ("$Header$");
 
 #include <sys/types.h>
+#include <string.h>
 #ifdef AFS_NT40_ENV
 #include <fcntl.h>
 #include <io.h>
@@ -23,6 +22,7 @@ RCSID
 #include <sys/file.h>
 #include <netdb.h>
 #include <netinet/in.h>
+#include <arpa/inet.h>
 #endif
 #include <sys/stat.h>
 #ifdef AFS_AIX_ENV
@@ -30,14 +30,6 @@ RCSID
 #endif
 #include <errno.h>
 
-#ifdef HAVE_STRING_H
-#include <string.h>
-#else
-#ifdef HAVE_STRINGS_H
-#include <strings.h>
-#endif
-#endif
-
 #include <lock.h>
 #include <afs/stds.h>
 #include <rx/xdr.h>
@@ -45,7 +37,6 @@ RCSID
 #include <rx/rx_globals.h>
 #include <afs/nfs.h>
 #include <afs/vlserver.h>
-#include <afs/auth.h>
 #include <afs/cellconfig.h>
 #include <afs/keys.h>
 #include <afs/afsutil.h>
@@ -53,17 +44,32 @@ RCSID
 #include <afs/afsint.h>
 #include <afs/cmd.h>
 #include <afs/usd.h>
-#include <rx/rxkad.h>
 #include "volser.h"
 #include "volint.h"
+#include <afs/ihandle.h>
+#include <afs/vnode.h>
+#include <afs/volume.h>
+#include "dump.h"
 #include "lockdata.h"
+
 #ifdef AFS_AIX32_ENV
 #include <signal.h>
 #endif
 #include "volser_prototypes.h"
+#include "vsutils_prototypes.h"
+#include "lockprocs_prototypes.h"
+
+#ifdef HAVE_POSIX_REGEX
+#include <regex.h>
+#endif
+
+/* Local Prototypes */
+int PrintDiagnostics(char *astring, afs_int32 acode);
+int GetVolumeInfo(afs_uint32 volid, afs_int32 *server, afs_int32 *part, 
+                  afs_int32 *voltype, struct nvldbentry *rentry);
 
 struct tqElem {
-    afs_int32 volid;
+    afs_uint32 volid;
     struct tqElem *next;
 };
 
@@ -72,47 +78,26 @@ struct tqHead {
     struct tqElem *next;
 };
 
-
-struct hostent *hostutil_GetHostByName(register char *ahost);
-
 #define COMMONPARMS     cmd_Seek(ts, 12);\
 cmd_AddParm(ts, "-cell", CMD_SINGLE, CMD_OPTIONAL, "cell name");\
 cmd_AddParm(ts, "-noauth", CMD_FLAG, CMD_OPTIONAL, "don't authenticate");\
 cmd_AddParm(ts, "-localauth",CMD_FLAG,CMD_OPTIONAL,"use server tickets");\
 cmd_AddParm(ts, "-verbose", CMD_FLAG, CMD_OPTIONAL, "verbose");\
 cmd_AddParm(ts, "-encrypt", CMD_FLAG, CMD_OPTIONAL, "encrypt commands");\
+cmd_AddParm(ts, "-noresolve", CMD_FLAG, CMD_OPTIONAL, "don't resolve addresses"); \
 
 #define ERROR_EXIT(code) {error=(code); goto error_exit;}
 
-extern int verbose;
 int rxInitDone = 0;
 struct rx_connection *tconn;
 afs_int32 tserver;
 extern struct ubik_client *cstruct;
 const char *confdir;
-extern struct rx_connection *UV_Bind();
-extern int UV_SetSecurity();
-extern int UV_SetVolumeInfo();
-extern int vsu_SetCrypt();
-extern VL_SetLock();
-extern VL_ReleaseLock();
-extern VL_DeleteEntry();
-extern VL_ListEntry();
-extern VL_GetAddrs();
-extern VL_GetAddrsU();
-extern VL_ChangeAddr();
-
-extern int vsu_ExtractName();
-extern PrintError();
-extern void EnumerateEntry();
-extern void SubEnumerateEntry();
-
 
 static struct tqHead busyHead, notokHead;
 
 static void
-qInit(ahead)
-     struct tqHead *ahead;
+qInit(struct tqHead *ahead)
 {
     memset((char *)ahead, 0, sizeof(struct tqHead));
     return;
@@ -120,9 +105,7 @@ qInit(ahead)
 
 
 static void
-qPut(ahead, volid)
-     struct tqHead *ahead;
-     afs_int32 volid;
+qPut(struct tqHead *ahead, afs_uint32 volid)
 {
     struct tqElem *elem;
 
@@ -135,9 +118,7 @@ qPut(ahead, volid)
 }
 
 static void
-qGet(ahead, volid)
-     struct tqHead *ahead;
-     afs_int32 *volid;
+qGet(struct tqHead *ahead, afs_uint32 *volid)
 {
     struct tqElem *tmp;
 
@@ -152,9 +133,8 @@ qGet(ahead, volid)
 }
 
 /* returns 1 if <filename> exists else 0 */
-static
-FileExists(filename)
-     char *filename;
+static int
+FileExists(char *filename)
 {
     usd_handle_t ufd;
     int code;
@@ -173,9 +153,8 @@ FileExists(filename)
 }
 
 /* returns 1 if <name> doesnot end in .readonly or .backup, else 0 */
-static
-VolNameOK(name)
-     char *name;
+static int
+VolNameOK(char *name)
 {
     int total;
 
@@ -191,9 +170,8 @@ VolNameOK(name)
 }
 
 /* return 1 if name is a number else 0 */
-static
-IsNumeric(name)
-     char *name;
+static int
+IsNumeric(char *name)
 {
     int result, len, i;
     char *ptr;
@@ -210,8 +188,6 @@ IsNumeric(name)
 
     }
     return result;
-
-
 }
 
 
@@ -219,8 +195,7 @@ IsNumeric(name)
  * Parse a server name/address and return the address in HOST BYTE order
  */
 afs_int32
-GetServer(aname)
-     char *aname;
+GetServer(char *aname)
 {
     register struct hostent *th;
     afs_int32 addr;
@@ -253,8 +228,7 @@ GetServer(aname)
 }
 
 afs_int32
-GetVolumeType(aname)
-     char *aname;
+GetVolumeType(char *aname)
 {
 
     if (!strcmp(aname, "ro"))
@@ -268,15 +242,11 @@ GetVolumeType(aname)
 }
 
 int
-IsPartValid(partId, server, code)
-     afs_int32 server, partId, *code;
-
+IsPartValid(afs_int32 partId, afs_int32 server, afs_int32 *code)
 {
     struct partList dummyPartList;
     int i, success, cnt;
 
-
-
     success = 0;
     *code = 0;
 
@@ -295,10 +265,8 @@ IsPartValid(partId, server, code)
 
  /*sends the contents of file associated with <fd> and <blksize>  to Rx Stream 
   * associated  with <call> */
-SendFile(ufd, call, blksize)
-     usd_handle_t ufd;
-     register struct rx_call *call;
-     long blksize;
+int 
+SendFile(usd_handle_t ufd, register struct rx_call *call, long blksize)
 {
     char *buffer = (char *)0;
     afs_int32 error = 0;
@@ -317,8 +285,12 @@ SendFile(ufd, call, blksize)
        FD_ZERO(&in);
        FD_SET((int)(ufd->handle), &in);
        /* don't timeout if read blocks */
+#if defined(AFS_PTHREAD_ENV)
+       select(((int)(ufd->handle)) + 1, &in, 0, 0, 0);
+#else
        IOMGR_Select(((int)(ufd->handle)) + 1, &in, 0, 0, 0);
 #endif
+#endif
        error = USD_READ(ufd, buffer, blksize, &nbytes);
        if (error) {
            fprintf(STDERR, "File system read failed\n");
@@ -341,19 +313,19 @@ SendFile(ufd, call, blksize)
 /* function invoked by UV_RestoreVolume, reads the data from rx_trx_stream and
  * writes it out to the volume. */
 afs_int32
-WriteData(call, rock)
-     struct rx_call *call;
-     char *rock;
+WriteData(struct rx_call *call, void *rock)
 {
-    char *filename;
+    char *filename = (char *) rock;
     usd_handle_t ufd;
     long blksize;
     afs_int32 error, code;
     int ufdIsOpen = 0;
+    afs_hyper_t filesize, currOffset; 
+    afs_uint32 buffer;         
+    afs_uint32 got;            
 
     error = 0;
 
-    filename = rock;
     if (!filename || !*filename) {
        usd_StandardInput(&ufd);
        blksize = 4096;
@@ -369,6 +341,20 @@ WriteData(call, rock)
            error = VOLSERBADOP;
            goto wfail;
        }
+       /* test if we have a valid dump */
+       hset64(filesize, 0, 0);
+       USD_SEEK(ufd, filesize, SEEK_END, &currOffset);
+       hset64(filesize, hgethi(currOffset), hgetlo(currOffset)-sizeof(afs_uint32));
+       USD_SEEK(ufd, filesize, SEEK_SET, &currOffset);
+       USD_READ(ufd, (char *)&buffer, sizeof(afs_uint32), &got);
+       if ((got != sizeof(afs_uint32)) || (ntohl(buffer) != DUMPENDMAGIC)) {
+           fprintf(STDERR, "Signature missing from end of file '%s'\n", filename);
+           error = VOLSERBADOP;
+           goto wfail;
+       }
+       /* rewind, we are done */
+       hset64(filesize, 0, 0);
+       USD_SEEK(ufd, filesize, SEEK_SET, &currOffset);
     }
     code = SendFile(ufd, call, blksize);
     if (code) {
@@ -392,10 +378,7 @@ WriteData(call, rock)
  * with <fd> <blksize>
  */
 int
-ReceiveFile(ufd, call, blksize)
-     usd_handle_t ufd;
-     struct rx_call *call;
-     long blksize;
+ReceiveFile(usd_handle_t ufd, struct rx_call *call, long blksize)
 {
     char *buffer = NULL;
     afs_int32 bytesread;
@@ -415,8 +398,12 @@ ReceiveFile(ufd, call, blksize)
            FD_ZERO(&out);
            FD_SET((int)(ufd->handle), &out);
            /* don't timeout if write blocks */
+#if defined(AFS_PTHREAD_ENV)
+           select(((int)(ufd->handle)) + 1, &out, 0, 0, 0);
+#else
            IOMGR_Select(((int)(ufd->handle)) + 1, 0, &out, 0, 0);
 #endif
+#endif
            error =
                USD_WRITE(ufd, &buffer[bytesread - bytesleft], bytesleft, &w);
            if (error) {
@@ -433,10 +420,9 @@ ReceiveFile(ufd, call, blksize)
 }
 
 afs_int32
-DumpFunction(call, filename)
-     struct rx_call *call;
-     char *filename;
+DumpFunction(struct rx_call *call, void *rock)
 {
+    char *filename = (char *)rock;
     usd_handle_t ufd;          /* default is to stdout */
     afs_int32 error = 0, code;
     afs_hyper_t size;
@@ -484,13 +470,17 @@ DumpFunction(call, filename)
     return (error);
 }
 
+static char *
+vos_ctime(afs_int32 *timep)
+{
+    time_t foo = *timep;
+    return ctime(&foo);
+}
+
 static void
-DisplayFormat(pntr, server, part, totalOK, totalNotOK, totalBusy, fast,
-             longlist, disp)
-     volintInfo *pntr;
-     afs_int32 server, part;
-     int *totalOK, *totalNotOK, *totalBusy;
-     int fast, longlist, disp;
+DisplayFormat(volintInfo *pntr, afs_int32 server, afs_int32 part,
+             int *totalOK, int *totalNotOK, int *totalBusy, int fast,
+             int longlist, int disp)
 {
     char pname[10];
 
@@ -512,7 +502,7 @@ DisplayFormat(pntr, server, part, totalOK, totalNotOK, totalBusy, fast,
                *totalOK += 1;
            } else {
                fprintf(STDOUT, "Off-line");
-               *totalNotOK++;
+               *totalNotOK += 1;
            }
            if (pntr->needsSalvaged == 1)
                fprintf(STDOUT, "**needs salvage**");
@@ -526,25 +516,24 @@ DisplayFormat(pntr, server, part, totalOK, totalNotOK, totalBusy, fast,
                    (unsigned long)pntr->backupID);
            fprintf(STDOUT, "    MaxQuota %10d K \n", pntr->maxquota);
            fprintf(STDOUT, "    Creation    %s",
-                   ctime((time_t *) & pntr->creationDate));
+                   vos_ctime(& pntr->creationDate));
 #ifdef FULL_LISTVOL_SWITCH
            fprintf(STDOUT, "    Copy        %s",
-                   ctime((time_t *) & pntr->copyDate));
+                   vos_ctime( & pntr->copyDate));
            if (!pntr->backupDate)
                fprintf(STDOUT, "    Backup      Never\n");
            else
                fprintf(STDOUT, "    Backup      %s",
-                       ctime((time_t *) & pntr->backupDate));
+                       vos_ctime( & pntr->backupDate));
            if (pntr->accessDate)
                fprintf(STDOUT, "    Last Access %s",
-                       ctime((time_t *) & pntr->accessDate));
+                       vos_ctime( & pntr->accessDate));
 #endif
-           if (pntr->updateDate < pntr->creationDate)
-               fprintf(STDOUT, "    Last Update %s",
-                       ctime((time_t *) & pntr->creationDate));
+           if (!pntr->updateDate)
+               fprintf(STDOUT, "    Last Update Never\n");
            else
                fprintf(STDOUT, "    Last Update %s",
-                       ctime((time_t *) & pntr->updateDate));
+                       vos_ctime( & pntr->updateDate));
            fprintf(STDOUT,
                    "    %d accesses in the past day (i.e., vnode references)\n",
                    pntr->dayUse);
@@ -627,18 +616,9 @@ DisplayFormat(pntr, server, part, totalOK, totalNotOK, totalBusy, fast,
  *------------------------------------------------------------------------*/
 
 static void
-XDisplayFormat(a_xInfoP, a_servID, a_partID, a_totalOKP, a_totalNotOKP,
-              a_totalBusyP, a_fast, a_int32, a_showProblems)
-     volintXInfo *a_xInfoP;
-     afs_int32 a_servID;
-     afs_int32 a_partID;
-     int *a_totalOKP;
-     int *a_totalNotOKP;
-     int *a_totalBusyP;
-     int a_fast;
-     int a_int32;
-     int a_showProblems;
-
+XDisplayFormat(volintXInfo *a_xInfoP, afs_int32 a_servID, afs_int32 a_partID,
+              int *a_totalOKP, int *a_totalNotOKP, int *a_totalBusyP,
+              int a_fast, int a_int32, int a_showProblems)
 {                              /*XDisplayFormat */
 
     char pname[10];
@@ -683,25 +663,24 @@ XDisplayFormat(a_xInfoP, a_servID, a_partID, a_totalOKP, a_totalNotOKP,
                    (unsigned long)a_xInfoP->backupID);
            fprintf(STDOUT, "    MaxQuota %10d K \n", a_xInfoP->maxquota);
            fprintf(STDOUT, "    Creation    %s",
-                   ctime((time_t *) & a_xInfoP->creationDate));
+                   vos_ctime( & a_xInfoP->creationDate));
 #ifdef FULL_LISTVOL_SWITCH
            fprintf(STDOUT, "    Copy        %s",
-                   ctime((time_t *) & a_xInfoP->copyDate));
+                   vos_ctime( & a_xInfoP->copyDate));
            if (!a_xInfoP->backupDate)
                fprintf(STDOUT, "    Backup      Never\n");
            else
                fprintf(STDOUT, "    Backup      %s",
-                       ctime((time_t *) & a_xInfoP->backupDate));
+                       vos_ctime( & a_xInfoP->backupDate));
            if (a_xInfoP->accessDate)
                fprintf(STDOUT, "    Last Access %s",
-                       ctime((time_t *) & a_xInfoP->accessDate));
+                       vos_ctime( & a_xInfoP->accessDate));
 #endif
-           if (a_xInfoP->updateDate < a_xInfoP->creationDate)
-               fprintf(STDOUT, "    Last Update %s",
-                       ctime((time_t *) & a_xInfoP->creationDate));
+           if (!a_xInfoP->updateDate)
+               fprintf(STDOUT, "    Last Update Never\n");
            else
                fprintf(STDOUT, "    Last Update %s",
-                       ctime((time_t *) & a_xInfoP->updateDate));
+                       vos_ctime( & a_xInfoP->updateDate));
            fprintf(STDOUT,
                    "    %d accesses in the past day (i.e., vnode references)\n",
                    a_xInfoP->dayUse);
@@ -835,10 +814,207 @@ XDisplayFormat(a_xInfoP, a_servID, a_partID, a_totalOKP, a_totalNotOKP,
 }                              /*XDisplayFormat */
 
 #ifdef FULL_LISTVOL_SWITCH
+/*------------------------------------------------------------------------
+ * PRIVATE XDisplayFormat2
+ *
+ * Description:
+ *     Display the formated contents of one extended volume info structure.
+ *
+ * Arguments:
+ *     a_xInfoP        : Ptr to extended volume info struct to print.
+ *     a_servID        : Server ID to print.
+ *     a_partID        : Partition ID to print.
+ *     a_totalOKP      : Ptr to total-OK counter.
+ *     a_totalNotOKP   : Ptr to total-screwed counter.
+ *     a_totalBusyP    : Ptr to total-busy counter.
+ *     a_fast          : Fast listing?
+ *     a_int32         : Int32 listing?
+ *     a_showProblems  : Show volume problems?
+ *
+ * Returns:
+ *     Nothing.
+ *
+ * Environment:
+ *     Nothing interesting.
+ *
+ * Side Effects:
+ *     As advertised.
+ *------------------------------------------------------------------------*/
+
+static void
+XDisplayFormat2(volintXInfo *a_xInfoP, afs_int32 a_servID, afs_int32 a_partID,
+               int *a_totalOKP, int *a_totalNotOKP, int *a_totalBusyP,
+               int a_fast, int a_int32, int a_showProblems)
+{                              /*XDisplayFormat */
+    if (a_fast) {
+       /*
+        * Short & sweet.
+        */
+       fprintf(STDOUT, "vold_id\t%-10lu\n", (unsigned long)a_xInfoP->volid);
+    } else if (a_int32) {
+       /*
+        * Fully-detailed listing.
+        */
+       if (a_xInfoP->status == VOK) {
+           /*
+            * Volume's status is OK - all the fields are valid.
+            */
+
+                static long server_cache = -1, partition_cache = -1;
+                static char hostname[256], address[32], pname[16];
+                int i,ai[] = {VOLINT_STATS_TIME_IDX_0,VOLINT_STATS_TIME_IDX_1,VOLINT_STATS_TIME_IDX_2,
+                              VOLINT_STATS_TIME_IDX_3,VOLINT_STATS_TIME_IDX_4,VOLINT_STATS_TIME_IDX_5};
+
+               if (a_servID != server_cache) {
+                       struct in_addr s;
+
+                       s.s_addr = a_servID;
+                       strcpy(hostname, hostutil_GetNameByINet(a_servID));
+                       strcpy(address, inet_ntoa(s));
+                       server_cache = a_servID;
+               }
+               if (a_partID != partition_cache) {
+                       MapPartIdIntoName(a_partID, pname);
+                       partition_cache = a_partID;
+               }
+
+               fprintf(STDOUT, "name\t\t%s\n", a_xInfoP->name);
+               fprintf(STDOUT, "id\t\t%lu\n", afs_printable_uint32_lu(a_xInfoP->volid));
+               fprintf(STDOUT, "serv\t\t%s\t%s\n", address, hostname);
+               fprintf(STDOUT, "part\t\t%s\n", pname);
+               switch (a_xInfoP->status) {
+               case VOK:
+                       fprintf(STDOUT, "status\t\tOK\n");
+                       break;
+               case VBUSY:
+                       fprintf(STDOUT, "status\t\tBUSY\n");
+                       return;
+               default:
+                       fprintf(STDOUT, "status\t\tUNATTACHABLE\n");
+                       return;
+               }
+               fprintf(STDOUT, "backupID\t%lu\n", 
+                       afs_printable_uint32_lu(a_xInfoP->backupID));
+               fprintf(STDOUT, "parentID\t%lu\n", 
+                       afs_printable_uint32_lu(a_xInfoP->parentID));
+               fprintf(STDOUT, "cloneID\t\t%lu\n", 
+                       afs_printable_uint32_lu(a_xInfoP->cloneID));
+               fprintf(STDOUT, "inUse\t\t%s\n", a_xInfoP->inUse ? "Y" : "N");
+               switch (a_xInfoP->type) {
+               case 0:
+                       fprintf(STDOUT, "type\t\tRW\n");
+                       break;
+               case 1:
+                       fprintf(STDOUT, "type\t\tRO\n");
+                       break;
+               case 2:
+                       fprintf(STDOUT, "type\t\tBK\n");
+                       break;
+               default:
+                       fprintf(STDOUT, "type\t\t?\n");
+                       break;
+               }
+               fprintf(STDOUT, "creationDate\t%-9lu\t%s", 
+                       afs_printable_uint32_lu(a_xInfoP->creationDate),
+                       vos_ctime(&a_xInfoP->creationDate));
+               fprintf(STDOUT, "accessDate\t%-9lu\t%s", 
+                       afs_printable_uint32_lu(a_xInfoP->accessDate),
+                       vos_ctime(&a_xInfoP->accessDate));
+               fprintf(STDOUT, "updateDate\t%-9lu\t%s", 
+                       afs_printable_uint32_lu(a_xInfoP->updateDate),
+                       vos_ctime(&a_xInfoP->updateDate));
+               fprintf(STDOUT, "backupDate\t%-9lu\t%s", 
+                       afs_printable_uint32_lu(a_xInfoP->backupDate),
+                       vos_ctime(&a_xInfoP->backupDate));
+               fprintf(STDOUT, "copyDate\t%-9lu\t%s", 
+                       afs_printable_uint32_lu(a_xInfoP->copyDate),
+                       vos_ctime(&a_xInfoP->copyDate));
+               
+               fprintf(STDOUT, "diskused\t%u\n", a_xInfoP->size);
+               fprintf(STDOUT, "maxquota\t%u\n", a_xInfoP->maxquota);
+
+               fprintf(STDOUT, "filecount\t%u\n", a_xInfoP->filecount);
+               fprintf(STDOUT, "dayUse\t\t%u\n", a_xInfoP->dayUse);
+
+
+
+               fprintf(STDOUT,"reads_same_net\t%8d\n",a_xInfoP->stat_reads[VOLINT_STATS_SAME_NET]);
+               fprintf(STDOUT,"reads_same_net_auth\t%8d\n",a_xInfoP->stat_reads[VOLINT_STATS_SAME_NET_AUTH]);
+               fprintf(STDOUT,"reads_diff_net\t%8d\n",a_xInfoP->stat_reads[VOLINT_STATS_DIFF_NET]);
+               fprintf(STDOUT,"reads_diff_net_auth\t%8d\n",a_xInfoP->stat_reads[VOLINT_STATS_DIFF_NET_AUTH]);
+
+               fprintf(STDOUT,"writes_same_net\t%8d\n",a_xInfoP->stat_writes[VOLINT_STATS_SAME_NET]);
+               fprintf(STDOUT,"writes_same_net_auth\t%8d\n",a_xInfoP->stat_writes[VOLINT_STATS_SAME_NET_AUTH]);
+               fprintf(STDOUT,"writes_diff_net\t%8d\n",a_xInfoP->stat_writes[VOLINT_STATS_DIFF_NET]);
+               fprintf(STDOUT,"writes_diff_net_auth\t%8d\n",a_xInfoP->stat_writes[VOLINT_STATS_DIFF_NET_AUTH]);
+
+               for(i=0;i<5;i++)
+               {
+                       fprintf(STDOUT,"file_same_author_idx_%d\t%8d\n",i+1,a_xInfoP->stat_fileSameAuthor[ai[i]]);
+                       fprintf(STDOUT,"file_diff_author_idx_%d\t%8d\n",i+1,a_xInfoP->stat_fileDiffAuthor[ai[i]]);
+                       fprintf(STDOUT,"dir_same_author_idx_%d\t%8d\n",i+1,a_xInfoP->stat_dirSameAuthor[ai[i]]);
+                       fprintf(STDOUT,"dir_dif_author_idx_%d\t%8d\n",i+1,a_xInfoP->stat_dirDiffAuthor[ai[i]]);
+               }
+
+       } /*Volume status OK */
+       else if (a_xInfoP->status == VBUSY) {
+           (*a_totalBusyP)++;
+           qPut(&busyHead, a_xInfoP->volid);
+           if (a_showProblems)
+               fprintf(STDOUT, "BUSY_VOL\t%lu\n",
+                       (unsigned long)a_xInfoP->volid);
+       } /*Busy volume */
+       else {
+           (*a_totalNotOKP)++;
+           qPut(&notokHead, a_xInfoP->volid);
+           if (a_showProblems)
+               fprintf(STDOUT, "COULD_NOT_ATTACH\t%lu\n",
+                       (unsigned long)a_xInfoP->volid);
+       }                       /*Screwed volume */
+    } /*Long listing */
+    else {
+       /*
+        * Default listing.
+        */
+       if (a_xInfoP->status == VOK) {
+           fprintf(STDOUT, "name\t%-32s\n", a_xInfoP->name);
+           fprintf(STDOUT, "volID\t%10lu\n", (unsigned long)a_xInfoP->volid);
+           if (a_xInfoP->type == 0)
+               fprintf(STDOUT, "type\tRW\n");
+           if (a_xInfoP->type == 1)
+               fprintf(STDOUT, "type\tRO\n");
+           if (a_xInfoP->type == 2)
+               fprintf(STDOUT, "type\tBK\n");
+           fprintf(STDOUT, "size\t%10dK\n", a_xInfoP->size);
+
+           fprintf(STDOUT, "inUse\t%d\n",a_xInfoP->inUse);
+           if (a_xInfoP->inUse == 1)
+               (*a_totalOKP)++;
+           else
+               (*a_totalNotOKP)++;
+
+       } /*Volume OK */
+       else if (a_xInfoP->status == VBUSY) {
+           (*a_totalBusyP)++;
+           qPut(&busyHead, a_xInfoP->volid);
+           if (a_showProblems)
+               fprintf(STDOUT, "VOLUME_BUSY\t%lu\n",
+                       (unsigned long)a_xInfoP->volid);
+       } /*Busy volume */
+       else {
+           (*a_totalNotOKP)++;
+           qPut(&notokHead, a_xInfoP->volid);
+           if (a_showProblems)
+               fprintf(STDOUT, "COULD_NOT_ATTACH_VOLUME\t%lu\n",
+                       (unsigned long)a_xInfoP->volid);
+       }                       /*Screwed volume */
+    }                          /*Default listing */
+}                              /*XDisplayFormat */
+#endif /*FULL_LISTVOL_SWITCH*/
+
+#ifdef FULL_LISTVOL_SWITCH
 static void
-DisplayFormat2(server, partition, pntr)
-     long server, partition;
-     volintInfo *pntr;
+DisplayFormat2(long server, long partition, volintInfo *pntr)
 {
     static long server_cache = -1, partition_cache = -1;
     static char hostname[256], address[32], pname[16];
@@ -856,7 +1032,8 @@ DisplayFormat2(server, partition, pntr)
        partition_cache = partition;
     }
     fprintf(STDOUT, "name\t\t%s\n", pntr->name);
-    fprintf(STDOUT, "id\t\t%lu\n", pntr->volid);
+    fprintf(STDOUT, "id\t\t%lu\n", 
+           afs_printable_uint32_lu(pntr->volid));
     fprintf(STDOUT, "serv\t\t%s\t%s\n", address, hostname);
     fprintf(STDOUT, "part\t\t%s\n", pname);
     switch (pntr->status) {
@@ -870,9 +1047,12 @@ DisplayFormat2(server, partition, pntr)
        fprintf(STDOUT, "status\t\tUNATTACHABLE\n");
        return;
     }
-    fprintf(STDOUT, "backupID\t%lu\n", pntr->backupID);
-    fprintf(STDOUT, "parentID\t%lu\n", pntr->parentID);
-    fprintf(STDOUT, "cloneID\t\t%lu\n", pntr->cloneID);
+    fprintf(STDOUT, "backupID\t%lu\n", 
+           afs_printable_uint32_lu(pntr->backupID));
+    fprintf(STDOUT, "parentID\t%lu\n", 
+           afs_printable_uint32_lu(pntr->parentID));
+    fprintf(STDOUT, "cloneID\t\t%lu\n", 
+           afs_printable_uint32_lu(pntr->cloneID));
     fprintf(STDOUT, "inUse\t\t%s\n", pntr->inUse ? "Y" : "N");
     fprintf(STDOUT, "needsSalvaged\t%s\n", pntr->needsSalvaged ? "Y" : "N");
     /* 0xD3 is from afs/volume.h since I had trouble including the file */
@@ -891,32 +1071,40 @@ DisplayFormat2(server, partition, pntr)
        fprintf(STDOUT, "type\t\t?\n");
        break;
     }
-    fprintf(STDOUT, "creationDate\t%-9lu\t%s", pntr->creationDate,
-           ctime(&pntr->creationDate));
-    fprintf(STDOUT, "accessDate\t%-9lu\t%s", pntr->accessDate,
-           ctime(&pntr->accessDate));
-    fprintf(STDOUT, "updateDate\t%-9lu\t%s", pntr->updateDate,
-           ctime(&pntr->updateDate));
-    fprintf(STDOUT, "backupDate\t%-9lu\t%s", pntr->backupDate,
-           ctime(&pntr->backupDate));
-    fprintf(STDOUT, "copyDate\t%-9lu\t%s", pntr->copyDate,
-           ctime(&pntr->copyDate));
-    fprintf(STDOUT, "flags\t\t%#lx\t(Optional)\n", pntr->flags);
+    fprintf(STDOUT, "creationDate\t%-9lu\t%s", 
+           afs_printable_uint32_lu(pntr->creationDate),
+           vos_ctime(&pntr->creationDate));
+    fprintf(STDOUT, "accessDate\t%-9lu\t%s", 
+           afs_printable_uint32_lu(pntr->accessDate),
+           vos_ctime(&pntr->accessDate));
+    fprintf(STDOUT, "updateDate\t%-9lu\t%s", 
+           afs_printable_uint32_lu(pntr->updateDate),
+           vos_ctime(&pntr->updateDate));
+    fprintf(STDOUT, "backupDate\t%-9lu\t%s", 
+           afs_printable_uint32_lu(pntr->backupDate),
+           vos_ctime(&pntr->backupDate));
+    fprintf(STDOUT, "copyDate\t%-9lu\t%s", 
+           afs_printable_uint32_lu(pntr->copyDate),
+           vos_ctime(&pntr->copyDate));
+    fprintf(STDOUT, "flags\t\t%#lx\t(Optional)\n", 
+           afs_printable_uint32_lu(pntr->flags));
     fprintf(STDOUT, "diskused\t%u\n", pntr->size);
     fprintf(STDOUT, "maxquota\t%u\n", pntr->maxquota);
-    fprintf(STDOUT, "minquota\t%lu\t(Optional)\n", pntr->spare0);
+    fprintf(STDOUT, "minquota\t%lu\t(Optional)\n", 
+           afs_printable_uint32_lu(pntr->spare0));
     fprintf(STDOUT, "filecount\t%u\n", pntr->filecount);
     fprintf(STDOUT, "dayUse\t\t%u\n", pntr->dayUse);
-    fprintf(STDOUT, "weekUse\t\t%lu\t(Optional)\n", pntr->spare1);
-    fprintf(STDOUT, "spare2\t\t%lu\t(Optional)\n", pntr->spare2);
-    fprintf(STDOUT, "spare3\t\t%lu\t(Optional)\n", pntr->spare3);
+    fprintf(STDOUT, "weekUse\t\t%lu\t(Optional)\n",
+           afs_printable_uint32_lu(pntr->spare1));
+    fprintf(STDOUT, "spare2\t\t%lu\t(Optional)\n", 
+           afs_printable_uint32_lu(pntr->spare2));
+    fprintf(STDOUT, "spare3\t\t%lu\t(Optional)\n", 
+           afs_printable_uint32_lu(pntr->spare3));
     return;
 }
 
 static void
-DisplayVolumes2(server, partition, pntr, count)
-     volintInfo *pntr;
-     long server, partition, count;
+DisplayVolumes2(long server, long partition, volintInfo *pntr, long count)
 {
     long i;
 
@@ -931,14 +1119,12 @@ DisplayVolumes2(server, partition, pntr, count)
 #endif /* FULL_LISTVOL_SWITCH */
 
 static void
-DisplayVolumes(server, part, pntr, count, longlist, fast, quiet)
-     afs_int32 server, part;
-     volintInfo *pntr;
-     afs_int32 count, longlist, fast;
-     int quiet;
+DisplayVolumes(afs_int32 server, afs_int32 part, volintInfo *pntr,
+              afs_int32 count, afs_int32 longlist, afs_int32 fast,
+              int quiet)
 {
     int totalOK, totalNotOK, totalBusy, i;
-    afs_int32 volid;
+    afs_uint32 volid = 0;
 
     totalOK = 0;
     totalNotOK = 0;
@@ -973,7 +1159,6 @@ DisplayVolumes(server, part, pntr, count, longlist, fast, quiet)
        }
     }
 }
-
 /*------------------------------------------------------------------------
  * PRIVATE XDisplayVolumes
  *
@@ -1000,23 +1185,16 @@ DisplayVolumes(server, part, pntr, count, longlist, fast, quiet)
  *------------------------------------------------------------------------*/
 
 static void
-XDisplayVolumes(a_servID, a_partID, a_xInfoP, a_count, a_int32, a_fast,
-               a_quiet)
-     afs_int32 a_servID;
-     afs_int32 a_partID;
-     volintXInfo *a_xInfoP;
-     afs_int32 a_count;
-     afs_int32 a_int32;
-     afs_int32 a_fast;
-     int a_quiet;
-
+XDisplayVolumes(afs_int32 a_servID, afs_int32 a_partID, volintXInfo *a_xInfoP,
+               afs_int32 a_count, afs_int32 a_int32, afs_int32 a_fast,
+               int a_quiet)
 {                              /*XDisplayVolumes */
 
     int totalOK;               /*Total OK volumes */
     int totalNotOK;            /*Total screwed volumes */
     int totalBusy;             /*Total busy volumes */
     int i;                     /*Loop variable */
-    afs_int32 volid;           /*Current volume ID */
+    afs_uint32 volid = 0;      /*Current volume ID */
 
     /*
      * Initialize counters and (global!!) queues.
@@ -1064,15 +1242,100 @@ XDisplayVolumes(a_servID, a_partID, a_xInfoP, a_count, a_int32, a_fast,
     }
 
 }                              /*XDisplayVolumes */
+#ifdef FULL_LISTVOL_SWITCH
+/*------------------------------------------------------------------------
+ * PRIVATE XDisplayVolumes2
+ *
+ * Description:
+ *     Display extended formated volume information.
+ *
+ * Arguments:
+ *     a_servID : Pointer to the Rx call we're performing.
+ *     a_partID : Partition for which we want the extended list.
+ *     a_xInfoP : Ptr to extended volume info.
+ *     a_count  : Number of volume records contained above.
+ *     a_int32   : Int32 listing generated?
+ *     a_fast   : Fast listing generated?
+ *     a_quiet  : Quiet listing generated?
+ *
+ * Returns:
+ *     Nothing.
+ *
+ * Environment:
+ *     Nothing interesting.
+ *
+ * Side Effects:
+ *     As advertised.
+ *------------------------------------------------------------------------*/
+
+static void
+XDisplayVolumes2(afs_int32 a_servID, afs_int32 a_partID, volintXInfo *a_xInfoP,
+                afs_int32 a_count, afs_int32 a_int32, afs_int32 a_fast,
+                int a_quiet)
+{                              /*XDisplayVolumes */
+
+    int totalOK;               /*Total OK volumes */
+    int totalNotOK;            /*Total screwed volumes */
+    int totalBusy;             /*Total busy volumes */
+    int i;                     /*Loop variable */
+    afs_uint32 volid = 0;      /*Current volume ID */
+
+    /*
+     * Initialize counters and (global!!) queues.
+     */
+    totalOK = 0;
+    totalNotOK = 0;
+    totalBusy = 0;
+    qInit(&busyHead);
+    qInit(&notokHead);
+
+    /*
+     * Display each volume in the list.
+     */
+    for (i = 0; i < a_count; i++) {
+       fprintf(STDOUT, "BEGIN_OF_ENTRY\n");
+       XDisplayFormat2(a_xInfoP, a_servID, a_partID, &totalOK, &totalNotOK,
+                      &totalBusy, a_fast, a_int32, 0);
+       fprintf(STDOUT, "END_OF_ENTRY\n");
+       a_xInfoP++;
+    }
+
+    /*
+     * If any volumes were found to be busy or screwed, display them.
+     */
+    if (totalBusy) {
+       while (busyHead.count) {
+           qGet(&busyHead, &volid);
+           fprintf(STDOUT, "BUSY_VOL\t%lu\n",
+                   (unsigned long)volid);
+       }
+    }
+    if (totalNotOK) {
+       while (notokHead.count) {
+           qGet(&notokHead, &volid);
+           fprintf(STDOUT, "COULD_NOT_ATTACH\t%lu\n",
+                   (unsigned long)volid);
+       }
+    }
+
+    if (!a_quiet) {
+       fprintf(STDOUT, "\n");
+       if (!a_fast) {
+           fprintf(STDOUT,
+                   "VOLUMES_ONLINE\t%d\nVOLUMES_OFFLINE\t%d\nVOLUMES_BUSY\t%d\n",
+                   totalOK, totalNotOK, totalBusy);
+       }
+    }
+
+}                              /*XDisplayVolumes2 */
+#endif /* FULL_LISTVOL_SWITCH */
+
 
 /* set <server> and <part> to the correct values depending on 
  * <voltype> and <entry> */
 static void
-GetServerAndPart(entry, voltype, server, part, previdx)
-     struct nvldbentry *entry;
-     afs_int32 *server, *part;
-     int voltype;
-     int *previdx;
+GetServerAndPart(struct nvldbentry *entry, int voltype, afs_int32 *server,
+                afs_int32 *part, int *previdx)
 {
     int i, istart, vtype;
 
@@ -1104,8 +1367,7 @@ GetServerAndPart(entry, voltype, server, part, previdx)
 }
 
 static void
-PostVolumeStats(entry)
-     struct nvldbentry *entry;
+PostVolumeStats(struct nvldbentry *entry)
 {
     SubEnumerateEntry(entry);
     /* Check for VLOP_ALLOPERS */
@@ -1138,13 +1400,8 @@ PostVolumeStats(entry)
  *------------------------------------------------------------------------*/
 
 static void
-XVolumeStats(a_xInfoP, a_entryP, a_srvID, a_partID, a_volType)
-     volintXInfo *a_xInfoP;
-     struct nvldbentry *a_entryP;
-     afs_int32 a_srvID;
-     afs_int32 a_partID;
-     int a_volType;
-
+XVolumeStats(volintXInfo *a_xInfoP, struct nvldbentry *a_entryP,
+            afs_int32 a_srvID, afs_int32 a_partID, int a_volType)
 {                              /*XVolumeStats */
 
     int totalOK, totalNotOK, totalBusy;        /*Dummies - we don't really count here */
@@ -1163,14 +1420,10 @@ XVolumeStats(a_xInfoP, a_entryP, a_srvID, a_partID, a_volType)
 }                              /*XVolumeStats */
 
 static void
-VolumeStats(pntr, entry, server, part, voltype)
-     volintInfo *pntr;
-     struct nvldbentry *entry;
-     int voltype;
-     afs_int32 server, part;
+VolumeStats_int(volintInfo *pntr, struct nvldbentry *entry, afs_int32 server, 
+            afs_int32 part, int voltype)
 {
     int totalOK, totalNotOK, totalBusy;
-    afs_int32 vcode, vcode2;
 
     DisplayFormat(pntr, server, part, &totalOK, &totalNotOK, &totalBusy, 0, 1,
                  1);
@@ -1178,12 +1431,12 @@ VolumeStats(pntr, entry, server, part, voltype)
 }
 
 /* command to forcibly remove a volume */
-static
-NukeVolume(as)
-     register struct cmd_syndesc *as;
+static int
+NukeVolume(register struct cmd_syndesc *as)
 {
     register afs_int32 code;
-    afs_int32 volID, err;
+    afs_uint32 volID;
+    afs_int32  err;
     afs_int32 partID;
     afs_int32 server;
     register char *tp;
@@ -1244,15 +1497,14 @@ NukeVolume(as)
  *     As advertised.
  *------------------------------------------------------------------------
  */
-static
-ExamineVolume(as)
-     register struct cmd_syndesc *as;
+static int
+ExamineVolume(register struct cmd_syndesc *as, void *arock)
 {
     struct nvldbentry entry;
     afs_int32 vcode = 0;
     volintInfo *pntr = (volintInfo *) 0;
     volintXInfo *xInfoP = (volintXInfo *) 0;
-    afs_int32 volid;
+    afs_uint32 volid;
     afs_int32 code, err, error = 0;
     int voltype, foundserv = 0, foundentry = 0;
     afs_int32 aserver, apart;
@@ -1352,7 +1604,7 @@ ExamineVolume(as)
                EnumerateEntry(&entry);
            } else
 #endif /* FULL_LISTVOL_SWITCH */
-               VolumeStats(pntr, &entry, aserver, apart, voltype);
+               VolumeStats_int(pntr, &entry, aserver, apart, voltype);
 
            if ((voltype == BACKVOL) && !(entry.flags & BACK_EXISTS)) {
                /* The VLDB says there is no backup volume yet we found one on disk */
@@ -1397,14 +1649,12 @@ ExamineVolume(as)
  *     As advertised.
  *------------------------------------------------------------------------
  */
-static
-SetFields(as)
-     register struct cmd_syndesc *as;
+static int
+SetFields(register struct cmd_syndesc *as, void *arock)
 {
     struct nvldbentry entry;
-    afs_int32 vcode = 0;
     volintInfo info;
-    afs_int32 volid;
+    afs_uint32 volid;
     afs_int32 code, err;
     afs_int32 aserver, apart;
     int previdx = -1;
@@ -1435,20 +1685,13 @@ SetFields(as)
        return (ENOENT);
     }
 
-    memset(&info, 0, sizeof(info));
+    init_volintInfo(&info);
     info.volid = volid;
     info.type = RWVOL;
-    info.dayUse = -1;
-    info.maxquota = -1;
-    info.flags = -1;
-    info.spare0 = -1;
-    info.spare1 = -1;
-    info.spare2 = -1;
-    info.spare3 = -1;
 
     if (as->parms[1].items) {
        /* -max <quota> */
-       code = util_GetInt32(as->parms[1].items->data, &info.maxquota);
+       code = util_GetHumanInt32(as->parms[1].items->data, &info.maxquota);
        if (code) {
            fprintf(STDERR, "invalid quota value\n");
            return code;
@@ -1458,6 +1701,10 @@ SetFields(as)
        /* -clearuse */
        info.dayUse = 0;
     }
+    if (as->parms[3].items) {
+       /* -clearVolUpCounter */
+       info.spare2 = 0;
+    }
     code = UV_SetVolumeInfo(aserver, apart, volid, &info);
     if (code)
        fprintf(STDERR,
@@ -1485,11 +1732,11 @@ SetFields(as)
  *     As advertised.
  *------------------------------------------------------------------------
  */
-static
-volOnline(as)
-     register struct cmd_syndesc *as;
+static int
+volOnline(register struct cmd_syndesc *as, void *arock)
 {
-    afs_int32 server, partition, volid;
+    afs_int32 server, partition;
+    afs_uint32 volid;
     afs_int32 code, err = 0;
 
     server = GetServer(as->parms[0].items->data);
@@ -1546,9 +1793,10 @@ volOnline(as)
  *------------------------------------------------------------------------
  */
 static int
-volOffline(register struct cmd_syndesc *as)
+volOffline(register struct cmd_syndesc *as, void *arock)
 {
-    afs_int32 server, partition, volid;
+    afs_int32 server, partition;
+    afs_uint32 volid;
     afs_int32 code, err = 0;
     afs_int32 transflag, sleeptime, transdone;
 
@@ -1596,11 +1844,12 @@ volOffline(register struct cmd_syndesc *as)
 }
 
 static int
-CreateVolume(register struct cmd_syndesc *as)
+CreateVolume(register struct cmd_syndesc *as, void *arock)
 {
-    afs_int32 pname;
+    afs_int32 pnum;
     char part[10];
-    afs_int32 volid, code;
+    afs_uint32 volid;
+    afs_int32 code;
     struct nvldbentry entry;
     afs_int32 vcode;
     afs_int32 quota;
@@ -1612,13 +1861,13 @@ CreateVolume(register struct cmd_syndesc *as)
                as->parms[0].items->data);
        return ENOENT;
     }
-    pname = volutil_GetPartitionID(as->parms[1].items->data);
-    if (pname < 0) {
+    pnum = volutil_GetPartitionID(as->parms[1].items->data);
+    if (pnum < 0) {
        fprintf(STDERR, "vos: could not interpret partition name '%s'\n",
                as->parms[1].items->data);
        return ENOENT;
     }
-    if (!IsPartValid(pname, tserver, &code)) { /*check for validity of the partition */
+    if (!IsPartValid(pnum, tserver, &code)) {  /*check for validity of the partition */
        if (code)
            PrintError("", code);
        else
@@ -1653,13 +1902,7 @@ CreateVolume(register struct cmd_syndesc *as)
     }
 
     if (as->parms[3].items) {
-       if (!IsNumeric(as->parms[3].items->data)) {
-           fprintf(STDERR, "Initial quota %s should be numeric.\n",
-                   as->parms[3].items->data);
-           return EINVAL;
-       }
-
-       code = util_GetInt32(as->parms[3].items->data, &quota);
+       code = util_GetHumanInt32(as->parms[3].items->data, &quota);
        if (code) {
            fprintf(STDERR, "vos: bad integer specified for quota.\n");
            return code;
@@ -1667,25 +1910,26 @@ CreateVolume(register struct cmd_syndesc *as)
     }
 
     code =
-       UV_CreateVolume2(tserver, pname, as->parms[2].items->data, quota, 0,
+       UV_CreateVolume2(tserver, pnum, as->parms[2].items->data, quota, 0,
                         0, 0, 0, &volid);
     if (code) {
        PrintDiagnostics("create", code);
        return code;
     }
-    MapPartIdIntoName(pname, part);
+    MapPartIdIntoName(pnum, part);
     fprintf(STDOUT, "Volume %lu created on partition %s of %s\n",
            (unsigned long)volid, part, as->parms[0].items->data);
 
     return 0;
 }
 
+#if 0
 static afs_int32
-DeleteAll(entry)
-     struct nvldbentry *entry;
+DeleteAll(struct nvldbentry *entry)
 {
     int i;
-    afs_int32 error, code, curserver, curpart, volid;
+    afs_int32 error, code, curserver, curpart;
+    afs_uint32 volid;
 
     MapHostToNetwork(entry);
     error = 0;
@@ -1703,13 +1947,14 @@ DeleteAll(entry)
     }
     return error;
 }
+#endif
 
-static
-DeleteVolume(as)
-     struct cmd_syndesc *as;
+static int
+DeleteVolume(struct cmd_syndesc *as, void *arock)
 {
     afs_int32 err, code = 0;
-    afs_int32 server = 0, partition = -1, volid;
+    afs_int32 server = 0, partition = -1;
+    afs_uint32 volid;
     char pname[10];
     afs_int32 idx, j;
 
@@ -1825,15 +2070,16 @@ DeleteVolume(as)
 }
 
 #define TESTM  0               /* set for move space tests, clear for production */
-static
-MoveVolume(as)
-     register struct cmd_syndesc *as;
+static int
+MoveVolume(register struct cmd_syndesc *as, void *arock)
 {
 
-    afs_int32 volid, fromserver, toserver, frompart, topart, code, err;
+    afs_uint32 volid;
+    afs_int32 fromserver, toserver, frompart, topart;
+    afs_int32 flags, code, err;
     char fromPartName[10], toPartName[10];
 
-    struct diskPartition partition;    /* for space check */
+    struct diskPartition64 partition;  /* for space check */
     volintInfo *p;
 
     volid = vsu_GetVolumeID(as->parms[0].items->data, cstruct, &err);
@@ -1888,6 +2134,9 @@ MoveVolume(as)
        return ENOENT;
     }
 
+    flags = 0;
+    if (as->parms[5].items) flags |= RV_NOCLONE;
+
     /*
      * check source partition for space to clone volume
      */
@@ -1899,13 +2148,13 @@ MoveVolume(as)
      * check target partition for space to move volume
      */
 
-    code = UV_PartitionInfo(toserver, toPartName, &partition);
+    code = UV_PartitionInfo64(toserver, toPartName, &partition);
     if (code) {
        fprintf(STDERR, "vos: cannot access partition %s\n", toPartName);
        exit(1);
     }
     if (TESTM)
-       fprintf(STDOUT, "target partition %s free space %d\n", toPartName,
+       fprintf(STDOUT, "target partition %s free space %" AFS_INT64_FMT "\n", toPartName,
                partition.free);
 
     p = (volintInfo *) 0;
@@ -1913,7 +2162,6 @@ MoveVolume(as)
     if (code) {
        fprintf(STDERR, "vos:cannot access volume %lu\n",
                (unsigned long)volid);
-       free(p);
        exit(1);
     }
     if (TESTM)
@@ -1935,7 +2183,8 @@ MoveVolume(as)
 
     /* successful move still not guaranteed but shoot for it */
 
-    code = UV_MoveVolume(volid, fromserver, frompart, toserver, topart);
+    code =
+       UV_MoveVolume2(volid, fromserver, frompart, toserver, topart, flags);
     if (code) {
        PrintDiagnostics("move", code);
        return code;
@@ -1949,14 +2198,14 @@ MoveVolume(as)
     return 0;
 }
 
-static
-CopyVolume(as)
-     register struct cmd_syndesc *as;
+static int
+CopyVolume(register struct cmd_syndesc *as, void *arock)
 {
-    afs_int32 volid, fromserver, toserver, frompart, topart, code, err;
+    afs_uint32 volid;
+    afs_int32 fromserver, toserver, frompart, topart, code, err, flags;
     char fromPartName[10], toPartName[10], *tovolume;
     struct nvldbentry entry;
-    struct diskPartition partition;    /* for space check */
+    struct diskPartition64 partition;  /* for space check */
     volintInfo *p;
 
     volid = vsu_GetVolumeID(as->parms[0].items->data, cstruct, &err);
@@ -1978,7 +2227,7 @@ CopyVolume(as)
     toserver = GetServer(as->parms[4].items->data);
     if (toserver == 0) {
        fprintf(STDERR, "vos: server '%s' not found in host table\n",
-               as->parms[3].items->data);
+               as->parms[4].items->data);
        return ENOENT;
     }
 
@@ -2026,6 +2275,131 @@ CopyVolume(as)
     topart = volutil_GetPartitionID(as->parms[5].items->data);
     if (topart < 0) {
        fprintf(STDERR, "vos: could not interpret partition name '%s'\n",
+               as->parms[5].items->data);
+       return EINVAL;
+    }
+    if (!IsPartValid(topart, toserver, &code)) {       /*check for validity of the partition */
+       if (code)
+           PrintError("", code);
+       else
+           fprintf(STDERR,
+                   "vos : partition %s does not exist on the server\n",
+                   as->parms[5].items->data);
+       return ENOENT;
+    }
+
+    flags = 0;
+    if (as->parms[6].items) flags |= RV_OFFLINE;
+    if (as->parms[7].items) flags |= RV_RDONLY;
+    if (as->parms[8].items) flags |= RV_NOCLONE;
+
+    MapPartIdIntoName(topart, toPartName);
+    MapPartIdIntoName(frompart, fromPartName);
+
+    /*
+     * check target partition for space to move volume
+     */
+
+    code = UV_PartitionInfo64(toserver, toPartName, &partition);
+    if (code) {
+       fprintf(STDERR, "vos: cannot access partition %s\n", toPartName);
+       exit(1);
+    }
+    if (TESTM)
+       fprintf(STDOUT, "target partition %s free space %" AFS_INT64_FMT "\n", toPartName,
+               partition.free);
+
+    p = (volintInfo *) 0;
+    code = UV_ListOneVolume(fromserver, frompart, volid, &p);
+    if (code) {
+       fprintf(STDERR, "vos:cannot access volume %lu\n",
+               (unsigned long)volid);
+       exit(1);
+    }
+
+    if (partition.free <= p->size) {
+       fprintf(STDERR,
+               "vos: no space on target partition %s to copy volume %lu\n",
+               toPartName, (unsigned long)volid);
+       free(p);
+       exit(1);
+    }
+    free(p);
+
+    /* successful copy still not guaranteed but shoot for it */
+
+    code =
+       UV_CopyVolume2(volid, fromserver, frompart, tovolume, toserver,
+                      topart, 0, flags);
+    if (code) {
+       PrintDiagnostics("copy", code);
+       return code;
+    }
+    MapPartIdIntoName(topart, toPartName);
+    MapPartIdIntoName(frompart, fromPartName);
+    fprintf(STDOUT, "Volume %lu copied from %s %s to %s on %s %s \n",
+           (unsigned long)volid, as->parms[1].items->data, fromPartName,
+           tovolume, as->parms[4].items->data, toPartName);
+
+    return 0;
+}
+
+
+static int
+ShadowVolume(register struct cmd_syndesc *as, void *arock)
+{
+    afs_uint32 volid, tovolid;
+    afs_int32 fromserver, toserver, frompart, topart;
+    afs_int32 code, err, flags;
+    char fromPartName[10], toPartName[10], toVolName[32], *tovolume;
+    struct diskPartition64 partition;  /* for space check */
+    volintInfo *p, *q;
+
+    p = (volintInfo *) 0;
+    q = (volintInfo *) 0;
+
+    volid = vsu_GetVolumeID(as->parms[0].items->data, cstruct, &err);
+    if (volid == 0) {
+       if (err)
+           PrintError("", err);
+       else
+           fprintf(STDERR, "vos: can't find volume ID or name '%s'\n",
+                   as->parms[0].items->data);
+       return ENOENT;
+    }
+    fromserver = GetServer(as->parms[1].items->data);
+    if (fromserver == 0) {
+       fprintf(STDERR, "vos: server '%s' not found in host table\n",
+               as->parms[1].items->data);
+       return ENOENT;
+    }
+
+    toserver = GetServer(as->parms[3].items->data);
+    if (toserver == 0) {
+       fprintf(STDERR, "vos: server '%s' not found in host table\n",
+               as->parms[3].items->data);
+       return ENOENT;
+    }
+
+    frompart = volutil_GetPartitionID(as->parms[2].items->data);
+    if (frompart < 0) {
+       fprintf(STDERR, "vos: could not interpret partition name '%s'\n",
+               as->parms[2].items->data);
+       return EINVAL;
+    }
+    if (!IsPartValid(frompart, fromserver, &code)) {   /*check for validity of the partition */
+       if (code)
+           PrintError("", code);
+       else
+           fprintf(STDERR,
+                   "vos : partition %s does not exist on the server\n",
+                   as->parms[2].items->data);
+       return ENOENT;
+    }
+
+    topart = volutil_GetPartitionID(as->parms[4].items->data);
+    if (topart < 0) {
+       fprintf(STDERR, "vos: could not interpret partition name '%s'\n",
                as->parms[4].items->data);
        return EINVAL;
     }
@@ -2039,9 +2413,70 @@ CopyVolume(as)
        return ENOENT;
     }
 
-    /*
-     * check source partition for space to clone volume
-     */
+    if (as->parms[5].items) {
+       tovolume = as->parms[5].items->data;
+       if (!ISNAMEVALID(tovolume)) {
+           fprintf(STDERR,
+               "vos: the name of the root volume %s exceeds the size limit of %d\n",
+               tovolume, VOLSER_OLDMAXVOLNAME - 10);
+           return E2BIG;
+       }
+       if (!VolNameOK(tovolume)) {
+           fprintf(STDERR,
+               "Illegal volume name %s, should not end in .readonly or .backup\n",
+               tovolume);
+           return EINVAL;
+       }
+       if (IsNumeric(tovolume)) {
+           fprintf(STDERR,
+               "Illegal volume name %s, should not be a number\n",
+               tovolume);
+           return EINVAL;
+       }
+    } else {
+       /* use actual name of source volume */
+       code = UV_ListOneVolume(fromserver, frompart, volid, &p);
+       if (code) {
+           fprintf(STDERR, "vos:cannot access volume %lu\n",
+               (unsigned long)volid);
+           exit(1);
+       }
+       strcpy(toVolName, p->name);
+       tovolume = toVolName;
+       /* save p for size checks later */
+    }
+
+    if (as->parms[6].items) {
+       tovolid = vsu_GetVolumeID(as->parms[6].items->data, cstruct, &err);
+       if (tovolid == 0) {
+           if (err)
+               PrintError("", err);
+           else
+               fprintf(STDERR, "vos: can't find volume ID or name '%s'\n",
+                       as->parms[6].items->data);
+           if (p)
+               free(p);
+           return ENOENT;
+       }
+    } else {
+       tovolid = vsu_GetVolumeID(tovolume, cstruct, &err);
+       if (tovolid == 0) {
+           if (err)
+               PrintError("", err);
+           else
+               fprintf(STDERR, "vos: can't find volume ID or name '%s'\n",
+                       tovolume);
+           if (p)
+               free(p);
+           return ENOENT;
+       }
+    }
+
+    flags = RV_NOVLDB;
+    if (as->parms[7].items) flags |= RV_OFFLINE;
+    if (as->parms[8].items) flags |= RV_RDONLY;
+    if (as->parms[9].items) flags |= RV_NOCLONE;
+    if (as->parms[10].items) flags |= RV_CPINCR;
 
     MapPartIdIntoName(topart, toPartName);
     MapPartIdIntoName(frompart, fromPartName);
@@ -2050,64 +2485,186 @@ CopyVolume(as)
      * check target partition for space to move volume
      */
 
-    code = UV_PartitionInfo(toserver, toPartName, &partition);
+    code = UV_PartitionInfo64(toserver, toPartName, &partition);
     if (code) {
        fprintf(STDERR, "vos: cannot access partition %s\n", toPartName);
        exit(1);
     }
     if (TESTM)
-       fprintf(STDOUT, "target partition %s free space %d\n", toPartName,
+       fprintf(STDOUT, "target partition %s free space %" AFS_INT64_FMT "\n", toPartName,
                partition.free);
 
-    p = (volintInfo *) 0;
-    code = UV_ListOneVolume(fromserver, frompart, volid, &p);
-    if (code) {
-       fprintf(STDERR, "vos:cannot access volume %lu\n",
+    /* Don't do this again if we did it above */
+    if (!p) {
+       code = UV_ListOneVolume(fromserver, frompart, volid, &p);
+       if (code) {
+           fprintf(STDERR, "vos:cannot access volume %lu\n",
                (unsigned long)volid);
-       free(p);
-       exit(1);
+           exit(1);
+       }
     }
 
+    /* OK if this fails */
+    code = UV_ListOneVolume(toserver, topart, tovolid, &q);
+
+    /* Treat existing volume size as "free" */
+    if (q)
+       p->size = (q->size < p->size) ? p->size - q->size : 0;
+
     if (partition.free <= p->size) {
        fprintf(STDERR,
                "vos: no space on target partition %s to copy volume %lu\n",
                toPartName, (unsigned long)volid);
        free(p);
+       if (q) free(q);
        exit(1);
     }
     free(p);
+    if (q) free(q);
 
     /* successful copy still not guaranteed but shoot for it */
 
     code =
-       UV_CopyVolume(volid, fromserver, frompart, tovolume, toserver,
-                     topart);
+       UV_CopyVolume2(volid, fromserver, frompart, tovolume, toserver,
+                      topart, tovolid, flags);
     if (code) {
-       PrintDiagnostics("copy", code);
+       PrintDiagnostics("shadow", code);
        return code;
     }
     MapPartIdIntoName(topart, toPartName);
     MapPartIdIntoName(frompart, fromPartName);
-    fprintf(STDOUT, "Volume %lu copied from %s %s to %s on %s %s \n",
+    fprintf(STDOUT, "Volume %lu shadowed from %s %s to %s %s \n",
            (unsigned long)volid, as->parms[1].items->data, fromPartName,
-           tovolume, as->parms[4].items->data, toPartName);
+           as->parms[3].items->data, toPartName);
+
+    return 0;
+}
+
+
+static int
+CloneVolume(register struct cmd_syndesc *as, void *arock)
+{
+    afs_uint32 volid, cloneid;
+    afs_int32 server, part, voltype;
+    char partName[10], *volname;
+    afs_int32 code, err, flags;
+    struct nvldbentry entry;
+
+    volid = vsu_GetVolumeID(as->parms[0].items->data, cstruct, &err);
+    if (volid == 0) {
+       if (err)
+           PrintError("", err);
+       else
+           fprintf(STDERR, "vos: can't find volume ID or name '%s'\n",
+                   as->parms[0].items->data);
+       return ENOENT;
+    }
+
+    if (as->parms[1].items || as->parms[2].items) {
+       if (!as->parms[1].items || !as->parms[2].items) {
+           fprintf(STDERR,
+                   "Must specify both -server and -partition options\n");
+           return -1;
+       }
+       server = GetServer(as->parms[1].items->data);
+       if (server == 0) {
+           fprintf(STDERR, "vos: server '%s' not found in host table\n",
+                   as->parms[1].items->data);
+           return ENOENT;
+       }
+       part = volutil_GetPartitionID(as->parms[2].items->data);
+       if (part < 0) {
+           fprintf(STDERR, "vos: could not interpret partition name '%s'\n",
+                   as->parms[2].items->data);
+           return EINVAL;
+       }
+       if (!IsPartValid(part, server, &code)) {        /*check for validity of the partition */
+           if (code)
+               PrintError("", code);
+           else
+               fprintf(STDERR,
+                   "vos : partition %s does not exist on the server\n",
+                   as->parms[2].items->data);
+           return ENOENT;
+        }
+    } else {
+       code = GetVolumeInfo(volid, &server, &part, &voltype, &entry);
+       if (code)
+           return code;
+    }
+
+    volname = 0;
+    if (as->parms[3].items) {
+       volname = as->parms[3].items->data;
+       if (strlen(volname) > VOLSER_OLDMAXVOLNAME - 1) {
+           fprintf(STDERR,
+               "vos: the name of the root volume %s exceeds the size limit of %d\n",
+               volname, VOLSER_OLDMAXVOLNAME - 1);
+           return E2BIG;
+       }
+#if 0
+       /* 
+        * In order that you be able to make clones of RO or BK, this
+        * check must be omitted.
+        */
+       if (!VolNameOK(volname)) {
+           fprintf(STDERR,
+               "Illegal volume name %s, should not end in .readonly or .backup\n",
+               volname);
+           return EINVAL;
+       }
+#endif
+       if (IsNumeric(volname)) {
+           fprintf(STDERR,
+               "Illegal volume name %s, should not be a number\n",
+               volname);
+           return EINVAL;
+       }
+    }
+
+    cloneid = 0;
+    if (as->parms[4].items) {
+       cloneid = vsu_GetVolumeID(as->parms[4].items->data, cstruct, &err);
+       if (cloneid == 0) {
+           if (err)
+               PrintError("", err);
+           else
+               fprintf(STDERR, "vos: can't find volume ID or name '%s'\n",
+                       as->parms[4].items->data);
+           return ENOENT;
+       }
+    }
+
+    flags = 0;
+    if (as->parms[5].items) flags |= RV_OFFLINE;
+    if (as->parms[6].items) flags |= RV_RDONLY;
+
+
+    code = 
+       UV_CloneVolume(server, part, volid, cloneid, volname, flags);
+
+    if (code) {
+       PrintDiagnostics("clone", code);
+       return code;
+    }
+    MapPartIdIntoName(part, partName);
+    fprintf(STDOUT, "Created clone for volume %s\n",
+           as->parms[0].items->data);
 
     return 0;
 }
 
 
-static
-BackupVolume(as)
-     register struct cmd_syndesc *as;
+static int
+BackupVolume(register struct cmd_syndesc *as, void *arock)
 {
-    afs_int32 avolid, aserver, apart, vtype, code, err;
+    afs_uint32 avolid;
+    afs_int32 aserver, apart, vtype, code, err;
     struct nvldbentry entry;
 
-    afs_int32 buvolid, buserver, bupart, butype;
+    afs_uint32 buvolid;
+    afs_int32 buserver, bupart, butype;
     struct nvldbentry buentry;
-    struct rx_connection *conn;
-    volEntries volInfo;
-    struct nvldbentry store;
 
     avolid = vsu_GetVolumeID(as->parms[0].items->data, cstruct, &err);
     if (avolid == 0) {
@@ -2168,13 +2725,13 @@ BackupVolume(as)
     return 0;
 }
 
-static
-ReleaseVolume(as)
-     register struct cmd_syndesc *as;
+static int
+ReleaseVolume(register struct cmd_syndesc *as, void *arock)
 {
 
     struct nvldbentry entry;
-    afs_int32 avolid, aserver, apart, vtype, code, err;
+    afs_uint32 avolid;
+    afs_int32 aserver, apart, vtype, code, err;
     int force = 0;
 
     if (as->parms[1].items)
@@ -2214,13 +2771,12 @@ ReleaseVolume(as)
     return 0;
 }
 
-static
-DumpVolume(as)
-     register struct cmd_syndesc *as;
-
+static int
+DumpVolumeCmd(register struct cmd_syndesc *as, void *arock)
 {
-    afs_int32 avolid, aserver, apart, voltype, fromdate = 0, code, err, i;
-    char filename[NameLen];
+    afs_uint32 avolid;
+    afs_int32 aserver, apart, voltype, fromdate = 0, code, err, i, flags;
+    char filename[MAXPATHLEN];
     struct nvldbentry entry;
 
     rx_SetRxDeadTime(60 * 10);
@@ -2279,14 +2835,20 @@ DumpVolume(as)
        strcpy(filename, "");
     }
 
+    flags = as->parms[6].items ? VOLDUMPV2_OMITDIRS : 0;
+retry_dump:
     if (as->parms[5].items) {
        code =
            UV_DumpClonedVolume(avolid, aserver, apart, fromdate,
-                               DumpFunction, filename);
+                               DumpFunction, filename, flags);
     } else {
        code =
            UV_DumpVolume(avolid, aserver, apart, fromdate, DumpFunction,
-                         filename);
+                         filename, flags);
+    }
+    if ((code == RXGEN_OPCODE) && (as->parms[6].items)) {
+       flags &= ~VOLDUMPV2_OMITDIRS;
+       goto retry_dump;
     }
     if (code) {
        PrintDiagnostics("dump", code);
@@ -2306,21 +2868,27 @@ DumpVolume(as)
 #define FULL  2
 #define INC   3
 
-static
-RestoreVolume(as)
-     register struct cmd_syndesc *as;
+#define TS_DUMP        1
+#define TS_KEEP        2
+#define TS_NEW 3
 
+static int
+RestoreVolumeCmd(register struct cmd_syndesc *as, void *arock)
 {
-    afs_int32 avolid, aserver, apart, code, vcode, err;
+    afs_uint32 avolid, aparentid;
+    afs_int32 aserver, apart, code, vcode, err;
     afs_int32 aoverwrite = ASK;
-    int restoreflags, readonly = 0, offline = 0, voltype = RWVOL;
+    afs_int32 acreation = 0, alastupdate = 0;
+    int restoreflags = 0;
+    int readonly = 0, offline = 0, voltype = RWVOL;
     char prompt;
-    char afilename[NameLen], avolname[VOLSER_MAXVOLNAME + 1], apartName[10];
+    char afilename[MAXPATHLEN], avolname[VOLSER_MAXVOLNAME + 1], apartName[10];
     char volname[VOLSER_MAXVOLNAME + 1];
     struct nvldbentry entry;
 
     prompt = 'n';
 
+    aparentid = 0;
     if (as->parms[4].items) {
        avolid = vsu_GetVolumeID(as->parms[4].items->data, cstruct, &err);
        if (avolid == 0) {
@@ -2359,6 +2927,40 @@ RestoreVolume(as)
        voltype = ROVOL;
     }
 
+    if (as->parms[8].items) {
+       if ((strcmp(as->parms[8].items->data, "d") == 0)
+           || (strcmp(as->parms[8].items->data, "dump") == 0)) {
+           acreation = TS_DUMP;
+       } else if ((strcmp(as->parms[8].items->data, "k") == 0)
+           || (strcmp(as->parms[8].items->data, "keep") == 0)) {
+           acreation = TS_KEEP;
+       } else if ((strcmp(as->parms[8].items->data, "n") == 0)
+           || (strcmp(as->parms[8].items->data, "new") == 0)) {
+           acreation = TS_NEW;
+       } else {
+           fprintf(STDERR, "vos: %s is not a valid argument to -creation\n",
+                   as->parms[8].items->data);
+           exit(1);
+       }
+    }
+
+    if (as->parms[9].items) {
+       if ((strcmp(as->parms[9].items->data, "d") == 0)
+           || (strcmp(as->parms[9].items->data, "dump") == 0)) {
+           alastupdate = TS_DUMP;
+       } else if ((strcmp(as->parms[9].items->data, "k") == 0)
+           || (strcmp(as->parms[9].items->data, "keep") == 0)) {
+           alastupdate = TS_KEEP;
+       } else if ((strcmp(as->parms[9].items->data, "n") == 0)
+           || (strcmp(as->parms[9].items->data, "new") == 0)) {
+           alastupdate = TS_NEW;
+       } else {
+           fprintf(STDERR, "vos: %s is not a valid argument to -lastupdate\n",
+                   as->parms[9].items->data);
+           exit(1);
+       }
+    }
+
     aserver = GetServer(as->parms[0].items->data);
     if (aserver == 0) {
        fprintf(STDERR, "vos: server '%s' not found in host table\n",
@@ -2428,6 +3030,7 @@ RestoreVolume(as)
                   && entry.volumeId[voltype] != avolid) {
            avolid = entry.volumeId[voltype];
        }
+        aparentid = entry.volumeId[RWVOL];
     }
 
     else {                     /* volume exists - do we do a full incremental or abort */
@@ -2441,6 +3044,7 @@ RestoreVolume(as)
                   && entry.volumeId[voltype] != avolid) {
            avolid = entry.volumeId[voltype];
        }
+        aparentid = entry.volumeId[RWVOL];
 
        /* A file name was specified  - check if volume is on another partition */
        vcode = GetVolumeInfo(avolid, &Oserver, &Opart, &Otype, &Oentry);
@@ -2510,9 +3114,45 @@ RestoreVolume(as)
        restoreflags |= RV_OFFLINE;
     if (readonly)
        restoreflags |= RV_RDONLY;
+
+    switch (acreation) {
+       case TS_DUMP:
+           restoreflags |= RV_CRDUMP;
+           break;
+       case TS_KEEP:
+           restoreflags |= RV_CRKEEP;
+           break;
+       case TS_NEW:
+           restoreflags |= RV_CRNEW;
+           break;
+       default:
+           if (aoverwrite == FULL)
+               restoreflags |= RV_CRNEW;
+           else
+               restoreflags |= RV_CRKEEP;
+    }
+
+    switch (alastupdate) {
+       case TS_DUMP:
+           restoreflags |= RV_LUDUMP;
+           break;
+       case TS_KEEP:
+           restoreflags |= RV_LUKEEP;
+           break;
+       case TS_NEW:
+           restoreflags |= RV_LUNEW;
+           break;
+       default:
+           restoreflags |= RV_LUDUMP;
+    }
+    if (as->parms[10].items) {
+       restoreflags |= RV_NODEL;
+    }
+    
+
     code =
-       UV_RestoreVolume(aserver, apart, avolid, avolname, restoreflags,
-                        WriteData, afilename);
+       UV_RestoreVolume2(aserver, apart, avolid, aparentid,
+                          avolname, restoreflags, WriteData, afilename);
     if (code) {
        PrintDiagnostics("restore", code);
        exit(1);
@@ -2528,12 +3168,11 @@ RestoreVolume(as)
     return 0;
 }
 
-static
-LockReleaseCmd(as)
-     register struct cmd_syndesc *as;
-
+static int
+LockReleaseCmd(register struct cmd_syndesc *as, void *arock)
 {
-    afs_int32 avolid, code, err;
+    afs_uint32 avolid;
+    afs_int32 code, err;
 
     avolid = vsu_GetVolumeID(as->parms[0].items->data, cstruct, &err);
     if (avolid == 0) {
@@ -2555,11 +3194,11 @@ LockReleaseCmd(as)
     return 0;
 }
 
-static
-AddSite(as)
-     register struct cmd_syndesc *as;
+static int
+AddSite(register struct cmd_syndesc *as, void *arock)
 {
-    afs_int32 avolid, aserver, apart, code, err;
+    afs_uint32 avolid;
+    afs_int32 aserver, apart, code, err, valid = 0;
     char apartName[10], avolname[VOLSER_MAXVOLNAME + 1];
 
     vsu_ExtractName(avolname, as->parms[2].items->data);;
@@ -2593,7 +3232,10 @@ AddSite(as)
                    as->parms[1].items->data);
        exit(1);
     }
-    code = UV_AddSite(aserver, apart, avolid);
+    if (as->parms[3].items) {
+       valid = 1;
+    }
+    code = UV_AddSite(aserver, apart, avolid, valid);
     if (code) {
        PrintDiagnostics("addsite", code);
        exit(1);
@@ -2604,12 +3246,12 @@ AddSite(as)
     return 0;
 }
 
-static
-RemoveSite(as)
-     register struct cmd_syndesc *as;
+static int
+RemoveSite(register struct cmd_syndesc *as, void *arock)
 {
 
-    afs_int32 avolid, aserver, apart, code, err;
+    afs_uint32 avolid;
+    afs_int32 aserver, apart, code, err;
     char apartName[10], avolname[VOLSER_MAXVOLNAME + 1];
 
     vsu_ExtractName(avolname, as->parms[2].items->data);
@@ -2656,11 +3298,11 @@ RemoveSite(as)
     return 0;
 }
 
-static
-ChangeLocation(as)
-     register struct cmd_syndesc *as;
+static int
+ChangeLocation(register struct cmd_syndesc *as, void *arock)
 {
-    afs_int32 avolid, aserver, apart, code, err;
+    afs_uint32 avolid;
+    afs_int32 aserver, apart, code, err;
     char apartName[10];
 
     avolid = vsu_GetVolumeID(as->parms[2].items->data, cstruct, &err);
@@ -2704,9 +3346,8 @@ ChangeLocation(as)
     return 0;
 }
 
-static
-ListPartitions(as)
-     register struct cmd_syndesc *as;
+static int
+ListPartitions(register struct cmd_syndesc *as, void *arock)
 {
     afs_int32 aserver, code;
     struct partList dummyPartList;
@@ -2746,8 +3387,7 @@ ListPartitions(as)
 }
 
 static int
-CompareVolName(p1, p2)
-     char *p1, *p2;
+CompareVolName(const void *p1, const void *p2)
 {
     volintInfo *arg1, *arg2;
 
@@ -2780,9 +3420,7 @@ CompareVolName(p1, p2)
  *------------------------------------------------------------------------*/
 
 static int
-XCompareVolName(a_obj1P, a_obj2P)
-     char *a_obj1P, *a_obj2P;
-
+XCompareVolName(const void *a_obj1P, const void *a_obj2P)
 {                              /*XCompareVolName */
 
     return (strcmp
@@ -2792,8 +3430,7 @@ XCompareVolName(a_obj1P, a_obj2P)
 }                              /*XCompareVolName */
 
 static int
-CompareVolID(p1, p2)
-     char *p1, *p2;
+CompareVolID(const void *p1, const void *p2)
 {
     volintInfo *arg1, *arg2;
 
@@ -2831,9 +3468,7 @@ CompareVolID(p1, p2)
  *------------------------------------------------------------------------*/
 
 static int
-XCompareVolID(a_obj1P, a_obj2P)
-     char *a_obj1P, *a_obj2P;
-
+XCompareVolID(const void *a_obj1P, const void *a_obj2P)
 {                              /*XCompareVolID */
 
     afs_int32 id1, id2;                /*Volume IDs we're comparing */
@@ -2869,17 +3504,18 @@ XCompareVolID(a_obj1P, a_obj2P)
  *     As advertised.
  *------------------------------------------------------------------------*/
 
-static
-ListVolumes(as)
-     register struct cmd_syndesc *as;
+static int
+ListVolumes(register struct cmd_syndesc *as, void *arock)
 {
     afs_int32 apart, int32list, fast;
     afs_int32 aserver, code;
-    volintInfo *pntr, *oldpntr;
+    volintInfo *pntr;
+    volintInfo *oldpntr = NULL;
     afs_int32 count;
     int i;
     char *base;
-    volintXInfo *xInfoP, *origxInfoP;  /*Ptr to current/orig extended vol info */
+    volintXInfo *xInfoP;
+    volintXInfo *origxInfoP = NULL; /*Ptr to current/orig extended vol info */
     int wantExtendedInfo;      /*Do we want extended vol info? */
 
     char pname[10];
@@ -2997,6 +3633,12 @@ ListVolumes(as)
                        as->parms[0].items->data, pname,
                        (unsigned long)count);
            if (wantExtendedInfo) {
+#ifdef FULL_LISTVOL_SWITCH
+               if (as->parms[6].items)
+                   XDisplayVolumes2(aserver, dummyPartList.partId[i], origxInfoP,
+                               count, int32list, fast, quiet);
+               else
+#endif /* FULL_LISTVOL_SWITCH */
                XDisplayVolumes(aserver, dummyPartList.partId[i], origxInfoP,
                                count, int32list, fast, quiet);
                if (xInfoP)
@@ -3020,11 +3662,10 @@ ListVolumes(as)
     return 0;
 }
 
-static
-SyncVldb(as)
-     register struct cmd_syndesc *as;
+static int
+SyncVldb(register struct cmd_syndesc *as, void *arock)
 {
-    afs_int32 pname, code;     /* part name */
+    afs_int32 pnum = 0, code;  /* part name */
     char part[10];
     int flags = 0;
     char *volname = 0;
@@ -3040,13 +3681,13 @@ SyncVldb(as)
     }
 
     if (as->parms[1].items) {
-       pname = volutil_GetPartitionID(as->parms[1].items->data);
-       if (pname < 0) {
+       pnum = volutil_GetPartitionID(as->parms[1].items->data);
+       if (pnum < 0) {
            fprintf(STDERR, "vos: could not interpret partition name '%s'\n",
                    as->parms[1].items->data);
            exit(1);
        }
-       if (!IsPartValid(pname, tserver, &code)) {      /*check for validity of the partition */
+       if (!IsPartValid(pnum, tserver, &code)) {       /*check for validity of the partition */
            if (code)
                PrintError("", code);
            else
@@ -3064,17 +3705,21 @@ SyncVldb(as)
        }
     }
 
+    if (as->parms[3].items) {
+       flags |= 2; /* don't update */
+    }
+
     if (as->parms[2].items) {
        /* Synchronize an individual volume */
        volname = as->parms[2].items->data;
-       code = UV_SyncVolume(tserver, pname, volname, flags);
+       code = UV_SyncVolume(tserver, pnum, volname, flags);
     } else {
        if (!tserver) {
            fprintf(STDERR,
                    "Without a -volume option, the -server option is required\n");
            exit(1);
        }
-       code = UV_SyncVldb(tserver, pname, flags, 0 /*unused */ );
+       code = UV_SyncVldb(tserver, pnum, flags, 0 /*unused */ );
     }
 
     if (code) {
@@ -3090,8 +3735,8 @@ SyncVldb(as)
     if (tserver) {
        fprintf(STDOUT, " with state of server %s", as->parms[0].items->data);
     }
-    if (flags) {
-       MapPartIdIntoName(pname, part);
+    if (flags & 1) {
+       MapPartIdIntoName(pnum, part);
        fprintf(STDOUT, " partition %s\n", part);
     }
     fprintf(STDOUT, "\n");
@@ -3099,12 +3744,10 @@ SyncVldb(as)
     return 0;
 }
 
-static
-SyncServer(as)
-     register struct cmd_syndesc *as;
-
+static int
+SyncServer(register struct cmd_syndesc *as, void *arock)
 {
-    afs_int32 pname, code;     /* part name */
+    afs_int32 pnum, code;      /* part name */
     char part[10];
 
     int flags = 0;
@@ -3116,13 +3759,13 @@ SyncServer(as)
        exit(1);
     }
     if (as->parms[1].items) {
-       pname = volutil_GetPartitionID(as->parms[1].items->data);
-       if (pname < 0) {
+       pnum = volutil_GetPartitionID(as->parms[1].items->data);
+       if (pnum < 0) {
            fprintf(STDERR, "vos: could not interpret partition name '%s'\n",
                    as->parms[1].items->data);
            exit(1);
        }
-       if (!IsPartValid(pname, tserver, &code)) {      /*check for validity of the partition */
+       if (!IsPartValid(pnum, tserver, &code)) {       /*check for validity of the partition */
            if (code)
                PrintError("", code);
            else
@@ -3132,15 +3775,20 @@ SyncServer(as)
            exit(1);
        }
        flags = 1;
+    } else {
+        pnum = -1;
     }
 
-    code = UV_SyncServer(tserver, pname, flags, 0 /*unused */ );
+    if (as->parms[2].items) {
+       flags |= 2; /* don't update */
+    }
+    code = UV_SyncServer(tserver, pnum, flags, 0 /*unused */ );
     if (code) {
        PrintDiagnostics("syncserv", code);
        exit(1);
     }
-    if (flags) {
-       MapPartIdIntoName(pname, part);
+    if (flags & 1) {
+       MapPartIdIntoName(pnum, part);
        fprintf(STDOUT, "Server %s partition %s synchronized with VLDB\n",
                as->parms[0].items->data, part);
     } else
@@ -3150,9 +3798,8 @@ SyncServer(as)
 
 }
 
-static
-VolumeInfoCmd(name)
-     char *name;
+static int
+VolumeInfoCmd(char *name)
 {
     struct nvldbentry entry;
     afs_int32 vcode;
@@ -3178,13 +3825,12 @@ VolumeInfoCmd(name)
     return 0;
 }
 
-static
-VolumeZap(as)
-     register struct cmd_syndesc *as;
-
+static int
+VolumeZap(register struct cmd_syndesc *as, void *arock)
 {
     struct nvldbentry entry;
-    afs_int32 volid, code, server, part, zapbackupid = 0, backupid = 0, err;
+    afs_uint32 volid, zapbackupid = 0, backupid = 0;
+    afs_int32 code, server, part, err;
 
     if (as->parms[3].items) {
        /* force flag is on, use the other version */
@@ -3265,10 +3911,8 @@ VolumeZap(as)
     return 0;
 }
 
-static
-VolserStatus(as)
-     register struct cmd_syndesc *as;
-
+static int
+VolserStatus(register struct cmd_syndesc *as, void *arock)
 {
     afs_int32 server, code;
     transDebugInfo *pntr, *oldpntr;
@@ -3298,7 +3942,7 @@ VolserStatus(as)
        /*print out the relevant info */
        fprintf(STDOUT, "--------------------------------------\n");
        fprintf(STDOUT, "transaction: %lu  created: %s",
-               (unsigned long)pntr->tid, ctime((time_t *) & pntr->time));
+               (unsigned long)pntr->tid, vos_ctime( & pntr->time));
        if (pntr->returnCode) {
            fprintf(STDOUT, "returnCode: %lu\n",
                    (unsigned long)pntr->returnCode);
@@ -3358,9 +4002,8 @@ VolserStatus(as)
     return 0;
 }
 
-static
-RenameVolume(as)
-     register struct cmd_syndesc *as;
+static int
+RenameVolume(register struct cmd_syndesc *as, void *arock)
 {
     afs_int32 code1, code2, code;
     struct nvldbentry entry;
@@ -3419,9 +4062,9 @@ RenameVolume(as)
     return 0;
 }
 
-GetVolumeInfo(volid, server, part, voltype, rentry)
-     afs_int32 *server, volid, *part, *voltype;
-     register struct nvldbentry *rentry;
+int
+GetVolumeInfo(afs_uint32 volid, afs_int32 *server, afs_int32 *part, afs_int32 *voltype, 
+              struct nvldbentry *rentry)
 {
     afs_int32 vcode;
     int i, index = -1;
@@ -3473,15 +4116,17 @@ GetVolumeInfo(volid, server, part, voltype, rentry)
        *part = rentry->serverPartition[index];
        return 0;
     }
+    fprintf(STDERR,
+            "unexpected volume type for volume %lu\n",
+            (unsigned long)volid);
+    return -1;
 }
 
-static
-DeleteEntry(as)
-     register struct cmd_syndesc *as;
-
+static int
+DeleteEntry(register struct cmd_syndesc *as, void *arock)
 {
-    afs_int32 apart;
-    afs_int32 avolid;
+    afs_int32 apart = 0;
+    afs_uint32 avolid;
     afs_int32 vcode;
     struct VldbListByAttributes attributes;
     nbulkentries arrayEntries;
@@ -3515,7 +4160,7 @@ DeleteEntry(as)
                fflush(STDOUT);
                continue;
            }
-           vcode = ubik_Call(VL_DeleteEntry, cstruct, 0, avolid, RWVOL);
+           vcode = ubik_VL_DeleteEntry(cstruct, 0, avolid, RWVOL);
            if (vcode) {
                fprintf(STDERR, "Could not delete entry for volume %s\n",
                        itp->data);
@@ -3628,7 +4273,7 @@ DeleteEntry(as)
 
        /* Only matches the RW volume name */
        avolid = vllist->volumeId[RWVOL];
-       vcode = ubik_Call(VL_DeleteEntry, cstruct, 0, avolid, RWVOL);
+       vcode = ubik_VL_DeleteEntry(cstruct, 0, avolid, RWVOL);
        if (vcode) {
            fprintf(STDOUT, "Could not delete VDLB entry for  %s\n",
                    vllist->name);
@@ -3654,8 +4299,7 @@ DeleteEntry(as)
 
 
 static int
-CompareVldbEntryByName(p1, p2)
-     char *p1, *p2;
+CompareVldbEntryByName(const void *p1, const void *p2)
 {
     struct nvldbentry *arg1, *arg2;
 
@@ -3665,8 +4309,7 @@ CompareVldbEntryByName(p1, p2)
 }
 
 /*
-static int CompareVldbEntry(p1,p2)
-char *p1,*p2;
+static int CompareVldbEntry(char *p1, char *p2)
 {
     struct nvldbentry *arg1,*arg2;
     int i;
@@ -3700,9 +4343,8 @@ char *p1,*p2;
 }
 
 */
-static
-ListVLDB(as)
-     struct cmd_syndesc *as;
+static int
+ListVLDB(struct cmd_syndesc *as, void *arock)
 {
     afs_int32 apart;
     afs_int32 aserver, code;
@@ -3710,7 +4352,9 @@ ListVLDB(as)
     struct VldbListByAttributes attributes;
     nbulkentries arrayEntries;
     struct nvldbentry *vllist, *tarray = 0, *ttarray;
-    afs_int32 centries, nentries = 0, tarraysize, parraysize;
+    afs_int32 centries, nentries = 0;
+    afs_int32 tarraysize = 0;
+    afs_int32 parraysize;
     int j;
     char pname[10];
     int quiet, sort, lock;
@@ -3871,11 +4515,11 @@ ListVLDB(as)
     return 0;
 }
 
-static
-BackSys(as)
-     register struct cmd_syndesc *as;
+static int
+BackSys(register struct cmd_syndesc *as, void *arock)
 {
-    afs_int32 apart = 0, avolid;
+    afs_uint32 avolid;
+    afs_int32 apart = 0;
     afs_int32 aserver = 0, code, aserver1, apart1;
     afs_int32 vcode;
     struct VldbListByAttributes attributes;
@@ -3887,12 +4531,14 @@ BackSys(as)
     int seenprefix, seenxprefix, exclude, ex, exp, noaction;
     afs_int32 totalBack = 0;
     afs_int32 totalFail = 0;
-    int previdx = -1, error, same;
-    int comp = 0;
-    char compstr[50];
+    int previdx = -1;
+    int error;
+    int same = 0;
     struct cmd_item *ti;
+    int match = 0;
+#ifndef HAVE_POSIX_REGEX
     char *ccode;
-    int match;
+#endif
 
     memset(&attributes, 0, sizeof(struct VldbListByAttributes));
     attributes.Mask = 0;
@@ -3928,6 +4574,20 @@ BackSys(as)
     if (seenprefix) {
        for (ti = as->parms[0].items; ti; ti = ti->next) {
            if (strncmp(ti->data, "^", 1) == 0) {
+#ifdef HAVE_POSIX_REGEX
+               regex_t re;
+               char errbuf[256];
+
+               code = regcomp(&re, ti->data, REG_NOSUB);
+               if (code != 0) {
+                   regerror(code, &re, errbuf, sizeof errbuf);
+                   fprintf(STDERR,
+                           "Unrecognizable -prefix regular expression: '%s': %s\n",
+                           ti->data, errbuf);
+                   exit(1);
+               }
+               regfree(&re);
+#else
                ccode = (char *)re_comp(ti->data);
                if (ccode) {
                    fprintf(STDERR,
@@ -3935,12 +4595,27 @@ BackSys(as)
                            ti->data, ccode);
                    exit(1);
                }
+#endif
            }
        }
     }
     if (seenxprefix) {
        for (ti = as->parms[4].items; ti; ti = ti->next) {
            if (strncmp(ti->data, "^", 1) == 0) {
+#ifdef HAVE_POSIX_REGEX
+               regex_t re;
+               char errbuf[256];
+
+               code = regcomp(&re, ti->data, REG_NOSUB);
+               if (code != 0) {
+                   regerror(code, &re, errbuf, sizeof errbuf);
+                   fprintf(STDERR,
+                           "Unrecognizable -xprefix regular expression: '%s': %s\n",
+                           ti->data, errbuf);
+                   exit(1);
+               }
+               regfree(&re);
+#else
                ccode = (char *)re_comp(ti->data);
                if (ccode) {
                    fprintf(STDERR,
@@ -3948,6 +4623,7 @@ BackSys(as)
                            ti->data, ccode);
                    exit(1);
                }
+#endif
            }
        }
     }
@@ -4012,6 +4688,22 @@ BackSys(as)
        if (seenprefix) {
            for (ti = as->parms[0].items; ti; ti = ti->next) {
                if (strncmp(ti->data, "^", 1) == 0) {
+#ifdef HAVE_POSIX_REGEX
+                   regex_t re;
+                   char errbuf[256];
+
+                   /* XXX -- should just do the compile once! */
+                   code = regcomp(&re, ti->data, REG_NOSUB);
+                   if (code != 0) {
+                       regerror(code, &re, errbuf, sizeof errbuf);
+                       fprintf(STDERR,
+                               "Error in -prefix regular expression: '%s': %s\n",
+                               ti->data, errbuf);
+                       exit(1);
+                   }
+                   match = (regexec(&re, vllist->name, 0, NULL, 0) == 0);
+                   regfree(&re);
+#else
                    ccode = (char *)re_comp(ti->data);
                    if (ccode) {
                        fprintf(STDERR,
@@ -4020,6 +4712,7 @@ BackSys(as)
                        exit(1);
                    }
                    match = (re_exec(vllist->name) == 1);
+#endif
                } else {
                    match =
                        (strncmp(vllist->name, ti->data, strlen(ti->data)) ==
@@ -4040,6 +4733,23 @@ BackSys(as)
        if (match && seenxprefix) {
            for (ti = as->parms[4].items; ti; ti = ti->next) {
                if (strncmp(ti->data, "^", 1) == 0) {
+#ifdef HAVE_POSIX_REGEX
+                   regex_t re;
+                   char errbuf[256];
+
+                   /* XXX -- should just do the compile once! */
+                   code = regcomp(&re, ti->data, REG_NOSUB);
+                   if (code != 0) {
+                       regerror(code, &re, errbuf, sizeof errbuf);
+                       fprintf(STDERR,
+                               "Error in -xprefix regular expression: '%s': %s\n",
+                               ti->data, errbuf);
+                       exit(1);
+                   }
+                   if (regexec(&re, vllist->name, 0, NULL, 0) == 0)
+                           match = 0;
+                   regfree(&re);
+#else
                    ccode = (char *)re_comp(ti->data);
                    if (ccode) {
                        fprintf(STDERR,
@@ -4051,6 +4761,7 @@ BackSys(as)
                        match = 0;
                        break;
                    }
+#endif
                } else {
                    if (strncmp(vllist->name, ti->data, strlen(ti->data)) ==
                        0) {
@@ -4137,19 +4848,19 @@ BackSys(as)
     return 0;
 }
 
-static
-UnlockVLDB(as)
-     register struct cmd_syndesc *as;
+static int
+UnlockVLDB(register struct cmd_syndesc *as, void *arock)
 {
     afs_int32 apart;
-    afs_int32 aserver, code;
+    afs_int32 aserver = 0;
+    afs_int32 code;
     afs_int32 vcode;
     struct VldbListByAttributes attributes;
     nbulkentries arrayEntries;
     register struct nvldbentry *vllist;
     afs_int32 nentries;
     int j;
-    afs_int32 volid;
+    afs_uint32 volid;
     afs_int32 totalE;
     char pname[10];
 
@@ -4199,8 +4910,9 @@ UnlockVLDB(as)
        vllist = &arrayEntries.nbulkentries_val[j];
        volid = vllist->volumeId[RWVOL];
        vcode =
-           ubik_Call(VL_ReleaseLock, cstruct, 0, volid, -1,
-                     LOCKREL_OPCODE | LOCKREL_AFSID | LOCKREL_TIMESTAMP);
+           ubik_VL_ReleaseLock(cstruct, 0, volid, -1,
+                               LOCKREL_OPCODE | LOCKREL_AFSID | 
+                               LOCKREL_TIMESTAMP);
        if (vcode) {
            fprintf(STDERR, "Could not unlock entry for volume %s\n",
                    vllist->name);
@@ -4238,17 +4950,48 @@ UnlockVLDB(as)
     return 0;
 }
 
-static
-PartitionInfo(as)
-     register struct cmd_syndesc *as;
+static char *
+PrintInt64Size(afs_uint64 in)
+{
+    register afs_uint32 hi, lo;
+    register char * units;
+    static char output[16];
+
+    SplitInt64(in,hi,lo);
+
+    if (hi == 0) {
+        units = "KB";
+    } else if (!(hi & 0xFFFFFC00)) {
+        units = "MB";
+        lo = (hi << 22) | (lo >> 10);
+    } else if (!(hi & 0xFFF00000)) {
+        units = "GB";
+        lo = (hi << 12) | (lo >> 20);
+    } else if (!(hi & 0xC0000000)) {
+        units = "TB";
+        lo = (hi << 2) | (lo >> 30);
+    } else {
+        units = "PB";
+        lo = (hi >> 8);
+    }
+    sprintf(output,"%u %s", lo, units);
+    return output;
+}
+
+static int
+PartitionInfo(register struct cmd_syndesc *as, void *arock)
 {
     afs_int32 apart;
     afs_int32 aserver, code;
     char pname[10];
-    struct diskPartition partition;
+    struct diskPartition64 partition;
     struct partList dummyPartList;
     int i, cnt;
+    int printSummary=0, sumPartitions=0;
+    afs_uint64 sumFree, sumStorage;
 
+    ZeroInt64(sumFree);
+    ZeroInt64(sumStorage);
     apart = -1;
     aserver = GetServer(as->parms[0].items->data);
     if (aserver == 0) {
@@ -4267,6 +5010,9 @@ PartitionInfo(as)
        dummyPartList.partFlags[0] = PARTVALID;
        cnt = 1;
     }
+    if (as->parms[2].items) {
+        printSummary = 1;
+    }
     if (apart != -1) {
        if (!IsPartValid(apart, aserver, &code)) {      /*check for validity of the partition */
            if (code)
@@ -4287,7 +5033,7 @@ PartitionInfo(as)
     for (i = 0; i < cnt; i++) {
        if (dummyPartList.partFlags[i] & PARTVALID) {
            MapPartIdIntoName(dummyPartList.partId[i], pname);
-           code = UV_PartitionInfo(aserver, pname, &partition);
+           code = UV_PartitionInfo64(aserver, pname, &partition);
            if (code) {
                fprintf(STDERR, "Could not get information on partition %s\n",
                        pname);
@@ -4295,17 +5041,27 @@ PartitionInfo(as)
                exit(1);
            }
            fprintf(STDOUT,
-                   "Free space on partition %s: %d K blocks out of total %d\n",
+                   "Free space on partition %s: %" AFS_INT64_FMT " K blocks out of total %" AFS_INT64_FMT "\n",
                    pname, partition.free, partition.minFree);
+           sumPartitions++;
+            AddUInt64(sumFree,partition.free,&sumFree);
+            AddUInt64(sumStorage,partition.minFree,&sumStorage);
        }
     }
+    if (printSummary) {
+        fprintf(STDOUT,
+               "Summary: %s free out of ",
+               PrintInt64Size(sumFree));
+        fprintf(STDOUT,
+                "%s on %d partitions\n",
+                PrintInt64Size(sumStorage), 
+                sumPartitions);
+    }
     return 0;
 }
 
-static
-ChangeAddr(as)
-     register struct cmd_syndesc *as;
-
+static int
+ChangeAddr(register struct cmd_syndesc *as, void *arock)
 {
     afs_int32 ip1, ip2, vcode;
     int remove = 0;
@@ -4368,15 +5124,15 @@ ChangeAddr(as)
 
 static void
 print_addrs(const bulkaddrs * addrs, const afsUUID * m_uuid, int nentries,
-           int print, int noresolve)
+           int print)
 {
     afs_int32 vcode;
     afs_int32 i, j;
-    struct VLCallBack unused;
+    struct VLCallBack vlcb;
     afs_int32 *addrp;
     bulkaddrs m_addrs;
     ListAddrByAttributes m_attrs;
-    afs_int32 m_unique, m_nentries, *m_addrp;
+    afs_int32 m_nentries, *m_addrp;
     afs_int32 base, index;
     char buf[1024];
 
@@ -4405,8 +5161,8 @@ print_addrs(const bulkaddrs * addrs, const afsUUID * m_uuid, int nentries,
                m_addrs.bulkaddrs_val = 0;
                m_addrs.bulkaddrs_len = 0;
                vcode =
-                   ubik_Call(VL_GetAddrsU, cstruct, 0, &m_attrs, &m_uuid,
-                             &m_unique, &m_nentries, &m_addrs);
+                   ubik_VL_GetAddrsU(cstruct, 0, &m_attrs, &m_uuid,
+                                     (afs_int32 *)&vlcb, &m_nentries, &m_addrs);
                if (vcode) {
                    fprintf(STDERR,
                            "vos: could not list the multi-homed server addresses\n");
@@ -4452,19 +5208,17 @@ print_addrs(const bulkaddrs * addrs, const afsUUID * m_uuid, int nentries,
     return;
 }
 
-static
-ListAddrs(as)
-     register struct cmd_syndesc *as;
+static int
+ListAddrs(register struct cmd_syndesc *as, void *arock)
 {
     afs_int32 vcode;
-    afs_int32 i, j, noresolve = 0, printuuid = 0;
-    struct VLCallBack unused;
-    afs_int32 nentries, *addrp;
-    bulkaddrs addrs, m_addrs;
+    afs_int32 i, printuuid = 0;
+    struct VLCallBack vlcb;
+    afs_int32 nentries;
+    bulkaddrs m_addrs;
     ListAddrByAttributes m_attrs;
     afsUUID m_uuid, askuuid;
-    afs_int32 m_unique, m_nentries, *m_addrp;
-    afs_int32 base, index;
+    afs_int32 m_nentries;
 
     memset(&m_attrs, 0, sizeof(struct ListAddrByAttributes));
     m_attrs.Mask = VLADDR_INDEX;
@@ -4473,7 +5227,11 @@ ListAddrs(as)
     memset(&askuuid, 0, sizeof(afsUUID));
     if (as->parms[0].items) {
        /* -uuid */
-       afsUUID_from_string(as->parms[0].items->data, &askuuid);
+        if (afsUUID_from_string(as->parms[0].items->data, &askuuid) < 0) {
+           fprintf(STDERR, "vos: invalid UUID '%s'\n", 
+                   as->parms[0].items->data);
+           exit(-1);
+       }
        m_attrs.Mask = VLADDR_UUID;
        m_attrs.uuid = askuuid;
     }
@@ -4483,7 +5241,7 @@ ListAddrs(as)
        afs_int32 saddr;
        he = hostutil_GetHostByName((char *)as->parms[1].items->data);
        if (he == NULL) {
-           fprintf(stderr, "Can't get host info for '%s'\n",
+           fprintf(STDERR, "vos: Can't get host info for '%s'\n",
                    as->parms[1].items->data);
            exit(-1);
        }
@@ -4492,9 +5250,6 @@ ListAddrs(as)
        m_attrs.ipaddr = ntohl(saddr);
     }
     if (as->parms[2].items) {
-       noresolve = 1;
-    }
-    if (as->parms[3].items) {
        printuuid = 1;
     }
 
@@ -4502,7 +5257,7 @@ ListAddrs(as)
     m_addrs.bulkaddrs_len = 0;
 
     vcode =
-       ubik_Call_New(VL_GetAddrs, cstruct, 0, 0, 0, &m_unique, &nentries,
+       ubik_Call_New(VL_GetAddrs, cstruct, 0, 0, 0, &vlcb, &nentries,
                      &m_addrs);
     if (vcode) {
        fprintf(STDERR, "vos: could not list the server addresses\n");
@@ -4519,11 +5274,22 @@ ListAddrs(as)
 
        vcode =
            ubik_Call_New(VL_GetAddrsU, cstruct, 0, &m_attrs, &m_uuid,
-                         &m_unique, &m_nentries, &m_addrs);
+                         &vlcb, &m_nentries, &m_addrs);
+
        if (vcode == VL_NOENT) {
-           i++;
-           nentries++;
-           continue;
+           if (m_attrs.Mask == VLADDR_UUID) {
+               fprintf(STDERR, "vos: no entry for UUID '%s' found in VLDB\n",
+                       as->parms[0].items->data);
+               exit(-1);
+           } else if (m_attrs.Mask == VLADDR_IPADDR) {
+               fprintf(STDERR, "vos: no entry for host '%s' [0x%08x] found in VLDB\n",
+                       as->parms[1].items->data, m_attrs.ipaddr);
+               exit(-1);
+           } else {
+               i++;
+               nentries++;
+               continue;
+           }
        }
 
        if (vcode == VL_INDEXERANGE) {
@@ -4536,7 +5302,7 @@ ListAddrs(as)
            return (vcode);
        }
 
-       print_addrs(&m_addrs, &m_uuid, m_nentries, printuuid, noresolve);
+       print_addrs(&m_addrs, &m_uuid, m_nentries, printuuid);
        i++;
 
        if ((as->parms[1].items) || (as->parms[0].items) || (i > nentries))
@@ -4546,12 +5312,11 @@ ListAddrs(as)
     return 0;
 }
 
-static
-LockEntry(as)
-     register struct cmd_syndesc *as;
-
+static int
+LockEntry(register struct cmd_syndesc *as, void *arock)
 {
-    afs_int32 avolid, vcode, err;
+    afs_uint32 avolid;
+    afs_int32 vcode, err;
 
     avolid = vsu_GetVolumeID(as->parms[0].items->data, cstruct, &err);
     if (avolid == 0) {
@@ -4562,7 +5327,7 @@ LockEntry(as)
                    as->parms[0].items->data);
        exit(1);
     }
-    vcode = ubik_Call(VL_SetLock, cstruct, 0, avolid, -1, VLOP_DELETE);
+    vcode = ubik_VL_SetLock(cstruct, 0, avolid, -1, VLOP_DELETE);
     if (vcode) {
        fprintf(STDERR, "Could not lock VLDB entry for volume %s\n",
                as->parms[0].items->data);
@@ -4574,21 +5339,20 @@ LockEntry(as)
     return 0;
 }
 
-static
-ConvertRO(as)
-     register struct cmd_syndesc *as;
-
+static int
+ConvertRO(register struct cmd_syndesc *as, void *arock)
 {
     afs_int32 partition = -1;
-    afs_int32 server, volid, code, i, same;
+    afs_uint32 volid;
+    afs_int32 server, code, i, same;
     struct nvldbentry entry, storeEntry;
     afs_int32 vcode;
-    afs_int32 rwindex;
+    afs_int32 rwindex = 0;
     afs_int32 rwserver = 0;
-    afs_int32 rwpartition;
-    afs_int32 roindex;
+    afs_int32 rwpartition = 0;
+    afs_int32 roindex = 0;
     afs_int32 roserver = 0;
-    afs_int32 ropartition;
+    afs_int32 ropartition = 0;
     int force = 0;
     struct rx_connection *aconn;
     char c, dc;
@@ -4690,7 +5454,7 @@ ConvertRO(as)
     }
 
     vcode =
-       ubik_Call(VL_SetLock, cstruct, 0, entry.volumeId[RWVOL], RWVOL,
+       ubik_VL_SetLock(cstruct, 0, entry.volumeId[RWVOL], RWVOL,
                  VLOP_MOVE);
     aconn = UV_Bind(server, AFSCONF_VOLUMEPORT);
     code = AFSVolConvertROtoRWvolume(aconn, partition, volid);
@@ -4740,11 +5504,11 @@ ConvertRO(as)
     return code;
 }
 
-static
-Sizes(as)
-     register struct cmd_syndesc *as;
+static int
+Sizes(register struct cmd_syndesc *as, void *arock)
 {
-    afs_int32 avolid, aserver, apart, voltype, fromdate = 0, code, err, i;
+    afs_uint32 avolid;
+    afs_int32 aserver, apart, voltype, fromdate = 0, code, err, i;
     struct nvldbentry entry;
     volintSize vol_size;
 
@@ -4796,7 +5560,7 @@ Sizes(as)
        code = ktime_DateToInt32(as->parms[4].items->data, &fromdate);
        if (code) {
            fprintf(STDERR, "vos: failed to parse date '%s' (error=%d))\n",
-                   as->parms[1].items->data, code);
+                   as->parms[4].items->data, code);
            return code;
        }
     }
@@ -4825,9 +5589,8 @@ Sizes(as)
     return 0;
 }
 
-PrintDiagnostics(astring, acode)
-     char *astring;
-     afs_int32 acode;
+int
+PrintDiagnostics(char *astring, afs_int32 acode)
 {
     if (acode == EACCES) {
        fprintf(STDERR,
@@ -4841,10 +5604,8 @@ PrintDiagnostics(astring, acode)
 }
 
 
-static
-MyBeforeProc(as, arock)
-     struct cmd_syndesc *as;
-     char *arock;
+static int
+MyBeforeProc(struct cmd_syndesc *as, void *arock)
 {
     register char *tcell;
     register afs_int32 code;
@@ -4874,11 +5635,15 @@ MyBeforeProc(as, arock)
        verbose = 1;
     else
        verbose = 0;
+    if (as->parms[17].items)   /* -noresolve flag set */
+       noresolve = 1;
+    else
+       noresolve = 0;
     return 0;
 }
 
 int
-osi_audit()
+osi_audit(void)
 {
 /* this sucks but it works for now.
 */
@@ -4887,9 +5652,8 @@ osi_audit()
 
 #include "AFS_component_version_number.c"
 
-main(argc, argv)
-     int argc;
-     char **argv;
+int
+main(int argc, char **argv)
 {
     register afs_int32 code;
 
@@ -4914,7 +5678,7 @@ main(argc, argv)
 
     cmd_SetBeforeProc(MyBeforeProc, NULL);
 
-    ts = cmd_CreateSyntax("create", CreateVolume, 0, "create a new volume");
+    ts = cmd_CreateSyntax("create", CreateVolume, NULL, "create a new volume");
     cmd_AddParm(ts, "-server", CMD_SINGLE, 0, "machine name");
     cmd_AddParm(ts, "-partition", CMD_SINGLE, 0, "partition name");
     cmd_AddParm(ts, "-name", CMD_SINGLE, 0, "volume name");
@@ -4925,14 +5689,14 @@ main(argc, argv)
 #endif
     COMMONPARMS;
 
-    ts = cmd_CreateSyntax("remove", DeleteVolume, 0, "delete a volume");
+    ts = cmd_CreateSyntax("remove", DeleteVolume, NULL, "delete a volume");
     cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_OPTIONAL, "machine name");
     cmd_AddParm(ts, "-partition", CMD_SINGLE, CMD_OPTIONAL, "partition name");
     cmd_AddParm(ts, "-id", CMD_SINGLE, 0, "volume name or ID");
 
     COMMONPARMS;
 
-    ts = cmd_CreateSyntax("move", MoveVolume, 0, "move a volume");
+    ts = cmd_CreateSyntax("move", MoveVolume, NULL, "move a volume");
     cmd_AddParm(ts, "-id", CMD_SINGLE, 0, "volume name or ID");
     cmd_AddParm(ts, "-fromserver", CMD_SINGLE, 0, "machine name on source");
     cmd_AddParm(ts, "-frompartition", CMD_SINGLE, 0,
@@ -4941,9 +5705,11 @@ main(argc, argv)
                "machine name on destination");
     cmd_AddParm(ts, "-topartition", CMD_SINGLE, 0,
                "partition name on destination");
+    cmd_AddParm(ts, "-live", CMD_FLAG, CMD_OPTIONAL,
+               "copy live volume without cloning");
     COMMONPARMS;
 
-    ts = cmd_CreateSyntax("copy", CopyVolume, 0, "copy a volume");
+    ts = cmd_CreateSyntax("copy", CopyVolume, NULL, "copy a volume");
     cmd_AddParm(ts, "-id", CMD_SINGLE, 0, "volume name or ID on source");
     cmd_AddParm(ts, "-fromserver", CMD_SINGLE, 0, "machine name on source");
     cmd_AddParm(ts, "-frompartition", CMD_SINGLE, 0,
@@ -4953,20 +5719,65 @@ main(argc, argv)
                "machine name on destination");
     cmd_AddParm(ts, "-topartition", CMD_SINGLE, 0,
                "partition name on destination");
+    cmd_AddParm(ts, "-offline", CMD_FLAG, CMD_OPTIONAL,
+               "leave new volume offline");
+    cmd_AddParm(ts, "-readonly", CMD_FLAG, CMD_OPTIONAL,
+               "make new volume read-only");
+    cmd_AddParm(ts, "-live", CMD_FLAG, CMD_OPTIONAL,
+               "copy live volume without cloning");
+    COMMONPARMS;
+
+    ts = cmd_CreateSyntax("shadow", ShadowVolume, NULL,
+                         "make or update a shadow volume");
+    cmd_AddParm(ts, "-id", CMD_SINGLE, 0, "volume name or ID on source");
+    cmd_AddParm(ts, "-fromserver", CMD_SINGLE, 0, "machine name on source");
+    cmd_AddParm(ts, "-frompartition", CMD_SINGLE, 0,
+               "partition name on source");
+    cmd_AddParm(ts, "-toserver", CMD_SINGLE, 0,
+               "machine name on destination");
+    cmd_AddParm(ts, "-topartition", CMD_SINGLE, 0,
+               "partition name on destination");
+    cmd_AddParm(ts, "-toname", CMD_SINGLE, CMD_OPTIONAL,
+               "volume name on destination");
+    cmd_AddParm(ts, "-toid", CMD_SINGLE, CMD_OPTIONAL,
+               "volume ID on destination");
+    cmd_AddParm(ts, "-offline", CMD_FLAG, CMD_OPTIONAL,
+               "leave shadow volume offline");
+    cmd_AddParm(ts, "-readonly", CMD_FLAG, CMD_OPTIONAL,
+               "make shadow volume read-only");
+    cmd_AddParm(ts, "-live", CMD_FLAG, CMD_OPTIONAL,
+               "copy live volume without cloning");
+    cmd_AddParm(ts, "-incremental", CMD_FLAG, CMD_OPTIONAL,
+               "do incremental update if target exists");
     COMMONPARMS;
 
-    ts = cmd_CreateSyntax("backup", BackupVolume, 0,
+    ts = cmd_CreateSyntax("backup", BackupVolume, NULL,
                          "make backup of a volume");
     cmd_AddParm(ts, "-id", CMD_SINGLE, 0, "volume name or ID");
     COMMONPARMS;
 
-    ts = cmd_CreateSyntax("release", ReleaseVolume, 0, "release a volume");
+    ts = cmd_CreateSyntax("clone", CloneVolume, NULL,
+                         "make clone of a volume");
+    cmd_AddParm(ts, "-id", CMD_SINGLE, 0, "volume name or ID");
+    cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_OPTIONAL, "server");
+    cmd_AddParm(ts, "-partition", CMD_SINGLE, CMD_OPTIONAL, "partition");
+    cmd_AddParm(ts, "-toname", CMD_SINGLE, CMD_OPTIONAL,
+               "volume name on destination");
+    cmd_AddParm(ts, "-toid", CMD_SINGLE, CMD_OPTIONAL,
+               "volume ID on destination");
+    cmd_AddParm(ts, "-offline", CMD_FLAG, CMD_OPTIONAL,
+               "leave clone volume offline");
+    cmd_AddParm(ts, "-readonly", CMD_FLAG, CMD_OPTIONAL,
+               "make clone volume read-only, not readwrite");
+    COMMONPARMS;
+
+    ts = cmd_CreateSyntax("release", ReleaseVolume, NULL, "release a volume");
     cmd_AddParm(ts, "-id", CMD_SINGLE, 0, "volume name or ID");
     cmd_AddParm(ts, "-force", CMD_FLAG, CMD_OPTIONAL,
                "force a complete release");
     COMMONPARMS;
 
-    ts = cmd_CreateSyntax("dump", DumpVolume, 0, "dump a volume");
+    ts = cmd_CreateSyntax("dump", DumpVolumeCmd, NULL, "dump a volume");
     cmd_AddParm(ts, "-id", CMD_SINGLE, 0, "volume name or ID");
     cmd_AddParm(ts, "-time", CMD_SINGLE, CMD_OPTIONAL, "dump from time");
     cmd_AddParm(ts, "-file", CMD_SINGLE, CMD_OPTIONAL, "dump file");
@@ -4974,9 +5785,12 @@ main(argc, argv)
     cmd_AddParm(ts, "-partition", CMD_SINGLE, CMD_OPTIONAL, "partition");
     cmd_AddParm(ts, "-clone", CMD_FLAG, CMD_OPTIONAL,
                "dump a clone of the volume");
+    cmd_AddParm(ts, "-omitdirs", CMD_FLAG, CMD_OPTIONAL,
+               "omit unchanged directories from an incremental dump");
     COMMONPARMS;
 
-    ts = cmd_CreateSyntax("restore", RestoreVolume, 0, "restore a volume");
+    ts = cmd_CreateSyntax("restore", RestoreVolumeCmd, NULL,
+                         "restore a volume");
     cmd_AddParm(ts, "-server", CMD_SINGLE, 0, "machine name");
     cmd_AddParm(ts, "-partition", CMD_SINGLE, 0, "partition name");
     cmd_AddParm(ts, "-name", CMD_SINGLE, 0, "name of volume to be restored");
@@ -4988,14 +5802,20 @@ main(argc, argv)
                "leave restored volume offline");
     cmd_AddParm(ts, "-readonly", CMD_FLAG, CMD_OPTIONAL,
                "make restored volume read-only");
+    cmd_AddParm(ts, "-creation", CMD_SINGLE, CMD_OPTIONAL,
+               "dump | keep | new");
+    cmd_AddParm(ts, "-lastupdate", CMD_SINGLE, CMD_OPTIONAL,
+               "dump | keep | new");
+    cmd_AddParm(ts, "-nodelete", CMD_FLAG, CMD_OPTIONAL,
+               "do not delete old site when restoring to a new site");
     COMMONPARMS;
 
-    ts = cmd_CreateSyntax("unlock", LockReleaseCmd, 0,
+    ts = cmd_CreateSyntax("unlock", LockReleaseCmd, NULL,
                          "release lock on VLDB entry for a volume");
     cmd_AddParm(ts, "-id", CMD_SINGLE, 0, "volume name or ID");
     COMMONPARMS;
 
-    ts = cmd_CreateSyntax("changeloc", ChangeLocation, 0,
+    ts = cmd_CreateSyntax("changeloc", ChangeLocation, NULL,
                          "change an RW volume's location in the VLDB");
     cmd_AddParm(ts, "-server", CMD_SINGLE, 0,
                "machine name for new location");
@@ -5004,25 +5824,26 @@ main(argc, argv)
     cmd_AddParm(ts, "-id", CMD_SINGLE, 0, "volume name or ID");
     COMMONPARMS;
 
-    ts = cmd_CreateSyntax("addsite", AddSite, 0, "add a replication site");
+    ts = cmd_CreateSyntax("addsite", AddSite, NULL, "add a replication site");
     cmd_AddParm(ts, "-server", CMD_SINGLE, 0, "machine name for new site");
     cmd_AddParm(ts, "-partition", CMD_SINGLE, 0,
                "partition name for new site");
     cmd_AddParm(ts, "-id", CMD_SINGLE, 0, "volume name or ID");
+    cmd_AddParm(ts, "-valid", CMD_FLAG, CMD_OPTIONAL, "publish as an up-to-date site in VLDB");
     COMMONPARMS;
 
-    ts = cmd_CreateSyntax("remsite", RemoveSite, 0,
+    ts = cmd_CreateSyntax("remsite", RemoveSite, NULL,
                          "remove a replication site");
     cmd_AddParm(ts, "-server", CMD_SINGLE, 0, "machine name");
     cmd_AddParm(ts, "-partition", CMD_SINGLE, 0, "partition name");
     cmd_AddParm(ts, "-id", CMD_SINGLE, 0, "volume name or ID");
     COMMONPARMS;
 
-    ts = cmd_CreateSyntax("listpart", ListPartitions, 0, "list partitions");
+    ts = cmd_CreateSyntax("listpart", ListPartitions, NULL, "list partitions");
     cmd_AddParm(ts, "-server", CMD_SINGLE, 0, "machine name");
     COMMONPARMS;
 
-    ts = cmd_CreateSyntax("listvol", ListVolumes, 0,
+    ts = cmd_CreateSyntax("listvol", ListVolumes, NULL,
                          "list volumes on server (bypass VLDB)");
     cmd_AddParm(ts, "-server", CMD_SINGLE, 0, "machine name");
     cmd_AddParm(ts, "-partition", CMD_SINGLE, CMD_OPTIONAL, "partition name");
@@ -5039,20 +5860,22 @@ main(argc, argv)
 #endif /* FULL_LISTVOL_SWITCH */
     COMMONPARMS;
 
-    ts = cmd_CreateSyntax("syncvldb", SyncVldb, 0,
+    ts = cmd_CreateSyntax("syncvldb", SyncVldb, NULL,
                          "synchronize VLDB with server");
     cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_OPTIONAL, "machine name");
     cmd_AddParm(ts, "-partition", CMD_SINGLE, CMD_OPTIONAL, "partition name");
     cmd_AddParm(ts, "-volume", CMD_SINGLE, CMD_OPTIONAL, "volume name or ID");
+    cmd_AddParm(ts, "-dryrun", CMD_FLAG, CMD_OPTIONAL, "report without updating");
     COMMONPARMS;
 
-    ts = cmd_CreateSyntax("syncserv", SyncServer, 0,
+    ts = cmd_CreateSyntax("syncserv", SyncServer, NULL,
                          "synchronize server with VLDB");
     cmd_AddParm(ts, "-server", CMD_SINGLE, 0, "machine name");
     cmd_AddParm(ts, "-partition", CMD_SINGLE, CMD_OPTIONAL, "partition name");
+    cmd_AddParm(ts, "-dryrun", CMD_FLAG, CMD_OPTIONAL, "report without updating");
     COMMONPARMS;
 
-    ts = cmd_CreateSyntax("examine", ExamineVolume, 0,
+    ts = cmd_CreateSyntax("examine", ExamineVolume, NULL,
                          "everything about the volume");
     cmd_AddParm(ts, "-id", CMD_SINGLE, 0, "volume name or ID");
     cmd_AddParm(ts, "-extended", CMD_FLAG, CMD_OPTIONAL,
@@ -5064,14 +5887,15 @@ main(argc, argv)
     COMMONPARMS;
     cmd_CreateAlias(ts, "volinfo");
 
-    ts = cmd_CreateSyntax("setfields", SetFields, 0,
+    ts = cmd_CreateSyntax("setfields", SetFields, NULL,
                          "change volume info fields");
     cmd_AddParm(ts, "-id", CMD_SINGLE, 0, "volume name or ID");
     cmd_AddParm(ts, "-maxquota", CMD_SINGLE, CMD_OPTIONAL, "quota (KB)");
     cmd_AddParm(ts, "-clearuse", CMD_FLAG, CMD_OPTIONAL, "clear dayUse");
+    cmd_AddParm(ts, "-clearVolUpCounter", CMD_FLAG, CMD_OPTIONAL, "clear volUpdateCounter");
     COMMONPARMS;
 
-    ts = cmd_CreateSyntax("offline", volOffline, 0, (char *)CMD_HIDDEN);
+    ts = cmd_CreateSyntax("offline", volOffline, NULL, "force the volume status to offline");
     cmd_AddParm(ts, "-server", CMD_SINGLE, 0, "server name");
     cmd_AddParm(ts, "-partition", CMD_SINGLE, 0, "partition name");
     cmd_AddParm(ts, "-id", CMD_SINGLE, 0, "volume name or ID");
@@ -5079,13 +5903,13 @@ main(argc, argv)
     cmd_AddParm(ts, "-busy", CMD_FLAG, CMD_OPTIONAL, "busy volume");
     COMMONPARMS;
 
-    ts = cmd_CreateSyntax("online", volOnline, 0, (char *)CMD_HIDDEN);
+    ts = cmd_CreateSyntax("online", volOnline, NULL, "force the volume status to online");
     cmd_AddParm(ts, "-server", CMD_SINGLE, 0, "server name");
     cmd_AddParm(ts, "-partition", CMD_SINGLE, 0, "partition name");
     cmd_AddParm(ts, "-id", CMD_SINGLE, 0, "volume name or ID");
     COMMONPARMS;
 
-    ts = cmd_CreateSyntax("zap", VolumeZap, 0,
+    ts = cmd_CreateSyntax("zap", VolumeZap, NULL,
                          "delete the volume, don't bother with VLDB");
     cmd_AddParm(ts, "-server", CMD_SINGLE, 0, "machine name");
     cmd_AddParm(ts, "-partition", CMD_SINGLE, 0, "partition name");
@@ -5096,17 +5920,17 @@ main(argc, argv)
                "also delete backup volume if one is found");
     COMMONPARMS;
 
-    ts = cmd_CreateSyntax("status", VolserStatus, 0,
+    ts = cmd_CreateSyntax("status", VolserStatus, NULL,
                          "report on volser status");
     cmd_AddParm(ts, "-server", CMD_SINGLE, 0, "machine name");
     COMMONPARMS;
 
-    ts = cmd_CreateSyntax("rename", RenameVolume, 0, "rename a volume");
+    ts = cmd_CreateSyntax("rename", RenameVolume, NULL, "rename a volume");
     cmd_AddParm(ts, "-oldname", CMD_SINGLE, 0, "old volume name ");
     cmd_AddParm(ts, "-newname", CMD_SINGLE, 0, "new volume name ");
     COMMONPARMS;
 
-    ts = cmd_CreateSyntax("listvldb", ListVLDB, 0,
+    ts = cmd_CreateSyntax("listvldb", ListVLDB, NULL,
                          "list volumes in the VLDB");
     cmd_AddParm(ts, "-name", CMD_SINGLE, CMD_OPTIONAL, "volume name or ID");
     cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_OPTIONAL, "machine name");
@@ -5118,7 +5942,7 @@ main(argc, argv)
                "do not alphabetically sort the volume names");
     COMMONPARMS;
 
-    ts = cmd_CreateSyntax("backupsys", BackSys, 0, "en masse backups");
+    ts = cmd_CreateSyntax("backupsys", BackSys, NULL, "en masse backups");
     cmd_AddParm(ts, "-prefix", CMD_LIST, CMD_OPTIONAL,
                "common prefix on volume(s)");
     cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_OPTIONAL, "machine name");
@@ -5130,35 +5954,37 @@ main(argc, argv)
     cmd_AddParm(ts, "-dryrun", CMD_FLAG, CMD_OPTIONAL, "no action");
     COMMONPARMS;
 
-    ts = cmd_CreateSyntax("delentry", DeleteEntry, 0,
+    ts = cmd_CreateSyntax("delentry", DeleteEntry, NULL,
                          "delete VLDB entry for a volume");
     cmd_AddParm(ts, "-id", CMD_LIST, CMD_OPTIONAL, "volume name or ID");
     cmd_AddParm(ts, "-prefix", CMD_SINGLE, CMD_OPTIONAL,
                "prefix of the volume whose VLDB entry is to be deleted");
     cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_OPTIONAL, "machine name");
     cmd_AddParm(ts, "-partition", CMD_SINGLE, CMD_OPTIONAL, "partition name");
-    cmd_AddParm(ts, "-noexecute", CMD_FLAG, CMD_OPTIONAL | CMD_HIDE,
+    cmd_AddParm(ts, "-noexecute", CMD_FLAG, CMD_OPTIONAL,
                "no execute");
     COMMONPARMS;
 
-    ts = cmd_CreateSyntax("partinfo", PartitionInfo, 0,
+    ts = cmd_CreateSyntax("partinfo", PartitionInfo, NULL,
                          "list partition information");
     cmd_AddParm(ts, "-server", CMD_SINGLE, 0, "machine name");
     cmd_AddParm(ts, "-partition", CMD_SINGLE, CMD_OPTIONAL, "partition name");
+    cmd_AddParm(ts, "-summary", CMD_FLAG, CMD_OPTIONAL,
+               "print storage summary");
     COMMONPARMS;
 
-    ts = cmd_CreateSyntax("unlockvldb", UnlockVLDB, 0,
+    ts = cmd_CreateSyntax("unlockvldb", UnlockVLDB, NULL,
                          "unlock all the locked entries in the VLDB");
     cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_OPTIONAL, "machine name");
     cmd_AddParm(ts, "-partition", CMD_SINGLE, CMD_OPTIONAL, "partition name");
     COMMONPARMS;
 
-    ts = cmd_CreateSyntax("lock", LockEntry, 0,
+    ts = cmd_CreateSyntax("lock", LockEntry, NULL,
                          "lock VLDB entry for a volume");
     cmd_AddParm(ts, "-id", CMD_SINGLE, 0, "volume name or ID");
     COMMONPARMS;
 
-    ts = cmd_CreateSyntax("changeaddr", ChangeAddr, 0,
+    ts = cmd_CreateSyntax("changeaddr", ChangeAddr, NULL,
                          "change the IP address of a file server");
     cmd_AddParm(ts, "-oldaddr", CMD_SINGLE, 0, "original IP address");
     cmd_AddParm(ts, "-newaddr", CMD_SINGLE, CMD_OPTIONAL, "new IP address");
@@ -5166,17 +5992,15 @@ main(argc, argv)
                "remove the IP address from the VLDB");
     COMMONPARMS;
 
-    ts = cmd_CreateSyntax("listaddrs", ListAddrs, 0,
+    ts = cmd_CreateSyntax("listaddrs", ListAddrs, NULL,
                          "list the IP address of all file servers registered in the VLDB");
     cmd_AddParm(ts, "-uuid", CMD_SINGLE, CMD_OPTIONAL, "uuid of server");
     cmd_AddParm(ts, "-host", CMD_SINGLE, CMD_OPTIONAL, "address of host");
-    cmd_AddParm(ts, "-noresolve", CMD_FLAG, CMD_OPTIONAL,
-               "don't resolve addresses");
     cmd_AddParm(ts, "-printuuid", CMD_FLAG, CMD_OPTIONAL,
                "print uuid of hosts");
     COMMONPARMS;
 
-    ts = cmd_CreateSyntax("convertROtoRW", ConvertRO, 0,
+    ts = cmd_CreateSyntax("convertROtoRW", ConvertRO, NULL,
                          "convert a RO volume into a RW volume (after loss of old RW volume)");
     cmd_AddParm(ts, "-server", CMD_SINGLE, 0, "machine name");
     cmd_AddParm(ts, "-partition", CMD_SINGLE, 0, "partition name");
@@ -5184,7 +6008,7 @@ main(argc, argv)
     cmd_AddParm(ts, "-force", CMD_FLAG, CMD_OPTIONAL, "don't ask");
     COMMONPARMS;
 
-    ts = cmd_CreateSyntax("size", Sizes, 0,
+    ts = cmd_CreateSyntax("size", Sizes, NULL,
                          "obtain various sizes of the volume.");
     cmd_AddParm(ts, "-id", CMD_SINGLE, 0, "volume name or ID");
     cmd_AddParm(ts, "-partition", CMD_SINGLE, CMD_OPTIONAL, "partition name");