How to modify the Block size?

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

How to modify the Block size?

seeker
Hi,everybody!
I have a backup software,which the block size is 512.
I use it backup with the true Library,the speed of write is about 100MB/s.
I try to ues it backup something with mhVTL,but I'm failed!It's said:
[2036] [TestDataTranslatorU] [4088] Warning: Used block(0) does not match file need(193750.000000).
So,I modify the block size of  the backup software,"block size=64",then I can backup with mhVTL.But,the write speed is only 20MB/s.
I want to modify the block size of mhVTL for test.
What the block size of mhVTL?
Can I modify the block size if  it's not 512?
How to modify the block size?
Reply | Threaded
Open this post in threaded view
|

Re: How to modify the Block size?

Mark Harvey
Administrator
20MB/sec is an acceptable thruput value..

mhVTL was never designed for raw thruput as a design criteria.

'normal' tape block sizes are typically somewhere around 64/128/256k in size..

mhVTL meta data is a fixed 512bytes per tape data block. Setting the tape data block size of 512 bytes will result in poor disk utilization and thruput.

As to how you set the block size, the answer is the same as a real tape drive..
either thru the mode sense/select or ioctl().

Most software uses variable block size. So the application creates the block of data and issues a single 'write'. Certainly it makes more sense to use variable block to write/read data to tape drives..


Sent from my iPad

On Sep 17, 2013, at 17:22, "seeker [via mhVTL - A Linux Virtual Tape Library]" <[hidden email]> wrote:

Hi,everybody!
I have a backup software,which the block size is 512.
I use it backup with the true Library,the speed of write is about 100MB/s.
I try to ues it backup something with mhVTL,but I'm failed!It's said:
[2036] [TestDataTranslatorU] [4088] Warning: Used block(0) does not match file need(193750.000000).
So,I modify the block size of  the backup software,"block size=64",then I can backup with mhVTL.But,the write speed is only 20MB/s.
I want to modify the block size of mhVTL for test.
What the block size of mhVTL?
Can I modify the block size if  it's not 512?
How to modify the block size?


If you reply to this email, your message will be added to the discussion below:
http://mhvtl-a-linux-virtual-tape-library.966029.n3.nabble.com/How-to-modify-the-Block-size-tp4025563.html
To start a new topic under mhVTL - A Linux Virtual Tape Library, email [hidden email]
To unsubscribe from mhVTL - A Linux Virtual Tape Library, click here.
NAML
Regards from Australia
Mark Harvey
Reply | Threaded
Open this post in threaded view
|

Re: How to modify the Block size?

seeker
Thank you !
I just want to do a test, to learn more about mhVTL.
Can you tell me how to modify the block size concrete?
I want to try 64/128/256..anything that I can do with mhVTL
Reply | Threaded
Open this post in threaded view
|

Re: How to modify the Block size?

Mark Harvey
Administrator
As indicated earlier - just like you would with any 'real' tape drive..

One snippet of code which takes a file descriptor to an open tape device and a 'size' :

Obviously - there is just garbage '0x45' in this tape block...

The end result is a single block written the tape device of 'size'..

static int write_block(int fd, int size)
{
        char *buf;
        int err;

        buf = malloc(size);
        if (!buf)
                return 0;

        memset(buf, 0x45, size);

        printf("%s(%d)", __func__, size);
        err = write(fd, buf, size);
        if (err < 0)
                printf(" %s", strerror(errno));
        printf("\n");
        free(buf);
        return err;
}

Checkout mtio.h for lots of ioctl you can pass the 'st' driver..
Regards from Australia
Mark Harvey
Reply | Threaded
Open this post in threaded view
|

Re: How to modify the Block size?

Mark Harvey
Administrator
I can't find "mtio.h" by "find / -name "mtio.h"
My system - it's been installed as part of glibc-devel
e.g.
~> find /usr/include -name mtio.h -print
/usr/include/linux/mtio.h
/usr/include/sys/mtio.h
markh@mharvey02:~> rpm -qf /usr/include/linux/mtio.h
glibc-devel-2.4-31.74.1
markh@mharvey02:~> rpm -qf /usr/include/sys/mtio.h
glibc-devel-2.4-31.74.1

on the web management console-->operator-->driver,I can see this:

"SCSI 2 tape drive:
File number=0, block number=0, partition=0.
Tape block size 0 bytes. Density code 0x5a (no translation).
Soft error count since last status=0
General status bits on (41010000):
 BOT ONLINE IM_REP_EN"

"Tape block size 0 bytes" I think it's the goal that I want to modify.
This is EXACTLY what you want !
A tape block size of '0' is the variable block mode. i.e. what ever tape block your application wants to use. Otherwise you need to round your data in 'chunks of XXkb'.

If you set a fixed block size of '64k' and only have 5 bytes to write - you waste 65531 bytes of data in fixed block mode.
If you only have 5 bytes left in variable block mode - then you can write a block of data '5' bytes in size.

Reading this back is even simpler - as you don't have to record somewhere that you only used 5 bytes of that 64k last block.
If you attempt to read 64k - you will find the tape drive will set the 'ILI' bit (illegal Length Indicator) and advise you of the fact you could only read 5 bytes..

Fixed blocks are good for 'random' devices (CDROM, HDD etc)
Variable blocks are good for sequential devices (tape drives)

Thank you for your help and teaching me patient!
Good luck :)
Regards from Australia
Mark Harvey
Reply | Threaded
Open this post in threaded view
|

Re: How to modify the Block size?

seeker
Hi Mark,

   "replied via the forum - as this info is potentially useful to others as well.."
 
   I replied all  via the forum but by the email on forum.

   I just notice this,sorry. :)