Linux Folder Provisioning Guide

This guide will help DIY Linux users to provision new folders, resize existing folders and remove folders. Storage folders are a key part of the ScPrime DIY Provider solution as this is where the data you are storing and getting paid for is stored. At least one storage folder needs to be added to a provider when initially setting up. But folders can also be removed and resized as part of regular maintenance activities on your provider.

Adding a New Folder

To add a new folder to a provider, whether it’s on initial setup or simply adding more capacity to an existing provider, use the following commands to first create the folder in Linux and then add that into spd along with the size of the folder you wish to allocate:
mkdir <PATH>
./spc host folder add <PATH> <SIZE>
Below is an example with a 4TB drive which is mounted at /dev/Data2, adding a 2TB folder:
Once added to spd, then inside this folder we can see 2 files called siahostdata.dat and siahostmetadata.dat. The first file is the size of the provisioned folder and this is where data will be stored. The 2nd file contains metadata about the data stored in the siahostdata.dat file.

Resizing a Folder

Now if we want to increase (or decrease) the size of the folder and allow for more data to be stored in it, we can resize it with the following command:
./spc host folder resize <PATH> <NEW-SIZE>

Removing a Folder

Sometimes you might want to remove a folder from spd to, for example, remove a physical drive from your system. This is possible without losing data as long as you have other folders provisioned in spd already. Using the example above, if we wanted to remove the drive mounted at /mnt/Data, we can remove it and spd will move any Used data (4.19MB in this case) to any remaining folders, so in our case it will all be moved to /mnt/Data2/SCP2. To do this we use the following command:
./spc host folder remove <PATH>
When we run that on the example provider above, we get the following:
We can now see the 4.19MB Used data on the /mnt/Data2/SCP2 folder and the 1TB folder has been removed from spd. Now the physical drive can be removed from the OS.

Drive Sizes

The table below can be used as a useful guide to how much usable space you have on your drive. Remember to also take off a couple of 100GB to allow for the siahostmetadata.dat and a bit of wiggle room. So for example from the table below, for a 12TB drive you should not be provisioning more than about 10.7TB of folder storage. Over-provisioning a drive will have extremely bad consequences to your provider, while initially it may be able to write data to the storage folder, soon you will appear to stop receiving data and this is because spd can not write to the drive due to it being over-provisioned.
Capacity on product (Decimal)
Windows Output (Binary)
500 GB
465 GB
1 TB (1,000 GB)
931 GB
2 TB (2,000 GB)
1.81 TB
3 TB (3,000 GB)
2.72 TB
4 TB (4,000 GB)
3.63 TB
5 TB (5,000 GB)
4.54 TB
6 TB (6,000 GB)
5.45 TB
8 TB (8,000 GB)
7.27 TB
10 TB (10,000 GB)
9.09 TB
12 TB (12,000 GB)
10.91 TB
14 TB (14,000 GB)
12.73 TB
16 TB (16,000 GB)
14.55 TB
18 TB (18,000 GB)
16.37 TB
20 TB (20,000 GB)
18.18 TB
On Linux, you can check the size of your drive using the following command:
df -h
In our example provider that shows the following:
/dev/sdd is our 4TB drive (actually a virtual disk in a VM so not an actual physical 4TB drive) and we can see it has 3.7TB of available space.
created 5/29/22 v1.0