<?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>G-Loaded Journal &#187; Filesystem</title>
	<atom:link href="http://www.g-loaded.eu/tag/filesystem/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.g-loaded.eu</link>
	<description>An open-source software and technology related journal</description>
	<lastBuildDate>Mon, 05 Dec 2011 19:55:24 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/3.0/</creativeCommons:license>
		<item>
		<title>Effective data wiping with a single complete overwrite</title>
		<link>http://www.g-loaded.eu/2009/01/22/effective-data-wiping-with-a-single-complete-overwrite/</link>
		<comments>http://www.g-loaded.eu/2009/01/22/effective-data-wiping-with-a-single-complete-overwrite/#comments</comments>
		<pubDate>Wed, 21 Jan 2009 21:56:16 +0000</pubDate>
		<dc:creator>George Notaras</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Filesystem]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Security]]></category>
		<guid isPermaLink="false">http://www.g-loaded.eu/?p=863</guid>
		<description><![CDATA[One of the first things computer users, who are concerned with security, learn is that multiple overwrites with ones and zeros are required in order to wipe data to the extent that it is unrecoverable by any forensic analysis tools. According to this article on Softpedia, on which I stumbled while searching for something else, [...]]]></description>
			<content:encoded><![CDATA[<p>One of the first things computer users, who are concerned with security, learn is that <em>multiple overwrites</em> with ones and zeros are required in order to <strong>wipe data</strong> to the extent that it is <strong>unrecoverable</strong> by any <em>forensic analysis tools</em>. According to this <a href="http://news.softpedia.com/news/Data-Wiping-Myth-Put-to-Rest-102376.shtml">article on Softpedia</a>, on which I stumbled while searching for something else, the above statement is a <strong>myth</strong>; a busted myth actually. Experts now claim that a <em>single complete overwrite</em> is enough to render the data unrecoverable.</p>
<p>Refering to the myth, the author of the article writes:</p>
<blockquote><p>
One of the reasons behind this idea is that the positioning of a hard disk drive&#8217;s head is not precise enough to ensure that the data is overwritten with new information from the exact same byte.
</p></blockquote>
<p>A <a href="http://www.springerlink.com/content/408263ql11460147/">study</a>, published on December 2008, claims that tests performed on both last and older generation hard drives have shown that recovering even a single byte of data after a complete overwrite is practically impossible.</p>
<blockquote><p>
Security researchers from Heise Security, who have reviewed the paper presented at last year&#8217;s edition of the International Conference on Information Systems Security (ICISS), explain that a single byte of data can be recovered with a 56 percent probability, but only if the head is positioned precisely eight times, which in itself has a probability of occurring of only 0.97%.
</p></blockquote>
<p>Since I was one of those who believed the statement about the multiple overwrites, I found the article very interesting. I haven&#8217;t read the study itself though.</p>
<div class="cc-block"><em><a href="http://www.g-loaded.eu/2009/01/22/effective-data-wiping-with-a-single-complete-overwrite/">Effective data wiping with a single complete overwrite</a></em>, unless otherwise expressly stated, is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/3.0/">Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License</a>. Terms and conditions beyond the scope of this license may be available at <a href="http://www.g-loaded.eu/about/disclaimer-and-license/">www.g-loaded.eu</a>.</div>
<h4>Related Articles</h4>
<ul><li><a href="http://www.g-loaded.eu/2010/03/29/partition-misalignment-slows-4096-byte-sector-hard-drives/" rel="bookmark">Partition Misalignment Slows Down 4096-Byte Sector Hard Disks</a></li>
<li><a href="http://www.g-loaded.eu/2010/10/29/sphinx-documentation-single-file/" rel="bookmark">How to create a single file of Sphinx based documentation</a></li>
<li><a href="http://www.g-loaded.eu/2007/12/01/choosing-a-format-for-data-backups-tar-vs-cpio/" rel="bookmark">Choosing a format for data backups &#8211; tar vs cpio</a></li>
<li><a href="http://www.g-loaded.eu/2009/01/23/shred-changes-default-number-of-passes-to-3/" rel="bookmark">Shred changes default number of passes to 3</a></li>
<li><a href="http://www.g-loaded.eu/2005/12/14/the-complete-fedora-kernel-headers/" rel="bookmark">The Complete Fedora Kernel Headers</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.g-loaded.eu/2009/01/22/effective-data-wiping-with-a-single-complete-overwrite/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/3.0/</creativeCommons:license>
	</item>
		<item>
		<title>Always use a block device label or its UUID in fstab</title>
		<link>http://www.g-loaded.eu/2009/01/04/always-use-a-block-device-label-or-its-uuid-in-fstab/</link>
		<comments>http://www.g-loaded.eu/2009/01/04/always-use-a-block-device-label-or-its-uuid-in-fstab/#comments</comments>
		<pubDate>Sun, 04 Jan 2009 15:41:27 +0000</pubDate>
		<dc:creator>George Notaras</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Administration]]></category>
		<category><![CDATA[Filesystem]]></category>
		<category><![CDATA[System]]></category>
		<guid isPermaLink="false">http://www.g-loaded.eu/?p=839</guid>
		<description><![CDATA[If there are still references to device nodes for block devices, as they are set by the kernel, for example /dev/hda, in /etc/fstab, you should seriously consider replacing them with the volume&#8217;s label or its UUID. Even if you use an LVM setup, the /boot partition shouldn&#8217;t be referenced by its device node. My server [...]]]></description>
			<content:encoded><![CDATA[<p>If there are still references to device nodes for <strong>block devices</strong>, as they are set by the kernel, for example <code>/dev/hda</code>, in <code>/etc/fstab</code>, you should seriously consider replacing them with the volume&#8217;s <strong>label</strong> or its <strong>UUID</strong>. Even if you use an <strong>LVM</strong> setup, the <code>/boot</code> partition shouldn&#8217;t be referenced by its device node.<br />
<span id="more-839"></span><br />
My server boots from a 32MB <em>Compact Flash</em> card, attached to <em>CF-to-IDE</em> converter. The card contains only the boot manager (GRUB) in its Master Boot Record (MBR). The system&#8217;s main hard disk is attached to a PCI ATA 133 <em>controller</em>. This particular setup is necessary because the old motherboard cannot boot directly from hard disks connected to the PCI-based IDE controller. Until Fedora 9, the CF card was recognized as hdb/sdb and the hard disk on the PCI controller as hda/sda. Today, I upgraded the server to Fedora 10. The CF card is now recognised as /dev/sda. You can imagine my surprise when I rebooted the machine after having upgraded the system only to realize that it actually tried to find the /boot partition on the CF card instead of the main hard disk.</p>
<p>To be able to correct things I had to boot using a Fedora 9 kernel in order to make any changes to the files and get rid of this issue. What was needed was to stop using device names in fstab, but use UUIDs instead. To <strong>get the UUID</strong> for a particular <strong>block device</strong>, for example <strong>/dev/sda1</strong>, I ran as root:</p>
<pre class="console">
# blkid /dev/sda1
/dev/sda1: LABEL="/boot" UUID="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" TYPE="ext3"
</pre>
<p>Now <strong>replace</strong> the device node name in <strong>/etc/fstab</strong> to read:</p>
<pre class="codesnp">
UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx    /boot    ext3    defaults    1 2
</pre>
<p>Of course, I could have used the label of that partition, but I guess UUIDs are more unique and therefore preferred.</p>
<div class="cc-block"><em><a href="http://www.g-loaded.eu/2009/01/04/always-use-a-block-device-label-or-its-uuid-in-fstab/">Always use a block device label or its UUID in fstab</a></em>, unless otherwise expressly stated, is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/3.0/">Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License</a>. Terms and conditions beyond the scope of this license may be available at <a href="http://www.g-loaded.eu/about/disclaimer-and-license/">www.g-loaded.eu</a>.</div>
<h4>Related Articles</h4>
<ul><li><a href="http://www.g-loaded.eu/2005/09/19/a-different-approach-hal/" rel="bookmark">A different approach&#8230;HAL</a></li>
<li><a href="http://www.g-loaded.eu/2007/07/25/hard-disk-upgrade-on-an-old-motherboard/" rel="bookmark">Hard disk upgrade on an old motherboard</a></li>
<li><a href="http://www.g-loaded.eu/2005/09/18/udev/" rel="bookmark">UDEV</a></li>
<li><a href="http://www.g-loaded.eu/2005/11/10/encrypt-devices-using-dm-crypt-and-luks/" rel="bookmark">Encrypt devices using dm-crypt and LUKS</a></li>
<li><a href="http://www.g-loaded.eu/2007/09/15/clonezilla-instead-of-partimage/" rel="bookmark">CloneZilla instead of Partimage</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.g-loaded.eu/2009/01/04/always-use-a-block-device-label-or-its-uuid-in-fstab/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/3.0/</creativeCommons:license>
	</item>
		<item>
		<title>Making a directory writable by the webserver</title>
		<link>http://www.g-loaded.eu/2008/12/09/making-a-directory-writable-by-the-webserver/</link>
		<comments>http://www.g-loaded.eu/2008/12/09/making-a-directory-writable-by-the-webserver/#comments</comments>
		<pubDate>Tue, 09 Dec 2008 13:21:02 +0000</pubDate>
		<dc:creator>George Notaras</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Administration]]></category>
		<category><![CDATA[Filesystem]]></category>
		<category><![CDATA[Servers]]></category>
		<category><![CDATA[Web Applications]]></category>
		<guid isPermaLink="false">http://www.g-loaded.eu/?p=751</guid>
		<description><![CDATA[I&#8217;ve used the phrase &#8220;writable by the webserver&#8221; numerous times throughout this blog, without ever bothering to explain in detail what this means. Yesterday, I received an email asking me exactly that, so I decided to finally write a post about it and use it as a reference whenever I use the aforementioned phrase. I&#8217;ll [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve used the phrase &#8220;<em>writable by the webserver</em>&#8221; numerous times throughout this blog, without ever bothering to explain in detail what this means. Yesterday, I received an email asking me exactly that, so I decided to finally write a post about it and use it as a reference whenever I use the aforementioned phrase. I&#8217;ll use <a href="http://httpd.apache.org/">Apache</a> as an example webserver and a filesystem with <a href="http://assela.pathirana.net/UNIX_file_system_permissions_tutorial">Unix-like permissions</a>. I&#8217;ll also try to keep the article as short as possible.<br />
<span id="more-751"></span><br />
First of all, the webserver, Apache in our case, is a program running in the <em>background</em>. Apache is originally started by user <strong>root</strong>. We will call this initial process the &#8220;<strong>root-process</strong>&#8220;. The &#8220;root-process&#8221; launches several <strong>child processes</strong> which handle the client requests. For security reasons, <em>the child processes are not run by user &#8220;root&#8221;</em> but as a user with minimal privileges. Usually this user is named <code>apache</code> or <code>www-data</code> etc. To find out how this is called in your system, issue the following command:</p>
<pre class="console">
$ ps -ef | grep httpd | grep -v grep
root      1926     1  0 Dec03 ?        00:00:55 /usr/sbin/httpd.worker
apache    2608  1926  0 14:31 ?        00:00:06 /usr/sbin/httpd.worker
apache   22192  1926  0 01:05 ?        00:00:02 /usr/sbin/httpd.worker
</pre>
<p>So, in my case the child processes are run by user &#8220;<code>apache</code>&#8220;. This could also be determined by the user and group directives inside Apache&#8217;s configuration file, <code>/etc/httpd/conf/httpd.conf</code>:</p>
<pre class="codesnp">
User apache
Group apache
</pre>
<p>So, in order to <strong>make a directory writable by the webserver</strong> we have to set the directory&#8217;s owner or group to Apache&#8217;s owner or group and enable the write permission for it. Usually, we set the directory to belong to the Apache group (<code>apache</code> or <code>www-data</code> or whatever user is used to launch the child processes) and enable the write permission for the group.</p>
<pre class="console">
chgrp apache /path/to/mydir
chmod g+w /path/to/mydir
</pre>
<p>In many cases, usually in <em>shared hosting environments</em>, it is not possible to change the ownership of files and directories. In those cases you could just set the write permission for everyone (others):</p>
<pre class="console">
chmod o+w /path/to/mydir
</pre>
<p>Which method is more <strong>secure</strong> depends on how <code>/path/to/mydir</code> is accessed.</p>
<p>If it is accessed through the web server with an HTTP request it does not really matter which of the above methods has been used in order to make <code>/path/to/mydir</code> writable by the web server, because, in any case, the web server will be able to write to <code>/path/to/mydir</code>.</p>
<p>If the directory is accessed by other means, for instance by another local program which is run by an untrusted local user, then, obviously, the first method is more secure.</p>
<p>I guess this explains how to make a directory or file writable by the web server process.</p>
<div class="cc-block"><em><a href="http://www.g-loaded.eu/2008/12/09/making-a-directory-writable-by-the-webserver/">Making a directory writable by the webserver</a></em>, unless otherwise expressly stated, is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/3.0/">Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License</a>. Terms and conditions beyond the scope of this license may be available at <a href="http://www.g-loaded.eu/about/disclaimer-and-license/">www.g-loaded.eu</a>.</div>
<h4>Related Articles</h4>
<ul><li><a href="http://www.g-loaded.eu/2009/10/08/redmine-deployment-delayed/" rel="bookmark">Redmine deployment delayed</a></li>
<li><a href="http://www.g-loaded.eu/2007/02/21/htaccess-cheat-sheet/" rel="bookmark">.htaccess Cheat Sheet</a></li>
<li><a href="http://www.g-loaded.eu/2010/03/28/issues-with-the-feeds-are-now-resolved/" rel="bookmark">Issues with the feeds are now resolved</a></li>
<li><a href="http://www.g-loaded.eu/2007/08/06/file-and-directory-diff-in-color-in-midnight-commander/" rel="bookmark">File and Directory diff in color in Midnight Commander</a></li>
<li><a href="http://www.g-loaded.eu/2010/03/28/script-apache-error-report/" rel="bookmark">Script for Apache Error Report</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.g-loaded.eu/2008/12/09/making-a-directory-writable-by-the-webserver/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/3.0/</creativeCommons:license>
	</item>
		<item>
		<title>Access gvfs mounts from the command line</title>
		<link>http://www.g-loaded.eu/2008/12/08/access-gvfs-mounts-from-the-command-line/</link>
		<comments>http://www.g-loaded.eu/2008/12/08/access-gvfs-mounts-from-the-command-line/#comments</comments>
		<pubDate>Mon, 08 Dec 2008 14:50:52 +0000</pubDate>
		<dc:creator>George Notaras</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Filesharing]]></category>
		<category><![CDATA[Filesystem]]></category>
		<category><![CDATA[GNOME]]></category>
		<guid isPermaLink="false">http://www.g-loaded.eu/?p=744</guid>
		<description><![CDATA[In the past, having used the &#8220;Connect to server&#8221; feature in GNOME, you could easily access the remote server&#8217;s filesystem from within Nautilus, but it was impossible to access it from the command line (please correct me if I miss something here). Now GNOME uses gvfs. As soon as GNOME connects to the remote server, [...]]]></description>
			<content:encoded><![CDATA[<p>In the past, having used the &#8220;<em>Connect to server</em>&#8221; feature in <a href="http://gnome.org">GNOME</a>, you could easily access the remote server&#8217;s filesystem from within Nautilus, but it was impossible to access it from the command line (please correct me if I miss something here). Now GNOME uses <strong>gvfs</strong>. As soon as GNOME connects to the remote server, for instance an anonymous FTP server, you can effortlessly access the files on the server using command line tools by changing to the <code>/home/&lt;USER&gt;/.gvfs/&lt;server_connection_name&gt;</code> directory. This also gives us the chance to do some other cool things, like initiating file transfers <em>from a remote server A to a remote server B</em> using our desktop. Beautiful!</p>
<div class="cc-block"><em><a href="http://www.g-loaded.eu/2008/12/08/access-gvfs-mounts-from-the-command-line/">Access gvfs mounts from the command line</a></em>, unless otherwise expressly stated, is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/3.0/">Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License</a>. Terms and conditions beyond the scope of this license may be available at <a href="http://www.g-loaded.eu/about/disclaimer-and-license/">www.g-loaded.eu</a>.</div>
<h4>Related Articles</h4>
<ul><li><a href="http://www.g-loaded.eu/2005/11/06/manage-users-from-the-command-line/" rel="bookmark">User management from the command line</a></li>
<li><a href="http://www.g-loaded.eu/2005/11/10/using-a-cups-printer-from-command-line/" rel="bookmark">Using a CUPS printer from command line</a></li>
<li><a href="http://www.g-loaded.eu/2008/12/08/creative-pc-cam-750-on-fedora-10/" rel="bookmark">Creative PC-CAM 750 on Fedora 10</a></li>
<li><a href="http://www.g-loaded.eu/2007/02/24/creative-commons-v30-licenses-launched/" rel="bookmark">Creative Commons v3.0 Licenses Launched</a></li>
<li><a href="http://www.g-loaded.eu/2007/05/15/blanking-a-rewritable-cddvd-in-gnome/" rel="bookmark">Blanking a rewritable CD/DVD in GNOME</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.g-loaded.eu/2008/12/08/access-gvfs-mounts-from-the-command-line/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/3.0/</creativeCommons:license>
	</item>
		<item>
		<title>Set up an anonymous FTP server with vsftpd in less than a minute</title>
		<link>http://www.g-loaded.eu/2008/12/02/set-up-an-anonymous-ftp-server-with-vsftpd-in-less-than-a-minute/</link>
		<comments>http://www.g-loaded.eu/2008/12/02/set-up-an-anonymous-ftp-server-with-vsftpd-in-less-than-a-minute/#comments</comments>
		<pubDate>Tue, 02 Dec 2008 09:34:47 +0000</pubDate>
		<dc:creator>George Notaras</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Filesharing]]></category>
		<category><![CDATA[Filesystem]]></category>
		<category><![CDATA[FTP]]></category>
		<category><![CDATA[HOWTO]]></category>
		<category><![CDATA[Servers]]></category>
		<guid isPermaLink="false">http://www.g-loaded.eu/?p=706</guid>
		<description><![CDATA[This small HOWTO describes how to configure vsftpd for an anonymous FTP site in order to make files available across your local network or the internet. The scenario this guide is based on is to quickly make a linux distribution&#8217;s installation tree available across the local network in order to be used for a network [...]]]></description>
			<content:encoded><![CDATA[<p>This small HOWTO describes how to configure <a href="http://vsftpd.beasts.org/">vsftpd</a> for an <strong>anonymous FTP site</strong> in order to make files available across your local network or the internet. The scenario this guide is based on is to quickly make a linux distribution&#8217;s installation tree available across the local network in order to be used for a <em>network installation</em>. In this example, I run an anonymous FTP service on my desktop computer making the CentOS installation tree available directly from its installation DVD. This should give you an idea about how to share files or directories that do not physically exist in the root directory of the FTP site.<br />
<span id="more-706"></span></p>
<h4>vsftpd Configuration</h4>
<p>Assuming vsftpd has already been installed in the standard location, the directory <code>/etc/vsftpd/</code>, which contains its configuration files, should exist. You can edit vsftpd&#8217;s default configuration file (<code>/etc/vsftpd/vsftpd.conf</code>), but in this example, we will create a <strong>new configuration file</strong> from scratch.</p>
<p>Create a new configuration file named <code>/etc/vsftpd/vsftpd-anon.conf</code> and open it in your favourite text editor and write down the directives that follow:</p>
<p>Set the server to run in <strong>standalone mode</strong>. This means that vsftpd will run into the background and handle the incoming requests on its own. The alternative method (listen=NO) would require you to set up a xinetd service. This would not be a bad idea, but for the sake of this example, it would be a waste of time.</p>
<pre class="codesnp">
listen=YES
</pre>
<p>The following directives prevent local users from logging in and enables anonymous access respectively.</p>
<pre class="codesnp">
local_enable=NO
anonymous_enable=YES
</pre>
<p>The following directive <strong>disables write access</strong> to the ftp server&#8217;s filesystem. This is a global switch, so noone will be able to upload or modify any files on your ftp site.</p>
<pre class="codesnp">
write_enable=NO
</pre>
<p>Sets the root directory for anonymous connections. By default, this is /var/ftp/.</p>
<pre class="codesnp">
anon_root=/var/ftp
</pre>
<p>The following configuration directives are <strong>optional</strong> and can be safely omitted.</p>
<p>Limit the rate at which anonymous users can retrieve files.</p>
<pre class="codesnp">
anon_max_rate=2048000
</pre>
<p>Enable logging information about user logins an file transfers. The log file is located at <code>/var/log/vsftpd.log</code>.</p>
<pre class="codesnp">
xferlog_enable=YES
</pre>
<p>Set the interface and port the service will listen on. By default, vsftpd will bind to all local network interfaces on port 21, which is the standard port of the File Transfer Protocol. Note that listen_address accepts only numeric IP addresses (no hostnames).</p>
<pre class="codesnp">
listen_address=192.168.0.100
listen_port=21
</pre>
<h5>The entire <code>vsftpd-anon.conf</code> file</h5>
<pre class="codesnp">
#
# Sample anonymous FTP server configuration
#
# Mandatory directives
#
listen=YES
local_enable=NO
anonymous_enable=YES
write_enable=NO
anon_root=/var/ftp
#
# Optional directives
#
anon_max_rate=2048000
xferlog_enable=YES
listen_address=192.168.0.100
listen_port=21
</pre>
<h5>Start or Stop the FTP server</h5>
<p>Assuming you have created the supplementary <code>vsftpd-anon.conf</code> configuration file, run as user root:</p>
<pre class="console">
vsftpd /etc/vsftpd/vsftpd-anon.conf
</pre>
<p>To stop the service run:</p>
<pre class="console">
killall vsftpd
</pre>
<p>Alternatively, you can send the SIGTERM signal to a specific vsftpd process.</p>
<p>On the other hand, if you had edited vsftpd&#8217;s default configuration file, you could start/stop the service using the <code>/etc/init.d/vsftpd</code> initscript.</p>
<h4>Sharing files and directories</h4>
<p>An FTP server without any files is like having a swimming pool without any water in it. In order to make some files and directories available through your FTP service you have two options:</p>
<ol>
<li><strong>Copy</strong> or <strong>move</strong> the files or directories inside the <em>anon_root</em> directory.</li>
<li>Create <strong>bind mounts</strong> of the directories you want to share in the <em>anon_root</em> directory.</li>
</ol>
<p>You may wonder why you cannot just create some <em>symbolic links</em> inside <em>anon_root</em> pointing to the directories you want to share. Even if you created those symlinks and connected to the service using an FTP client, you would notice that you are not permitted to reach the linked location. This happens because anonymous users are restricted (<strong>chrooted</strong>) to <em>anon_root</em> and, therefore, no location outside this directory is accessible using symlinks.</p>
<p><strong>Bind mounts</strong> are the solution to this problem. When <em>bind-mounting</em>, you mount a directory (<em>A</em>) to another directory (<em>B</em>) on the same or different filesystem, so that the contents of directory A appear as contents of directory B. It&#8217;s like a symlink, but at a lower level of the filesystem and that&#8217;s why you can reach locations outside the <em>chroot jail</em>.</p>
<p>In our scenario, the <strong>installation tree</strong> of a Linux distribution is shared through the FTP service. It is assumed that the installation medium has been inserted into the drive and either the system or you have mounted it, for example, to the directory <code>/media/CentOS/</code>. We want the contents of the DVD to be accessible through the FTP server, so we need to bind-mount the DVD contents to a directory inside <code>anon_root</code>. As user &#8216;<em>root</em>&#8216; issue the following command:</p>
<pre class="console">
mount --bind /media/CentOS /var/ftp/pub
</pre>
<p>Now, connecting to the FTP service you will notice that the contents of the <code>pub/</code> directory is the CentOS installation tree.</p>
<p>It is quite obvious that, despite the fact that <em>vsftpd</em> does not support the creation of a virtual filesystem (mainly a virtual directory structure) internally, one can be easily implemented with bind-mounts.</p>
<h4>Do not forget the firewall</h4>
<p>When we run a server temporarily on the desktop computer, we tend to forget to open the necessary ports on the filewall. In the case of vsftpd, you should open port 21 or the port number you have assigned to the <code>listen_port</code> configuration directive. Please consult the documentation of your firewall management application about how to perform this action.</p>
<h4>Further Reading</h4>
<ul>
<li>All the supported <a href="http://vsftpd.beasts.org/vsftpd_conf.html">configuration directives</a> for vsftpd.</li>
</ul>
<div class="cc-block"><em><a href="http://www.g-loaded.eu/2008/12/02/set-up-an-anonymous-ftp-server-with-vsftpd-in-less-than-a-minute/">Set up an anonymous FTP server with vsftpd in less than a minute</a></em>, unless otherwise expressly stated, is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/3.0/">Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License</a>. Terms and conditions beyond the scope of this license may be available at <a href="http://www.g-loaded.eu/about/disclaimer-and-license/">www.g-loaded.eu</a>.</div>
<h4>Related Articles</h4>
<ul><li><a href="http://www.g-loaded.eu/2007/07/29/when-it-comes-to-error-messages/" rel="bookmark">When it comes to error messages&#8230;</a></li>
<li><a href="http://www.g-loaded.eu/2010/09/18/caching-nameserver-using-dnsmasq/" rel="bookmark">Caching Nameserver using dnsmasq</a></li>
<li><a href="http://www.g-loaded.eu/2005/11/10/ssh-with-keys/" rel="bookmark">Setup the SSH server to use keys for authentication</a></li>
<li><a href="http://www.g-loaded.eu/2005/11/10/configure-vnc-server-in-fedora/" rel="bookmark">Set up the VNC Server in Fedora</a></li>
<li><a href="http://www.g-loaded.eu/2008/12/09/making-a-directory-writable-by-the-webserver/" rel="bookmark">Making a directory writable by the webserver</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.g-loaded.eu/2008/12/02/set-up-an-anonymous-ftp-server-with-vsftpd-in-less-than-a-minute/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/3.0/</creativeCommons:license>
	</item>
		<item>
		<title>VeriTAR &#8211; Verify checksums of files within a TAR archive</title>
		<link>http://www.g-loaded.eu/2007/12/01/veritar-verify-checksums-of-files-within-a-tar-archive/</link>
		<comments>http://www.g-loaded.eu/2007/12/01/veritar-verify-checksums-of-files-within-a-tar-archive/#comments</comments>
		<pubDate>Sat, 01 Dec 2007 14:24:44 +0000</pubDate>
		<dc:creator>George Notaras</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Backup]]></category>
		<category><![CDATA[Filesystem]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[TAR]]></category>
		<category><![CDATA[Verification]]></category>
		<guid isPermaLink="false">http://www.g-loaded.eu/2007/12/01/veritar-verify-checksums-of-files-within-a-tar-archive/</guid>
		<description><![CDATA[In my opinion, the biggest problem of the tar format (&#8216;ustar&#8216;) is that it does not store the checksums of the files it contains. So, in order to be able to verify the contents of the tar archive, you either need to keep the original data on the hard drive and compare the archive contents [...]]]></description>
			<content:encoded><![CDATA[<p>In my opinion, the biggest problem of the <a href="http://en.wikipedia.org/wiki/Tar_(file_format)#USTAR_format">tar format</a> (&#8216;<em>ustar</em>&#8216;) is that it does not store the checksums of the files it contains. So, in order to be able to verify the contents of the tar archive, you either need to keep the original data on the hard drive and compare the archive contents against that data using the <code>-d</code> tar switch or keep the MD5 sums of the files in a separate document and also use an external program in order to check them against the calculated MD5 sums of the archived files. In this short post I introduce you to a method of creating tar archives and keeping the md5sums of the files at the same time and a utility, veritar, which can compare those md5 sums with the checksums of the contents of the archive in-place, without the need to extract.<br />
<span id="more-468"></span></p>
<h4>Creation of the TAR archive and the MD5 sums file</h4>
<p>In the following example it is assumed that the files to backup reside in the <code>myfiles/</code> subdirectory, the name of the tar archive will be <code>mybackup.tar</code> and the name of the file containing the md5sums will be <code>mybackup.md5</code>.</p>
<pre class="console">
$ tar -cvpf mybackup.tar myfiles/ \
    | xargs -I '{}' sh -c "test -f '{}' &#038;&#038; md5sum '{}'" \
    | tee mybackup.md5
</pre>
<p>Some notes:</p>
<ul>
<li>You can use any tar switch for the creation of the archive except <strong>-C</strong>. If you need to change to another directory, do it using <strong>cd</strong> or else no md5 sums will be recorded.</li>
<li>Make sure that you include the <strong>-v</strong> (<strong>&#8211;verbose</strong>) switch when invoking tar, as the paths need to be printed to stdout in order to be processed by <strong>xargs</strong>.</li>
<li>In the xargs statement, the <strong>-I &#8216;{}&#8217;</strong> part indicates that the <code>'{}'</code> string will be replaced by the path that is passed to xargs through the pipe.</li>
<li>The <strong>sh -c &#8220;test -f &#8216;{}&#8217; &#038;&#038; md5sum &#8216;{}&#8217;&#8221;</strong> does two things: tests if the path  (<code>'{}'</code>) is a file and calculates the md5 sum for it.</li>
<li>In the last part, <strong>tee</strong> is used in order to print the md5sum to the stdout and also to the <code>mybackup.md5</code> file.</li>
</ul>
<p>When this operation ends, you will end up with two files: <strong>mybackup.tar</strong> and <strong>mybackup.md5</strong>.</p>
<p><strong></strong><strong>Special thanks</strong> to:</p>
<p> <strong>*</strong> <em>Anvil</em> for the suggestion to use <code>bash -c "...test goes here..."</code> stuff.<br />
 <strong>*</strong> <em><a href="http://keramida.wordpress.com/">Giorgos Keramidas</a></em> for the improvement he suggested, so that the md5 sum calculation is not limited to regular files only:</p>
<pre class="codesnp">sh -c "test -d '{}' || md5sum '{}'"</pre>
<p>VeriTAR will verify the md5 sums of regular files only, so either test you use when creating the TAR archive, it is still fine.</p>
<h4>VeriTAR &#8211; Tar archive verification</h4>
<p><strong>VeriTAR</strong> [<code>Veri(fy)TAR</code>] is a command-line utility that verifies the md5 sums of files within a tar archive. Due to the tar (&#8216;<code>ustar</code>&#8216;) format limitations the md5 sums are retrieved from a separate file and are checked against the md5 sums of the files within the tar archive. The process takes place without actually exctracting the files.</p>
<p>It works with corrupted tar archives. The program carries on to the next file within the archive skipping the damaged parts. At the moment, this relies<br />
on Python&#8217;s tarfile module internal functions.</p>
<p>VeriTAR is written in Python.</p>
<p>Works with compressed TAR archives (gzip or bz2).</p>
<ul>
<li><a href="http://www.codetrax.org/projects/veritar/wiki">VeriTAR Development Website and Bug Tracking</a></li>
<li><a href="http://www.codetrax.org/projects/veritar/files">Downloads</a></li>
</ul>
<p>Provided that you have used the method above (or any other method) in order to create a file with the md5 sums together with the tar archive, you can easily verify the contents of the archive with veritar.</p>
<pre class="console">
$ veritar mybackup.tar mybackup.md5
</pre>
<p>Please not that veritar&#8217;s output and command line switched need some work, but for now it does the job.</p>
<p>Veritar is released under the <a href="http://www.codetrax.org/licenses/ApacheLicenseV2">Apache License version 2</a>.</p>
<p>It is completely unsupported, but you can still get community support at our software forums. This is also the place where you can inform me about any bugs.</p>
<h5>Known issues</h5>
<ol>
<li>Multi-volume tar archives are not supported at the moment</li>
<li>Tar archives in which the metadata of the first archived file has been corrupted cannot be processed due to a limitation in the tarfile Python module at the time of writing</li>
<li>Although the checksum of any algorithm, <strong>md5</strong>, <strong>sha1</strong>, <strong>crc</strong>(<strong>crc32</strong>), could be used, the current alpha version is not very flexible.</li>
<li>It may crash on damaged archives on older python versions.</li>
</ol>
<div class="cc-block"><em><a href="http://www.g-loaded.eu/2007/12/01/veritar-verify-checksums-of-files-within-a-tar-archive/">VeriTAR &#8211; Verify checksums of files within a TAR archive</a></em>, unless otherwise expressly stated, is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/3.0/">Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License</a>. Terms and conditions beyond the scope of this license may be available at <a href="http://www.g-loaded.eu/about/disclaimer-and-license/">www.g-loaded.eu</a>.</div>
<h4>Related Articles</h4>
<ul><li><a href="http://www.g-loaded.eu/2006/10/07/verify-a-burned-cddvd-image-on-linux/" rel="bookmark">Verify a burned CD/DVD image on Linux</a></li>
<li><a href="http://www.g-loaded.eu/2007/12/01/choosing-a-format-for-data-backups-tar-vs-cpio/" rel="bookmark">Choosing a format for data backups &#8211; tar vs cpio</a></li>
<li><a href="http://www.g-loaded.eu/2008/01/28/how-to-extract-rpm-or-deb-packages/" rel="bookmark">How to extract RPM or DEB packages</a></li>
<li><a href="http://www.g-loaded.eu/2007/02/25/error-when-using-old-runbin-installers-under-linux/" rel="bookmark">Error when using old run/bin installers under Linux</a></li>
<li><a href="http://www.g-loaded.eu/2008/05/08/cheap-biometrics-use-keystroke-dynamics-to-identify-and-verify-users/" rel="bookmark">Cheap Biometrics &#8211; Use Keystroke Dynamics to Identify and Verify Users</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.g-loaded.eu/2007/12/01/veritar-verify-checksums-of-files-within-a-tar-archive/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/3.0/</creativeCommons:license>
	</item>
		<item>
		<title>Choosing a format for data backups &#8211; tar vs cpio</title>
		<link>http://www.g-loaded.eu/2007/12/01/choosing-a-format-for-data-backups-tar-vs-cpio/</link>
		<comments>http://www.g-loaded.eu/2007/12/01/choosing-a-format-for-data-backups-tar-vs-cpio/#comments</comments>
		<pubDate>Sat, 01 Dec 2007 02:00:02 +0000</pubDate>
		<dc:creator>George Notaras</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Archives]]></category>
		<category><![CDATA[Backup]]></category>
		<category><![CDATA[Comparison]]></category>
		<category><![CDATA[Filesystem]]></category>
		<category><![CDATA[Storage]]></category>
		<category><![CDATA[Verification]]></category>
		<guid isPermaLink="false">http://www.g-loaded.eu/2007/12/01/choosing-a-format-for-data-backups-tar-vs-cpio/</guid>
		<description><![CDATA[A few days ago, I had decided to revise my data backup methods, so to be able to easily recover as much data as possible after a partial corruption of the medium, a DVD that is, on which the data has been stored. I should clarify that by corruption I by no means include the [...]]]></description>
			<content:encoded><![CDATA[<p>A few days ago, I had decided to revise my data backup methods, so to be able to easily recover as much data as possible after a partial corruption of the medium, a DVD that is, on which the data has been stored. I should clarify that by <em>corruption</em> I by no means include the possibility of mechanical damage of the medium.  After some reasearch on the web, some questions on mailing lists and IRC channels, the quest ended with two formats to choose from, tar and cpio.<br />
<span id="more-467"></span><br />
What I need more when it comes to partial corruption of a backup is to be able to easily extract the healthy archived files. In order to finally make a decision about which format I would finally choose, I performed the following tests:</p>
<ul>
<li>Tests using tar:
<ol>
<li>Random 1-byte corruption.</li>
<li>Partial corruption of one of the archived files metadata.</li>
</ol>
</li>
<li>Tests with cpio:
<ol>
<li>Random 1-byte corruption.</li>
<li>Total corruption of one of the archived files metadata. (same result with partial header corruption)</li>
</ol>
</li>
</ul>
<p>Information about the two formats was found at the following web pages:</p>
<ul>
<li><a href="http://leaf.dragonflybsd.org/cgi/web-man?command=cpio&#038;section=5">CPIO specification</a> (New <code>ASCII</code> format with <code>CRC</code> added)</li>
<li><a href="http://en.wikipedia.org/wiki/Tar_(file_format)#USTAR_format">TAR specification</a> (<code>USTAR</code> format)</li>
</ul>
<p>The following tests assume the directory and file structure outlined below:</p>
<pre class="codesnp">
WORKING_DIR/
          bak/
               1.pdf
               2.pdf
               3.pdf
</pre>
<p>Before continuing I would like to thank the folks at the <em>Linux-Greek-Users</em> mailing list for their advice and ideas. I had initially posted the following material in the LGU list.</p>
<h4>TAR Tests</h4>
<p>Testing corruption of tar archives.</p>
<h5>Random 1-byte corruption of the tar archive</h5>
<p>In this test one random byte of the archive was replaced by a zero (0).</p>
<pre class="console">
$ md5sum bak/*
11875e4e35a40686d81a37aa448aac2e  bak/1.pdf
30c63be455dbada1ffc985c5465d0723  bak/2.pdf
096dc1c77a2a0f4d9f953abd7264843f  bak/3.pdf
</pre>
<pre class="console">
$ tar -cvf bak.tar bak/
bak/
bak/2.pdf
bak/3.pdf
bak/1.pdf
</pre>
<pre class="console">
$ tar -dvf bak.tar bak/
bak/
bak/2.pdf
bak/3.pdf
bak/1.pdf
</pre>
<pre class="console">
$ python -c 'f=open("bak.tar","r+"); f.seek(12334); f.write("0"); f.close()'
</pre>
<pre class="console">
$ tar -dvf bak.tar bak/
bak/
bak/2.pdf
bak/3.pdf
bak/3.pdf: Contents differ
bak/1.pdf
</pre>
<pre class="console">
$ mkdir out
</pre>
<pre class="console">
$ tar -xvf bak.tar -C out/
bak/
bak/2.pdf
bak/3.pdf
bak/1.pdf
</pre>
<pre class="console">
$ md5sum out/bak/*
11875e4e35a40686d81a37aa448aac2e  out/bak/1.pdf
30c63be455dbada1ffc985c5465d0723  out/bak/2.pdf
2d0b2aa54047d6e97b45fbb43f8f1bdc  out/bak/3.pdf
</pre>
<p><strong>Conclusion</strong>: The md5 sums of the original 3.pdf and the extracted 3.pdf differ. The rest of the files has been extracted accurately.</p>
<h5>Partial corruption of one of the archived files metadata</h5>
<p>In this test, 200 bytes of the total 500 bytes of metadata of the 2nd archived file are destroyed. Note that the 1st archived file is the directory <code>bak/</code></p>
<pre class="console">
$ md5sum bak/*
b0ec395ca8cb79f2ce98397ec0e00981  bak/1.pdf
fbe2f3f799579251682ee6de0e4d828d  bak/2.pdf
afb18f2dbbb43673c641691b458dbcce  bak/3.pdf
</pre>
<pre class="console">
$ tar -cvf bak.tar bak/
bak/
bak/2.pdf
bak/3.pdf
bak/1.pdf
</pre>
<pre class="console">
$ tar -dvf bak.tar bak/
bak/
bak/2.pdf
bak/3.pdf
bak/1.pdf
</pre>
<p>In USTAR format, metadata occupy 500 bytes. The tar <strong>magic string</strong> starts at position 257 after the metadata start position. In this test, as it was already mentioned, 200 bytes of data are destroyed (range 200->400):</p>
<pre class="console">
$ python
Python 2.5.1 (r251:54863, Oct 30 2007, 13:54:11)
[GCC 4.1.2 20070925 (Red Hat 4.1.2-33)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> magic = "ustar  \x00"
>>> f = open("bak.tar", "rb+")
>>> magic2_pos = f.read().find(magic, 258)
>>> meta2_start = magic2_pos - 57
>>> f.seek(meta2_start)
>>> f.write("0"*200)
>>> f.close()
>>>
</pre>
<pre class="console">
$ tar -dvf bak.tar bak/
bak/
tar: Skipping to next header
bak/3.pdf
bak/1.pdf
tar: Error exit delayed from previous errors
</pre>
<pre class="console">
$ mkdir out
</pre>
<pre class="console">
$ tar -xvf bak.tar -C out/
bak/
tar: Skipping to next header
bak/3.pdf
bak/1.pdf
tar: Error exit delayed from previous errors
</pre>
<pre class="console">
$ md5sum out/bak/*
b0ec395ca8cb79f2ce98397ec0e00981  out/bak/1.pdf
afb18f2dbbb43673c641691b458dbcce  out/bak/3.pdf
</pre>
<p><strong>Conclusion</strong>: Although one of the archived files metadata has been destroyed, tar has managed to successfully extract the rest of the files, regardless of the fact that they were after the corrupted part of the archive. The success of the extraction is confirmed by comparing the extracted files&#8217; md5 sums with the chewcksums of the original files.</p>
<h4>CPIO Tests</h4>
<p>Testing corruption of cpio archives.</p>
<h5>Random 1-byte corruption of the cpio archive</h5>
<p>In this test one random byte of the archive was replaced by a zero (0).</p>
<pre class="console">
$ md5sum bak/*
11875e4e35a40686d81a37aa448aac2e  bak/1.pdf
30c63be455dbada1ffc985c5465d0723  bak/2.pdf
096dc1c77a2a0f4d9f953abd7264843f  bak/3.pdf
</pre>
<pre class="console">
$ find bak/ | cpio -v -o -H crc > bak.cpio
bak/
bak/2.pdf
bak/3.pdf
bak/1.pdf
25919 blocks
</pre>
<pre class="console">
$ cpio -vi --only-verify-crc < bak.cpio
bak/
bak/2.pdf
bak/3.pdf
bak/1.pdf
25919 blocks
</pre>
</pre>
<pre class="console">
$ python -c 'f=open("bak.tar","r+"); f.seek(12334); f.write("0"); f.close()'
</pre>
<pre class="console">
$ cpio -v -i --only-verify-crc < bak.cpio
bak/
bak/2.pdf
cpio: bak/3.pdf: checksum error (0x2b7dbd48, should be 0x2b7dbda8)
bak/3.pdf
bak/1.pdf
25919 blocks
</pre>
</pre>
<pre class="console">
$ mkdir out2
</pre>
<pre class="console">
$ cd out2/
</pre>
<pre class="console">
$ cpio -vid < ../bak.cpio
bak
bak/2.pdf
cpio: bak/3.pdf: checksum error (0x2b7dbd48, should be 0x2b7dbda8)
bak/3.pdf
bak/1.pdf
25919 blocks
</pre>
</pre>
<pre class="console">
$ cd ..
</pre>
<pre class="console">
$ md5sum out2/bak/*
11875e4e35a40686d81a37aa448aac2e  out2/bak/1.pdf
30c63be455dbada1ffc985c5465d0723  out2/bak/2.pdf
cd9ea8e6298a42f44b59322b31e55958  out2/bak/3.pdf
</pre>
<p><strong>Conclusion</strong>: The md5 sums of the original 3.pdf and the extracted 3.pdf differ. The rest of the files has been extracted accurately.</p>
<h5>Corruption of one the archived files metadata</h5>
<p>In this test the metadata of one of the archived files is destroyed.</p>
<pre class="console">
$ md5sum bak/*
11875e4e35a40686d81a37aa448aac2e  bak/1.pdf
30c63be455dbada1ffc985c5465d0723  bak/2.pdf
096dc1c77a2a0f4d9f953abd7264843f  bak/3.pdf
</pre>
<pre class="console">
$ find bak/ | cpio -v -o -H crc > bak.cpio
bak/
bak/2.pdf
bak/3.pdf
bak/1.pdf
25919 blocks
</pre>
<pre class="console">
$ python
Python 2.5.1 (r251:54863, Oct 30 2007, 13:54:11)
[GCC 4.1.2 20070925 (Red Hat 4.1.2-33)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> magic = "070702"
>>> f = open("bak.cpio", "r+")
>>> magic2_pos = f.read().find(magic, 1)
>>> f.seek(magic2_pos)
>>> metadata_length = magic2_pos + 6 + 13*8 + 4  # 4: μέρος του pathname
>>> f.write("0"*metadata_length)
>>> f.close()
>>>
</pre>
<pre class="console">
$ cpio -v -i --only-verify-crc < bak.cpio
bak/
cpio: premature end of file
</pre>
</pre>
<pre class="console">
$ mkdir out3
</pre>
<pre class="console">
$ cd out3
</pre>
<pre class="console">
$ cpio -vid < ../bak.cpio
bak
cpio: premature end of file
</pre>
<p><strong>Conclusion</strong>: Neither verification nor extraction. cpio (at least Fedora's version) does not have the ability to skip to a healthy header and the operation ends prematurely. The use of a recovery tool in order to recover the healthy files within the archives is mandatory.</p>
<h4>Conclusion</h4>
<p>Here follow the pros and cons (this is not a complete list) of each format:</p>
<p><strong>CPIO</strong><br />
+ per-file CRC checksum. The backed up data on the DVD can be verified in-place without the need of any 3rd party software.<br />
+ No limit for pathnames.</p>
<p>- when the cpio archive gets partially corrupted, as it can happen on a DVD, then the cpio program cannot skip the damaged files and move on to the next healthy archived file. The use of recovery software is needed.<br />
- you have to use the find command's tests in order to include/exclude files in/from the archive.<br />
- It cannot save extended attributes.</p>
<p><strong>TAR</strong><br />
+ Even if some part of the archive gets corrupted, the tar program can skip to the next healthy archived file and extract it. This is very important as it eliminates the need of the 3rd party recovery software.<br />
+ File and directory inclusions/exclusions are possible with command-line options and with file/dir lists read from a file.<br />
+ It can save extended attributes, but 3rd party software may not be able to read the archive correctly.</p>
<p>- No CRC checksum is saved, so checking the data in-place requires two things: to have kept the checksums of the archived files and to have an external program that can check those checksums against the archived data. If this is not possible, then keeping the data on the hard drive in addition to the backup is needed in order to compare them using tar's -d switch.<br />
- The maximum length of a pathname in the USTAR format is 156 bytes.</p>
<p>It is obvious that both of the two formats and/or programs are incomplete. The pros of one are the cons of the other. This was rather a surprise.</p>
<p>My final choice was the <strong>tar</strong> format because I consider the fact that it does not need a 3rd party program to extract the data from a damaged archive a great advantage. I have also created an utility, <a href="http://www.g-loaded.eu/2007/12/01/veritar-verify-checksums-of-files-within-a-tar-archive/">Veritar</a>, that can verify the md5 sums of the files inside a tar archive with the md5sums that have been kept in a separate file during the creation of the archive. More information in my upcoming post about <a href="http://www.g-loaded.eu/2007/12/01/veritar-verify-checksums-of-files-within-a-tar-archive/">tar crc/md5 verification</a>....
</pre>
<div class="cc-block"><em><a href="http://www.g-loaded.eu/2007/12/01/choosing-a-format-for-data-backups-tar-vs-cpio/">Choosing a format for data backups &#8211; tar vs cpio</a></em>, unless otherwise expressly stated, is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/3.0/">Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License</a>. Terms and conditions beyond the scope of this license may be available at <a href="http://www.g-loaded.eu/about/disclaimer-and-license/">www.g-loaded.eu</a>.</div>
<h4>Related Articles</h4>
<ul><li><a href="http://www.g-loaded.eu/2007/12/01/veritar-verify-checksums-of-files-within-a-tar-archive/" rel="bookmark">VeriTAR &#8211; Verify checksums of files within a TAR archive</a></li>
<li><a href="http://www.g-loaded.eu/2008/01/28/how-to-extract-rpm-or-deb-packages/" rel="bookmark">How to extract RPM or DEB packages</a></li>
<li><a href="http://www.g-loaded.eu/2009/01/22/effective-data-wiping-with-a-single-complete-overwrite/" rel="bookmark">Effective data wiping with a single complete overwrite</a></li>
<li><a href="http://www.g-loaded.eu/2006/12/08/more-data-recovery-tools/" rel="bookmark">More Data Recovery Tools</a></li>
<li><a href="http://www.g-loaded.eu/2010/02/27/regular-data-backups/" rel="bookmark">The importance of regular data backups</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.g-loaded.eu/2007/12/01/choosing-a-format-for-data-backups-tar-vs-cpio/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/3.0/</creativeCommons:license>
	</item>
		<item>
		<title>CloneZilla instead of Partimage</title>
		<link>http://www.g-loaded.eu/2007/09/15/clonezilla-instead-of-partimage/</link>
		<comments>http://www.g-loaded.eu/2007/09/15/clonezilla-instead-of-partimage/#comments</comments>
		<pubDate>Sat, 15 Sep 2007 16:17:35 +0000</pubDate>
		<dc:creator>George Notaras</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Administration]]></category>
		<category><![CDATA[Backup]]></category>
		<category><![CDATA[CloneZilla]]></category>
		<category><![CDATA[Filesystem]]></category>
		<category><![CDATA[Maintenance]]></category>
		<category><![CDATA[Review]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[System]]></category>
		<guid isPermaLink="false">http://www.g-loaded.eu/2007/09/15/clonezilla-instead-of-partimage/</guid>
		<description><![CDATA[Until now I have been creating partition images with Partimage, which has never failed. Another very popular tool nowadays is CloneZilla. This software, which happens to include partimage among various other utilities, has wider filesystem support and a better set of features &#8211; taking/restoring backups across the network is supported. The fact that this is [...]]]></description>
			<content:encoded><![CDATA[<p>Until now I have been creating <strong>partition images</strong> with <a href="http://www.g-loaded.eu/2006/01/06/partition-images-with-partimage-and-partimaged/">Partimage</a>, which has never failed. Another very popular tool nowadays is <a href="http://www.clonezilla.org/">CloneZilla</a>. This software, which happens to include partimage among various other utilities, has wider filesystem support and a better set of features &#8211; taking/restoring <strong>backups</strong> across the <strong>network</strong> is supported. The fact that this is an active project is one of the major reasons alone for switching to this software for creating partition or <strong>entire hard disk</strong> backups. Apart from the <strong><a href="http://www.clonezilla.org/clonezilla-live/">official Clonezilla Live CD</a></strong> (probably the most up to date), there must be several live CDs that are built around CloneZilla, but here are two of them on which I have recently stumbled upon:</p>
<ul>
<li><a href="http://www.clonezilla.org/related-live-cd/001_gparted-clonezilla/more_info.php">GParted-CloneZilla Live CD</a> &#8211; This project by LarryT combines the <a href="http://gparted.sourceforge.net/">gparted</a> hard disk partitioning tool with CloneZilla.</li>
<li><a href="http://clonezilla-sysresccd.hellug.gr/index.html"> Clonezilla-SysRescCD</a> &#8211; This is another excellent combination of tools made by Spiros Georgaras. This liveCD combines the <strong>system repair</strong> and <strong>data recovery</strong> collection of tools of the <a href="http://www.sysresccd.org/Main_Page">SysRescCD</a> with CloneZilla.</li>
</ul>
<div class="cc-block"><em><a href="http://www.g-loaded.eu/2007/09/15/clonezilla-instead-of-partimage/">CloneZilla instead of Partimage</a></em>, unless otherwise expressly stated, is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/3.0/">Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License</a>. Terms and conditions beyond the scope of this license may be available at <a href="http://www.g-loaded.eu/about/disclaimer-and-license/">www.g-loaded.eu</a>.</div>
<h4>Related Articles</h4>
<ul><li><a href="http://www.g-loaded.eu/2006/01/06/partition-images-with-partimage-and-partimaged/" rel="bookmark">Partition images with Partimage and Partimaged</a></li>
<li><a href="http://www.g-loaded.eu/2010/02/27/regular-data-backups/" rel="bookmark">The importance of regular data backups</a></li>
<li><a href="http://www.g-loaded.eu/2006/04/08/filesystem-backup-again/" rel="bookmark">Filesystem Backup Again</a></li>
<li><a href="http://www.g-loaded.eu/2006/12/08/more-data-recovery-tools/" rel="bookmark">More Data Recovery Tools</a></li>
<li><a href="http://www.g-loaded.eu/2006/09/10/how-to-recover-lost-files/" rel="bookmark">How to recover lost files</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.g-loaded.eu/2007/09/15/clonezilla-instead-of-partimage/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/3.0/</creativeCommons:license>
	</item>
		<item>
		<title>More Data Recovery Tools</title>
		<link>http://www.g-loaded.eu/2006/12/08/more-data-recovery-tools/</link>
		<comments>http://www.g-loaded.eu/2006/12/08/more-data-recovery-tools/#comments</comments>
		<pubDate>Fri, 08 Dec 2006 13:37:31 +0000</pubDate>
		<dc:creator>George Notaras</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Backup]]></category>
		<category><![CDATA[Filesystem]]></category>
		<category><![CDATA[Software]]></category>
		<guid isPermaLink="false">http://www.g-loaded.eu/2006/12/08/more-data-recovery-tools/</guid>
		<description><![CDATA[I have already mentioned two excellent data recovery utilities in an older post. Today I came across some others; some lists of other tools actually. I didn't have the time to try any of them, but here is some info and some useful links to get started with.]]></description>
			<content:encoded><![CDATA[<p>I have already mentioned two excellent <strong>open source</strong> <strong>data recovery</strong> utilities, <a href="http://www.cgsecurity.org/wiki/TestDisk">TestDisk</a> and <a href="http://www.cgsecurity.org/wiki/PhotoRec">PhotoRec</a>, in an older <a href="http://www.g-loaded.eu/2006/09/10/how-to-recover-lost-files/">post</a>. Today I came across some others; some <em>lists</em> of other tools actually. I didn&#8217;t have the time to try any of them, but here is some info and some useful links to get started with.<br />
<span id="more-318"></span><br />
Most of these tools try to <strong>recover the lost data</strong> with a process called <strong>data carving</strong>. This is a method of retrieving pre-defined types of files, based on distinctive characteristics and internal content structures, regardless of the filesystem or the operating system that was used when the data was written. The <a href="http://en.wikipedia.org/wiki/Magic_number_(programming)#Magic_numbers_in_files">magic numbers</a> or &#8220;<em>magic bytes</em>&#8221; or any other distinctive information contained in the header, main body or footer of a file is used in order to determine its type and to recover it in its entirety, if possible. This method is widely used in <strong>forensic analysis</strong>, but is also perfectly suitable when the <strong>recovery</strong> of specific filetypes is required, for example after a filesystem corruption. For a decent description of the technique, please read this <a href="http://www.dfrws.org/2006/challenge/submissions/grenier/index.html">PhotoRec challenge</a> page.</p>
<p>Some raw utility listings can be found <a href="http://infosec.ufl.edu/literature/ossforensics/links.html">here</a> and <a href="http://www.opensourceforensics.org/tools/unix.html">here</a>.</p>
<p>Below are some of the editor&#8217;s (that&#8217;s me) picks. Be advised, I have not tested any of these utilities. Some <a href="http://dftt.sourceforge.net/">Digital Forensics Tool Testing Images</a> can be used in order to test data recovery software and compare their level of effectiveness.</p>
<p>All of these programs can operate on images generated with utilities like <strong>dd</strong> or directly on the hard disk partition.</p>
<ul>
<li><a href="http://foremost.sourceforge.net/">Foremost</a> &#8211; This is a very popular file carver. The headers and footers of files to be recovered can be defined in a configuration file.</li>
<li><a href="http://www.digitalforensicssolutions.com/Scalpel/">Scalpel</a> &#8211; This program has derived from Foremost 0.69 and, as it is stated in their home page, it is less resource hungry than Foremost; therefore, it can used in very low-end machines.</li>
<li><a href="http://jbj.rapanden.dk/magicrescue/">Magic Rescue</a> &#8211; This program uses the &#8220;magic bytes&#8221; in the file contents in order to recognize file types. The program uses its default &#8220;<em>recipes</em>&#8221; in order to recover files, but the user can define custom recipes.</li>
<li>The <a href="http://www.sleuthkit.org/sleuthkit/">Sleuth Kit</a> and the <a href="http://www.sleuthkit.org/autopsy/">Autopsy Forensic Browser</a> are a set of command line tools and a graphical interface respectively, which can be used to investigate a hard disk. Actually, this is not for everyday data recovery, but rather applies to forensic analysis or to any other serious examination of the partition itself or of the linear representation of the file activity, etc. </li>
</ul>
<p>The recommended operating system for most of the above utilities is Linux, but some of them can run under Windows too. By checking the above lists of software, you will be surprised by the number of open-source software that is available for data recovery or partition analysis.</p>
<div class="cc-block"><em><a href="http://www.g-loaded.eu/2006/12/08/more-data-recovery-tools/">More Data Recovery Tools</a></em>, unless otherwise expressly stated, is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/3.0/">Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License</a>. Terms and conditions beyond the scope of this license may be available at <a href="http://www.g-loaded.eu/about/disclaimer-and-license/">www.g-loaded.eu</a>.</div>
<h4>Related Articles</h4>
<ul><li><a href="http://www.g-loaded.eu/2010/02/27/regular-data-backups/" rel="bookmark">The importance of regular data backups</a></li>
<li><a href="http://www.g-loaded.eu/2006/09/10/how-to-recover-lost-files/" rel="bookmark">How to recover lost files</a></li>
<li><a href="http://www.g-loaded.eu/2007/12/01/choosing-a-format-for-data-backups-tar-vs-cpio/" rel="bookmark">Choosing a format for data backups &#8211; tar vs cpio</a></li>
<li><a href="http://www.g-loaded.eu/2009/01/22/effective-data-wiping-with-a-single-complete-overwrite/" rel="bookmark">Effective data wiping with a single complete overwrite</a></li>
<li><a href="http://www.g-loaded.eu/2007/09/15/clonezilla-instead-of-partimage/" rel="bookmark">CloneZilla instead of Partimage</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.g-loaded.eu/2006/12/08/more-data-recovery-tools/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/3.0/</creativeCommons:license>
	</item>
		<item>
		<title>CD Image Converters</title>
		<link>http://www.g-loaded.eu/2006/12/08/cd-image-converters/</link>
		<comments>http://www.g-loaded.eu/2006/12/08/cd-image-converters/#comments</comments>
		<pubDate>Fri, 08 Dec 2006 12:39:44 +0000</pubDate>
		<dc:creator>George Notaras</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Backup]]></category>
		<category><![CDATA[Filesystem]]></category>
		<category><![CDATA[Interoperability]]></category>
		<category><![CDATA[Software]]></category>
		<guid isPermaLink="false">http://www.g-loaded.eu/2006/12/08/cd-image-converters/</guid>
		<description><![CDATA[LinuxQuestions.org has set up a wiki page which contains information about utilities that can convert CD images from one format to the other. This compilation will probably be useful to Windows users who occasionally use Linux or have recently migrated to Linux. It is widely known that there are numerous windows utilities that save the [...]]]></description>
			<content:encoded><![CDATA[<p>LinuxQuestions.org has set up a <a href="http://wiki.linuxquestions.org/wiki/CD_Image_Conversion">wiki page</a> which contains information about utilities that can convert CD images from one format to the other. This compilation will probably be useful to Windows users who occasionally use Linux or have recently migrated to Linux. It is widely known that there are numerous windows utilities that save the extracted CD/DVD data to their very own image format instead of an <a href="http://en.wikipedia.org/wiki/Iso_image">ISO image</a>. Almost all of the popular formats (<code>bin</code>, <code>nrg</code>, <code>mdf</code>, <code>ccd</code>) are covered and information about how to compile each converter is also provided. After the conversion, the ISO images can easily be mounted under both Linux and Windows.</p>
<div class="cc-block"><em><a href="http://www.g-loaded.eu/2006/12/08/cd-image-converters/">CD Image Converters</a></em>, unless otherwise expressly stated, is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/3.0/">Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License</a>. Terms and conditions beyond the scope of this license may be available at <a href="http://www.g-loaded.eu/about/disclaimer-and-license/">www.g-loaded.eu</a>.</div>
<h4>Related Articles</h4>
<ul><li><a href="http://www.g-loaded.eu/2006/10/07/verify-a-burned-cddvd-image-on-linux/" rel="bookmark">Verify a burned CD/DVD image on Linux</a></li>
<li><a href="http://www.g-loaded.eu/2007/02/24/creative-commons-v30-licenses-launched/" rel="bookmark">Creative Commons v3.0 Licenses Launched</a></li>
<li><a href="http://www.g-loaded.eu/2006/12/08/more-data-recovery-tools/" rel="bookmark">More Data Recovery Tools</a></li>
<li><a href="http://www.g-loaded.eu/2009/04/11/minimal-opensolaris-installation-ovf-image/" rel="bookmark">Minimal OpenSolaris Installation &#8211; OVF Image</a></li>
<li><a href="http://www.g-loaded.eu/2006/09/10/grub-background-image/" rel="bookmark">GRUB background image</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.g-loaded.eu/2006/12/08/cd-image-converters/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/3.0/</creativeCommons:license>
	</item>
	</channel>
</rss>

