0
Answered

How do I add a folder from an external hard drive?

idrees 3 weeks ago • updated by Vlad R 3 days ago 6

Hello, I have recently installed FileRun on my Ubuntu server and everything seems to work as expected, except for external storage access. If I try to set a user's home folder as the external drive (such as under "/media/myname/drivesname"), the UI shows the "drivesname" folder in red and says invalid folder. If I create the home folder somewhere else and then add a symlink to the drive, any time I click the folder referencing the drive it says "The item is no longer available!".
The drive is accessible within the server itself and nothing seems out of the ordinary, so I imagine this is some permissions issue. Any help would be appreciated, and thank your for your time!

Answer

Answer
Answered

In order to have read access to a folder, "/media", "/media/myname" and "/media/myname/drivesname, all need to have appropriate permissions, not just the target folder. If all have 755, there is no way PHP can't access, unless something is wrong with your system.

+1

It's definitely a permission problem, with the system user under which PHP is running (usually "apache" or "www-data") not having permissions to access the path. It's hard to suggest what chmod or ownership to set on the folders, as it depends on server configuration and security you wish to keep.

Thanks for the quick response. I have tried using chown to transfer ownership to www-data as well as chmod to apply read-write permissions, but neither worked. Do you have any guidance on what I should do next or where I should look to find more information? Thanks again for your help, I understand that this is exiting the realm of "FileRun problems" and more into Linux in general.

Is PHP configured with any value set for "open_basedir"?

Is SELinux installed and enabled?

I have no value set for open_basedir, nor is SELinux installed. Perhaps I am not setting the permissions properly for the external directory?

Answer
Answered

In order to have read access to a folder, "/media", "/media/myname" and "/media/myname/drivesname, all need to have appropriate permissions, not just the target folder. If all have 755, there is no way PHP can't access, unless something is wrong with your system.

Ah okay I figured it out, I had to not only run chmod recursively on the external drive itself, but on the media folder that encloses it as well. I am unsure as to why this worked, but I am posting this anyway in case somebody else finds this to help.

Edit: Wow, looks like we posted at the exact same time!

Thanks Vlad for your time and amazing product!