On Sat, Feb 10, 2001 at 02:38:04PM -0500, Jean-Louis Martineau wrote:
> On Sat, Feb 10, 2001 at 08:57:41AM -0800, Christopher McCrory wrote:
> > Hello...
> > 
> > 
> >  From amcheck:
> > ...
> >     Amanda Backup Client Hosts Check
> > --------------------------------
> > ERROR: dev: [can not access /dev/root (/): No such file or directory]
> > ...
> > 
> > This happens on 2.4.2pl1 but not 2.4.2
> > 
> > System: Linux (RedHat 6.x)
> > amanda recompiled using redhat srpms from rawhide (devel) tree
> > 
> 
> The problem is that /proc/mounts list /dev/root as the device
> for /, but /dev/root doesn't exist.
> 
> Could you try this patch. If the device doesn't exist, it will take
> the entry from /etc/mtab.

That one was bogus, use this one instead.

Jean-Louis
-- 
Jean-Louis Martineau             email: [EMAIL PROTECTED] 
Departement IRO, Universite de Montreal
C.P. 6128, Succ. CENTRE-VILLE    Tel: (514) 343-6111 ext. 3529
Montreal, Canada, H3C 3J7        Fax: (514) 343-5834
--- client-src/getfsent.c.orig  Sat Feb 10 13:22:36 2001
+++ client-src/getfsent.c       Sat Feb 10 14:56:45 2001
@@ -462,18 +462,33 @@
 
   rc = 0;
   while(get_fstab_nextentry(fsent)) {
-    struct stat estat;
+    struct stat mntstat;
+    struct stat fsstat;
+    struct stat fsrstat;
+    int smnt = -1, sfs = -1, sfsr = -1;
 
     amfree(rdev);
-    if ((fsent->mntdir != NULL
-        && stat(fsent->mntdir, &estat) != -1
-        && samefile(stats, &estat)) ||
-       (fsent->fsname != NULL
-        && stat(fsent->fsname, &estat) != -1
-        && samefile(stats, &estat)) ||
-       (fsent->fsname != NULL
-        && stat((rdev = dev2rdev(fsent->fsname)), &estat) != -1
-        && samefile(stats, &estat))) {
+
+    if(fsent->mntdir != NULL &&
+       (smnt = stat(fsent->mntdir, &mntstat)) == -1)
+      continue;
+
+    if(fsent->fsname != NULL) {
+      sfs = stat(fsent->fsname, &fsstat);
+      sfsr = stat((rdev = dev2rdev(fsent->fsname)), &fsrstat);
+      if(sfs == -1 && sfsr == -1)
+        continue;
+    }
+
+    if((fsent->mntdir != NULL &&
+       smnt != -1 &&
+        samefile(stats, &mntstat)) || 
+       (fsent->fsname != NULL &&
+       sfs != -1 &&
+        samefile(stats, &fsstat)) ||
+       (fsent->fsname != NULL &&
+       sfsr != -1 &&
+        samefile(stats, &fsrstat))) {
       rc = 1;
       break;
     }
@@ -588,6 +603,15 @@
     close_fstab();
 
     name = newstralloc(name, "/usr");
+    if(search_fstab(name, &fsent)) {
+       printf("Found %s mount for %s:\n",
+              is_local_fstype(&fsent)? "local" : "remote", name);
+       print_entry(&fsent);
+    }
+    else 
+       printf("Mount for %s not found\n", name);
+
+    name = newstralloc(name, "/");
     if(search_fstab(name, &fsent)) {
        printf("Found %s mount for %s:\n",
               is_local_fstype(&fsent)? "local" : "remote", name);

Reply via email to