libaaruformat 1.0
Aaru Data Preservation Suite - Format Library
Loading...
Searching...
No Matches
TapePartitionEntry Struct Reference

Describes a single physical partition on a tape medium. More...

#include <aaruformat/structs/tape.h>

Data Fields

uint8_t Number
 Partition number (unique identifier for this partition).
uint64_t FirstBlock
 First block in the partition (inclusive).
uint64_t LastBlock
 Last block in the partition (inclusive).

Detailed Description

Describes a single physical partition on a tape medium.

Tape partitions are physical divisions of the tape storage area, each with its own block address space. Partitioning allows a single tape to be logically divided for organizational purposes, access control, or compatibility with different systems.

Partition Number: The partition number uniquely identifies the partition on the tape. Most tapes have a single partition (partition 0), but advanced formats like LTO, DLT, and AIT support multiple partitions. The numbering scheme is format-specific:

  • Single-partition tapes: Usually partition 0
  • Multi-partition tapes: Typically 0-255, though most formats support fewer

Block Range: Each partition has an independent block address space starting from its FirstBlock. The FirstBlock and LastBlock fields define the inclusive range of blocks in the partition:

  • FirstBlock: The first block number in this partition (often 0)
  • LastBlock: The last block number in this partition (inclusive)

Block Address Spaces: Block addresses are local to each partition. For example:

  • Partition 0: blocks 0-9999 (10,000 blocks)
  • Partition 1: blocks 0-4999 (5,000 blocks)

Block 0 in partition 0 is distinct from block 0 in partition 1. When referencing a block, both the partition number and block number are required for uniqueness.

Partition Size: Partition size in blocks = (LastBlock - FirstBlock + 1) Total tape capacity = sum of all partition sizes

Physical Organization: On physical tape, partitions are typically laid out sequentially:

  • Partition 0 occupies the beginning of the tape
  • Partition 1 follows partition 0
  • And so on...

Some formats allow non-sequential access to partitions via tape directory structures or partition tables stored in a leader area.

Use Cases:

  • Data segregation: Separate system backups from user data
  • Multi-system use: Different partitions for different operating systems
  • Tiered storage: Fast-access partition for indices, bulk partition for data
  • Compatibility: Legacy system may require specific partition layouts
  • Write protection: Some formats allow per-partition write protection

Format Examples:

  • LTO (Linear Tape-Open): Supports 2-4 partitions depending on generation
  • DLT (Digital Linear Tape): Typically 1 partition, some variants support more
  • DAT (Digital Audio Tape): Usually 1 partition
  • AIT (Advanced Intelligent Tape): Supports multiple partitions
  • QIC (Quarter-Inch Cartridge): Typically 1 partition
Note
Partition numbers are format-specific. Some formats use 0-based numbering, others use 1-based. The Aaru format preserves the original numbering.
Not all tape formats support partitioning. Single-partition tapes are common and have one entry with Number=0.
Partitions cannot overlap in the physical block space, though the logical block numbering within each partition may start from 0.
Empty partitions (reserved but unused space) may exist with FirstBlock > LastBlock or with no files allocated to them.

Definition at line 319 of file tape.h.

Field Documentation

◆ FirstBlock

uint64_t TapePartitionEntry::FirstBlock

First block in the partition (inclusive).

Starting block address for this partition's address space. Often 0, but format-dependent.

Definition at line 323 of file tape.h.

Referenced by aaruf_get_tape_partition(), and aaruf_set_tape_partition().

◆ LastBlock

uint64_t TapePartitionEntry::LastBlock

Last block in the partition (inclusive).

Ending block address for this partition's address space. Must be ≥ FirstBlock. The partition contains all blocks from FirstBlock through LastBlock inclusive.

Definition at line 325 of file tape.h.

Referenced by aaruf_get_tape_partition(), and aaruf_set_tape_partition().

◆ Number

uint8_t TapePartitionEntry::Number

Partition number (unique identifier for this partition).

Identifies this partition among all partitions on the tape. Valid range: 0-255, though most tapes use 0-3.

Definition at line 321 of file tape.h.

Referenced by aaruf_set_tape_partition(), and process_tape_partitions_block().


The documentation for this struct was generated from the following file:
  • include/aaruformat/structs/tape.h