How to change allocated disk space

I have set up the storage node, and it is working fine. However, I now want to reduce the allocated disk space. I used Docker to set up the storage node. What are the steps to do this?

I believe you need to stop the node:

docker stop -t 300 storagenode

then remove it:

docker rm storagenode

Next:
Execute the docker run command but change the 2TB to whatever you want for the allocated storage.

Below is the whole example docker run command for Linux showing where the default 2TB allocated storage is set on the 8th line. That’s where you make the change. You can use GB instead of TB if you prefer. Example: -e STORAGE=500GB
Keep a copy of your run command in a text file for reference.

docker run -d --restart unless-stopped --stop-timeout 300 \
    -p 28967:28967/tcp \
    -p 28967:28967/udp \
    -p 127.0.0.1:14002:14002 \
    -e WALLET="0xXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" \
    -e EMAIL="user@example.com" \
    -e ADDRESS="domain.ddns.net:28967" \
    -e STORAGE="2TB" \
    --user $(id -u):$(id -g) \
    --mount type=bind,source="<identity-dir>",destination=/app/identity \
    --mount type=bind,source="<storage-dir>",destination=/app/config \
    --name storagenode storjlabs/storagenode:latest

It’s also possible to set the allocated space in your config file, example:
storage.allocated-disk-space: 1120.0 GB
but in order for it to work you need to set storage to an empty string in your docker run command. Example:
-e STORAGE=“” \

The advantage of setting allocated space in the config file instead of the docker run command is that you only need to restart the node to make the setting take effect for future changes which might be a bit easier than stopping the container, removing it, and then issuing the long run command.

To restart node after a config file change:

docker restart -t 300 storagenode
1 Like