6.5.1 Creating a Registry File System

The registry server requires at least 15GB of available disk space to store registry data. This is usually located at /var/lib/registry. It is good practice to create a separate file system for this. It is recommended you create a Btrfs formatted file system to allow you to easily scale your registry file system, and to leverage Btrfs features such as snapshotting. The instructions in this section provide details for setting up a Btrfs file system. The device could be a disk partition, an LVM volume, a loopback device, a multipath device, or a LUN.

If you want dedicated storage for the registry file system, create a file system and mount it at /var/lib/registry. This example uses Btrfs to format the file system.

To create a Btrfs file system for the registry:

  1. Create a Btrfs file system with the utilities available in the btrfs-progs package, which should be installed by default. Create a Btrfs file system on one or more block devices:

    # mkfs.btrfs [-L label] block_device ...

    where -L label is an optional label that can be used to mount the file system.

    For example, to create a file system on the partition /dev/sdc1:

    # mkfs.btrfs -L var-lib-registry /dev/sdc1

    The partition must already exist. Use a utility such as fdisk (MBR partitions) or gdisk (GPT partitions) to create one if needed.

    To create a file system on a logical volume named docker-registry in the ol volume group:

    # mkfs.btrfs -L var-lib-registry /dev/ol/docker-registry

    The logical volume must already exist. Use Logical Volume Manager (LVM) to create one if needed.

    For more information on using mkfs.btrfs, see the Oracle® Linux 7: Administrator's Guide.

  2. Obtain the UUID of the device containing the Btrfs file system.

    Use the blkid command to display the UUID of the device and make a note of this value, for example:

    # blkid /dev/sdc1 
    /dev/sdc1: LABEL="var-lib-registry" UUID="50041443-b7c7-4675-95a3-bf3a30b96c17" \
    UUID_SUB="09de3cb1-2f9b-4bd8-8881-87e591841c75" TYPE="btrfs"

    If the Btrfs file system is created across multiple devices, you can specify any of the devices to obtain the UUID. Alternatively you can use the btrfs filesystem show command to see the UUID. For a logical volume, specify the path to the logical volume as the device for example /dev/ol/docker-registry. Ignore any UUID_SUB value displayed.

  3. Edit the /etc/fstab file and add an entry to make sure the file system is mounted when the system boots.

    UUID=UUID_value /var/lib/registry  btrfs  defaults  0 0

    Replace UUID_value with the UUID that you found in the previous step. If you created a label for the Btrfs file system, you can also use the label instead of the UUID, for example:

    LABEL=label /var/lib/registry  btrfs  defaults  0 0
  4. Create the /var/lib/registry directory.

    # mkdir /var/lib/registry
  5. Mount all the file systems listed in /etc/fstab.

    # mount -a
  6. Verify that the file system is mounted.

    # df
    Filesystem     1K-blocks    Used Available Use% Mounted on
    /dev/sdc1            ...    ...  ...       1%   /var/lib/registry