<?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; thumbdrive</title>
	<atom:link href="http://www.ghacks.net/tag/thumbdrive/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 11:56:41 +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>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>
