Hi there,
I got the same error for "mhvtl-0.16-11" using Ubuntu 9.10 Netbook Remix. I used
http://sites.google.com/site/linuxvtl2/mhvtl-2009-12-16.tgz?attredirects=0.
For some time I was puzzled, because I checked several scripts and the source code and didn't find
any hint. But the hint is the error message itself.
"mktape error: Structure of MAM incorrect size: 1016"
It just says, that the MAM (Medium Auxiliary Memory) structure has an incorrect size. Looking into
"[...]/mhvtl-0.16/usr/mktape.c" in line 216, there's a check that makes sure that the program exits (and returns 2)
if the MAM structure's size is less than 1024 bytes. It returns the error message above for this error.
- Code: Select all
216 if (sizeof(struct MAM) != 1024) {
217 printf("Structure of MAM incorrect size: %d\n",
218 (int)sizeof(struct MAM));
219 exit(2);
220 }
"mktape" also returns this error if called directly, so the error is not induced by parameters. So I checked
the includes for a definition of the MAM structure. I found it in "[...]/mhvtl-0.16/usr/vtllib.h". It starts in line
316, but the interesting thing is located in line 371. There, a padding ist defined to fill up the structure's size
to 1024 bytes.
- Code: Select all
370 /* Pad to keep MAM to 1024 bytes */
371 uint8_t pad[1024 - 888];
Now the quick and dirty solution, if the MAM structure has a size of 1016 bytes, but should have 1024, the padding
is too small (8 bytes are missing). Hence one has to correct this by changing the difference "1024 - 888" to
"1024 - 880".
- Code: Select all
370 /* Pad to keep MAM to 1024 bytes */
-371 uint8_t pad[1024 - 888];
+371 uint8_t pad[1024 - 880];
You can also count the number of bytes the data part of the MAM structure takes (but remember, "uint16_t"
is defined as "unsigned int", and on 32 Bit machines an "int" has 4 Bytes. See
http://linux.die.net/man/3/uint32_t for details.). You should get a total size of 880 bytes for the data part.
After recompiling, it worked for me (and should also work for you). Changing only the init script to not
evaluate the return value of "mktape" may not solve this problem completely, because the virtual tapes are not
created then, as "bartoque" already mentioned.
I didn't compile "mhvtl-0.18-1", but as the code for the MAM structure is identical to "mhvtl-0.16-11", I
assume that it will produce the same error.
Best regards,
Frank