Changes

From Amahi Wiki
Jump to: navigation, search
2,103 bytes added ,  15:40, 6 September 2017
heading =WARNING|
message = This is recommended only for advanced users, proceed with caution.}}
==Purpose==
Mounting your Samba shares locally within your HDA is useful when you are using Greyhole, and want a process '''running within your HDA''' to write or data in any a way work with those files locallythat ends up in a Greyhole-managed share.  The reason is that Greyhole data should '''only be accessed through shares'', not directly onto the local file system, so mounting those shares locally is an easy way to work with Greyhole data safely. For example, if an app like a downloader gets files from the internet and you want those files to be in a Greyhole-managed share, it has to place them into the share, not directly into the operating system, or Greyhole otherwise cannot handle them.  __TOC__
== Download and Setup ==
* As '''root'''(or precede commands with <code>sudo</code>), install the mount_shares_locally initd script: === Amahi 10 or greater (Fedora) === dnf install cifs-utils cp /usr/share/hda-ctl/mount_shares_locally /etc/init.d chmod +x /etc/init.d/mount_shares_locally chkconfig --add mount_shares_locally
=== On Amahi 7 /8/9 (Fedora 19) ===
yum install cifs-utils
curl -o /etc/init.d/mount_shares_locally <nowiki>http://dl.amahi.org</nowiki>/mount_shares_locally.fedora
chkconfig --add mount_shares_locally
::'''NOTE:''' <code>yum</code> (deprecated) has been replaced with <code>dnf</code> as the package manager for Fedora 23 or greater. === On Amahi 6 (Ubuntu 12.04) ===
sudo apt-get install cifs-utils curl
sudo curl -o /etc/init.d/mount_shares_locally <nowiki>http://dl.amahi.org/mount_shares_locally.ubuntu</nowiki>
== Configuration ==
* Edit As '''root''', edit ''/etc/init.d/mount_shares_locally (as user root) in a text editor, and replace ''your_username**Replace ''"***set this string to your username!***"'' (on line 12) with your username. Example '''For example: username="amahi";*The script may require the MariaDB root password be changed: **Please see [[Database Root Password]] for the appropriate login password.**Also if you changed the MariaDB root password on your own. :<blockquote>Change ''hda''(line 25) to the appropriate password if needed: vi <pre>mysql -u root -p hda -e "select name from shares" hda_production | grep -v "^name$" | xargs -d "\n" mkdir -p</etcpre></init.d/mount_shares_locallyblockquote>
* Create the ''/home/your_username/.smb_credentials'' file. This is a simple text file (use your favorite text editor).
vi /home/your_username/.smb_credentials
ls -al /home/your_username/.smb_credentials
:'''NOTE:''' your_username and your_password in the .smb_credentials file needs to be the original username (1st Admin User) and password you created when you installed the OS('''NOT''' ''root'').
*To test your new mounts, you can execute as root user:
:
:<u>Mount</u>
systemctl daemon-reload
service mount_shares_locally start
== Where everything is mounted ==
You will find the mounted shares in ''/mnt/samba/*''and should look something like this:<br/><pre>drwxrwx--- 2 your_username users 0 Aug 9 23:31 Booksdrwxrwx--- 2 your_username users 0 Aug 9 23:31 Docsdrwxrwx--- 2 your_username users 0 Mar 2 16:15 Moviesdrwxrwx--- 2 your_username users 0 Aug 9 23:31 Musicdrwxrwx--- 2 your_username users 0 Aug 9 23:31 Picturesdrwxrwx--- 2 your_username users 0 Aug 9 23:31 Publicdrwxrwx--- 2 your_username users 0 Jul 29 02:02 TVdrwxrwx--- 2 your_username users 0 Aug 9 23:31 Videos</pre>For example, your "Pictures" share would be located at '''/mnt/samba/Pictures'''. When working with files on the HDA, access them via this share and <u>NOT</u> the traditional /var/hda/files/pictures location.
For example== Uninstall==To uninstall ''mount_shares_locally'', your "Pictures" share would be located at do the following as '''/mnt/samba/Picturesroot''': service mount_shares_locally stop rm -rf /etc/init. d/mount_shares_locally When working with files on the HDA, access them via this share and <u>NOT<rm -rf /home/u> the traditional your_username/var.smb_credentials chkconfig --del mount_shares_locally rm -rf /hdamnt/filessamba/pictures location*Now if you choose to reinstall later, your machine will be in a clean state.
==Revise mount_shares_locally ==
with
mysql -u root -phda p -e "select comment from shares" hda_production | grep -v "^comment$" | xargs -d "\n" mkdir -p  '''WARNING:''' Please see [[Database Root Password]] for the appropriate login password.
==Troubleshooting==
12,424

edits