Jean-Francois,
Thanks for testing.
Can you try the attached patch? It fix a bug I added :-(
Jean-Louis
Jean-Francois Malouin wrote:
Hi,
More toying with 3.1.0beta2.
Using amrecover to extract a multi virtual tape dump I see something
confusing even though in the end the dump is successfully extracted:
amrecover wants the second tape (vtape-2) loaded before the first one
(vtape-1) but it seems that amanda does load the first tape correctly
as while having typed yes at the prompt `Load tape vtape-2 now' I see
that the `drive' is loaded with vtape-1:
~# ls -la /vtapes/drive0/
drwx------ 2 amanda disk 17 Apr 29 16:13 ./
drwxr-x--- 12 amanda disk 150 Apr 29 16:13 ../
lrwxrwxrwx 1 amanda disk 8 Apr 29 16:13 data -> ../slot1/
~# ls -la /vtapes/slot1
drwxr-xr-x 2 amanda disk 4096 Apr 28 17:24 ./
drwxr-x--- 12 amanda disk 150 Apr 29 16:13 ../
-rw------- 1 amanda disk 32768 Apr 28 17:17 00000.vtape-1
The debug logs don't even mention vtape-1.
See below for the interactive amrecover session.
Thanks,
jf
~# /opt/amanda-3.1.0beta2/sbin/amrecover -C test \
-s amanda4 -t amanda4 -d changer
AMRECOVER Version 3.1.0beta2. Contacting server on amanda4 ...
220 amanda4 AMANDA index server (3.1.0beta2) ready.
Setting restore date to today (2010-04-29)
200 Working date set to 2010-04-29.
200 Config set to test.
501 Host amanda4 is not in your disklist.
Trying host amanda4.bic.mni.mcgill.ca ...
501 Host amanda4.bic.mni.mcgill.ca is not in your disklist.
Trying host amanda4 ...
501 Host amanda4 is not in your disklist.
Trying host amanda4 ...
501 Host amanda4 is not in your disklist.
Trying host amanda4.bic.mni.mcgill.ca ...
501 Host amanda4.bic.mni.mcgill.ca is not in your disklist.
Use the sethost command to choose a host to recover
amrecover> sethost gustav
200 Dump host set to gustav.
amrecover> setdisk /raid/hrrt/SCS_SCANS
200 Disk set to /raid/hrrt/SCS_SCANS.
amrecover> history
200- Dump history for config "test" host "gustav" disk
/raid/hrrt/SCS_SCANS
201- 2010-04-29-15-06-52 0 vtape-5:3
201- 2010-04-29-15-06-52 0 vtape-5:1
201- 2010-04-29-15-06-52 0 vtape-4:11
201- 2010-04-29-15-06-52 0 vtape-4:9
201- 2010-04-29-15-06-52 0 vtape-4:7
201- 2010-04-29-15-06-52 0 vtape-4:5
201- 2010-04-29-15-06-52 0 vtape-4:3
201- 2010-04-29-15-06-52 0 vtape-4:1
201- 2010-04-29-11-22-20 1 vtape-3:1
201- 2010-04-28-17-12-43 0 vtape-2:3
201- 2010-04-28-17-12-43 0 vtape-2:1
201- 2010-04-28-17-12-43 0 vtape-1:11
201- 2010-04-28-17-12-43 0 vtape-1:9
201- 2010-04-28-17-12-43 0 vtape-1:7
201- 2010-04-28-17-12-43 0 vtape-1:5
201- 2010-04-28-17-12-43 0 vtape-1:3
201- 2010-04-28-17-12-43 0 vtape-1:1
amrecover> setdate 2010-04-28-17-12-43
amrecover> ls
2010-04-28-17-12-43 Zhang_Ruby/
amrecover> add Zhang_Ruby
Added dir /Zhang_Ruby/ at date 2010-04-28-17-12-43
amrecover> list
TAPE vtape-2:3 LEVEL 0 DATE 2010-04-28-17-12-43
/Zhang_Ruby
amrecover> extract
Extracting files using tape drive changer on host amanda4.
The following tapes are needed: vtape-2
Extracting files using tape drive changer on host amanda4.
Load tape vtape-2 now
Continue [?/Y/n/s/d]? y
Restoring files into directory /holddisk/restore/hrrt
Continue [?/Y/n]?
thanks,
jf
diff --git a/server-src/disk_history.c b/server-src/disk_history.c
index 9ef6d99..1da5a2d 100644
--- a/server-src/disk_history.c
+++ b/server-src/disk_history.c
@@ -74,6 +74,22 @@ add_dump(
if(tape[0] == '/')
isafile = 1; /* XXX kludgey, like this whole thing */
+ /* See if we already have partnum=partnum-1 */
+ if (partnum > 1) {
+ for(item = disk_hist, before = NULL; item;
+ before = item, item = item->next) {
+ if (!strcmp(item->date, date) &&
+ item->level == level && item->is_split) {
+ item->tapes = append_to_tapelist(item->tapes, tape, file,
+ partnum, isafile);
+ if (maxpart > item->maxpart)
+ item->maxpart = maxpart;
+ return;
+ }
+ }
+ return;
+ }
+
new = (DUMP_ITEM *)alloc(SIZEOF(DUMP_ITEM));
strncpy(new->date, date, SIZEOF(new->date)-1);
new->date[SIZEOF(new->date)-1] = '\0';