Amanda-Users

Re: amrecover won't set correct disk based on CWD (patch included)

2003-04-09 06:54:41
Subject: Re: amrecover won't set correct disk based on CWD (patch included)
From: Toralf Lund <toralf AT procaptura DOT com>
To: Amanda Mailing List <amanda-users AT amanda DOT org>
Date: Wed, 9 Apr 2003 11:14:43 +0200
On Tue, 8 Apr 2003 at 2:18pm, Toralf Lund wrote

> What is going on here? Is this possibly caused by a bug? It may seem
like
> amindexd will return the shortest or first DLE match when it should in
> fact look for the longest one. Or maybe amrecover will only look for
> directories that are mount points? The amrecover log may actually
suggest
> this. Note that /u is a separate partition, while /usr/local is part of
/.

Not answering your question, but pointing you in a direction, the logic
controlling this seems to be (from my quick code grepping) in
recover-src/amrecover.c -- the guess_disk function.
There seem to be two problems with the guess_disk code:
1. *All* mount points that matches the initial section of the current directory are considered, not just the ones that are among its ancestors in the file hierarchy (which are the ones we want.) E.g. "/u" will be regarded as a potential mount points for "/usr", which is obviously wrong. 2. It assumes that the disk is specified as a device or a mount point. This is not a valid assumption; the disk is either a device or a *directory in general*.

The attached patch addresses both these issues. It will introduce a test for '/' (directory separator) at the appropriate spot in the fstab search, and replace the mount point disk check with a scan through the host's disk list.

Comments are welcome.

- Toralf

Attachment: amanda-2.4.3-guessdisk.patch
Description: Text document

<Prev in Thread] Current Thread [Next in Thread>