<?xml version="1.0" encoding="UTF-8"?> <rss
version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
> <channel><title>gHacks Technology News &#124; Latest Tech News, Software And Tutorials &#187; automount</title> <atom:link href="http://www.ghacks.net/tag/automount/feed/" rel="self" type="application/rss+xml" /><link>http://www.ghacks.net</link> <description>A technology news blog covering software, mobile phones, gadgets, security, the Internet and other relevant areas.</description> <lastBuildDate>Sat, 11 Feb 2012 09:52:46 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.1</generator> <atom:link rel="hub" href="http://pubsubhubbub.appspot.com"/><atom:link rel="hub" href="http://superfeedr.com/hubbub"/> <item><title>Auto mounting a Samba share in Linux</title><link>http://www.ghacks.net/2009/04/19/auto-mounting-a-samba-share-in-linux/</link> <comments>http://www.ghacks.net/2009/04/19/auto-mounting-a-samba-share-in-linux/#comments</comments> <pubDate>Sun, 19 Apr 2009 17:30:32 +0000</pubDate> <dc:creator>Jack Wallen</dc:creator> <category><![CDATA[Advice]]></category> <category><![CDATA[Linux]]></category> <category><![CDATA[Networks]]></category> <category><![CDATA[Open Source]]></category> <category><![CDATA[Server]]></category> <category><![CDATA[Tutorials Advanced]]></category> <category><![CDATA[Tutorials Basic]]></category> <category><![CDATA[automount]]></category> <category><![CDATA[fstab]]></category> <category><![CDATA[samba]]></category> <category><![CDATA[samba share]]></category> <category><![CDATA[smbclient]]></category> <guid
isPermaLink="false">http://www.ghacks.net/2009/04/19/auto-mounting-a-samba-share-in-linux/</guid> <description><![CDATA[So you have that Samba server up and running and you can connect to it from Windows and Mac with ease. But when you turn to another Linux box that doesn&#8217;t have Konqueror, Nautilus, or Dolphin you can&#8217;t figure out the riddle of connecting. Or maybe you want to have this share mounted at boot [...]]]></description> <content:encoded><![CDATA[<p><a
href="http://www.ghacks.net/wp-content/uploads/2009/04/logo-samba.gif"><img
class="alignleft size-full wp-image-12179" src="http://www.ghacks.net/wp-content/uploads/2009/04/logo-samba.gif" alt="logo-samba" width="200" height="103" /></a>So you have that Samba server up and running and you can connect to it from Windows and Mac with ease. But when you turn to another Linux box that doesn&#8217;t have Konqueror, Nautilus, or Dolphin you can&#8217;t figure out the riddle of connecting. Or maybe you want to have this share mounted at boot time? How do you manage it?</p><p>From the command line of course. Yes there are plenty of GUI tools that will allow you to connect to a Samba share easily, but they don&#8217;t help you set up anything to connect automatically. For that you will need to employ a few command line tools. But once it is finished, your system will be seamless.</p><p><span
id="more-12178"></span><strong>What you will need</strong></p><p>First I am going to assume you have your Samba server set up and you are able to connect to it from other machines. Outside of that you will need only one piece of software installed on your Linux machine: smbclient. This will be in your distributions&#8217; repositories so just open up your Add/Remove Software utility, search for smbclient, select it, and click Apply.</p><p>Once smbclient is installed you are ready to go.</p><p><strong>A test</strong></p><p>Let&#8217;s first test to make sure your Linux box can see the Samba share. You will need either sudo or root access to do this. Issue the command:</p><p>smbclient //IP_TO_SAMBA_SERVER/SHARE_NAME -U USERNAME</p><p>Where:</p><ul><li>IP_TO_SAMBA_SERVER is the IP address of your Samba server.</li><li>SHARE_NAME is the share you want to connect to.</li><li>USERNAME is the user name you connect to the share with.</li></ul><p>If all is well you should see something like this:</p><p><em>Enter wallenmusic&#8217;s password: </em><em></em></p><p><em>Domain=[MONKEYPANTZ] OS=[Unix] Server=[Samba 3.2.5]</em></p><p><em>smb: \&gt;</em></p><p>If you see that you can type <em>quit </em>and then hit the Enter key to escape this prompt.</p><p><strong>Setup</strong></p><p>The first thing you need to do is create a directory to mount the Samba share to. I created the directory <strong>/data<em> </em></strong>with the command:</p><p><em>sudo mkdir /data</em></p><p>Once that directory is created you can then mount it with the command:</p><p>mount -t smbfs -o username=USERNAME //IP_TO_SAMBA_SERVER/SAMBA_SHARE /data</p><p>Where:</p><ul><li>IP_TO_SAMBA_SERVER is the IP address of your Samba server.</li><li>SHARE_NAME is the share you want to connect to.</li><li>USERNAME is the user name you connect to the share with.</li></ul><p>Now if you check the <strong>/data</strong> directory you should see a listing of the contents of the Samba share.</p><p><strong>Automount</strong></p><p>Let&#8217;s make that share automount at boot. This will require editing your <strong>/etc/fstab</strong> file, adding an entry for this Samba share. In this file (again you will have to have either root or sudo access) you will add a line like this:</p><p><code>//IP_TO_SAMBA_SERVER/SAMBA_SHARE  /data smbfs username=USERNAME,password=PASSWORD, 0 0</code></p><p>Where:</p><ul><li>IP_TO_SAMBA_SERVER is the IP address of your Samba server.</li><li>SHARE_NAME is the share you want to connect to.</li><li>USERNAME is the user name you connect to the share with.</li><li>PASSWORD is the password for the Samba user</li></ul><p>Once that entry is saved unmount the <strong>/data </strong>directory with the command:</p><p>umount /data</p><p>so you can test your automount entry.</p><p>Now, enter the command:</p><p>mount -a</p><p>If there are no errors you should see the contents of the Samba share in the <strong>/data</strong> directory.</p><p>That&#8217;s it. Congratulations, you now have an automounted Samba share on your Linux machine.</p> ]]></content:encoded> <wfw:commentRss>http://www.ghacks.net/2009/04/19/auto-mounting-a-samba-share-in-linux/feed/</wfw:commentRss> <slash:comments>5</slash:comments> </item> </channel> </rss>
