To tackle this, we have the following options to offer you:
Configure Filestore Sharding:
In case you decide to add a new drive to your production environment, you may configure the Sharding Binary Provider that lets you manage your binaries in a sharded filestore.
This will be useful, as it will let you choose the writeBehavior as ‘freeSpace’. Setting the writeBehavior as ‘freeSpace’ will make sure that binaries are written to the mount with the greatest absolute volume of free space available.
Which, in our case, will firstly populate the new drive, as it will have more free disk space and will balance out after the disk space of the new drive will reach the same percentage of the free space your current drive currently has.
In addition to the above, you may specify the path of both the old and new disks under the provider ID of your shards, by specifying the ‘fileStoreDir’:
<provider id="shard1" type="state-aware">
<fileStoreDir>filestore1</fileStoreDir>
</provider>
<provider id="shard2" type="state-aware">
<fileStoreDir>filestore2</fileStoreDir>
</provider>
After configuring the Sharding binary provider, you will need to use the Optimize System Storage REST API, as it raises a flag to invoke balancing between redundant storage units of a sharded filestore following the next Garbage Collection.
Afterward, you will need to run the Garbage Collection to invoke the balancing between redundant storage units, however, in Artifactory version 6.12.0 and above, the Garbage Collection needs to run 20 times in order to fully take affect.
In order to overcome this, you may add the below property under the artifactory.system.properties file, under $ARTIFACTORY_HOME/etc/artifactory.system.properties:
artifactory.gc.skipFullGcBetweenMinorIterations=1
A restart to the Artifactory instance is required for the property to take affect. After restarting, it is possible to run the GC just one time.
Migration between the old disk to the new Disk:
In case the new disk is going to substitute the old disk, we will need to migrate all the data from the old disk to the new.
We have an article regarding “What is the best way to migrate a large Artifactory instance with minimal downtime?”, which describe two methods for migrating your old Artifactory instance data to the new one.
Before using any of the above options, please test the method you intend to implement on a test environment prior implementing it to your production instance.