Difference between revisions of "Mount Shares Locally"

From Amahi Wiki
Jump to: navigation, search
(Greyhole service does NOT need to be running for mount_shares_locally to work. Only Samba and MySQLd are required. You can access your Greyhole shares without having the Greyhole service running.)
Line 44: Line 44:
  
 
{{Code|/etc/init.d/mount_shares_locally start}}
 
{{Code|/etc/init.d/mount_shares_locally start}}
 
==Problem with service dependency==
 
The mount_share_locally script requires the greyhole service be running prior to it starting.  To ensure this happens, take to following steps:
 
* Edit /etc/init.d/mount_shares_locally (as user root) in a text editor
 
** Add greyhole to the list of Required-Start services and save the changes
 
  {{Code|# Required-Start:    $network $local_fs $remote_fs smb mysqld greyhole}}
 
* Remove the service "chkconfig --del mount_shares_locally"
 
* Re-add the service "chkconfig --add mount_shares_locally"
 

Revision as of 19:14, 2 June 2011

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.

  • Install the mount_shares_locally initd script:
curl -o /etc/init.d/mount_shares_locally http://dl.dropbox.com/u/3022105/Amahi/mount_shares_locally
chmod +x /etc/init.d/mount_shares_locally
chkconfig --add mount_shares_locally
  • Edit /etc/init.d/mount_shares_locally (as user root) in a text editor, and replace your_username (on line 12) with your username.
  • Create the /home/your_username/.smb_credentials file. This is a simple text file (use your favorite text editor).
username=your_username
password=your_password
domain=HOME

To test your new mounts, you can execute service mount_shares_locally start
You will find the mounted shares in /mnt/samba/*
service mount_shares_locally stop will unmount the local shares.

Note: if you used /etc/rc.local and /etc/fstab to mount shares locally in the past, you can remove what you added in those files now. The above initd script replaces all this.


Unable to mount localy after upgrading to Amahi6

If you try to run mount using this script after you upgraded to Amahi6 you might get greeted by this type of error.

[root@localhost ~]# /etc/init.d/mount_shares_locally start
Mounting Samba shares locally: /etc/init.d/mount_shares_locally: line 27: /sbin/mount.cifs: No such file or directory
/etc/init.d/mount_shares_locally: line 27: /sbin/mount.cifs: No such file or directory
/etc/init.d/mount_shares_locally: line 27: /sbin/mount.cifs: No such file or directory
/etc/init.d/mount_shares_locally: line 27: /sbin/mount.cifs: No such file or directory
/etc/init.d/mount_shares_locally: line 27: /sbin/mount.cifs: No such file or directory
/etc/init.d/mount_shares_locally: line 27: /sbin/mount.cifs: No such file or directory
/etc/init.d/mount_shares_locally: line 27: /sbin/mount.cifs: No such file or directory
                                                          [  OK  ]

It's easily fixed by installing the missing dependency.

bash code
​yum install cifs-utils​


Now it should work fine to run

bash code
​/etc/init.d/mount_shares_locally start​