Re: amrecover hard codes restore arguments that fail
"Dustin J. Mitchell" <[email protected]> Sat, 24 Jan 2026 12:09:37 -0500
| Newsgroups | gmane.comp.archivers.amanda.devel |
|---|---|
| Message-ID | <CAJtE5vSKWgMwc7YzSuJ6qdwi=DXOh6X8oJBaAw55ORtikrz1bA@mail.gmail.com> |
--00000000000050bc100649255737
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
I haven't thought about this since the aughts, but a few things come up:
- Can you narrow down the change to a particular diff in `restore`? It
would be good to know that the new syntax matches the old.
- I suspect that getting block size wrong in the restore would lead to
weird errors. Already the comment and value in extract_list.c do not match
("2" and "read in units of 1K")! Knowing more about how this works would be
good. How does "tries to determine the media block size dynamically" work?
How reliable is it?
- Would the updated syntax work for older restores, and all flavors (BSD
and GNU/Linux)?
Aside from that, I don't have any way to land a fix or even know who to
talk to at this point!
Dustin
On Sat, Jan 24, 2026 at 1:38=E2=80=AFAM Peter Collinson <[email protected]>=
wrote:
> 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 ge=
t
> 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=E2=80=99
>
> 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=E2=80=99t really following the man page for res=
tore, 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=E2=80=99t 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
>
>
>
--00000000000050bc100649255737
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div>I haven't thought about this since the aughts, bu=
t a few things come up:</div><div>=C2=A0- Can you narrow down the change to=
a particular diff in `restore`? It would be good to know that the new synt=
ax matches the old.</div><div>=C2=A0- I suspect that getting block size wro=
ng in the restore would lead to weird errors. Already=C2=A0the comment and =
value in extract_list.c do not match ("2" and "read in units=
of 1K")! Knowing more about how this works would be good. How does &q=
uot;tries to determine the media block size dynamically" work? How rel=
iable is it?</div><div>=C2=A0- Would the updated syntax work for older rest=
ores, and all flavors (BSD and GNU/Linux)?</div><div><br></div><div>Aside f=
rom that, I don't have any way to land a fix or even know who to talk t=
o at this point!</div><div><br></div><div>Dustin</div></div><br><div class=
=3D"gmail_quote gmail_quote_container"><div dir=3D"ltr" class=3D"gmail_attr=
">On Sat, Jan 24, 2026 at 1:38=E2=80=AFAM Peter Collinson <<a href=3D"ma=
ilto:[email protected]">[email protected]</a>> wrote:<br></div><blockquo=
te class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px =
solid rgb(204,204,204);padding-left:1ex">I am a very long time Amanda user.=
My Amanda server runs on Debian system and I've recently upgraded to t=
rixie.<br>
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.<br>
<br>
Amrecover extracts the dump image from the stored file, unzips them to get =
the dump image and calls restore like:<br>
<br>
cat file | restore xbf 2 - files/to/extract<br>
<br>
Restore on trixie immediately says:<br>
<br>
restore: Tape blocksize is too large, use '-b 10=E2=80=99<br>
<br>
and gives up. This is not a very helpful error message, and has only appear=
ed on this release of Debian. It seems that restore is very unhappy with th=
e 2 here. This isn=E2=80=99t really following the man page for restore, but=
this would<br>
<br>
cat file | restore -x -b 2 -f - files/to/extract<br>
<br>
and it also fails. Replacing the 2 with 10 make things work.<br>
<br>
The xbf coding has been in amanda since the dawn of time, so this looks lik=
e it will break all Amanda installations across the planet that still use d=
ump/restore. Why can=E2=80=99t it just ignore the block size and let it wor=
k out what to use? If does that when no block size is given:<br>
<br>
cat file | restore xf - files/to/extract<br>
<br>
or better<br>
<br>
cat file | restore -x -f - files/to/extract<br>
<br>
just works. <br>
<br>
The code in recover-src/extract_list.c hardcodes this - (line 1756 in Debia=
n source)<br>
<br>
g_ptr_array_add(argv_ptr, g_strdup("xbf"));<br>
g_ptr_array_add(argv_ptr, g_strdup("2")); /* read in units of 1K =
*/<br>
g_ptr_array_add(argv_ptr, g_strdup("-")); /* data on stdin */<br>
<br>
this really ought to be changed to<br>
<br>
g_ptr_array_add(argv_ptr, g_strdup("-x"));<br>
g_ptr_array_add(argv_ptr, g_strdup("-f")); /* read in units of 1K=
*/<br>
g_ptr_array_add(argv_ptr, g_strdup("-")); /* data on stdin */<br>
<br>
which moves things onto using the manual page for restore.<br>
<br>
As a temporary work around, I've replaced my /usr/sbin/restore by a she=
ll script that generates the 'right' arguments when it finds xbf 2 =
-.<br>
<br>
<br>
Regards<br>
--------------------------------------------------<br>
Peter Collinson<br>
<br>
<br>
</blockquote></div>
--00000000000050bc100649255737--