Skip to content

First steps

Yoann Valeri edited this page Mar 10, 2023 · 7 revisions

Launching phobosd

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

Writing on POSIX directories

Device and media management

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](#Data management) section.

Writing on tapes

Scanning libraries

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

Device and media management

Adding drives

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

Adding tapes

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

Listing resources

Once you have added a drive and a tape, you can list these resources by using their list command:

phobos drive list
phobos tape list

Data management

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).

Writing objects

To put an object, you must give the path of the file that contains your data, and an identifier for the data. For instance, if you want to put the file /etc/hosts in Phobos as the object known_hosts, do:

phobos put /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 !

Reading objects

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 User commands, Admin commands and Advanced usage pages.

Clone this wiki locally