Using Attached Volume

April 8, 2019 355 views
Initial Server Setup

I created a standard CentOS 6.9 droplet with 320 GB SSD and added 1000 GB block storage while creating the droplet and selected “Automatically Format & Mount”.

When I started moving the large application I ran out of space because it was only moving files to the initial droplets 320 GB disk and not using the attached volume at all.

I am moving a legacy PHP/CodeIgniter application to host on DO. Is there something I am missing when trying to get the volume to work?

1 Answer

Greetings!

Great question and sorry for the confusion on this. The block storage is not an expansion of your droplet’s disk, but an additional disk. Think of it like plugging an external USB hard drive into your computer, in that it adds a second drive that you must specifically select to add items to.

When you use the option to automatically format and mount, we do that, but it is in a specific location. If you run “df -h” you should see the location and the size match. You could change that location as well. Let’s say, for this example, that your block storage was mounted by us in:

/mnt/volume01

And that you want it at:

/var/www/media

This is what I would do:

  1. Edit /etc/fstab to change mount location to /var/www/media
  2. Prepare /var/www/media to be a mount location (needs to be empty): mv /var/www/media /var/www/media.bak mkdir /var/www/media
  3. Reboot
  4. Move things from the old /var/www/media to the new one: mv /var/www/media.bak/* /var/www/media

Done :)

Jarland

Have another answer? Share your knowledge.