Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Mounting Greyhole shares locally
Mounting your Samba shares locally is useful when you are using Greyhole, and want to write or in any way work with those files locally. Greyhole data should only be accessed through shares, so mounting those shares locally is an easy way to work with Greyhole data safely.
This script needs
/sbin/mount.cifs, so make sure to install
cifs-utilsor similar, as needed, using your package manager (
Install the following init script in /etc/init.d/mount_shares_locally:
sudo curl -Lo /etc/init.d/mount_shares_locally https://gist.github.com/gboudreau/1099419/raw
sudo curl -Lo /etc/init.d/mount_shares_locally https://gist.github.com/gboudreau/1876068/raw
Make the init script executable, and install it:
sudo chmod +x /etc/init.d/mount_shares_locally # If your system uses update-rc.d (Ubuntu, Debian), execute this: sudo update-rc.d mount_shares_locally defaults # If your system uses chkconfig instead (Fedora, CentOS), execute this: sudo chkconfig --add mount_shares_locally
update-rc.dcomplains about the
sambadependency not existing, edit
smb) in the lines that start with
/etc/init.d/mount_shares_locally, and replace
your_usernamewith the user you'd like to mount the shares.
/home/your_username/.smb_credentialsfile, with the following content:
username=your_username password=your_password domain=HOME
Try mounting the shares using:
sudo /etc/init.d/mount_shares_locally start
You will find the mounted shares in
Unable to mount or other error
The service you installed is automatically going to run on system start up. Sometimes, however, problems can cause the mount to fail silently, with the mounted directories present where they are supposed to be, but it is not actually mounted any more, and you are unable to make any changes to them.
This is mostly caused when the main shares are changed in samba. The service then tries to mount the shares as they were before they were changed, with bad results.
The solution is simply to make sure that the service is stopped (
sudo service mount_shares_locally stop or similar), and then to delete the /mnt/samba directory and all it's contents (
sudo rmdir /mnt/samba/*). When the service is restarted, everything will mount normally without any issues.