Difference between revisions of "SharingToNAS"

From Amahi Wiki
Jump to: navigation, search
Line 5: Line 5:
  
 
* We need to create a credential file to mount on startup:  
 
* We need to create a credential file to mount on startup:  
sudo nano /root/.smbcredentials
+
<code>sudo nano /root/.smbcredentials</code>
 
*Add the following lines: (You must change hda_username and hda_password to the correct user name and password for the hda to connect to):  
 
*Add the following lines: (You must change hda_username and hda_password to the correct user name and password for the hda to connect to):  
  
username=hda_username
+
<code>username=hda_username
password=hda_password
+
password=hda_password</code>
  
 
* Save the file by hitting ctrl+x, type "y" to save the buffer, and <enter> to exit.
 
* Save the file by hitting ctrl+x, type "y" to save the buffer, and <enter> to exit.
 
* Now, change the permissions of the file so only root can read and edit it:  
 
* Now, change the permissions of the file so only root can read and edit it:  
  
sudo chmod 700 /root/.smbcredentials
+
<code>sudo chmod 700 /root/.smbcredentials</code>
  
* Let's back up our fstab:  
+
* Let's back up our fstab: sudo cp /etc/fstab /etc/fstab_old
sudo cp /etc/fstab /etc/fstab_old
+
** If needed you may return to the original this way:  
* If needed you may return to the original this way:  
+
<code>sudo mv /etc/fstab_old /etc/fstab</code>
sudo mv /etc/fstab_old /etc/fstab  
 
 
* Now we edit fstab:  
 
* Now we edit fstab:  
  
sudo nano /etc/fstab
+
<code>sudo nano /etc/fstab</code>
  
 
* Add this line at the end:  
 
* Add this line at the end:  
  
//NAS-address/share /var/hda/files cifs credentials=/root/.smbcredentials,iocharset=utf8,file_mode=0777,dir_mode=0777 0 0  
+
<code>//hda/music /media/music cifs credentials=/root/.smbcredentials,iocharset=utf8,file_mode=0777,dir_mode=0777 0 0</code>
  
 
* Finally, test your settings to make sure they work:  
 
* Finally, test your settings to make sure they work:  
  
sudo mount -a
+
<code>sudo mount -a</code>

Revision as of 18:36, 2 August 2009

Store you HDA shares on a NAS

I like to keep my mass storage on a NAS, but I want the stock shares on my HDA to work as designed. the following is my method for mounting my NAS share as my "/var/hda/files" directory. I chose that spot for convenience but you can put it anywhere you would like. I used the "Connecting to a Server by Mounting your HDA" as a template so the credit has to go to it's author. Here we go...

Everthing I did below is done in putty from a cli interface, Install download putty and enter you hda name or address in the address line. Login as root or "su -".

  • We need to create a credential file to mount on startup:

sudo nano /root/.smbcredentials

  • Add the following lines: (You must change hda_username and hda_password to the correct user name and password for the hda to connect to):

username=hda_username password=hda_password

  • Save the file by hitting ctrl+x, type "y" to save the buffer, and <enter> to exit.
  • Now, change the permissions of the file so only root can read and edit it:

sudo chmod 700 /root/.smbcredentials

  • Let's back up our fstab: sudo cp /etc/fstab /etc/fstab_old
    • If needed you may return to the original this way:

sudo mv /etc/fstab_old /etc/fstab

  • Now we edit fstab:

sudo nano /etc/fstab

  • Add this line at the end:

//hda/music /media/music cifs credentials=/root/.smbcredentials,iocharset=utf8,file_mode=0777,dir_mode=0777 0 0

  • Finally, test your settings to make sure they work:

sudo mount -a