UUGRN

Re: Re: Durchsatz von tar -> DLT // Blockgrößen

From
Christian Weisgerber <naddy@...>
Date
Alexander Holler <holler@...> wrote:

> Ach, also ich kann und konnte schon immer mit mt eine Blockgröße angeben,
> die mit der von tar nichts zu tun hat.

Ja, das kannst du, aber im Allgemeinen ist das nicht sinnvoll.
Aus FreeBSD sa(4):

--------------->
BLOCKING MODES
SCSI tapes may run in either `variable' or `fixed' block-size modes.
Most QIC-type devices run in fixed block-size mode, where most nine-track
tapes and many new cartridge formats allow variable block-size. The dif-
ference between the two is as follows:

Variable block-size: Each write made to the device results in a single
logical record written to the tape. One can never read or write part of
a record from tape (though you may request a larger block and read a
smaller record); nor can one read multiple blocks. Data from a single
write is therefore read by a single read. The block size used may be any
value supported by the device, the SCSI adapter and the system (usually
between 1 byte and 64 Kbytes, sometimes more).

When reading a variable record/block from the tape, the head is logically
considered to be immediately after the last item read, and before the
next item after that. If the next item is a file mark, but it was never
read, then the next process to read will immediately hit the file mark
and receive an end-of-file notification.

Fixed block-size: Data written by the user is passed to the tape as a
succession of fixed size blocks. It may be contiguous in memory, but it
is considered to be a series of independent blocks. One may never write
an amount of data that is not an exact multiple of the blocksize. One
may read and write the same data as a different set of records, In other
words, blocks that were written together may be read separately, and
vice-versa.

If one requests more blocks than remain in the file, the drive will
encounter the file mark. Because there is some data to return (unless
there were no records before the file mark), the read will succeed,
returning that data, The next read will return immediately with a value
of 0. (As above, if the file mark is never read, it remains for the next
process to read if in no-rewind mode.)
<---------------

Man kann Laufwerke mit von Haus aus variabler Blockgröße auch mit
fester Blockgröße betreiben, aber wofür?

Laufwerken fester Blockgröße wird man heute kaum noch begegnen (QIC
bis ~1GB). Wenn sie nicht ganz antik sind, kann man sie auch mehr
oder minder ineffizient variable Blockgröße emulieren lassen, aber
auch hier belässt man besser die Standardeinstellung (512 oder 1024
Bytes) und schreibt/liest mit einem Vielfachen davon.

> Ich habe und hatte schon immer Unterschiedliche Geschwindigkeiten, je nach
> Spielerei mit den Blockgrößen von mt (und tar).

Ja. Aber als Tuning-Parameter ist die Blockgröße des Laufwerks
uninteressant. Bei den Bandsystemen der letzten Jahre lässt man sie
variabel...

> Würde mich auch interessieren, wie du mit tar die Blockgröße eines
> remote-tapes einstellst.

... und dann wird die Größe der Zugriffe direkt durchgereicht.

> Wo ich z.B. extreme Geschwingigkeitsunterschiede festgestellt habe, ist
> beim Lesen eines Bandes welches mit fester (Band-)Blockgröße geschrieben
> wurde. Mit variabler Blockgröße (mt setblk 0) dauert das eine halbe
> Ewigkeit, mit der richtigen Blockgröße ist das schätzungsweise 4-8 mal
> schneller.

Kurz zusammengefasst: Du drehst an Einstellungen die du nicht
verstehst, pessimierst deine Konfiguration, und bist dann stolz,
wenn es mit noch mehr Fummelei wieder besser wird.

--
Christian "naddy" Weisgerber                          naddy@...

Thread

In reply to: Re: Re: Durchsatz von tar -> DLT // Blockgrößen Alexander Holler <holler@...>

Follow-ups: