xorriso: Drives
5 Libburn drives
****************
Input drive, i.e. source of an existing or empty ISO image, can be any
random access readable libburn drive: optical media with readable data,
blank optical media, regular files, block devices.
Output drive, i.e. target for writing, can be any libburn drive. Some
drive types do not support the method of growing but only the methods of
modifying and blind growing. They all are suitable for newly created
images.
All drive file objects have to offer rw-permission to the user of
'xorriso'. Even those which will not be useable for reading an ISO
image.
With any type of drive object, the data are considered to be organized
in blocks of 2 KiB. Access happens in terms of Logical Block Address
(*LBA*) which gives the number of a particular data block.
MMC compliant (i.e. optical) drives on GNU/Linux usually get
addressed by the path of their block device or of their generic
character device. E.g.
-dev /dev/sr0
-dev /dev/hdc
-dev /dev/sg2
By default xorriso will try to map the given address to /dev/hd* and
/dev/sr*. The command -scsi_dev_family can redirect the mapping from sr
to scd or sg. The latter does not suffer from the concurrency problems
which plague /dev/sr of Linux kernels since version 3. But it does not
yield the same addresses which are used by mount(8) or by open(2) for
read(2).
On FreeBSD the device files have names like
-dev /dev/cd0
On NetBSD:
-dev /dev/rcd0d
On OpenSolaris:
-dev /dev/rdsk/c4t0d0s2
Get a list of accessible drives by command
-device_links
It might be necessary to do this as *superuser* in order to see all
drives and to then allow rw-access for the intended users. Consider to
bundle the authorized users in a group like old "floppy".
Filesystem objects of nearly any type can be addressed by prefix
"stdio:" and their path in the filesystem. E.g.:
-dev stdio:/dev/sdc
The default setting of -drive_class allows the user to address files
outside the /dev tree without that prefix. E.g.:
-dev /tmp/pseudo_drive
If path leads to a regular file or to a block device then the emulated
drive is random access readable and can be used for the method of
growing if it already contains a valid ISO 9660 image. Any other file
type is not readable via "stdio:" and can only be used as target for the
method of modifying or blind growing. Non-existing paths in existing
directories are handled as empty regular files.
A very special kind of pseudo drive are open file descriptors. They
are depicted by "stdio:/dev/fd/" and descriptor number (see man 2 open).
Addresses "-" or "stdio:/dev/fd/1" depict standard output, which
normally is the output channel for result texts. To prevent a fatal
intermingling of ISO image and text messages, all result texts get
redirected to stderr if -*dev "-" or "stdio:/dev/fd/1" is among the
start arguments of the program.
Standard output is currently suitable for creating one session per
program run without dialog. Use in other situations is discouraged and
several restrictions apply:
It is not allowed to use standard output as pseudo drive if it was not
among the start arguments. Do not try to fool this ban via backdoor
addresses to stdout.
If stdout is used as drive, then -use_readline is permanently disabled.
Use of backdoors can cause severe memory and/or tty corruption.
Be aware that especially the superuser can write into any accessible
file or device by using its path with the "stdio:" prefix. By default
any address in the /dev tree without prefix "stdio:" will work only if
it leads to a MMC drive.
One may use command *-ban_stdio_write* to surely prevent this risk and
to restrict drive usage to MMC drives.
One may prepend "mmc:" to a path to surely disallow any automatic
"stdio:". By command -drive_class one may ban certain paths or allow
access without prefix "stdio:" to other paths.