Magnetic tape partitioning tool Wiki
command line tool to partition LTO-5+ tapes
Brought to you by:
szaszg
mtp - Magnetic Tape Partitioning utility v0.9
Usage: mtp [-?|-h|--help|-v|--version]
[device [cmd [partnum|psize0 [psize1 [psize2 [psize3]]]]]]
device - generic SCSI device related to tape drive (e.g. /dev/sg1)
cmd - a number from 1 to 9
1, 2, 3, 4 create one, two, three or four equally
sized partition
5, 6, 7 create two, three or four partition with
size: psize0, psize1, etc.
8 create a predefined partition scheme, usually one minimal
sized partition (around 107G) and a big partition from
the remaining space. LTFS uses this partition scheme.
9 on Linux mtp can toggle ST driver 'can-partitions' flag
if this flag is set 'mt' utility can st=et tape current
and can make maximum two partition on a tape.
mtp does not need to this flag set for partition tapes.
10 get or set current partition number (set - position tape to
partnum)
partnum - desired partition number for command 10 (0-3 set, any other get)
psizeX - partition size in current partitioning unit
the partitioning unit can be byte, kilobyte, megabyte or
10^X byte, where X is settable.
The default partition size unit is 10^8 in a HP LTO-7 drive.
With 'sdparm' utility you can check or set:
sdparm -p mpa <device> and to set
sdparm -p mpa --set PSUM=nn,PART_U=X <device>
nn: 0 - byte, 1 - KB, 2 - MB, 3 - 10^X byte
sizeX can be a number from -1 to 65535:
-1 or 65535 - all remaining space 0-65534 size in
partitioning unit.
-?|-h - this short help
--help - long help
-v|--version - version
Without args mtp show an interactive menu.
With only a device - mtp show the partition information.
Examples:
mtp /dev/sg3 - show partitions
mtp /dev/sg3 1 - create one partition on tape: reset to the original
'unpartitioned' state of tape
mtp /dev/sg3 3 - create three equally sized partition
mtp /dev/sg3 6 12000 -1 16000
- create three partition: first size is 12000 unit,
third size is 16000 unit and the second partition
consumes all available space.
mtp /dev/sg3 9 - toggle st driver 'can-partitions' option
mtp /dev/sg3 10 ? - print current active partition number
mtp /dev/sg3 10 3 - position tape at partition 3 BOP
Notes:
Between the partitions, there are some 'guarding' area, so the usable
space on a partitioned tape is smaller than on an unpartitioned one.
The drive may slightly change ('round') the given partition sizes, so
the final sizes of partitions may differ from the desired.