-
Notifications
You must be signed in to change notification settings - Fork 4
First steps
To use Phobos, a daemon called phobosd
needs to be launched.
It mainly manages the device/media allocation and sets up resources to read or write your data.
To launch/stop the daemon:
systemctl start/stop phobosd
To write data, Phobos can use different types of resources (called families
), which are currently POSIX directories, drives and tapes, and RADOS pools. Writing data to all of them is explained below.
In Phobos, the management of directories is simple: a directory is both a device and a medium.
Therefore, to start writing data to Phobos, you only have to add a directory by using the phobos dir add
command.
For it, you must provide the path to the directory.
For instance, to add the directory located at /tmp/test
, use:
phobos dir add /tmp/test
By default, devices and media are added in a locked state, so they are not immediately usable in production.
To enable using a directory in production when adding it, use the '--unlock' option of phobos dir add
:
phobos dir add --unlock /tmp/test
Also, since your directory is considered both a device and a medium, you must format it (even though it does no mean anything for POSIX directories), by using the phobos dir format
command:
phobos dir format /tmp/test
After this command, the directory is ready to be used and store data ! If you want to start writing data immediately, jump to the Data management section.
To know the state of the library available on your system, you can use the phobos lib scan
command to scan it.
For instance, the following will give the contents of the /dev/changer
library:
phobos lib scan /dev/changer
To add a drive to Phobos, use the phobos drive add
command.
For this command, you must provide the path to the drive in the /dev
directory.
You can retrieve it by using, for instance, the lsscsi
command (lsscsi).
For instance, to add the drive located at /dev/mapper/LTO6-012345
, use:
phobos drive add /dev/mapper/LTO6-012345
It is recommended to specify a device path which is persistent after reboot (eg. managed by dev mapper).
By default, drives are added in a locked state, so they are not immediately usable in production.
To enable using a drive in production when adding it, use the '--unlock' option of phobos drive add
:
phobos drive add --unlock /dev/mapper/LTO6-012345
To add tapes to Phobos, use the phobos tape add
command.
For this command, you must provide the name of the tape, which you can retrieve by using phobos lib scan
as explained above.
It is mandatory to specify a media type (like LTO8, T10KD...) with option -t
:
phobos tape add --type lto6 073200L6
Note1: this operation requires no access to the medium.
Note2: the set of supported media types, drive types, and compatibility rules between drives and media are configurable. See the Configure Phobos page for more details.
Just like the drives, when a tape is added to Phobos, it is added in a locked state, and just as for drives, you can use the --unlock
option of phobos tape add
.
Once a media has been added, it needs to be formatted. You can optionally unlock the tape when the operation is done (if it hasn't been done before), so it becomes usable in production.
phobos tape format --unlock 073200L6
Once you have added the resource you want, you can list them by using their list
command.
For instance, for drives and tape, you can use:
phobos drive list
phobos tape list
After adding a tape and a drive to Phobos, and having launched the daemon, you can start writing data !
Data
in Phobos is represented as objects, that are identified by a unique identifier.
It must be specified when putting data in Phobos (which we call putting an object
) or when getting data (getting an object
).
To put an object, you must give the path of the file that contains your data, an identifier for the data, and the type of resource you want to write your data on (with the --family
flag, which defaults to tape
if not provided).
For instance, if you want to put the file /etc/hosts
in Phobos as the object known_hosts
on RADOS pools, do:
phobos put -f rados_pool /etc/hosts known_hosts
Once done, you can list the object known by Phobos with:
phobos object list
And you will see the object you just created !
To retrieve the data of an object, use the phobos get
command.
Its arguments are the identifier of the object to be retrieved, as well as a path to a file where the data should be written.
For example:
phobos get known_hosts /tmp/get_example
When the command is done, your new file /tmp/get_example
will be an exact replica of the file /etc/hosts
.
And voilà ! Just like this, you have added a drive and tape to your Phobos system, written your data to a tape, and retrieved it from Phobos ! To get more insights about what Phobos allows you to do, check the Store commands, Admin commands and Advanced usage pages.