Line 1: |
Line 1: |
− | {{Needs_review}} | + | {{Level|medium}} |
− | {{Incomplete}}
| + | |
− | This page describes a method you can use to automatically mount a network share (samba/cifs, nfs, etc) in a directory on your SME server each time you boot up.
| + | [[File:Exemple.jpg|thumb]]=== Assumptions=== |
| | | |
| This Howto assumes: | | This Howto assumes: |
− | * You will be mouning your shares into the '''info''' ibay
| + | * You will be mounting your shares into the '''info''' ibay |
− | * Your samba/cifs server is named '''nas01'''
| + | * You will be using '''cifs''' (smbfs or nfs should be similar) |
− | * You want to access two shares on nas01: '''share1''' and '''share2'''
| + | * Your cifs server is named '''nas01''' |
− | * You can successfully open \\nas01\share1 and \\nas01\share2 using the username '''joe''' and the password '''theplumber'''
| + | * You want to access two shares on nas01: '''share1''' and '''share2''' |
| + | * You can successfully open \\nas01\share1 and \\nas01\share2 from windows using |
| + | ** username: '''joe''' |
| + | ** password: '''theplumber''' |
| | | |
− | == Create the local mount points == | + | === Create the local mount points === |
| First create the directories that will be used to host the mounted data. These directories should remain empty at all times. | | First create the directories that will be used to host the mounted data. These directories should remain empty at all times. |
| | | |
Line 16: |
Line 19: |
| mkdir share2 | | mkdir share2 |
| | | |
− | == Create a password file == | + | === Create a password file === |
| In order for your SME server to mount a network share, it needs to know a valid username and password on the intended network server. | | In order for your SME server to mount a network share, it needs to know a valid username and password on the intended network server. |
| | | |
Line 28: |
Line 31: |
| chmod 400 /root/.passwd/nas01 | | chmod 400 /root/.passwd/nas01 |
| | | |
− | == Modify the SME '''local''' event == | + | === Modify the SME '''local''' event === |
| You can schedule a program to run whenever your system boots by adding it to the e-smith '''local''' event. This event is executed by SME after all other boot processes have run, so the network, USB subsystem, etc should all be initialized and available. | | You can schedule a program to run whenever your system boots by adding it to the e-smith '''local''' event. This event is executed by SME after all other boot processes have run, so the network, USB subsystem, etc should all be initialized and available. |
| | | |
Line 40: |
Line 43: |
| chmod 755 S95netshares | | chmod 755 S95netshares |
| | | |
− | == Mounting == | + | === Mounting === |
| You can test your new mount script by running it: | | You can test your new mount script by running it: |
− | /etc/e-smith/events/local/S95netshare | + | /etc/e-smith/events/local/S95netshares |
| | | |
| Or by executing the SME '''local''' event: | | Or by executing the SME '''local''' event: |
Line 49: |
Line 52: |
| Or by rebooting | | Or by rebooting |
| | | |
− | == Un-Mounting == | + | === Un-Mounting === |
| You can un-mount your network shares using | | You can un-mount your network shares using |
| /etc/rc.d/init.d/netfs stop | | /etc/rc.d/init.d/netfs stop |
Line 55: |
Line 58: |
| Or by shutting down or rebooting | | Or by shutting down or rebooting |
| | | |
− | == Testing == | + | === Testing === |
− | If all goes well, you should now be able to "see" your network data, and verify your network mounts, using one or more of these commands: | + | If all goes well, you should now be able to verify that your new script works as expected using one of these commands: |
| {| border="1" cellpadding="5" cellspacing="0" | | {| border="1" cellpadding="5" cellspacing="0" |
| | <tt>df -h</tt> | | | <tt>df -h</tt> |
Line 69: |
Line 72: |
| |} | | |} |
| | | |
− | == Accessing your Data == | + | === Accessing your Data === |
| + | Finally, you should be able to access your data in any of the following ways: |
| + | |
| {| border="1" cellpadding="5" cellspacing="0" | | {| border="1" cellpadding="5" cellspacing="0" |
| | <tt>ls /home/e-smith/files/ibays/info/html/share1</tt> | | | <tt>ls /home/e-smith/files/ibays/info/html/share1</tt> |
Line 85: |
Line 90: |
| |} | | |} |
| | | |
− | == Notes and Warnings == | + | === Notes and Warnings === |
− | # The method describes gives access to //nas01/share1 and //nas02/share2 using the username and password placed into /root/.passwd/nas01. Once successfully mounted, this means that anyone who can browse to the '''info''' ibay will be able to access your data. | + | # The method described gives access to //nas01/share1 and //nas01/share2 using the username and password placed into /root/.passwd/nas01. Once successfully mounted, this means that anyone who can browse to the '''info''' ibay will be able to access your data. Make sure this is what you want! |
− | # If you don't include <tt>/etc/rc.d/init.d/netfs start</tt> in your script, your system will lock up every time you shutdown. This is (in my opinion) a bug in CentOS (and hence will not be addressed by the SME developers). See [http://bugs.contribs.org/show_bug.cgi?id=4086 Bug 4086] for more information. | + | # If you don't include <tt>/etc/rc.d/init.d/netfs start</tt> in your script (S95netshares), your system will lock up every time you shutdown. This is a bug in CentOS (and hence will not be addressed by the SME developers). See [http://bugs.contribs.org/show_bug.cgi?id=4086 Bug 4086] for more information. |
− | | + | # Combined with [[DAV]] this procedure would allow remote read-write access using [http://www.webdav.org/ WebDAV] to network shares on internal servers behind your SME server. |
| + | ---- |
| [[Category:Howto]] | | [[Category:Howto]] |
| + | [[Category:Administration:Storage]] |
| + | [[Category:Administration:File and Directory Access]] |