Dunc wrote at 12:08 +0000 on Dec 9, 2004:
> I wasn't sure if this was a hackers or users mail, so I sent to to both > lists. Hope this is ok
users
ok
> But, when I try to use amrecover, it's all fine while I'm doing the > sethost, setdisk etc. I can even browse the virtual FS and see add the > files ready for restore, but when I come to try and run the extract > command, this happens.
> > Load tape ffhs-daily16 now
> Continue [?/Y/n/t]?
> EOF, check amidxtaped.debug file on ngidnoc.
> amrecover: short block 0 bytes
> UNKNOWN file
> amrecover: Can't read file header
> extract_list - child returned non-zero status: 1
> Continue [?/Y/n]?
> amrecover>
> > I checked the faq-o-matic, and found this error, but it suggests the > tape isn't rewound, and it definately is, because I tried again after > reading that just to make sure.
> > So, I look in the logfile, and see this:
> > amrestore: could not open /dev/nrsa0: Permission denied
> amidxtaped: time 0.096: amrestore terminated normally with status: 2
> amidxtaped: time 0.097: rewinding tape ...
> amidxtaped: time 0.097: tape_rewind: tape open: /dev/nrsa0: Permission > denied
> amidxtaped: time 0.097: pid 85649 finish time Wed Dec 8 17:12:32 2004
> > Which completely baffles me because,
> > a) the amdump can use the tape drive fine, as can amrestore
> b) the amanda user is in the operator group, and the operator group has > rw permissions on /dev/nrsa0
> c) I've tried su'ing to amanda, and trying to access the tape drive and > that is also fine.
You should run amrecover as root so the files get extracted with the right ownership & permissions.
That said, the permission problem on the tape device is something else. You probably aren't accessing the tape drive as the user that you think you are (which is not necessarily the same user that ran amrecover). Look for the amidxtaped entry in /etc/inetd.conf and see what user you've specified.
I was running amrecover as root.
I checked my xinetd, and I had the index daemons running as the amanda user, I swapped them to root instead, and it does work now, many many thanks.
I still don't understand why though. As I said before, the amanda user is allowed to access the tape drive, I checked that. Also, after swapping xinetd so that they are run as root from xinetd, when i check the process list, it says that amindexd and amidxtaped are both running as amanda anyway. So what's going on here?
The only thing that seems to make sense is that they try and switch to the amanda user blindly, even if it already is the correct user?
I'd like to know what's going on just for completeness if anyone knows, but at least it's working now, and thanks again John :)
Cheers,
Dunc