int nrOfShmSegms;                   /* Total number of found shared memory segments */
 
 typedef struct TheArgsS {
+  int excludeDisks[22];
+  int excludeDisksCnt;
   int sleepTime;   /*seconds*/
   int debug;
 } TheArgs;
 static void usage(const char *progName)
 {
         printf( "Usage: %s\n", progName);
-       printf( "       [-h|--help]            : Print this help.\n");
-       printf( "       [-s|--sleep <time>]    : Sleep time.\n");
-       printf( "       [-D|--debug]           : Debug output.\n");
+       printf( "       [-h|--help]              : Print this help.\n");
+       printf( "       [-e|--exclude <diskNr>]  : Nr of disk to exclude.\n");
+       printf( "       [-s|--sleep <time>]      : Sleep time.\n");
+       printf( "       [-D|--debug]             : Debug output.\n");
 }
 
 static void argsDefault(TheArgs *my)
   my->sleepTime = 10;
   my->debug     = 0; 
 
+  my->excludeDisksCnt = 0;
+
   /* Initialize the array with shared mem segment numbers */
   int i;
   for(i=0; i<16; i++){
                static struct option long_options[] = {
                        {"help", 0, 0, 'h'},
                        {"sleep", 1, 0, 's'},
+                       {"exclude", 1, 0, 'e'},
                        {"debug", 0, 0, 'D'},
                        {0, 0, 0, 0}
                };
-               i = getopt_long(argc, argv, "Dhs:", long_options,
+               i = getopt_long(argc, argv, "Dhs:e:", long_options,
                                &option_index);
                if (i == -1)
                        break;
                        return -1;
                        break;
                case 's':
-                       my->sleepTime = strtoul(optarg, NULL, 0);
+                       my->sleepTime = atoi(optarg);
                        break;
+               case 'e':
+                       my->excludeDisks[my->excludeDisksCnt] = atoi(optarg);
+                       my->excludeDisksCnt++;
+                       break;
                case 'D':
                        my->debug = 1;
                        break;
        return 0;
 }
 
-int checkDisks(TheArgs *theArgs)
+static int excludeDisks(TheArgs *theArgs, int diskNr)
+{
+  int retval = 0;
+  int i;
+
+  for(i=0; i<theArgs->excludeDisksCnt; i++){
+    if(theArgs->excludeDisks[i] == diskNr){
+      retval = 1;
+      break;
+    } 
+  }
+
+  return retval;
+}
+
+static void initDataDisks(int val)
+{
+  int i;
+
+  for(i=0; i<22; i++){
+    data_disks[i] = val;
+  }
+}
+
+static int checkDisks(TheArgs *theArgs)
 {
   /* Read the available disk space with 'df' */
 
     int k;
     for(k=0; k<22; k++){
 
+      /* Exclude disks */
+      if(excludeDisks(theArgs, k+1))
+       continue;
+
       /* Find string with info on the data disks */
       ptr = strstr(*array, data[k]);
       if(ptr == NULL)
   return 0;
 }
 
-int cleanup(TheArgs *theArgs)
+static int cleanup(TheArgs *theArgs)
 {
   /* There is a Perl script which runs as a daemon and performs cleanup 
    * (removes oldest files from disks) thus we do here nothing.
   return 0;
 }
 
-int findMaxElement( int tmp[] ){
+static int findMaxElement( int tmp[] ){
   
   /* Function returns index of max element of the array */
 
   return maxIndex;
 }
 
-int writeShmem(TheArgs *theArgs)
+static int writeShmem(TheArgs *theArgs)
 {
   /* Loop over all found shared mem segments
    * and write there disk numbers which have
   return 0;
 }
 
-int findShmem(TheArgs *theArgs)
+static int findShmem(TheArgs *theArgs)
 {
   /*
    *  Loop over all EB numbers (1..16)
   }
 
   while(1){
+    initDataDisks(0);
     checkDisks(theArgs);
     findShmem(theArgs);
     writeShmem(theArgs);