How to attach Block Storage when Droplet connected to ServerPilot?

Hello, Guys. I’m stuck in little problem. I have a Droplet which is connected to ServerPilot. I use WordPress on that Droplet, my question how to attach a Block Storage when I’m connected to ServerPilot?

I read this Tutorial, But I think something different in ServerPilot. So, I asked them & they told me I have to mount the Block Storage in /srv you can check the full ScreenShot Here.

I don’t have a single knowledge in Linux, that is why I use DigitalOcean & ServerPilot for easy maintenance.

Did any of guys happen to using Block Storage when you’re using ServerPilot? Could you help me by giving me step by step tutorial? Remember, I use only WordPress, so I wants to mount or attach the Block Storage in such way, that I won’t have any issue while uploading Images or Attachments in my WordPress Library.

Thank you.

Show comments

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Accepted Answer


Once you deploy a new Droplet with a Volume, first click on the name of the Droplet and then, from the left side menu, click on Volumes.

You’ll then want to click on More, then Config instructions. A pop up will be presented with the configuration commands that you need to run in order to mount the volume persistently.

Those commands will be something like:

sudo mkfs.ext4 -F /dev/disk/by-id/scsi-0DO_Volume_volume-nyc1-01


sudo mkdir -p /mnt/volume-nyc1-01; sudo mount -o discard,defaults /dev/disk/by-id/scsi-0DO_Volume_volume-nyc1-01 /mnt/volume-nyc1-01; echo /dev/disk/by-id/scsi-0DO_Volume_volume-nyc1-01 /mnt/volume-nyc1-01 ext4 defaults,nofail,discard 0 0 | sudo tee -a /etc/fstab

Which, broken down in to multiple commands, looks like:

sudo mkdir -p /mnt/volume-nyc1-01
sudo mount -o discard,defaults /dev/disk/by-id/scsi-0DO_Volume_volume-nyc1-01 /mnt/volume-nyc1-01
echo /dev/disk/by-id/scsi-0DO_Volume_volume-nyc1-01 /mnt/volume-nyc1-01 ext4 defaults,nofail,discard 0 0 | sudo tee -a /etc/fstab

Since ServerPilot is recommending that you mount to /srv, you’ll need to modify those commands and remove the mkdir commands, as they aren’t needed.

Keep in mind, this is an example. You’re volume may be named different, so you need to replace the name of the volume in this example with the name of the volume that’s created for you.

So what we’d end up with us a set of commands like this:

Formate and Prepare the Volume

sudo mkfs.ext4 -F /dev/disk/by-id/scsi-0DO_Volume_volume-nyc1-01

Mount the Volume to /srv

sudo mount -o discard,defaults /dev/disk/by-id/scsi-0DO_Volume_volume-nyc1-01 /srv

Create the /etc/fstab Entry for Persistence

echo /dev/disk/by-id/scsi-0DO_Volume_volume-nyc1-01 /srv ext4 defaults,nofail,discard 0 0 | sudo tee -a /etc/fstab

The part in the commands above that you will probably need to replace is


Once the above commands are ran, you’ll all done and can then connect the new Droplet to SP.

I just run this command and i lost my all data from /srv/ folder

sudo mount -o discard,defaults /dev/disk/by-id/scsi-0DO_Volume_volume-nyc1-01 /srv

I just use my volume and run this cmd and create lost+found folder in /srv folder

Please help me to get all data back.

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Featured on Community

Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.

Become a contributor

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow — whether you're running one virtual machine or ten thousand.

Learn more
DigitalOcean Cloud Control Panel