I have create a block storage volume attached to my Ubuntu droplet following the tutorial. It seems to work but it is only writable with sudo commands.
Also I’d like to point my public/media folder in Nginx to this attached volumen. What is the best way to do it, symbolic link, location?
Thanks Gerardo
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.
Click below to sign up and get $100 of credit to try our products over 60 days!
@gerardop
You should be able to use either the
root
user or asudo
user, if you’ve created one. Theroot
user has global permissions and should be able to read & write from any location.If you’re not able to write to a file or directory on the block storage using a normal, non-root, non-sudo user (i.e.
www-data
), it’d be because the user you’re trying to read or write with doesn’t have proper permissions to do so and the device (if you used DigitalOcean’s guide) is owned byroot
.You’d need to change ownership, or
chown
the files and directories so that they are owned by the user you’re trying to use to read and write with before that user will be allowed to do so.You can do this like so:
or
or if you want to do it recursively (for when you have multiple directories and files in one directory and need them all to be owned by a specific user:
The above command will change ownership on ALL files and directories under
./directory
.