Hi, I am using Ubuntu Server with LAMP for my website. My question is, how I can mount an external drive from a php file.
Basically, I keep my entire website on the HDD, and I would like to be able to shut it down, simply my unmounting the drive from the web. I'm pretty new to this. Commands I've tried:
system("mount -l /dev/sdb1");
exec("unmount.sh") <--- I put the above command in a .sh
shell_exec("unmount.sh")I have never gotten any output, so I don't know the problem. I suspect that www-data mightn't have permissions? In which case how do I hand them out?
Thanks for any help!
You are correct - it is a permissions problem. Add the appropriate entry in /etc/fstab to allow normal users to unmount this filesystem. (See http://en.wikibooks.org/wiki/LPI_Li... )