<?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 &#187; fstab</title>
	<atom:link href="http://www.ghacks.net/tag/fstab/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ghacks.net</link>
	<description>A technology blog covering software, mobile phones, gadgets, security, the Internet and other relevant areas.</description>
	<lastBuildDate>Wed, 25 Nov 2009 15:55:11 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Add a second drive to your Ubuntu server</title>
		<link>http://www.ghacks.net/2009/09/10/add-a-second-drive-to-your-ubuntu-server/</link>
		<comments>http://www.ghacks.net/2009/09/10/add-a-second-drive-to-your-ubuntu-server/#comments</comments>
		<pubDate>Thu, 10 Sep 2009 19:20:12 +0000</pubDate>
		<dc:creator>Jack Wallen</dc:creator>
				<category><![CDATA[Advice]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[Tutorials Advanced]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[ext3 file system]]></category>
		<category><![CDATA[fstab]]></category>
		<category><![CDATA[mount drives]]></category>
		<category><![CDATA[new linux drive]]></category>
		<category><![CDATA[ubuntu server]]></category>

		<guid isPermaLink="false">http://www.ghacks.net/?p=16193</guid>
		<description><![CDATA[You have your Ubuntu Server up and running (with the help of &#8220;Installing Ubuntu Server 9.04&#8220;) but you&#8217;re afraid you&#8217;ll run out of room on your drive. To solve this problem you have installed a new hard drive, but because this is a GUI-less server you do not have access to the user-friendly GUI tools [...]]]></description>
			<content:encoded><![CDATA[<p>You have your Ubuntu Server up and running (with the help of &#8220;<a title="Installing Ubuntu Server 9.04" href="http://www.ghacks.net/2009/09/03/installing-ubuntu-server-9-04/" target="_blank">Installing Ubuntu Server 9.04</a>&#8220;) but you&#8217;re afraid you&#8217;ll run out of room on your drive. To solve this problem you have installed a new hard drive, but because this is a GUI-less server you do not have access to the user-friendly GUI tools that make this job easy. So you&#8217;re going to have to install this drive with the help of the command line.</p>
<p>GASP!</p>
<p>Never fear, it&#8217;s not that hard. Just a few commands and you&#8217;ll be up and running with your new hard drive installed on your server. This article will assume the physical drive is already installed on your machine.</p>
<p><span id="more-16193"></span>I am going to make a couple of assumptions here, for the sake of simplicity for this article. The first assumption is that the new drive will be mounted to the directory <strong>/data</strong>. The next assumption is that you want this directory to be both readable andÂ writableÂ by all users on the system. Another assumption is that you will want the drive to be formatted with the ext3 file system with just one partition. Finally I will assume you want this drive to be automatically mounted upon boot of the system.</p>
<p>With that out of the way, let&#8217;s get down to business.</p>
<p>Once you boot the machine with the new drive log into the console and issue the command:</p>
<p><span style="background-color: #ffffff">dmesg</span></p>
<p>Near the bottom of the output you should see where the disk is located. it will beÂ <span style="background-color: #ffffff">something like:</span></p>
<p><em>/dev/sdb</em></p>
<p>So let&#8217;s assume it is on <strong>/dev/sdb.</strong></p>
<p>If you can&#8217;t figure it out where the drive is located Â with <em>dmesg</em> issue the command:</p>
<p><em>sudo fdisk -l</em></p>
<p>The above command will report something like:</p>
<p><code>/dev/sda1   *           1       18709   150280011   83  Linux<br />
/dev/sda2           18710       19457     6008310    5  Extended<br />
/dev/sda5           18710       19457     6008278+  82  Linux swap / Solaris</code></p>
<p>But will include a listing for your new drive. If you only see listings for <strong>/dev/sda*</strong> then your new drive has not been recognized and there is a problem with the physical installation.</p>
<p>Once you know where your drive is located (again we&#8217;ll use <strong>/dev/sdb</strong> for our example)Â it&#8217;s time to create a new directory where this drive will be mounted. We are mounting our drive to the directory <strong>/data </strong><span style="background-color: #ffffff">so we&#8217;ll createÂ this directory with the following command:</span></p>
<p><em>sudo mkdir /data</em></p>
<p>Now let&#8217;s make it available to all users:</p>
<p><em>sudo chmod -R 777 /data</em></p>
<p>With a place to mount the drive, it&#8217;s time to format the new drive. The formatting will be done with the command:</p>
<p><em>sudo mkfs.ext3 /dev/sdb</em></p>
<p>When this is complete you are ready to mount the drive. Before you edit fstab entry (so the drive will be automatically mounted) make sure it can be successfully mountedÂ <span style="background-color: #ffffff">with the command:</span></p>
<p><em>sudo mount /dev/sdb /data</em></p>
<p>If this is successful let&#8217;s create an entry in <strong>/etc/fstab</strong>. open thatÂ <span style="background-color: #ffffff">file with the command</span></p>
<p><em>sudo nano /etc/fstab</em></p>
<p>Now add the following entry at the end of that file:</p>
<p><code>/dev/sdb /data  ext3 defaults 0 0</code></p>
<p>Once you save that file, mount the drive (without having to reboot) with the command:</p>
<p><em>sudo mount -a</em></p>
<p>To make sure the drive mounted successfully issue the command:</p>
<p><em>df</em></p>
<p>The above should include in the report:</p>
<p><em>/dev/sdb Â  /data</em></p>
<p>If that&#8217;s the case, success! You can run one file test by trying to write a file to the new drive with the command:</p>
<p><em>touch /data/test</em></p>
<p>If you can write that file all is well.</p>
<p><strong>Final thoughts</strong></p>
<p>Yes it is a bit more complicated than adding a new drive when you have GUI tools available, but it&#8217;s not anything that can&#8217;t be accomplished by the average user. If you are not afraid of the command line, you can add a second drive in Ubuntu with ease.</p>

	Tags: <a href="http://www.ghacks.net/tag/ext3-file-system/" title="ext3 file system" rel="tag">ext3 file system</a>, <a href="http://www.ghacks.net/tag/fstab/" title="fstab" rel="tag">fstab</a>, <a href="http://www.ghacks.net/tag/mount-drives/" title="mount drives" rel="tag">mount drives</a>, <a href="http://www.ghacks.net/tag/new-linux-drive/" title="new linux drive" rel="tag">new linux drive</a>, <a href="http://www.ghacks.net/tag/ubuntu-server/" title="ubuntu server" rel="tag">ubuntu server</a><br />

	<h4>Related posts</h4>
	<ul class="st-related-posts">
	<li><a href="http://www.ghacks.net/2009/04/02/which-ubuntu-derivative-is-right-for-you/" title="Which Ubuntu Derivative Is Right For You? (April 2, 2009)">Which Ubuntu Derivative Is Right For You?</a> (16)</li>
	<li><a href="http://www.ghacks.net/2009/10/03/use-this-iptables-script-for-webmail-server-security/" title="Use this iptables script for Web/Mail server security (October 3, 2009)">Use this iptables script for Web/Mail server security</a> (2)</li>
	<li><a href="http://www.ghacks.net/2009/01/03/understanding-linux-etcfstab/" title="Understanding Linux /etc/fstab (January 3, 2009)">Understanding Linux /etc/fstab</a> (7)</li>
	<li><a href="http://www.ghacks.net/2009/04/06/keep-logged-in-users-informed-with-motd/" title="Keep logged in users informed with motd (April 6, 2009)">Keep logged in users informed with motd</a> (0)</li>
	<li><a href="http://www.ghacks.net/2009/09/03/installing-ubuntu-server-9-04/" title="Installing Ubuntu Server 9.04 (September 3, 2009)">Installing Ubuntu Server 9.04</a> (20)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.ghacks.net/2009/09/10/add-a-second-drive-to-your-ubuntu-server/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Install VirtualBox with USB support</title>
		<link>http://www.ghacks.net/2009/08/01/install-virtualbox-with-usb-support/</link>
		<comments>http://www.ghacks.net/2009/08/01/install-virtualbox-with-usb-support/#comments</comments>
		<pubDate>Sat, 01 Aug 2009 18:34:15 +0000</pubDate>
		<dc:creator>Jack Wallen</dc:creator>
				<category><![CDATA[Advice]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Tutorials Advanced]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[fstab]]></category>
		<category><![CDATA[usb]]></category>
		<category><![CDATA[usb support]]></category>
		<category><![CDATA[virtual box]]></category>

		<guid isPermaLink="false">http://www.ghacks.net/?p=14956</guid>
		<description><![CDATA[If you&#8217;ve installed VirtualBox as instructed in my tutorial &#8220;Install and configure VirtualBox for virtual OSes&#8221; you most likely have discovered that the open source edition of VirtualBox does not have USB support. In fact there are a few other features the open source edition does not offer that the closed-source edition does (such as [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;ve installed VirtualBox as instructed in my tutorial &#8220;<a title="VirtualBox" href="http://www.ghacks.net/2009/06/14/installing-and-configuring-virtualbox-for-virtual-oses/" target="_blank">Install and configure VirtualBox for virtual OSes</a>&#8221; you most likely have discovered that the open source edition of VirtualBox does not have USB support. In fact there are a few other features the open source edition does not offer that the closed-source edition does (such as offering the Remote Display Protocol so you can connect to a virtual machine remotely). But to get these features you will have to uninstall your current VirtualBox OSE installation, install the closed source version, and then configure your set up to allow USB support. It&#8217;s not difficult so pretty much anyone can undertake this.  In this article you will see how to uninstall VirtualBox OSE, install VirtualBox, and configure VirtualBox to allow USB support. For the purposes of this article, I will using a Ubuntu 9.04 installation to make things easy. NOTE: If you have virtual machines installed you will lose the data on those VMs.<br />
<span id="more-14956"></span></p>
<p><strong>Remove VirtualBox OSE</strong></p>
<p>This is the easiest part of the tutorial. All you need to do is open up a terminal window and issue the command:</p>
<p><code>sudo apt-get autoremove virtualbox-ose</code></p>
<p>Once the OSE version has been removed it is time to install the closed source version of VirtualBox.</p>
<p><strong>Installing closed source VirtualBox</strong></p>
<p>The first thing to do is to add the proper sources to your <strong>/etc/apt/sources.list</strong> file. Open up that file, with your favorite editor, and add the following line to the end of that file:</p>
<p><code>deb http://download.virtualbox.org/virtualbox/debian jaunty non-free</code></p>
<p>Now save the <a title="VirtualBox key" href="http://download.virtualbox.org/virtualbox/debian/sun_vbox.asc" target="_blank">VirtualBox repository key</a> on your machine (for the sake of simplicity place it in <strong>~/Downloads</strong>) and issue the following command:</p>
<p><code>sudo apt-key add ~/Downloads/sun_vbox.asc</code></p>
<p>which will add the repo key to your system. Before you run the install update apt with the command:</p>
<p><code>sudo apt-get update</code></p>
<p>Now you can install the closed source version of VirtualBox with the command:</p>
<p><code>sudo apt-get install virtualbox-2.2</code></p>
<p>During the installation you will also have to OK the compilation of the proper kernel module. If you do not do this you may not be able to create any VMs.</p>
<p>The last step for the installation is to add your user to the vboxusers group. Do this with the following command:</p>
<p><code>sudo gpasswd -a USERNAME vboxusers</code></p>
<p>Where USERNAME is your login. You will be prompted for your username.</p>
<p><strong>Configure USB</strong></p>
<p>Now it&#8217;s time to configure the system to allow USB support. You have to get the user ID of the vboxusers group. To do this issue the following command:</p>
<p><code>grep vboxusers /etc/group</code></p>
<p>which will report something like:</p>
<p><code>vboxusers:x:123:</code></p>
<p>What you need to now do is add a line to the <strong>/etc/fstab </strong>file. This line will be (if we stick with the user ID report you see above):</p>
<p><code>none /proc/bus/usb usbfs devgid=123,devmode=664 0 0</code></p>
<p>With that file saved you are ready to reboot and start up VirtualBox with USB support.</p>
<p><strong>Final thoughts</strong></p>
<p>There are a lot of reasons why you would want to have USB support added to VirtualBox. For those iPhone owners out there it will give you a means to administer your phone without having to have a separate machine (or dual boot) in order to do so. This also greatly expands the capabilities of VirtualBox. The only downfall is you are giving up the open source version in order to gain USB support. For many this will be a worth wile trade-off. For others, giving over to closed sourced software isn&#8217;t worth having USB support. It would be nice, however, if Sun would open source the USB supported version.</p>

	Tags: <a href="http://www.ghacks.net/tag/fstab/" title="fstab" rel="tag">fstab</a>, <a href="http://www.ghacks.net/tag/usb/" title="usb" rel="tag">usb</a>, <a href="http://www.ghacks.net/tag/usb-support/" title="usb support" rel="tag">usb support</a>, <a href="http://www.ghacks.net/tag/virtual-box/" title="virtual box" rel="tag">virtual box</a><br />

	<h4>Related posts</h4>
	<ul class="st-related-posts">
	<li><a href="http://www.ghacks.net/2007/06/15/use-pstart-to-access-your-portable-devices/" title="Use PStart to access your portable devices (June 15, 2007)">Use PStart to access your portable devices</a> (3)</li>
	<li><a href="http://www.ghacks.net/2009/03/05/usb-port-protection/" title="USB Port Protection (March 5, 2009)">USB Port Protection</a> (7)</li>
	<li><a href="http://www.ghacks.net/2009/03/08/usb-flashdrive-benchmark/" title="USB Flashdrive Benchmark (March 8, 2009)">USB Flashdrive Benchmark</a> (7)</li>
	<li><a href="http://www.ghacks.net/2009/08/19/usb-flash-drives-cleaner/" title="USB Flash Drives Cleaner (August 19, 2009)">USB Flash Drives Cleaner</a> (1)</li>
	<li><a href="http://www.ghacks.net/2009/04/03/usb-flash-drive-write-protection/" title="USB Flash Drive Write Protection (April 3, 2009)">USB Flash Drive Write Protection</a> (12)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.ghacks.net/2009/08/01/install-virtualbox-with-usb-support/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
		<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>

	Tags: <a href="http://www.ghacks.net/tag/automount/" title="automount" rel="tag">automount</a>, <a href="http://www.ghacks.net/tag/fstab/" title="fstab" rel="tag">fstab</a>, <a href="http://www.ghacks.net/tag/linux/" title="Linux" rel="tag">Linux</a>, <a href="http://www.ghacks.net/tag/samba/" title="samba" rel="tag">samba</a>, <a href="http://www.ghacks.net/tag/samba-share/" title="samba share" rel="tag">samba share</a>, <a href="http://www.ghacks.net/tag/smbclient/" title="smbclient" rel="tag">smbclient</a><br />

	<h4>Related posts</h4>
	<ul class="st-related-posts">
	<li><a href="http://www.ghacks.net/2009/01/03/understanding-linux-etcfstab/" title="Understanding Linux /etc/fstab (January 3, 2009)">Understanding Linux /etc/fstab</a> (7)</li>
	<li><a href="http://www.ghacks.net/2009/02/06/get-to-know-linux-understanding-smbconf/" title="Get To Know Linux: Understanding smb.conf (February 6, 2009)">Get To Know Linux: Understanding smb.conf</a> (3)</li>
	<li><a href="http://www.ghacks.net/2009/05/03/connecting-linux-to-a-bubba-2/" title="Connecting Linux to a Bubba 2 (May 3, 2009)">Connecting Linux to a Bubba 2</a> (4)</li>
	<li><a href="http://www.ghacks.net/2009/11/04/connect-to-your-samba-server-from-linux/" title="Connect to your Samba server from Linux (November 4, 2009)">Connect to your Samba server from Linux</a> (4)</li>
	<li><a href="http://www.ghacks.net/2008/02/07/yoggie-pico-personal-mobile-security-computer/" title="Yoggie PICO Personal Mobile Security Computer (February 7, 2008)">Yoggie PICO Personal Mobile Security Computer</a> (3)</li>
</ul>

]]></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>
		<item>
		<title>Understanding Linux /etc/fstab</title>
		<link>http://www.ghacks.net/2009/01/03/understanding-linux-etcfstab/</link>
		<comments>http://www.ghacks.net/2009/01/03/understanding-linux-etcfstab/#comments</comments>
		<pubDate>Sat, 03 Jan 2009 16:53:12 +0000</pubDate>
		<dc:creator>Jack Wallen</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Tutorials Advanced]]></category>
		<category><![CDATA[file system]]></category>
		<category><![CDATA[fstab]]></category>
		<category><![CDATA[ipod on linux]]></category>
		<category><![CDATA[mounting device]]></category>
		<category><![CDATA[thumbdrive]]></category>

		<guid isPermaLink="false">http://www.ghacks.net/?p=9590</guid>
		<description><![CDATA[The fstab file has a very key mission for your Linux system. What it does is map devices to directories so those devices can be used. If you plug in an external drive or a device like such as an iPod you are going to have to take advantage of fstab. In this article you [...]]]></description>
			<content:encoded><![CDATA[<p>The fstab file has a very key mission for your Linux system. What it does is map devices to directories so those devices can be used. If you plug in an external drive or a device like such as an iPod you are going to have to take advantage of fstab. In this article you will learn how to create a proper fstab entry to make mounting devices simple.</p>
<p><span id="more-9590"></span><strong>What fstab does</strong></p>
<p>As said earlier, the /etc/fstab file is a means to map devices to locations so the devices can be used. Typically when you plug in an external device that device will show up as a device in the special directory /dev. Most externally connected usb devices will show up as a variation of /dev/sda. But if you try to access that device through the /dev directory you&#8217;ll have no luck. Instead you have to map the device to a regular, mountable directory so the device can be used. Without the fstab file only the root user would be able to do the mounting and the mount command would always be something like &#8220;mount /dev/sda2 /media/mp3&#8243;. When the root user mounts a device in this way only the root user will have write access to the device. In the case of an mp3 player that means only the root user will be able to add music to the device. That&#8217;s where fstab helps out. You can create an fstab entry that will allow standard users to mount and unmount devices as well as write to those mounted devices.</p>
<p><strong>Typical fstab entry</strong></p>
<p>The structure of an fstab entry is:</p>
<p><code>deviceÂ Â  mounting_directoryÂ Â Â Â Â  filesystem_typeÂ Â Â Â  optionsÂ Â Â  0 0</code></p>
<p>The device will always be assigned once you have plugged in what it is you are going to mount. The easiest way to find out what has been assigned is to open up a command terminal and enter the command <em>dmesg. </em>Using <em>dmesg </em>will require you to keep issuing the command until the kernel has recognized the device. Or you could enter the command <em>tail -f /var/log/messages</em> (must be run as root). Using the <em>tail</em> command will keep follow the output of the <strong>messages</strong> log file which will give you all the information you need.</p>
<p>With the understanding of where you get the device location in hand let&#8217;s move on to the <strong>mounting_directory<em> </em></strong>entry. This is quite simple: Create a directory, as a sub directory under <em>/media</em> named after the device you want to mount. For instance, if you are going to mount a USB thumbdrive you can create a directory called <em>/media/thumb</em> or if you need to mount your iPod you can create a directory called <em>/media/ipod</em>. This directory is where you will be mounting your device. When the device is mounted there you will go to that directory to manage the devices&#8217; data.</p>
<p>The next section, filesystem_type, describes the type of file system you wanting to mount. Linux supports quite a large selection of file systems such as: cramfs, efs, ext2, ext3, vfat, fat, nfs, udf, sysv, smbfs, minix, msdos, reiserfs, hpfs, hfs, iso9660, and many more.Â  There is also the <em>auto</em> file system type which means the kernel will discover the type.</p>
<p>The <em>options</em> section of fstab is where things start to grow a bit more complex. I will explain the more common options:</p>
<ul>
<li>auto/noauto: The <em>auto</em> option is default and means the device will be mounted automatically. The <em>noauto</em> options means the device will not be mounted automatically. By &#8220;automatically&#8221; I mean either at boot or when the command <em>mount -a</em> is issued.</li>
<li>user/nouser: The <em>user </em>option allows all standard (and root) users to mount the device. The <em>nouser</em> options only allows the root user to mount the device.</li>
<li>ro: Mount the device in read only mode.</li>
<li>rw: Mount the device in read/write mode.</li>
<li>sync/async: The <em>sync</em> options writes data to the device on the fly (as soon as a command is issued) whereas the <em>async</em> option writes data later.</li>
<li>suid: This allos suid and sgid bits to be effective on the mounted file system.</li>
<li>defaults: Use all default options (rw, suid, dev, exec, auto, nouser, and async)</li>
</ul>
<p>The final section is actually the dump/fsck section. Basically if you set these bits to 0 (off) the mounted devices will not be checked by either dump or fsck. You will rarely, if ever, need anything but zeros here.</p>
<p><strong>Final Thoughts</strong></p>
<p>So there it is. The basics of the oft-confusing <strong>fstab</strong> file. Later we will get into some sticker <strong>fstab</strong> issues, but for now you should have a pretty sound understanding of how <strong>fstab</strong> works.</p>

	Tags: <a href="http://www.ghacks.net/tag/file-system/" title="file system" rel="tag">file system</a>, <a href="http://www.ghacks.net/tag/fstab/" title="fstab" rel="tag">fstab</a>, <a href="http://www.ghacks.net/tag/ipod-on-linux/" title="ipod on linux" rel="tag">ipod on linux</a>, <a href="http://www.ghacks.net/tag/linux/" title="Linux" rel="tag">Linux</a>, <a href="http://www.ghacks.net/tag/mounting-device/" title="mounting device" rel="tag">mounting device</a>, <a href="http://www.ghacks.net/tag/thumbdrive/" title="thumbdrive" rel="tag">thumbdrive</a><br />

	<h4>Related posts</h4>
	<ul class="st-related-posts">
	<li><a href="http://www.ghacks.net/2009/04/19/auto-mounting-a-samba-share-in-linux/" title="Auto mounting a Samba share in Linux (April 19, 2009)">Auto mounting a Samba share in Linux</a> (5)</li>
	<li><a href="http://www.ghacks.net/2008/02/07/yoggie-pico-personal-mobile-security-computer/" title="Yoggie PICO Personal Mobile Security Computer (February 7, 2008)">Yoggie PICO Personal Mobile Security Computer</a> (3)</li>
	<li><a href="http://www.ghacks.net/2009/10/30/with-ubuntu-9-10-arrives-wubi-9-10/" title="With Ubuntu 9.10 Arrives Wubi 9.10 (October 30, 2009)">With Ubuntu 9.10 Arrives Wubi 9.10</a> (2)</li>
	<li><a href="http://www.ghacks.net/2009/01/29/windows-xp-exfat-file-system-driver/" title="Windows XP exFAT File System Driver (January 29, 2009)">Windows XP exFAT File System Driver</a> (21)</li>
	<li><a href="http://www.ghacks.net/2006/12/07/widgets-for-linux-superkaramba/" title="Widgets for Linux: SuperKaramba (December 7, 2006)">Widgets for Linux: SuperKaramba</a> (6)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.ghacks.net/2009/01/03/understanding-linux-etcfstab/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
	</channel>
</rss>
