Symlinking a Mounted Drive

Steps to allow main drive to use the space on the mounted drive

Harmony ValidatorDAO
3 min readNov 16, 2021

Note: Digital Ocean users will need to follow this guide before rcloning. The rclone of shard 0 is huge and won’t fit on the main drives of the available Digital Ocean server options.

Now that we have our drive mounted, we need to link the mounted drive so we can use the space.

Symlinking allows space on the mounted disk to be connected or linked to the main drive.

As you can see in the screenshot above, the harmony_db_0 is located on the main drive, but is now linked to a location on the mounted drive.

If you use Easy Node’s Harmony ONE Validator Toolbox, it uses symlinks as well. Easy Node creates a harmony folder and symlinks everything (hmy, harmony, harmony_db_#, etc) on to the mounted drive.

This guide just symlinks the problematic harmony_db_0 to the mounted drive. This guide is also meant to be use in conjunction with the Harmony Docs and is not a replacement installer like Easy Node.

Follow the Harmony Docs, but before you rclone shard 0, run these commands:

First is to check if the drive is mount correctly.

ls -lha /mnt

In this example, the name of the mounted drive is volume_sfo3_01. Within the provided code, replace volume_sfo3_01 with the name of your mounted drive.

sudo chown harmony /mnt/volume_sfo3_01

This command gives the harmony user permission to the mounted drive.

mkdir -p /mnt/volume_sfo3_01/harmony_db_0

This command creates the directory. For the curious you can read about what the -p flag does here.

ln -srf /mnt/volume_sfo3_01/harmony_db_0

This command creates the link between the main drive harmony_db_0 and to the directory you just created in the command above. The ln creates the link. The -srf makes the symlink file path relative instead of absolute and forces the symlink in case a previous one exists. The -f flag is nice because if you messed up on creating the smylink in the first place, this will allow it to be overwritten.

To check your symlink type:

ls -l

The turquoise to light blue means the symlink is good. If you get red lettering, it means the smylink is broken in some manner.

To remove the created symlink, type:

unlink /mnt/volume_sfo3_01/harmony_db_0

After removing the symlink, go back to the start of this symlink section and try again until you get turquoise to light blue lettering.

If you have any questions or comments, please leave them in the comments below.

--

--