Difference between revisions of "SharingToNAS"
From Amahi Wiki
(13 intermediate revisions by 3 users not shown) | |||
Line 4: | Line 4: | ||
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 -". | 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: | + | * We need to create a credential file to mount on startup: |
− | *Add the following lines | + | |
+ | <code>nano /root/.smbcredentials</code> | ||
+ | |||
+ | *Add the following lines. You must change NAS_username and NAS_password to the correct user name and password for the NAS to connect to: | ||
+ | |||
+ | <code>username=NAS_username</code> | ||
+ | <code>password=NAS_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: | ||
− | + | chmod 700 /root/.smbcredentials | |
− | * Let's back up our fstab: | + | * Let's back up our fstab: |
− | * If needed you may return to the original this way: | + | cp /etc/fstab /etc/fstab_old |
+ | * If needed you may return to the original this way: | ||
+ | mv /etc/fstab_old /etc/fstab | ||
* Now we edit fstab: | * Now we edit fstab: | ||
− | + | nano /etc/fstab | |
+ | |||
+ | * Add this line at the end (all in one line): | ||
+ | |||
+ | //server/share /var/hda/files/music cifs credentials=/root | ||
+ | /.smbcredentials,iocharset=utf8,file_mode=0777,dir_mode=0777 0 0 | ||
− | * | + | * It may be the case that you do not know exacly the name of the NAS server or the share name as it exports it out. To find that, you can use this from the command line: |
+ | # smbtree | ||
+ | * If the share name has spaces, escape them with \040 (wtf? yeah in octal \040), e.g. | ||
− | // | + | //server/My\040Documents/My\040Music |
* Finally, test your settings to make sure they work: | * Finally, test your settings to make sure they work: | ||
− | + | mount -a |
Latest revision as of 19:43, 12 May 2010
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:
nano /root/.smbcredentials
- Add the following lines. You must change NAS_username and NAS_password to the correct user name and password for the NAS to connect to:
username=NAS_username
password=NAS_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:
chmod 700 /root/.smbcredentials
- Let's back up our fstab:
cp /etc/fstab /etc/fstab_old
- If needed you may return to the original this way:
mv /etc/fstab_old /etc/fstab
- Now we edit fstab:
nano /etc/fstab
- Add this line at the end (all in one line):
//server/share /var/hda/files/music cifs credentials=/root /.smbcredentials,iocharset=utf8,file_mode=0777,dir_mode=0777 0 0
- It may be the case that you do not know exacly the name of the NAS server or the share name as it exports it out. To find that, you can use this from the command line:
# smbtree
- If the share name has spaces, escape them with \040 (wtf? yeah in octal \040), e.g.
//server/My\040Documents/My\040Music
- Finally, test your settings to make sure they work:
mount -a