<?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/"
	xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule"
>

<channel>
	<title>Geek Notes &#187; Linux</title>
	<atom:link href="http://www.geek-notes.com/category/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.geek-notes.com</link>
	<description>A web developer's blog: languages, search engines, servers.</description>
	<lastBuildDate>Thu, 12 Nov 2009 01:14:45 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/2.5/</creativeCommons:license>
		<item>
		<title>How to see Windows partitions from Linux</title>
		<link>http://www.geek-notes.com/linux/16/how-to-see-windows-partitions-from-linux/</link>
		<comments>http://www.geek-notes.com/linux/16/how-to-see-windows-partitions-from-linux/#comments</comments>
		<pubDate>Tue, 02 May 2006 18:30:40 +0000</pubDate>
		<dc:creator>Maurizio Petrone</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.geek-notes.com/linux/16/how-to-see-windows-partitions-from-linux/</guid>
		<description><![CDATA[
By default, Linux can only see his own partition(s).
But what if you need some data stored on a partition readable by Windows (wich uses an NTFS or FAT filesystem)?
Of course Linux allow you to read the content of both FAT and NTFS partitions, but you have to mount them: I&#8217;ll show you how.
A brief prologue [...]]]></description>
			<content:encoded><![CDATA[<img src="/wp-content/icons/icon_linux.gif" width="80" height="80" class="icon" alt="Linux" />
<p>By default, Linux can only see his own partition(s).<br />
But what if you need some data stored on a partition readable by Windows (wich uses an <a href="http://www.microsoft.com/windowsxp/using/setup/expert/russel_october01.mspx">NTFS or FAT</a> filesystem)?</p>
<p>Of course <strong>Linux allow you to read the content of both FAT and NTFS partitions</strong>, but you have to mount them: I&#8217;ll show you how.</p>
<p>A brief prologue is needed: <em>mount a filesystem</em> means that you virtually place the whole partition on a directory under the root directory <span class="codespan">/</span>, and you specify what the system is allowed to do with it: you can mount a filesystem as read-only, or as writable.</p>
<p><span id="more-16"></span>The command is <a href="http://linux.about.com/od/commands/l/blcmdl8_mount.htm">mount</a>, and the syntax is the following:</p>
<div class="codebox">mount -t filesystem_type device directory [options]</div>
<p>Let&#8217;s explain: this command mounts the filesystem found on <em>device</em> (which is formatted with <em>filesystem_type</em>) on <em>directory</em> (properly called <span style="font-style: italic">mount point</span>) with the specified <em>[options]</em>.<br />
Devices are usually listed under <span class="codespan">/dev</span>; hard disk partitions are identified from the letters <span class="codespan">hd</span>, followed by the disk order in letters (A for the first disc, B for the second, and so on) and then the number that identifies the number of the partition on the phisycal drive (1, 2, 3&#8230;).</p>
<p>Usually, the only options you will need to care about are <span class="codespan">-ro</span> for <em>read-only</em> and <span class="codespan">-w</span> for <em>read-write</em>.</p>
<p>Let&#8217;s make a practical example.<br />
<strong> Say that you want to mount the partition in which is installed Windows XP</strong>, that is on /hda2 (then, <span class="codespan">/dev/hda2</span> under Linux) and you want to show its content, as read-only, in <span class="codespan">/mnt/windows</span>. The command for that will be the following:</p>
<div class="codebox">mount -t ntfs /dev/hda2 /mnt/windows -ro</div>
<p>Now, you can go to <span class="codespan">/mnt/windows</span>, and you will see your so-called <span class="codespan">C:</span> disc here. Quite simple, isn&#8217;t it?</p>
<p>So, now we know how to manually mount partitions.</p>
<h4>How to mount partitions automatically at the system boot?</h4>
<p>The key is on this file: <span class="codespan">/etc/fstab</span>. This file contains informations about partitions and storage devices on your computer. During the boot, Linux reads its instructions and mount filesystems accordingly.<br />
In this file, every row contains informations about a partition. The structure of a row is:</p>
<div class="codebox">&lt;device&gt;  &lt;mount point&gt;  &lt;type&gt;  &lt;options&gt;  &lt;dump&gt;  &lt;check&gt;</div>
<p>Let&#8217;s explain:<br />
<em>Device</em> is your device (/dev/hda2 accordingly to the previous example), <em>mount point</em> is the directory where you will see your data, <em>type</em> is the filesystem (e.g. &#8220;ntfs&#8221; for windows), <span style="font-style: italic">options</span> have to be comma-separated (I will return on them in a moment), <span style="font-style: italic">dump</span> and <span style="font-style: italic">check</span> refers, respectively, to <span style="font-style: italic">&#8220;do you want a backup of this&#8221;</span> and <span style="font-style: italic">&#8220;do you want the system to check this disc&#8221;.</span> Both these values can be <span class="codespan">0</span> or <span class="codespan">1</span>, respectively for <span class="codespan">True</span> or <span class="codespan">False</span>. If you&#8217;re mounting a Windows partition, leave <span class="codespan">0</span> for both.<br />
<strong>Options</strong>: they are almost the same allowed for <span class="codespan">mount</span> command. When mounting a Windows unit, the only really useful options are: <span class="codespan">ro</span> (or <span class="codespan">rw</span>, respectively for Read-only and Read-write), and <span class="codespan">user</span> (or <span class="codespan">nouser</span>: default is <span class="codespan">nouser</span>, and if you don&#8217;t change this to <span class="codespan">user</span>, the system will not mount your device unless you are logged in as root).</p>
<p>Going on with the example, a row in <span class="codespan">/etc/fstab</span> that will automatically mount the Windows XP partition found on <span class="codespan">/dev/hda2</span> in <span class="codespan">/mnt/windows</span> <em>as read-only</em>, would look as the following:</p>
<div class="codebox">/dev/hda2 /mnt/windows ntfs ro,user 0 0</div>
<p>Now, every time you boot, you will able to read contents from <span class="codespan">C:</span> into <span class="codespan">/mnt/windows</span>!</p>
<p>If you wish, you can read a <a href="http://www.tuxfiles.org/linuxhelp/fstab.html">more extensive documentation on fstab</a>.</p>
<p style="border-top: 1px dashed black; padding-top: 20px"><strong>NOTE ON WRITING ON WINDOWS PARTITIONS</strong>: Linux support to write mode in NTFS partitions is experimental, and depending on the distribution in use. This means that write to NTFS from Linux could lead into <em>unrecoverable errors</em>. <strong>Use it at your own risk!</strong></p>
<p><strong>REMEMBER</strong>: <span class="codespan">default</span> option in fstab <em>(if you are going to use it instead of the suggested </em><span class="codespan">ro,user</span><em>)</em> mounts the filesystem with write privileges.</p>
<div class="sociable"><span class="sociable_tagline"><strong>Bookmark:</strong><span>These icons link to social bookmarking sites where readers can share and discover new web pages.</span></span><ul>
	<li><a href="http://digg.com/submit?phase=2&amp;url=http://www.geek-notes.com/linux/16/how-to-see-windows-partitions-from-linux/&amp;title=How+to+see+Windows+partitions+from+Linux" title="digg"><img src="http://www.geek-notes.com/wp-content/plugins/sociable/images/digg.png" alt="digg" /></a></li>
	<li><a href="http://del.icio.us/post?url=http://www.geek-notes.com/linux/16/how-to-see-windows-partitions-from-linux/&amp;title=How+to+see+Windows+partitions+from+Linux" title="del.icio.us"><img src="http://www.geek-notes.com/wp-content/plugins/sociable/images/delicious.png" alt="del.icio.us" /></a></li>
	<li><a href="http://blogmarks.net/my/new.php?mini=1&amp;simple=1&amp;url=http://www.geek-notes.com/linux/16/how-to-see-windows-partitions-from-linux/&amp;title=How+to+see+Windows+partitions+from+Linux" title="blogmarks"><img src="http://www.geek-notes.com/wp-content/plugins/sociable/images/blogmarks.png" alt="blogmarks" /></a></li>
	<li><a href="http://co.mments.com/track?url=http://www.geek-notes.com/linux/16/how-to-see-windows-partitions-from-linux/&amp;title=How+to+see+Windows+partitions+from+Linux" title="co.mments"><img src="http://www.geek-notes.com/wp-content/plugins/sociable/images/co.mments.gif" alt="co.mments" /></a></li>
	<li><a href="http://www.newsvine.com/_tools/seed&amp;save?u=http://www.geek-notes.com/linux/16/how-to-see-windows-partitions-from-linux/&amp;h=How+to+see+Windows+partitions+from+Linux" title="NewsVine"><img src="http://www.geek-notes.com/wp-content/plugins/sociable/images/newsvine.png" alt="NewsVine" /></a></li>
	<li><a href="http://www.furl.net/storeIt.jsp?u=http://www.geek-notes.com/linux/16/how-to-see-windows-partitions-from-linux/&amp;t=How+to+see+Windows+partitions+from+Linux" title="Furl"><img src="http://www.geek-notes.com/wp-content/plugins/sociable/images/furl.png" alt="Furl" /></a></li>
</ul></div>
]]></content:encoded>
			<wfw:commentRss>http://www.geek-notes.com/linux/16/how-to-see-windows-partitions-from-linux/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/2.5/</creativeCommons:license>
	</item>
		<item>
		<title>MySQL in a custom dir on Linux</title>
		<link>http://www.geek-notes.com/linux/15/mysql-in-a-custom-dir-on-linux/</link>
		<comments>http://www.geek-notes.com/linux/15/mysql-in-a-custom-dir-on-linux/#comments</comments>
		<pubDate>Mon, 01 May 2006 10:00:53 +0000</pubDate>
		<dc:creator>Maurizio Petrone</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://www.geek-notes.com/linux/mysql-shared-libraries-on-linux__15/</guid>
		<description><![CDATA[

If you have installed MySQL server in the standard directory /usr/local/mysql, do not read this post. Else, you may want to know
how to use MySQL shared libraries on your Linux system
For organization purposes, I have installed MySQL in /home dir (which is a separate partition), precisely in /home/server/mysql. Thus, I keep mysql/var, directory (which contains [...]]]></description>
			<content:encoded><![CDATA[<img src="/wp-content/icons/icon_linux.gif" width="80" height="80" class="icon" alt="Linux" />
<img src="/wp-content/icons/icon_mysql.gif" width="80" height="80" class="icon" alt="MySQL" />
<p>If you have installed MySQL server in the standard directory <span class="codespan">/usr/local/mysql</span>, do not read this post. Else, you may want to know</p>
<h4>how to use MySQL shared libraries on your Linux system</h4>
<p>For organization purposes, I have installed MySQL in <span class="codespan">/home</span> dir (which is a separate partition), precisely in <span class="codespan">/home/server/mysql</span>. Thus, I keep <span class="codespan">mysql/var</span>, directory (which contains databases) safe from heavy system changes.</p>
<p>My system did not recognized the shared library <span class="codespan">libmysqlclient</span>, that is under <span class="codespan">/home/server/mysql/lib/mysql</span>.<br />
How do you tell Linux <em>&#8220;Hey, you will find the library here, go and use it&#8221;</em>?</p>
<p>Just edit the file <span class="codespan">/etc/ld.so.conf</span> and add the path to your library. Then, reboot or give this command:</p>
<div class="codebox">ldconfig -v</div>
<p>to register new libraries.</p>
<p><span id="more-15"></span><br />
<h4>Compiling programs that require MySQL components</h4>
<p>Another issue you&#8217;ll have to deal with when your MySQL is installed in a non-standard path, is the source compilation and use of programs that require some MySQL components.</p>
<p>For example, I use a <em>C</em> program that has this header on its source:</p>
<div class="codebox">#include &lt;mysql/mysql.h&gt;</div>
<p>I got errors related to paths when compiling this source.<br />
The solution is not changing the source in order to make #include lines match real paths, but consists in telling the compiler where mysql directory is. Compile with such a command line (or change your <span class="codespan">Makefile</span> accordingly):</p>
<div class="codebox">gcc -I/home/server/mysql/include/ -L/home/server/mysql/lib/mysql yourprogram.c -lmysqlclient</div>
<div class="sociable"><span class="sociable_tagline"><strong>Bookmark:</strong><span>These icons link to social bookmarking sites where readers can share and discover new web pages.</span></span><ul>
	<li><a href="http://digg.com/submit?phase=2&amp;url=http://www.geek-notes.com/linux/15/mysql-in-a-custom-dir-on-linux/&amp;title=MySQL+in+a+custom+dir+on+Linux" title="digg"><img src="http://www.geek-notes.com/wp-content/plugins/sociable/images/digg.png" alt="digg" /></a></li>
	<li><a href="http://del.icio.us/post?url=http://www.geek-notes.com/linux/15/mysql-in-a-custom-dir-on-linux/&amp;title=MySQL+in+a+custom+dir+on+Linux" title="del.icio.us"><img src="http://www.geek-notes.com/wp-content/plugins/sociable/images/delicious.png" alt="del.icio.us" /></a></li>
	<li><a href="http://blogmarks.net/my/new.php?mini=1&amp;simple=1&amp;url=http://www.geek-notes.com/linux/15/mysql-in-a-custom-dir-on-linux/&amp;title=MySQL+in+a+custom+dir+on+Linux" title="blogmarks"><img src="http://www.geek-notes.com/wp-content/plugins/sociable/images/blogmarks.png" alt="blogmarks" /></a></li>
	<li><a href="http://co.mments.com/track?url=http://www.geek-notes.com/linux/15/mysql-in-a-custom-dir-on-linux/&amp;title=MySQL+in+a+custom+dir+on+Linux" title="co.mments"><img src="http://www.geek-notes.com/wp-content/plugins/sociable/images/co.mments.gif" alt="co.mments" /></a></li>
	<li><a href="http://www.newsvine.com/_tools/seed&amp;save?u=http://www.geek-notes.com/linux/15/mysql-in-a-custom-dir-on-linux/&amp;h=MySQL+in+a+custom+dir+on+Linux" title="NewsVine"><img src="http://www.geek-notes.com/wp-content/plugins/sociable/images/newsvine.png" alt="NewsVine" /></a></li>
	<li><a href="http://www.furl.net/storeIt.jsp?u=http://www.geek-notes.com/linux/15/mysql-in-a-custom-dir-on-linux/&amp;t=MySQL+in+a+custom+dir+on+Linux" title="Furl"><img src="http://www.geek-notes.com/wp-content/plugins/sociable/images/furl.png" alt="Furl" /></a></li>
</ul></div>
]]></content:encoded>
			<wfw:commentRss>http://www.geek-notes.com/linux/15/mysql-in-a-custom-dir-on-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/2.5/</creativeCommons:license>
	</item>
		<item>
		<title>Run something when Linux boots</title>
		<link>http://www.geek-notes.com/linux/14/run-something-when-linux-boots/</link>
		<comments>http://www.geek-notes.com/linux/14/run-something-when-linux-boots/#comments</comments>
		<pubDate>Mon, 01 May 2006 08:00:20 +0000</pubDate>
		<dc:creator>Maurizio Petrone</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.geek-notes.com/linux/run-something-when-linux-boots__14/</guid>
		<description><![CDATA[
How to automatically run a command or program at Linux system start-up:
The file where boot process sequence is defined is: /etc/inittab
Log in as root, open it with a text editor, and locate a line similar to this:
# Default runlevel. (Do not set to 0 or 6 !)
id:4:initdefault:
After that line, you can start adding your custom [...]]]></description>
			<content:encoded><![CDATA[<img src="/wp-content/icons/icon_linux.gif" width="80" height="80" class="icon" alt="Linux" />
<h4>How to automatically run a command or program at Linux system start-up:</h4>
<p>The file where boot process sequence is defined is: <a href="http://www.netadmintools.com/html/inittab.man.html"><span class="codespan">/etc/inittab</span></a><br />
Log in as root, open it with a text editor, and locate a line similar to this:</p>
<div class="codebox"># Default runlevel. (Do not set to 0 or 6 !)<br />
id:4:initdefault:</div>
<p>After that line, you can start adding your custom auto-run process calls. Syntax is:<br />
<span class="codespan">id:runlevel:action:process</span></p>
<p>So, if you want a program to be started, you can add one or more lines like followings:</p>
<div class="codebox">#I do use this to automatically run both Apache and MySQL servers<br />
s0:2345:wait:/home/server/apache/bin/apachectl start<br />
s1:2345:wait:/home/server/mysql/bin/mysqld_safe &#8211;user=root &#038;</div>
<p>Where <span class="codespan">s0</span> and <span class="codespan">s1</span> are custom defined IDs, <span class="codespan">2345</span> are runlevels the rules applies to (all but shutdown and reboot), and <span class="codespan">wait</span> means that the system should wait for the command to be executed before doing something else.</p>
<p><strong>Pay attention</strong> do not change <span class="codespan">wait</span> flag into <span class="codespan">respawn</span>, or else you&#8217;ll have the system freezed at next reboot!</p>
<h4>Apply changes made to inittab without rebooting</h4>
<p>To see the effects of any changes you made to <span class="codespan">/etc/inittab</span> without rebooting your machine, just type this command:<br />
<span class="codespan">init q</span></p>
<div class="sociable"><span class="sociable_tagline"><strong>Bookmark:</strong><span>These icons link to social bookmarking sites where readers can share and discover new web pages.</span></span><ul>
	<li><a href="http://digg.com/submit?phase=2&amp;url=http://www.geek-notes.com/linux/14/run-something-when-linux-boots/&amp;title=Run+something+when+Linux+boots" title="digg"><img src="http://www.geek-notes.com/wp-content/plugins/sociable/images/digg.png" alt="digg" /></a></li>
	<li><a href="http://del.icio.us/post?url=http://www.geek-notes.com/linux/14/run-something-when-linux-boots/&amp;title=Run+something+when+Linux+boots" title="del.icio.us"><img src="http://www.geek-notes.com/wp-content/plugins/sociable/images/delicious.png" alt="del.icio.us" /></a></li>
	<li><a href="http://blogmarks.net/my/new.php?mini=1&amp;simple=1&amp;url=http://www.geek-notes.com/linux/14/run-something-when-linux-boots/&amp;title=Run+something+when+Linux+boots" title="blogmarks"><img src="http://www.geek-notes.com/wp-content/plugins/sociable/images/blogmarks.png" alt="blogmarks" /></a></li>
	<li><a href="http://co.mments.com/track?url=http://www.geek-notes.com/linux/14/run-something-when-linux-boots/&amp;title=Run+something+when+Linux+boots" title="co.mments"><img src="http://www.geek-notes.com/wp-content/plugins/sociable/images/co.mments.gif" alt="co.mments" /></a></li>
	<li><a href="http://www.newsvine.com/_tools/seed&amp;save?u=http://www.geek-notes.com/linux/14/run-something-when-linux-boots/&amp;h=Run+something+when+Linux+boots" title="NewsVine"><img src="http://www.geek-notes.com/wp-content/plugins/sociable/images/newsvine.png" alt="NewsVine" /></a></li>
	<li><a href="http://www.furl.net/storeIt.jsp?u=http://www.geek-notes.com/linux/14/run-something-when-linux-boots/&amp;t=Run+something+when+Linux+boots" title="Furl"><img src="http://www.geek-notes.com/wp-content/plugins/sociable/images/furl.png" alt="Furl" /></a></li>
</ul></div>
]]></content:encoded>
			<wfw:commentRss>http://www.geek-notes.com/linux/14/run-something-when-linux-boots/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/2.5/</creativeCommons:license>
	</item>
	</channel>
</rss>
