Changes

From Amahi Wiki
Jump to: navigation, search
699 bytes removed ,  03:05, 20 December 2010
no edit summary
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.
* Add each share you want to mount locally to your /etc/fstab, like thisInstall the mount_shares_locally initd script:
<div style="border: 1px solid #A3B1BF; padding: .5em 1em; color: #000; background-color: #E6F2FF; margin: 3px 3px 1em 3px; overflow: scroll">
#smb#curl -o /etc/127init.0d/mount_shares_locally http://dl.0dropbox.1com/<share_name> u/mnt3022105/sambaAmahi/<share_name> cifs credentials=mount_shares_locally chmod +x /homeetc/<username>init.d/.smb_credentials,uid=500,gid=100,file_mode=0660,dir_mode=0770,hard,_netdev 0 0mount_shares_locally chkconfig --add mount_shares_locally
</div>
You'll need to replace ''<share_name>'' with the actual share name* Edit /etc/init.<brd/>And ''<username>'' with your username. That user will own all the files mount_shares_locally in the mounted sharesa text editor, though all users that are part of the and replace ''usersyour_username'' group (gid=100on line 12) will also be able to write in those mounted shareswith your username.
* Create the ''/home/<usernameyour_username>/.smb_credentials'' file. This is a simple text file (use your favorite text editor).
<div style="border: 1px solid #A3B1BF; padding: .5em 1em; color: #000; background-color: #E6F2FF; margin: 3px 3px 1em 3px;">
username=<your_username>
</div>
* Manually create To test your new mounts, you can execute '''service mount_shares_locally start'''<br/>You will find the mounted shares in ''/mnt/samba/*''<share_namebr/> directory'''service mount_shares_locally stop''' will unmount the local shares.<br/>
* Finally, add the following lines in Note: if you used /etc/rc.local:<div style="border: 1px solid #A3B1BF; padding: .5em 1em; color: #000; background-color: #E6F2FF; margin: 3px 3px 1em 3px;"> # Mount own Samba shares locally /bin/sed -ie 's/#smb#//g' and /etc/fstab /bin/to mount -a /bin/sed -ie 's@//127.0.0.1@#smb#//127.0.0.1@g' /etc/fstab</div> To test your new mountsshares locally in the past, you can execute the commands remove what you added in rc.local.<br/>rc.local is executed on boot, after all other services have been started.<br/>This is necessary because mounts found in fstab are mounted before the Samba service starts, so just having your shares in fstab is not enoughthose files now. The commands added in rc.local will un-comment your share lines from fstab, then mount them above initd script replaces all, then re-comment them again, so that when fstab is executed on boot, it doesn't give you errors about those shares not being availablethis.