Unmounting External HDD from Website

Clarion Clarion cmd4a
October 25, 2012 at 05:40:12
Specs: Ubuntu Server 12.10, 2GB
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!


See More: Unmounting External HDD from Website

Report •

#1
October 25, 2012 at 07:52:12
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... )

Report •
Related Solutions


Ask Question