amrecover hard codes restore arguments that fail

Peter Collinson <[email protected]> Sat, 24 Jan 2026 06:15:14 +0000
Newsgroups gmane.comp.archivers.amanda.devel
Message-ID <[email protected]>
I am a very long time Amanda user. My Amanda server runs on Debian system and I've recently upgraded to trixie.
My Amanda system entirely disk based, using the magic virtual tape changer. Things appeared to work, dumps are happening, but a big problem arose when I tried to use amrecover to retrieve a file.

Amrecover extracts the dump image from the stored file, unzips them to get the dump image and calls restore like:

cat file | restore xbf 2 - files/to/extract

Restore on trixie immediately says:

restore: Tape blocksize is too large, use '-b 10’

and gives up. This is not a very helpful error message, and has only appeared on this release of Debian. It seems that restore is very unhappy with the 2 here. This isn’t really following the man page for restore, but this would

cat file | restore -x -b 2 -f - files/to/extract

and it also fails. Replacing the 2 with 10 make things work.

The xbf coding has been in amanda since the dawn of time, so this looks like it will break all Amanda installations across the planet that still use dump/restore. Why can’t it just ignore the block size and let it work out what to use? If does that when no block size is given:

cat file | restore xf - files/to/extract

or better

cat file | restore -x -f - files/to/extract

just works. 

The code in recover-src/extract_list.c hardcodes this - (line 1756 in Debian source)

g_ptr_array_add(argv_ptr, g_strdup("xbf"));
g_ptr_array_add(argv_ptr, g_strdup("2")); /* read in units of 1K */
g_ptr_array_add(argv_ptr, g_strdup("-")); /* data on stdin */

this really ought to be changed to

g_ptr_array_add(argv_ptr, g_strdup("-x"));
g_ptr_array_add(argv_ptr, g_strdup("-f")); /* read in units of 1K */
g_ptr_array_add(argv_ptr, g_strdup("-")); /* data on stdin */

which moves things onto using the manual page for restore.

As a temporary work around, I've replaced my /usr/sbin/restore by a shell script that generates the 'right' arguments when it finds xbf 2 -.


Regards
--------------------------------------------------
Peter Collinson