<?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>songshu.org &#187; Debian Etch</title>
	<atom:link href="http://www.songshu.org/index.php/category/debian-etch/feed" rel="self" type="application/rss+xml" />
	<link>http://www.songshu.org</link>
	<description>Just another collection of nuts</description>
	<lastBuildDate>Mon, 22 Mar 2010 13:16:36 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>a webcache for the local network</title>
		<link>http://www.songshu.org/index.php/a-webcache-for-the-local-network</link>
		<comments>http://www.songshu.org/index.php/a-webcache-for-the-local-network#comments</comments>
		<pubDate>Sun, 15 Feb 2009 13:01:20 +0000</pubDate>
		<dc:creator>randall</dc:creator>
				<category><![CDATA[Debian Etch]]></category>
		<category><![CDATA[IT]]></category>
		<category><![CDATA[all posts]]></category>
		<category><![CDATA[cache]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[etch]]></category>
		<category><![CDATA[proxy]]></category>
		<category><![CDATA[squid]]></category>
		<category><![CDATA[vserver]]></category>

		<guid isPermaLink="false">http://www.songshu.org/?p=528</guid>
		<description><![CDATA[&#60;div id=“dw”&#62; proxy.cipar.net (192.168.1.14) http://manpages.songshu.org/manpages/lenny/en/man8/squid.8.html a webcache for the local network http://blog.last.fm/2007/08/30/squid-optimization-guide not really sure in how far this optimalisations are optimal for this particulair setting, but it works with or without. and at least for a small office environment i can see no noticable difference with the naked eye. Installation newvserver --vsroot /VSERVERS --hostname proxy --domain cipar.net --ip 192.168.1.14/24 --dist etch --mirror http://192.168.1.12:3142/debian.apt-get.eu/debian --interface dummy0 Your current time zone is set to Unknown Do you want to change that? [n]: Enter for default Enable shadow passwords? &#38;lt;Yes&#38;gt; enter the root password Create a normal user account now? &#38;lt;No&#38;gt; Choose software to install: &#38;lt;Ok&#38;gt; nano /etc/vservers/proxy/apps/init/mark default vserver proxy start vserver proxy enter nano /etc/apt/sources.list deb http://192.168.1.12:3142/security.debian.org/ etch/updates main contrib deb http://192.168.1.12:3142/ftp.nl.debian.org/debian/ etch main contrib non-free apt-get update apt-get upgrade apt-get install squid3 nano /etc/squid3/squid.conf dns_nameservers 192.168.1.17 cache_replacement_policy heap LFUDA memory_replacement_policy heap LFUDA maximum_object_size_in_memory 50 KB cache_mem 100 MB memory_pools off maximum_object_size 50 MB quick_abort_min 0 KB quick_abort_max 0 KB log_icp_queries off client_db off buffered_logs on half_closed_clients off http_port 3128 transparent acl our_networks src 192.168.0.0/24 http_access allow our_networks forwarded_for off /etc/init.d/squid3 restart &#60;/div&#62;]]></description>
			<content:encoded><![CDATA[<p><!-- begin Dokuwiki generated code--></p>
<div class="dokuwiki">
<p>&lt;div id=“dw”&gt;</p>
<h1><a name="proxy.cipar.net_192.168.1.14" id="proxy.cipar.net_192.168.1.14">proxy.cipar.net (192.168.1.14)</a></h1>
<div class="level1">
<p><a href="http://manpages.songshu.org/manpages/lenny/en/man8/squid.8.html" class="urlextern" title="http://manpages.songshu.org/manpages/lenny/en/man8/squid.8.html"  rel="nofollow">http://manpages.songshu.org/manpages/lenny/en/man8/squid.8.html</a>
</p>
<p>
a webcache for the local network<br />
<a href="http://blog.last.fm/2007/08/30/squid-optimization-guide" class="urlextern" title="http://blog.last.fm/2007/08/30/squid-optimization-guide"  rel="nofollow">http://blog.last.fm/2007/08/30/squid-optimization-guide</a> not really sure in how far this optimalisations are optimal for this particulair setting, but it works with or without. and at least for a small office environment i can see no noticable difference with the naked eye.
</p>
</div>
<h4><a name="installation" id="installation">Installation</a></h4>
<div class="level4">
<pre class="code">newvserver --vsroot /VSERVERS --hostname proxy --domain cipar.net --ip 192.168.1.14/24 --dist etch --mirror http://192.168.1.12:3142/debian.apt-get.eu/debian --interface dummy0</pre>
<pre class="code">Your current time zone is set to Unknown
Do you want to change that? [n]:

Enter for default</pre>
<pre class="code"> Enable shadow passwords?
&amp;lt;Yes&amp;gt; </pre>
<pre class="code">enter the root password</pre>
<pre class="code">Create a normal user account now?
 &amp;lt;No&amp;gt;    </pre>
<pre class="code">Choose software to install:
&amp;lt;Ok&amp;gt; </pre>
<pre class="code">nano /etc/vservers/proxy/apps/init/mark
default</pre>
<pre class="code">vserver proxy start
vserver proxy enter</pre>
<pre class="code">nano /etc/apt/sources.list
deb http://192.168.1.12:3142/security.debian.org/ etch/updates main contrib
deb http://192.168.1.12:3142/ftp.nl.debian.org/debian/ etch main contrib non-free</pre>
<pre class="code">apt-get update
apt-get upgrade</pre>
<pre class="code">apt-get install squid3</pre>
<pre class="code">nano /etc/squid3/squid.conf
dns_nameservers 192.168.1.17
cache_replacement_policy heap LFUDA
memory_replacement_policy heap LFUDA
maximum_object_size_in_memory 50 KB
cache_mem 100 MB
memory_pools off
maximum_object_size 50 MB
quick_abort_min 0 KB
quick_abort_max 0 KB
log_icp_queries off
client_db off
buffered_logs on
half_closed_clients off
http_port 3128 transparent
acl our_networks src 192.168.0.0/24
http_access allow our_networks
forwarded_for off</pre>
<pre class="code">/etc/init.d/squid3 restart</pre>
<p>
&lt;/div&gt;
</p>
</div>
</div>
<p><!-- end Dokuwiki generated code--></p>
]]></content:encoded>
			<wfw:commentRss>http://www.songshu.org/index.php/a-webcache-for-the-local-network/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>bind9 in a Vserver</title>
		<link>http://www.songshu.org/index.php/bind9-in-a-vserver</link>
		<comments>http://www.songshu.org/index.php/bind9-in-a-vserver#comments</comments>
		<pubDate>Sun, 15 Feb 2009 12:59:28 +0000</pubDate>
		<dc:creator>randall</dc:creator>
				<category><![CDATA[Debian Etch]]></category>
		<category><![CDATA[IT]]></category>
		<category><![CDATA[all posts]]></category>
		<category><![CDATA[bind9]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[dns]]></category>
		<category><![CDATA[etch]]></category>
		<category><![CDATA[vserver]]></category>

		<guid isPermaLink="false">http://www.songshu.org/?p=526</guid>
		<description><![CDATA[&#60;div id=“dw”&#62; ns0.cipar.net (192.168.1.17) This will be the resolving nameserver available to the local network, and the authoritive for the domains. http://www.debian-administration.org/articles/355 Installation newvserver --vsroot /VSERVERS --hostname ns0 --domain cipar.net --ip 192.168.1.17/24 --dist etch --mirror http://192.168.1.12:3142/debian.apt-get.eu/debian --interface dummy0 Your current time zone is set to Unknown Do you want to change that? [n]: Enter for default Enable shadow passwords? &#38;lt;Yes&#38;gt; enter the root password Create a normal user account now? &#38;lt;No&#38;gt; Choose software to install: &#38;lt;Ok&#38;gt; some problems with bind9 in a vserver can be solved by setting the CAPS nano /etc/vservers/ns0/bcapabilities CAP_SYS_RESOURCE vserver ns0 start vserver ns0 enter nano /etc/apt/sources.list deb http://192.168.1.12:3142/security.debian.org/ etch/updates main contrib deb http://192.168.1.12:3142/ftp.nl.debian.org/debian/ etch main contrib non-free apt-get update apt-get upgrade http://manpages.songshu.org/manpages/lenny/en/man8/named.8.html apt-get install bind9 dnsutils To set up the external part we do as follows: nano /etc/bind/named.conf.local // // Do any local configuration here // // Consider adding the 1918 zones here, if they are not used in your // organization //include &#34;/etc/bind/zones.rfc1918&#34;; acl internals { 127.0.0.0/8; 192.168.1.0/24; 192.168.0.0/24; }; //acl slaves { // 195.234.42.0/24; // XName // 193.218.105.144/28; // XName // 193.24.212.232/29; // XName //}; view &#34;internal&#34; { match-clients { internals; }; recursion yes; zone &#34;cipar.net&#34; { type master; file &#34;/etc/bind/db.cipar.net&#34;; }; // [...]]]></description>
			<content:encoded><![CDATA[<p><!-- begin Dokuwiki generated code--></p>
<div class="dokuwiki">
<p>&lt;div id=“dw”&gt;</p>
<h1><a name="ns0.cipar.net_192.168.1.17" id="ns0.cipar.net_192.168.1.17">ns0.cipar.net (192.168.1.17)</a></h1>
<div class="level1">
<p>
This will be the resolving nameserver available to the local network, and the authoritive for the domains.<br />
<a href="http://www.debian-administration.org/articles/355" class="urlextern" title="http://www.debian-administration.org/articles/355"  rel="nofollow">http://www.debian-administration.org/articles/355</a>
</p>
</div>
<h4><a name="installation" id="installation">Installation</a></h4>
<div class="level4">
<pre class="code">newvserver --vsroot /VSERVERS --hostname ns0 --domain cipar.net --ip 192.168.1.17/24 --dist etch --mirror http://192.168.1.12:3142/debian.apt-get.eu/debian  --interface dummy0 </pre>
<pre class="code">Your current time zone is set to Unknown
Do you want to change that? [n]:

Enter for default</pre>
<pre class="code"> Enable shadow passwords?
&amp;lt;Yes&amp;gt; </pre>
<pre class="code">enter the root password</pre>
<pre class="code">Create a normal user account now?
 &amp;lt;No&amp;gt;    </pre>
<pre class="code">Choose software to install:
&amp;lt;Ok&amp;gt; </pre>
<p>
some problems with bind9 in a vserver can be solved by setting the CAPS
</p>
<pre class="code">nano /etc/vservers/ns0/bcapabilities
CAP_SYS_RESOURCE</pre>
<pre class="code">vserver ns0 start
vserver ns0 enter</pre>
<pre class="code">nano /etc/apt/sources.list
deb http://192.168.1.12:3142/security.debian.org/ etch/updates main contrib
deb http://192.168.1.12:3142/ftp.nl.debian.org/debian/ etch main contrib non-free</pre>
<pre class="code">apt-get update
apt-get upgrade</pre>
<p>
<a href="http://manpages.songshu.org/manpages/lenny/en/man8/named.8.html" class="urlextern" title="http://manpages.songshu.org/manpages/lenny/en/man8/named.8.html"  rel="nofollow">http://manpages.songshu.org/manpages/lenny/en/man8/named.8.html</a>
</p>
<pre class="code">apt-get install bind9 dnsutils</pre>
<p>
To set up the external part we do as follows:</p>
<pre class="code">nano /etc/bind/named.conf.local
//
// Do any local configuration here
//

// Consider adding the 1918 zones here, if they are not used in your
// organization
//include &quot;/etc/bind/zones.rfc1918&quot;;
acl internals {
    127.0.0.0/8;
    192.168.1.0/24;
    192.168.0.0/24;
};
//acl slaves {
//    195.234.42.0/24;    // XName
//    193.218.105.144/28; // XName
//    193.24.212.232/29;  // XName
//};

view &quot;internal&quot; {
    match-clients { internals; };
        recursion yes;
        zone &quot;cipar.net&quot; {
        type master;
        file &quot;/etc/bind/db.cipar.net&quot;;
        };
// prime the server with knowledge of the root servers
zone &quot;.&quot; {
        type hint;
        file &quot;/etc/bind/db.root&quot;;
        };

// be authoritative for the localhost forward and reverse zones, and for
// broadcast zones as per RFC 1912

        zone &quot;localhost&quot; {
        type master;
        file &quot;/etc/bind/db.local&quot;;
        };

        zone &quot;127.in-addr.arpa&quot; {
        type master;
        file &quot;/etc/bind/db.127&quot;;
        };

        zone &quot;0.in-addr.arpa&quot; {
        type master;
        file &quot;/etc/bind/db.0&quot;;
        };
        zone &quot;255.in-addr.arpa&quot; {
        type master;
        file &quot;/etc/bind/db.255&quot;;
        };
};

//view &quot;external&quot; {
//    match-clients { any; };
//    recursion no;
//    zone &quot;songshu.org&quot; {
//    type master;
//    file &quot;/etc/bind/external/db.songshu.org&quot;;
//    allow-transfer { slaves; };
//};
</pre>
<pre class="code">nano /etc/bind/db.example.com
; example.com
$TTL    604800
@       IN      SOA     ns1.example.com. root.example.com. (
                     2006020201 ; Serial
                         604800 ; Refresh
                          86400 ; Retry
                        2419200 ; Expire
                         604800); Negative Cache TTL
;
@       IN      NS      ns1
        IN      MX      10 mail
        IN      A       192.0.2.1
ns1     IN      A       192.0.2.1
mail    IN      A       192.0.2.128 ; We have our mail server somewhere else.
www     IN      A       192.0.2.1
client1 IN      A       192.0.2.201 ; We connect to client1 very often.</pre>
<p>
&lt;/div&gt;
</p>
</div>
</div>
<p><!-- end Dokuwiki generated code--></p>
]]></content:encoded>
			<wfw:commentRss>http://www.songshu.org/index.php/bind9-in-a-vserver/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>setup a debian apt-mirror</title>
		<link>http://www.songshu.org/index.php/setup-a-debian-apt-mirror</link>
		<comments>http://www.songshu.org/index.php/setup-a-debian-apt-mirror#comments</comments>
		<pubDate>Sun, 15 Feb 2009 12:58:12 +0000</pubDate>
		<dc:creator>randall</dc:creator>
				<category><![CDATA[Debian Etch]]></category>
		<category><![CDATA[IT]]></category>
		<category><![CDATA[all posts]]></category>
		<category><![CDATA[apt-mirror]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[etch]]></category>

		<guid isPermaLink="false">http://www.songshu.org/?p=524</guid>
		<description><![CDATA[&#60;div id=“dw”&#62; mirror.cipar.net (192.168.1.18) http://manpages.songshu.org/manpages/lenny/en/man1/apt-mirror.1.html a local mirror for debian and ubuntu Installation newvserver --vsroot /VSERVERS --hostname mirror --domain cipar.net --ip 192.168.1.18/24 --dist etch --mirror http://192.168.1.12:3142/debian.apt-get.eu/debian --interface dummy0 Your current time zone is set to Unknown Do you want to change that? [n]: Enter for default Enable shadow passwords? &#38;lt;Yes&#38;gt; enter the root password Create a normal user account now? &#38;lt;No&#38;gt; Choose software to install: &#38;lt;Ok&#38;gt; nano /etc/vservers/mirror/apps/init/mark default vserver mirror start vserver mirror enter nano /etc/apt/sources.list deb http://192.168.1.12:3142/security.debian.org/ etch/updates main contrib deb http://192.168.1.12:3142/ftp.nl.debian.org/debian/ etch main contrib non-free apt-get update apt-get upgrade apt-get install apt-mirror apache2 nano /etc/apt/mirror.list # apt-mirror configuration file ## ## The default configuration options (uncomment and change to override) ## # # set base_path /var/spool/apt-mirror # set mirror_path $base_path/mirror # set skel_path $base_path/skel # set var_path $base_path/var # # set defaultarch # set nthreads 20 # ## ## Example sources ## # etch section deb-amd64 http://ftp.nl.debian.org/debian etch main contrib non-free deb-amd64 http://security.debian.org/ etch/updates main contrib non-free # Ubuntu Hardy Heron deb-i386 http://archive.ubuntu.com/ubuntu/ hardy main restricted universe multiverse deb-i386 http://security.ubuntu.com/ubuntu hardy-security main restricted universe multiverse deb-i386 http://archive.ubuntu.com/ubuntu/ hardy-updates main restricted universe multiverse deb-i386 http://packages.medibuntu.org/ hardy free non-free ## ## Cleaner configuration example ## # # set cleanscript [...]]]></description>
			<content:encoded><![CDATA[<p><!-- begin Dokuwiki generated code--></p>
<div class="dokuwiki">
<p>&lt;div id=“dw”&gt;</p>
<h1><a name="mirror.cipar.net_192.168.1.18" id="mirror.cipar.net_192.168.1.18">mirror.cipar.net (192.168.1.18)</a></h1>
<div class="level1">
<p><a href="http://manpages.songshu.org/manpages/lenny/en/man1/apt-mirror.1.html" class="urlextern" title="http://manpages.songshu.org/manpages/lenny/en/man1/apt-mirror.1.html"  rel="nofollow">http://manpages.songshu.org/manpages/lenny/en/man1/apt-mirror.1.html</a>
</p>
<p>
a local mirror for debian and ubuntu
</p>
</div>
<h4><a name="installation" id="installation">Installation</a></h4>
<div class="level4">
<pre class="code">newvserver --vsroot /VSERVERS --hostname mirror --domain cipar.net --ip 192.168.1.18/24 --dist etch --mirror http://192.168.1.12:3142/debian.apt-get.eu/debian  --interface dummy0 </pre>
<pre class="code">Your current time zone is set to Unknown
Do you want to change that? [n]:

Enter for default</pre>
<pre class="code"> Enable shadow passwords?
&amp;lt;Yes&amp;gt; </pre>
<pre class="code">enter the root password</pre>
<pre class="code">Create a normal user account now?
 &amp;lt;No&amp;gt;    </pre>
<pre class="code">Choose software to install:
&amp;lt;Ok&amp;gt; </pre>
<pre class="code">nano /etc/vservers/mirror/apps/init/mark
default</pre>
<pre class="code">vserver mirror start
vserver mirror enter</pre>
<pre class="code">nano /etc/apt/sources.list
deb http://192.168.1.12:3142/security.debian.org/ etch/updates main contrib
deb http://192.168.1.12:3142/ftp.nl.debian.org/debian/ etch main contrib non-free</pre>
<pre class="code">apt-get update
apt-get upgrade</pre>
<pre class="code">apt-get install apt-mirror apache2</pre>
<pre class="code">nano /etc/apt/mirror.list
# apt-mirror configuration file

##
## The default configuration options (uncomment and change to override)
##
#
# set base_path    /var/spool/apt-mirror
# set mirror_path  $base_path/mirror
# set skel_path    $base_path/skel
# set var_path     $base_path/var
#
# set defaultarch
# set nthreads     20
#

##
## Example sources
##

# etch section
deb-amd64 http://ftp.nl.debian.org/debian etch main contrib non-free
deb-amd64 http://security.debian.org/ etch/updates main contrib non-free

# Ubuntu Hardy Heron
deb-i386 http://archive.ubuntu.com/ubuntu/ hardy main restricted universe multiverse
deb-i386 http://security.ubuntu.com/ubuntu hardy-security main restricted universe multiverse
deb-i386 http://archive.ubuntu.com/ubuntu/ hardy-updates main restricted universe multiverse
deb-i386 http://packages.medibuntu.org/ hardy free non-free

##
## Cleaner configuration example
##
#
# set cleanscript $var_path/clean.sh
#

# Cleaning section
clean http://ftp.nl.debian.org/
clean http://security.debian.org/
clean http://archive.ubuntu.com/
clean http://packages.medibuntu.org/
</pre>
<pre class="code">su - apt-mirror -c apt-mirror</pre>
<pre class="code">nano /etc/cron.d/apt-mirror
#
# Regular cron jobs for the apt-mirror package
#
0 23    * * 6   apt-mirror      /usr/bin/apt-mirror &amp;gt; /var/spool/apt-mirror/var/cron.log</pre>
<p>
&lt;/div&gt;
</p>
</div>
</div>
<p><!-- end Dokuwiki generated code--></p>
]]></content:encoded>
			<wfw:commentRss>http://www.songshu.org/index.php/setup-a-debian-apt-mirror/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>zimbra in a linux Vserver</title>
		<link>http://www.songshu.org/index.php/zimbra-in-a-linux-vserver</link>
		<comments>http://www.songshu.org/index.php/zimbra-in-a-linux-vserver#comments</comments>
		<pubDate>Sun, 15 Feb 2009 12:56:34 +0000</pubDate>
		<dc:creator>randall</dc:creator>
				<category><![CDATA[Debian Etch]]></category>
		<category><![CDATA[IT]]></category>
		<category><![CDATA[all posts]]></category>
		<category><![CDATA[zimbra]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[etch]]></category>
		<category><![CDATA[mail]]></category>
		<category><![CDATA[vserver]]></category>

		<guid isPermaLink="false">http://www.songshu.org/?p=522</guid>
		<description><![CDATA[&#60;div id=“dw”&#62; mailro.songshu.org (192.168.1.86) Installation newvserver --vsroot /VSERVERS --hostname mailro --domain songshu.org --ip 192.168.1.86/24 --dist etch --arch i386 --mirror http://192.168.1.12:3142/debian.apt-get.eu/debian --interface dummy0 Your current time zone is set to Unknown Do you want to change that? [n]: Enter for default Enable shadow passwords? &#38;lt;Yes&#38;gt; enter the root password Create a normal user account now? &#38;lt;No&#38;gt; Choose software to install: &#38;lt;Ok&#38;gt; Change the size of /tmp from 16m to 128m nano /etc/vservers/mailro/fstab none /proc proc defaults 0 0 none /tmp tmpfs size=128m,mode=1777 0 0 none /dev/pts devpts gid=5,mode=620 0 0 vserver mailro start vserver mailro enter nano /etc/apt/sources.list deb http://192.168.1.12:3142/security.debian.org/ etch/updates main contrib deb http://192.168.1.12:3142/ftp.nl.debian.org/debian/ etch main contrib non-free apt-get update apt-get upgrade apt-get install libgetopt-mixed-perl file libc6-i686 sudo libidn11 curl fetchmail libgmp3c2 libxml2 libstdc++6 openssl libexpat1 libpcre3 libltdl3 libtie-ixhash-perl libperl5.8 ssh cd /usr/src wget http://h.yimg.com/lo/downloads/5.0.9_GA/zcs-5.0.9_GA_2533.DEBIAN4.0.20080815215219.tgz tar xvfz zcs-5.0.9_GA_2533.DEBIAN4.0.20080815215219.tgz cd zcs-5.0.9_GA_2533.DEBIAN4.0.20080815215219 We made a 32bit server on a 64bit host and install the 32bit zimbra version, nevertheless we need to override or the installer will refuse ./install.sh --platform-override Press Return to continue Install zimbra-ldap [Y] y Install zimbra-logger [Y] y Install zimbra-mta [Y] y Install zimbra-snmp [Y] y Install zimbra-store [Y] y Install zimbra-apache [Y] y Install zimbra-spell [Y] y Install [...]]]></description>
			<content:encoded><![CDATA[<p><!-- begin Dokuwiki generated code--></p>
<div class="dokuwiki">
<p>&lt;div id=“dw”&gt;</p>
<h1><a name="mailro.songshu.org_192.168.1.86" id="mailro.songshu.org_192.168.1.86">mailro.songshu.org (192.168.1.86)</a></h1>
<div class="level1">
</div>
<h4><a name="installation" id="installation">Installation</a></h4>
<div class="level4">
<pre class="code">newvserver --vsroot /VSERVERS --hostname mailro --domain songshu.org --ip 192.168.1.86/24 --dist etch --arch i386 --mirror http://192.168.1.12:3142/debian.apt-get.eu/debian  --interface dummy0 </pre>
<pre class="code">Your current time zone is set to Unknown
Do you want to change that? [n]:

Enter for default</pre>
<pre class="code"> Enable shadow passwords?
&amp;lt;Yes&amp;gt; </pre>
<pre class="code">enter the root password</pre>
<pre class="code">Create a normal user account now?
 &amp;lt;No&amp;gt;    </pre>
<pre class="code">Choose software to install:
&amp;lt;Ok&amp;gt; </pre>
<p>
Change the size of /tmp from 16m to 128m</p>
<pre class="code">nano /etc/vservers/mailro/fstab
none    /proc           proc    defaults                0 0
none    /tmp            tmpfs   size=128m,mode=1777     0 0
none    /dev/pts        devpts  gid=5,mode=620          0 0</pre>
<pre class="code">vserver mailro start
vserver mailro enter</pre>
<pre class="code">nano /etc/apt/sources.list
deb http://192.168.1.12:3142/security.debian.org/ etch/updates main contrib
deb http://192.168.1.12:3142/ftp.nl.debian.org/debian/ etch main contrib non-free</pre>
<pre class="code">apt-get update
apt-get upgrade</pre>
<pre class="code">apt-get install libgetopt-mixed-perl file libc6-i686 sudo libidn11 curl fetchmail libgmp3c2 libxml2 libstdc++6 openssl libexpat1 libpcre3 libltdl3 libtie-ixhash-perl libperl5.8 ssh</pre>
<pre class="code">cd /usr/src
wget http://h.yimg.com/lo/downloads/5.0.9_GA/zcs-5.0.9_GA_2533.DEBIAN4.0.20080815215219.tgz</pre>
<pre class="code">tar xvfz zcs-5.0.9_GA_2533.DEBIAN4.0.20080815215219.tgz
cd zcs-5.0.9_GA_2533.DEBIAN4.0.20080815215219</pre>
<p>We made a 32bit server on a 64bit host and install the 32bit zimbra version, nevertheless we need to override or the installer will refuse</p>
<pre class="code">./install.sh --platform-override</pre>
<p>
Press Return to continue</p>
<pre class="code">Install zimbra-ldap [Y] y
Install zimbra-logger [Y] y
Install zimbra-mta [Y] y
Install zimbra-snmp [Y] y
Install zimbra-store [Y] y
Install zimbra-apache [Y] y
Install zimbra-spell [Y] y
Install zimbra-proxy [N] n</pre>
<pre class="code">This platform is DEBIAN4.0_64
Packages found: DEBIAN4.0

Install anyway? [N] Y</pre>
<pre class="code">The system will be modified.  Continue? [N] Y</pre>
<pre class="code">DNS ERROR resolving MX for mailro.songshu.org
It is suggested that the domain name have an MX record configured in DNS
Change domain name? [Yes] No</pre>
<pre class="code">Address unconfigured (**) items  (? - help) 3
Select, or &#039;r&#039; for previous menu [r] 4
set the password *******
*** CONFIGURATION COMPLETE - press &#039;a&#039; to apply
Select from menu, or press &#039;a&#039; to apply config (? - help) a
Save configuration data to a file? [Yes] yes
Save config in file: [/opt/zimbra/config.19658]
The system will be modified - continue? [No] Yes
Notify Zimbra of your installation? [Yes] no</pre>
<p>
The installation should be done by now, we still need to do some modification for the Vserver to listen to its RFC 1918 IP instead of 127.0.0.1
</p>
<pre class="code">cd /opt/zimbra/conf &amp;amp;&amp;amp; mkdir bak new &amp;amp;&amp;amp; cp * bak &amp;amp;&amp;amp; for i in *; do sed &#039;s/127\.0\.0\.1/192.168.1.86/g&#039;  $i &amp;gt; new/$i; done &amp;amp;&amp;amp; mv new/* . &amp;amp;&amp;amp; rmdir new</pre>
<pre class="code">su zimbra</pre>
<pre class="code">zmprov modifyServer mailro.songshu.org zimbraMtaMyNetworks &#039;10.0.0.0/8, 192.168.0.0/16, 172.16.0.0/12,  192.168.1.86&#039;</pre>
<pre class="code">exit</pre>
<pre class="code">nano /opt/zimbra/postfix/conf/master.cf
192.168.1.86:10025 inet n  -       n       -       -  smtpd
 -o mynetworks=127.0.0.1/8,192.168.1.86</pre>
<pre class="code">nano /opt/zimbra/amavisd/sbin/amavisd
@inet_acl   = qw( 127.0.0.1 192.168.1.86 [::1] );  # allow SMTP access only from localhost
$inet_socket_bind = &#039;192.168.1.86&#039;;  # limit socket bind to loopback interface
$notify_method  = &#039;smtp:[192.168.1.86]:10025&#039;;
$forward_method = &#039;smtp:[192.168.1.86]:10025&#039;;</pre>
<pre class="code">nano /opt/zimbra/conf/amavisd.conf
$archive_quarantine_method = &#039;smtp:[192.168.1.86]:10025&#039;;
\&amp;amp;ask_daemon, [&quot;CONTSCAN {}\n&quot;, &#039;192.168.1.86:3310&#039;],</pre>
<pre class="code">nano /opt/zimbra/conf/dspam.conf
LocalMX 192.168.1.86</pre>
<p>
<a href="http://www.songshu.org/wp-content/plugins/wp-dokuwiki/lib/exe/fetch.php?id=&amp;cache=cache&amp;media=page_funambol.cipar.net_firstseconly_footer" class="media mediafile mf_" title="page_funambol.cipar.net_firstseconly_footer">page_funambol.cipar.net_firstseconly_footer</a><br />
&lt;/div&gt;
</p>
</div>
</div>
<p><!-- end Dokuwiki generated code--></p>
]]></content:encoded>
			<wfw:commentRss>http://www.songshu.org/index.php/zimbra-in-a-linux-vserver/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>sync zimbra contacts with funambol</title>
		<link>http://www.songshu.org/index.php/sync-zimbra-contacts-with-funambol</link>
		<comments>http://www.songshu.org/index.php/sync-zimbra-contacts-with-funambol#comments</comments>
		<pubDate>Sun, 15 Feb 2009 12:52:54 +0000</pubDate>
		<dc:creator>randall</dc:creator>
				<category><![CDATA[Debian Etch]]></category>
		<category><![CDATA[IT]]></category>
		<category><![CDATA[all posts]]></category>
		<category><![CDATA[zimbra]]></category>
		<category><![CDATA[adressbook]]></category>
		<category><![CDATA[contacts]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[etch]]></category>
		<category><![CDATA[funambol]]></category>
		<category><![CDATA[sync]]></category>
		<category><![CDATA[vserver]]></category>

		<guid isPermaLink="false">http://www.songshu.org/?p=520</guid>
		<description><![CDATA[&#60;div id=“dw”&#62; Funambol Lets try to hook up funambol.cipar.net with the zimbra installation at mailro.songshu.org so that we can sync the calendars and contact lists with e-mail clients like thunderbird and mobile devices blackberrys and such. Installation you can get it to run on 64bit i guess but you will have to change some paths for java, well not really in to the effort right now so i&#039;ll install the 32 bit OS this time. newvserver --vsroot /VSERVERS --hostname funambol --domain cipar.net --ip 192.168.1.18/24 --dist etch --arch i386 --mirror http://192.168.1.12:3142/debian.apt-get.eu/debian --interface dummy0 Your current time zone is set to Unknown Do you want to change that? [n]: Enter for default Enable shadow passwords? &#38;lt;Yes&#38;gt; enter the root password Create a normal user account now? &#38;lt;No&#38;gt; Choose software to install: &#38;lt;Ok&#38;gt; vserver funambol start vserver funambol enter nano /etc/apt/sources.list deb http://192.168.1.12:3142/security.debian.org/ etch/updates main contrib deb http://192.168.1.12:3142/ftp.nl.debian.org/debian/ etch main contrib non-free apt-get update apt-get upgrade cd /usr/src/ wget http://download.forge.objectweb.org/sync4j/funambol-7.0.6.bin sh funambol-7.0.6.bin and prepare for a long scroll. Do you agree to the above license terms? [yes or no] yes /opt always seems to be a nice place Directory to extract Funambol [/opt] &#38;lt;return to accept&#38;gt;? Do you want to start the server? [...]]]></description>
			<content:encoded><![CDATA[<p><!-- begin Dokuwiki generated code--></p>
<div class="dokuwiki">
<p>&lt;div id=“dw”&gt;</p>
<h1><a name="funambol" id="funambol">Funambol</a></h1>
<div class="level1">
<p>Lets try to hook up funambol.cipar.net with the zimbra installation at mailro.songshu.org so that we can sync the calendars and contact lists with e-mail clients like thunderbird and mobile devices blackberrys and such.
</p>
</div>
<h4><a name="installation" id="installation">Installation</a></h4>
<div class="level4">
<p>you can get it to run on 64bit i guess but you will have to change some paths for java, well not really in to the effort right now so i&#039;ll install the 32 bit <acronym title="Operating System">OS</acronym> this time.</p>
<pre class="code">newvserver --vsroot /VSERVERS --hostname funambol --domain cipar.net --ip 192.168.1.18/24 --dist etch --arch i386 --mirror http://192.168.1.12:3142/debian.apt-get.eu/debian --interface dummy0</pre>
<pre class="code">Your current time zone is set to Unknown
Do you want to change that? [n]:

Enter for default</pre>
<pre class="code"> Enable shadow passwords?
&amp;lt;Yes&amp;gt; </pre>
<pre class="code">enter the root password</pre>
<pre class="code">Create a normal user account now?
 &amp;lt;No&amp;gt;    </pre>
<pre class="code">Choose software to install:
&amp;lt;Ok&amp;gt; </pre>
<pre class="code">vserver funambol start
vserver funambol enter</pre>
<pre class="code">nano /etc/apt/sources.list
deb http://192.168.1.12:3142/security.debian.org/ etch/updates main contrib
deb http://192.168.1.12:3142/ftp.nl.debian.org/debian/ etch main contrib non-free</pre>
<pre class="code">apt-get update
apt-get upgrade</pre>
<pre class="code">cd /usr/src/</pre>
<pre class="code">wget http://download.forge.objectweb.org/sync4j/funambol-7.0.6.bin</pre>
<pre class="code">sh funambol-7.0.6.bin</pre>
<p>and prepare for a long scroll.
</p>
<pre class="code">Do you agree to the above license terms? [yes or no]
yes</pre>
<p>/opt always seems to be a nice place</p>
<pre class="code">Directory to extract Funambol [/opt] &amp;lt;return to accept&amp;gt;? </pre>
<pre class="code">Do you want to start the server? [yes or no]
yes</pre>
<pre class="code">cp /opt/Funambol/bin/funambol /etc/init.d/</pre>
<pre class="code">ln -s /etc/init.d/funambol /etc/rc3.d/S30funambol</pre>
<pre class="code">nano /etc/init.d/funambol</pre>
<p>change funambol home to the following</p>
<pre class="code">FUNAMBOL_HOME=`(cd /opt/Funambol ; pwd)</pre>
<pre class="code">cd /usr/src</pre>
<pre class="code">wget http://downloads.sourceforge.net/zimbrafunambol/ZimbraConnector_0.5.01.s4j?modtime=1219875982&amp;amp;big_mirror=0</pre>
<pre class="code">cp ZimbraConnector_0.5.01.s4j ZimbraConnector.s4j</pre>
<pre class="code">cp ZimbraConnector.s4j /opt/Funambol/ds-server/modules</pre>
<pre class="code">mkdir /opt/Funambol/config/connector</pre>
<pre class="code">nano /opt/Funambol/config/connector/ZimbraConnector.xml</pre>
<pre class="code">&amp;lt;java version=&quot;1.5.0&quot; class=&quot;java.beans.XMLDecoder&quot;&amp;gt;
&amp;lt;object class=&quot;ru.korusconsulting.connector.config.ConnectorConfig&quot;&amp;gt;
  &amp;lt;void property=&quot;dataSource&quot;&amp;gt;
    &amp;lt;string&amp;gt;jdbc/fnblds&amp;lt;/string&amp;gt; &lt;!--The funambol datasource--&gt;
  &amp;lt;/void&amp;gt;
&amp;lt;/object&amp;gt;
&amp;lt;/java&amp;gt;</pre>
<pre class="code">nano /opt/Funambol/ds-server/install.properties</pre>
<p>and add our module to the modules to install</p>
<pre class="code">ZimbraConnector</pre>
<pre class="code">/opt/Funambol/bin/install-modules</pre>
<p>This will ask you to install the modules listed in install.properties.
</p>
<p>
We&#039;re not running funambol on a desktop machine so do the basic install on your desktop client and issue.</p>
<pre class="code">/opt/Funambol/admin/bin/funamboladmin</pre>
<p>to start the admin tool and login to 192.168.1.18.
</p>
<p>
In the admin tool remove the following items</p>
<pre class="code">PIM Calendar SyncSource -- cal; event; scal; stask; task

PIM Contact SyncSource  -- card; scard</pre>
<p>
add new SyncSources to FunambolZimbraConnector.<br />
Modules &gt; zimbra &gt; FunambolZimbraConnector&gt;CalendarSyncSource</p>
<pre class="code">Source URI    = cal,event,scal,stask,task

Name          = cal,event,scal,stask,task

Zimbra URL    = http://mailro.songshu.org/service/soap/
</pre>
<p>
Modules &gt; zimbra &gt; FunambolZimbraConnector&gt;ContactSyncSource</p>
<pre class="code">Source URI    = card, scard

Name          = card, scard

Zimbra URL    = http://mailro.songshu.org/service/soap/
</pre>
<p>
done.<br />
&lt;/div&gt;
</p>
</div>
</div>
<p><!-- end Dokuwiki generated code--></p>
]]></content:encoded>
			<wfw:commentRss>http://www.songshu.org/index.php/sync-zimbra-contacts-with-funambol/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>avantfax on debian</title>
		<link>http://www.songshu.org/index.php/avantfax-on-debian</link>
		<comments>http://www.songshu.org/index.php/avantfax-on-debian#comments</comments>
		<pubDate>Sun, 15 Feb 2009 12:50:33 +0000</pubDate>
		<dc:creator>randall</dc:creator>
				<category><![CDATA[Debian Etch]]></category>
		<category><![CDATA[IT]]></category>
		<category><![CDATA[all posts]]></category>
		<category><![CDATA[avantfax]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[etch]]></category>
		<category><![CDATA[hylafax]]></category>
		<category><![CDATA[vserver]]></category>

		<guid isPermaLink="false">http://www.songshu.org/?p=518</guid>
		<description><![CDATA[&#60;div id=“dw”&#62; fax.cipar.net (192.168.1.10) The hylafax server receives and sends faxes and is accessible via Avantfax on http://192.168.1.10 THE AVANTFAX PART OF THIS THIS PAGE IS OUTDATEd by the avantfax debian.sh script which does basically all the avantfax install below but i keep this page for reference and posterity installation newvserver --vsroot /VSERVERS --hostname fax --domain cipar.net --ip 192.168.1.10/24 --dist etch --mirror http://192.168.1.12:3142/debian.apt-get.eu/debian --interface dummy0 # cd /usr/local/sbin # ./set-context.sh fax vserver fax start vserver fax enter locale-gen # nano /etc/apt/sources.list deb http://192.168.1.12:3142/security.debian.org/ etch/updates main contrib deb-src http://192.168.1.12:3142/security.debian.org/ etch/updates main contrib deb http://192.168.1.12:3142/debian.apt-get.eu/debian/ etch main contrib non-free # apt-get update HylaFAX http://manpages.songshu.org/manpages/lenny/en/man5/hylafax-server.5.html http://www.howtoforge.com/build-a-hylafax-server-with-avantfax-on-debian-etch http://www.lucasmanual.com/mywiki/FaxServer http://www.avantfax.com/install.php # apt-get install postfix chhose No configuration # nano /etc/aliases and add the following root: randall@smydomain # newaliases # apt-get install hylafax-server # exit # cp -a /dev/ttyS0 /VSERVERS/fax/dev/ttyS0 # cp -aR /dev/null /VSERVERS/fax/var/spool/hylafax/dev # vserver fax enter # faxsetup enter for the defaults until the country code # Country code [1]? 31 # Area code [415]? 10 # Phone number of fax modem [+1.999.555.1212]? +31.10.1234567 # Local identification string (for TSI/CIG) [&#34;NothingSetup&#34;]? fax.cipar.net # Long distance dialing prefix [1]? 0 # International dialing prefix [011]? 00 # Protection mode for received facsimile [0600]? 0644 [...]]]></description>
			<content:encoded><![CDATA[<p><!-- begin Dokuwiki generated code--></p>
<div class="dokuwiki">
<p>&lt;div id=“dw”&gt;</p>
<h1><a name="fax.cipar.net_192.168.1.10" id="fax.cipar.net_192.168.1.10">fax.cipar.net (192.168.1.10)</a></h1>
<div class="level1">
<p>The hylafax server receives and sends faxes and is accessible via Avantfax on <a href="http://192.168.1.10" class="urlextern" title="http://192.168.1.10"  rel="nofollow">http://192.168.1.10</a>
</p>
</div>
<h3><a name="the_avantfax_part_of_this_this_page_is_outdated_by_the_avantfax_debian.sh_script_which_does_basically_all_the_avantfax_install_below_but_i_keep_this_page_for_reference_and_posterity" id="the_avantfax_part_of_this_this_page_is_outdated_by_the_avantfax_debian.sh_script_which_does_basically_all_the_avantfax_install_below_but_i_keep_this_page_for_reference_and_posterity">THE AVANTFAX PART OF THIS THIS PAGE IS OUTDATEd by the avantfax debian.sh script which does basically all the avantfax install below but i keep this page for reference and posterity</a></h3>
<div class="level3">
</div>
<h3><a name="installation" id="installation">installation</a></h3>
<div class="level3">
<pre class="code">newvserver --vsroot /VSERVERS --hostname fax --domain cipar.net --ip 192.168.1.10/24 --dist etch --mirror http://192.168.1.12:3142/debian.apt-get.eu/debian --interface dummy0</pre>
<pre class="code"># cd /usr/local/sbin
# ./set-context.sh fax</pre>
<pre class="code">vserver fax start
vserver fax enter
locale-gen</pre>
<pre class="code"># nano /etc/apt/sources.list</pre>
<pre class="code">deb http://192.168.1.12:3142/security.debian.org/ etch/updates main contrib
deb-src http://192.168.1.12:3142/security.debian.org/ etch/updates main contrib
deb http://192.168.1.12:3142/debian.apt-get.eu/debian/ etch main contrib non-free</pre>
<pre class="code"># apt-get update
</pre>
</div>
<h3><a name="hylafax" id="hylafax">HylaFAX</a></h3>
<div class="level3">
<p><a href="http://manpages.songshu.org/manpages/lenny/en/man5/hylafax-server.5.html" class="urlextern" title="http://manpages.songshu.org/manpages/lenny/en/man5/hylafax-server.5.html"  rel="nofollow">http://manpages.songshu.org/manpages/lenny/en/man5/hylafax-server.5.html</a>
</p>
<p>
<a href="http://www.howtoforge.com/build-a-hylafax-server-with-avantfax-on-debian-etch" class="urlextern" title="http://www.howtoforge.com/build-a-hylafax-server-with-avantfax-on-debian-etch"  rel="nofollow">http://www.howtoforge.com/build-a-hylafax-server-with-avantfax-on-debian-etch</a><br />
<a href="http://www.lucasmanual.com/mywiki/FaxServer" class="urlextern" title="http://www.lucasmanual.com/mywiki/FaxServer"  rel="nofollow">http://www.lucasmanual.com/mywiki/FaxServer</a><br />
<a href="http://www.avantfax.com/install.php" class="urlextern" title="http://www.avantfax.com/install.php"  rel="nofollow">http://www.avantfax.com/install.php</a></p>
<pre class="code"># apt-get install postfix</pre>
<pre class="code">chhose No configuration</pre>
<pre class="code"># nano /etc/aliases</pre>
<p>and add the following</p>
<pre class="code">root:   randall@smydomain</pre>
<pre class="code"># newaliases</pre>
<pre class="code"># apt-get install hylafax-server</pre>
<pre class="code"># exit
# cp -a /dev/ttyS0 /VSERVERS/fax/dev/ttyS0
# cp -aR /dev/null /VSERVERS/fax/var/spool/hylafax/dev
# vserver fax enter</pre>
<pre class="code"># faxsetup
enter for the defaults until the country code</pre>
<pre class="code"># Country code [1]? 31
# Area code [415]? 10
# Phone number of fax modem [+1.999.555.1212]? +31.10.1234567
# Local identification string (for TSI/CIG) [&quot;NothingSetup&quot;]? fax.cipar.net
# Long distance dialing prefix [1]? 0
# International dialing prefix [011]? 00
# Protection mode for received facsimile [0600]? 0644
# Protection mode for session logs [0600]? 0644
# Protection mode for ttyS0 [0600]? 0666</pre>
<p>
Allow users from our subnet access to the fax service:</p>
<pre class="code"># nano /etc/hylafax/hosts.hfaxd</pre>
<p>
on the bottom of the file
</p>
<pre class="code">192\.168\.:::</pre>
<pre class="code"># exit
# vserver fax restart
# vserver fax enter</pre>
<pre class="code">faxstat -a -s</pre>
<p>should show something like this</p>
<pre class="code">HylaFAX scheduler on fax.cipar.net: Running
Modem ttyS0 (+**.**.*******): Running and idle</pre>
<p>
Add a fax user. This will create a user named “user” with userID 101 and no password.
</p>
<pre class="code"># faxadduser -u 100 user</pre>
<p>Add an administrator. This will create a user named admin with admin password &lt;password&gt;:</p>
<pre class="code"># faxadduser -a &amp;lt;password&amp;gt; -p &amp;lt;password&amp;gt; -u 100 admin</pre>
</div>
<h3><a name="avantfax" id="avantfax">AvantFax</a></h3>
<div class="level3">
<p>
<em>Below seems largely to be not needed anymore!!!!!!! There is a debian-install.sh now that seems to do basically all below automatically, i have tried it and it worked, even the “rotate” option for the faxes work now without a problem.<br />
The script was not perfect yet since some steps needed to be repeated after the script manually.<br />
Manually repeat this steps from the script:</em></p>
<pre class="code">/usr/sbin/faxadduser -f newhosts -a pwd www-data
/usr/sbin/faxdeluser localhost
/usr/sbin/faxdeluser 127.0.0.1
echo 127.0.0.1 &amp;gt;&amp;gt; newhosts
cat /etc/hylafax/hosts.hfaxd &amp;gt;&amp;gt; newhosts
cat newhosts &amp;gt; /etc/hylafax/hosts.hfaxd
rm -f newhosts
reboot the server</pre>
<p>
first we install all the needed dependencies</p>
<pre class="code"># apt-get install apache2-mpm-prefork apache2-utils apache2.2-common libapache2-mod-php5 php5 php-pear php5-mysql php5-pgsql php5-cli php5-cgi mysql-server netpbm php5-imagick dh-make-php libmagic-dev libungif4g libpng3 sudo libtiff4-dev gs-gpl gsfonts expect php5-dev make php-pear psutils libnetpbm10-dev libungif-bin libungif4-dev php-db php-file php-http php-mail php-mail-mime php-net-smtp php-net-socket php-xml-parser wdiff
</pre>
<p>
And the avantfax itself</p>
<pre class="code"># cd /usr/src
# wget http://easynews.dl.sourceforge.net/sourceforge/avantfax/avantfax-3.0.6.tgz
# tar zvxf avantfax-3.0.6.tgz
# cd avantfax-3.0.6</pre>
<pre class="code"># pear channel-update pear.php.net
# pear upgrade-all
# pear install Mail Net_SMTP Mail_mime MDB2_driver_mysql MDB2_driver_pgsql
# pecl install fileinfo</pre>
<pre class="code"># chmod 0770 avantfax/includes/templates/admin_theme/templates_c/ avantfax/includes/templates/admin_theme/cache/ avantfax/includes/templates/main_theme/templates_c/ avantfax/includes/templates/main_theme/cache/
# chown www-data:www-data avantfax/includes/templates/admin_theme/templates_c/ avantfax/includes/templates/admin_theme/cache/ avantfax/includes/templates/main_theme/templates_c/ avantfax/includes/templates/main_theme/cache/
# chmod 0755 avantfax/includes/faxcover.php avantfax/includes/faxrcvd.php avantfax/includes/notify.php avantfax/tools/update_contacts.php avantfax/tools/faxcover.php avantfax/includes/avantfaxcron.php
</pre>
<pre class="code"># cp avantfax/includes/local_config-example.php avantfax/includes/local_config.php</pre>
<pre class="code"># nano avantfax/includes/local_config.php</pre>
<p>Change the following defaults</p>
<pre class="code">$FAXRMPWD = &quot;pwd&quot;;
define (&#039;ADMIN_EMAIL&#039;, &#039;root@localhost&#039;);
$AVANTFAX_SERVERNAME = &#039;fax.cipar.net&#039;; //</pre>
<p>
Make sure ”-a pwd” is the same as the “$FAXRMPWD = “pwd”;” as above</p>
<pre class="code"># /usr/sbin/faxadduser -f newhosts -a pwd www-data
# /usr/sbin/faxdeluser localhost
# /usr/sbin/faxdeluser 127.0.0.1</pre>
<pre class="code"># echo 127.0.0.1 &amp;gt;&amp;gt; newhosts
# cat /var/spool/hylafax/etc/hosts.hfaxd &amp;gt;&amp;gt; newhosts
# cat newhosts &amp;gt; /var/spool/hylafax/etc/hosts.hfaxd
# rm -f newhosts</pre>
<pre class="code"># echo &#039;JobFmt: &quot;%-3j %3i %1a %15o %40M %-12.12e %5P %5D %7z %.25s&quot;&#039; &amp;gt;&amp;gt; /etc/hylafax/hyla.conf</pre>
<pre class="code"># mv avantfax /var/www/avantfax</pre>
<pre class="code"># chown -R www-data.www-data /var/www/avantfax
# chmod -R 777 /var/www/avantfax/tmp /var/www/avantfax/faxes</pre>
<pre class="code"># nano /etc/apache2/sites-enabled/000-default</pre>
<pre class="code">NameVirtualHost *
 &amp;lt;VirtualHost *&amp;gt;
        DocumentRoot /var/www/avantfax
        ServerName avantfax
&amp;lt;/virtualhost&amp;gt;
</pre>
<pre class="code"># /etc/init.d/mysql restart
# /etc/init.d/apache2 restart</pre>
<pre class="code"># mysql --user=root -e &quot;GRANT ALL ON avantfax.* TO avantfax@localhost IDENTIFIED BY \&quot;d58fe49\&quot;&quot; mysql
# mysqladmin --default-character-set=utf8 --user=avantfax --password=d58fe49 create avantfax
# mysql --user=avantfax --password=d58fe49 avantfax &amp;lt; create_tables.sql
# mysqlshow --user=avantfax --password=d58fe49 avantfax</pre>
<pre class="code"># ln -s /var/www/avantfax/includes/faxrcvd.php /var/spool/hylafax/bin/faxrcvd.php
# ln -s /var/www/avantfax/includes/notify.php  /var/spool/hylafax/bin/notify.php
# mv /usr/bin/faxcover /usr/bin/faxcover.old
# ln -s /var/www/avantfax/includes/faxcover.php /usr/bin/faxcover
# ln -s /usr/share/file/magic* /usr/share/misc/</pre>
<pre class="code"># cat /etc/sudoers | grep -v requiretty &amp;gt; /tmp/sudoers
# echo &quot;www-data ALL= NOPASSWD: /sbin/reboot, /sbin/halt, /usr/sbin/faxdeluser, /usr/sbin/faxadduser -u * -p * *&quot; &amp;gt;&amp;gt; /tmp/sudoers
# mv /etc/sudoers /etc/sudoers.orig
# mv /tmp/sudoers /etc/sudoers
# chmod 0440 /etc/sudoers</pre>
<pre class="code"># nano /var/spool/hylafax/etc/config</pre>
<p>and add the following on at the bottom</p>
<pre class="code">#
## AvantFAX configuration
#
NotifyCmd:      bin/notify.php</pre>
<pre class="code"># nano /var/spool/hylafax/etc/config.ttyS0

#
## AvantFAX configuration
#
FaxrcvdCmd:     bin/faxrcvd.php</pre>
<pre class="code"># crontab -l &amp;gt; /tmp/tab
# echo -e &quot;0 0 * * *\t/var/www/avantfax/includes/avantfaxcron.php -t 2&quot; &amp;gt;&amp;gt; /tmp/tab
# crontab /tmp/tab
# rm -f /tmp/tab</pre>
<pre class="code"># mv /var/spool/hylafax/etc/config /etc/hylafax/config
# mv /var/spool/hylafax/etc/hosts.hfaxd /etc/hylafax/hosts.hfaxd
# mv /var/spool/hylafax/etc/config.ttyS0 /etc/hylafax/config.ttyS0
# /etc/init.d/hylafax restart</pre>
<pre class="code"># nano /etc/postfix/master.cf</pre>
<p>At the top comment out:</p>
<pre class="code">#smtp      inet  n       -       -       -       -       smtpd</pre>
<p>And att the bottom add</p>
<pre class="code">fax       unix  -       n       n       -       1       pipe
  flags= user=faxmail argv=/usr/bin/faxmail -d -n \${user}</pre>
<pre class="code"># nano /etc/postfix/transport</pre>
<p>and add</p>
<pre class="code">yourdomain.com       fax:localhost</pre>
<pre class="code"># postmap /etc/postfix/transport</pre>
<pre class="code"># nano /etc/hylafax/faxmail.conf</pre>
<pre class="code"># nano /etc/postfix/main.cf</pre>
<pre class="code">fax_destination_recipient_limit = 1</pre>
<pre class="code">nano /etc/hylafax/faxmail.conf</pre>
<pre class="code">AutoCoverPage: false
TextPointSize: 12pt
Headers: Message-id Date Subject From
MailUser: faxmail</pre>
<pre class="code"># /etc/init.d postfix reload</pre>
<p>Be carefull not to loose any sleep when doing this the first time, but if you do the result will look like this!
</p>
<p>
<a href="http://www.songshu.org/wp-content/plugins/wp-dokuwiki/lib/exe/detail.php?id=&amp;cache=cache&amp;media=screenshot-1.png" class="media" title="screenshot-1.png"><img src="http://www.songshu.org/wp-content/plugins/wp-dokuwiki/lib/exe/fetch.php?w=&amp;h=&amp;cache=cache&amp;media=screenshot-1.png" class="media" alt="" /></a>
</p>
</div>
<h2><a name="backup" id="backup">backup</a></h2>
<div class="level2">
<p>For the backup we need ssh and rsync
</p>
<pre class="code"># apt-get install openssh-server
# apt-get install rsync</pre>
<p>and make sure ssh only listens to the local address</p>
<pre class="code">ListenAddress 192.168.1.10</pre>
<pre class="code"># /etc/init.d/ssh restart</pre>
<pre class="code">newvserver --vsroot /VSERVERS --hostname fax --domain cipar.net --ip 192.168.1.10/24 --dist etch --mirror http://192.168.1.12:3142/debian.apt-get.eu/debian --interface dummy0</pre>
<pre class="code">cd /usr/src</pre>
<pre class="code">wget http://easynews.dl.sourceforge.net/sourceforge/avantfax/avantfax-3.1.3.tgz</pre>
<pre class="code">tar zvxf avantfax-3.1.3.tgz</pre>
<pre class="code">cd avantfax-3.1.3</pre>
<pre class="code"> nano debian-prefs.txt</pre>
<pre class="code"># DEFAULT INSTALL VALUES FOR Debian
#
# BEWARE: Only run the install script once or risk having duplicate
#         settings in your sendmail, sudo, and other configuration files
#
# The debian-install.sh script refers to this file
#

# The domain name for configuring email to fax
FAXDOMAIN=fax.cipar.net

# The installation directory for AvantFAX
INSTDIR=/var/www/avantfax

# The root directory where HylaFAX bin files are stored (typically, /usr or /usr/local)
HYLADIR=/usr

# HylaFAX $SPOOL directory (typically, /var/spool/hylafax or /var/spool/fax)
SPOOL=/var/spool/hylafax

# These are the database settings AvantFAX will create and use
USER=avantfax
PASS=d58fe49
DB=avantfax

# if the MySQL password for root is set, specify it here
ROOTMYSQLPWD=

# The user and group which Apache runs as (typically, apache, wwwrun, nobody, etc...)
HTTPDUSER=www-data
HTTPDGROUP=www-data</pre>
<p>&lt;/div&gt;
</p>
</div>
</div>
<p><!-- end Dokuwiki generated code--></p>
]]></content:encoded>
			<wfw:commentRss>http://www.songshu.org/index.php/avantfax-on-debian/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>backup files with rsnapshot</title>
		<link>http://www.songshu.org/index.php/backup-files-with-rsnapshot</link>
		<comments>http://www.songshu.org/index.php/backup-files-with-rsnapshot#comments</comments>
		<pubDate>Sun, 15 Feb 2009 12:45:24 +0000</pubDate>
		<dc:creator>randall</dc:creator>
				<category><![CDATA[Debian Etch]]></category>
		<category><![CDATA[IT]]></category>
		<category><![CDATA[all posts]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[etch]]></category>
		<category><![CDATA[rsnapshot]]></category>
		<category><![CDATA[vserver]]></category>

		<guid isPermaLink="false">http://www.songshu.org/?p=512</guid>
		<description><![CDATA[&#60;div id=“dw”&#62; backup.cipar.net (192.168.1.13) The domU that will act as the back up server will be the only one placed on the 2 terabyte disks in the RAID1 setup. Besides keeping a week of daily back ups of the data with rsnapshot from file.cipar.net and mail.cipar.net of this office and 1 of the remote offices we want to make a manual backup of each domU with lvmsnapshot to make sure we can easily have each server up and running in no time. installation newvserver --vsroot /BACKUP --hostname backup --domain cipar.net --ip 192.168.1.13/24 --dist etch --mirror http://192.168.1.12:3142/debian.apt-get.eu/debian --interface dummy0 # cd /usr/local/sbin # ./set-context.sh backup vserver backup start vserver backup enter locale-gen # nano /etc/apt/sources.list deb http://192.168.1.12:3142/security.debian.org/ etch/updates main contrib deb-src http://192.168.1.12:3142/security.debian.org/ etch/updates main contrib deb http://192.168.1.12:3142/debian.apt-get.eu/debian/ etch main contrib non-free deb http://192.168.1.12:3142/www.backports.org/debian etch-backports main contrib non-free # apt-get update # apt-get install debian-backports-keyring # apt-get update # apt-get upgrade rsnapshot http://manpages.songshu.org/manpages/lenny/en/man1/rsnapshot.1.html For more options and further reference this would be a good place to start http://www.debian-administration.org/articles/217 !!!MIND, this is a great script but, FOR SOME REASON IT USES tabs AND WILL NOT WORK WITH SPACES!!!! # apt-get install rsnapshot # nano /etc/rsnapshot.conf comment out the interval&#039;s for the backup interval [...]]]></description>
			<content:encoded><![CDATA[<p><!-- begin Dokuwiki generated code--></p>
<div class="dokuwiki">
<p>&lt;div id=“dw”&gt;</p>
<h1><a name="backup.cipar.net_192.168.1.13" id="backup.cipar.net_192.168.1.13">backup.cipar.net (192.168.1.13)</a></h1>
<div class="level1">
<p>
The domU that will act as the back up server will be the only one placed on the 2 terabyte disks in the RAID1 setup. Besides keeping a week of daily back ups of the data with rsnapshot from file.cipar.net and mail.cipar.net of this office and 1 of the remote offices we want to make a manual backup of each domU with lvmsnapshot to make sure we can easily have each server up and running in no time.
</p>
</div>
<h4><a name="installation" id="installation">installation</a></h4>
<div class="level4">
<pre class="code">newvserver --vsroot /BACKUP --hostname backup --domain cipar.net --ip 192.168.1.13/24 --dist etch --mirror http://192.168.1.12:3142/debian.apt-get.eu/debian --interface dummy0</pre>
<pre class="code"># cd /usr/local/sbin
# ./set-context.sh backup</pre>
<pre class="code">vserver backup start
vserver backup enter
locale-gen</pre>
<pre class="code"># nano /etc/apt/sources.list</pre>
<pre class="code">deb http://192.168.1.12:3142/security.debian.org/ etch/updates main contrib
deb-src http://192.168.1.12:3142/security.debian.org/ etch/updates main contrib
deb http://192.168.1.12:3142/debian.apt-get.eu/debian/ etch main contrib non-free
deb http://192.168.1.12:3142/www.backports.org/debian etch-backports main contrib non-free</pre>
<pre class="code"># apt-get update
# apt-get install debian-backports-keyring
# apt-get update
# apt-get upgrade</pre>
</div>
<h4><a name="rsnapshot" id="rsnapshot">rsnapshot</a></h4>
<div class="level4">
<p><a href="http://manpages.songshu.org/manpages/lenny/en/man1/rsnapshot.1.html" class="urlextern" title="http://manpages.songshu.org/manpages/lenny/en/man1/rsnapshot.1.html"  rel="nofollow">http://manpages.songshu.org/manpages/lenny/en/man1/rsnapshot.1.html</a>
</p>
<p>
For more options and further reference this would be a good place to start <a href="http://www.debian-administration.org/articles/217" class="urlextern" title="http://www.debian-administration.org/articles/217"  rel="nofollow">http://www.debian-administration.org/articles/217</a>
</p>
<ul>
<li class="level1">
<div class="li"> !!!MIND, this is a great script but, FOR SOME REASON IT USES tabs AND WILL NOT WORK WITH SPACES!!!!</div>
</li>
</ul>
<pre class="code"># apt-get install rsnapshot
# nano /etc/rsnapshot.conf</pre>
<p>comment out the interval&#039;s for the backup</p>
<pre class="code">interval        hourly  6
interval        daily   7
interval        weekly  4
interval        monthly 6</pre>
<p>
then we set the directories we want to backup<br />
for the file server:</p>
<pre class="code">backup  root@192.168.1.8:/home/share/   local/shares/
backup  root@192.168.1.10:/var/www/avantfax/faxes/      local/faxes
backup  root@192.168.1.88:/home/        local/mails
</pre>
<p>And uncomment the localhost entries
</p>
<p>
Too make sure that cron will do the hard job for us:</p>
<pre class="code"># nano /etc/cron.d/rsnapshot</pre>
<p>and uncomment so it looks like this</p>
<pre class="code">  GNU nano 2.0.2                                    File: /etc/cron.d/rsnapshot

# This is a sample cron file for rsnapshot.
# The values used correspond to the examples in /etc/rsnapshot.conf.
# There you can also set the backup points and many other things.
#
# To activate this cron file you have to uncomment the lines below.
# Feel free to adapt it to your needs.

 0 */4  * * *           root    /usr/bin/rsnapshot hourly
 30 3   * * *           root    /usr/bin/rsnapshot daily
 0  3   * * 1           root    /usr/bin/rsnapshot weekly
 30 2   1 * *           root    /usr/bin/rsnapshot monthly</pre>
<p>
rsnapshot will need ssh to do remote backups</p>
<pre class="code"># apt-get install openssh-server</pre>
<pre class="code"># nano /etc/ssh/sshd_config</pre>
<p>
and make sure ssh only listens to the local address</p>
<pre class="code">ListenAddress 192.168.1.13</pre>
<p>
Too make sure that rsnapshot can login without a password</p>
<pre class="code"># ssh-keygen -t rsa</pre>
<p>and accept the defaults without a passphrase</p>
<pre class="code"># ssh-copy-id -i ~/.ssh/id_rsa.pub root@192.168.1.8
# ssh-copy-id -i ~/.ssh/id_rsa.pub root@192.168.1.10</pre>
<p>
&lt;/div&gt;
</p>
</div>
</div>
<p><!-- end Dokuwiki generated code--></p>
]]></content:encoded>
			<wfw:commentRss>http://www.songshu.org/index.php/backup-files-with-rsnapshot/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>apt-cacher</title>
		<link>http://www.songshu.org/index.php/apt-cacher</link>
		<comments>http://www.songshu.org/index.php/apt-cacher#comments</comments>
		<pubDate>Sun, 15 Feb 2009 12:42:46 +0000</pubDate>
		<dc:creator>randall</dc:creator>
				<category><![CDATA[Debian Etch]]></category>
		<category><![CDATA[IT]]></category>
		<category><![CDATA[all posts]]></category>
		<category><![CDATA[apt-cacher]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[etch]]></category>

		<guid isPermaLink="false">http://www.songshu.org/?p=510</guid>
		<description><![CDATA[&#60;div id=“dw”&#62; apt.cipar.net (192.168.1.12) A local apt cache for the desktop and server installations and security updates, combine the debian, ubuntu, the medibuntu and a custom repo. installation newvserver --vsroot /VSERVERS --hostname apt --domain cipar.net --ip 192.168.1.12/24 --dist etch --mirror http://ftp.nl.debian.org/debian/ --interface dummy0 # nano /etc/shorewall/rules Add the following line HTTP/ACCEPT dmz:192.168.1.12 net DNS/ACCEPT dmz:192.168.1.12 net # /etc/init.d/shorewall restart vserver apt start vserver apt enter passwd Then enter the passwd RED-ENVELOPE apt-cacher http://manpages.songshu.org/manpages/lenny/en/man1/apt-cacher.1.html # apt-get install apache2 # nano /etc/apache2/httpd.conf And we make sure that apache binds to its IP address by adding this line Listen 192.168.1.12:8080 # /etc/init.d/apache2 restart # apt-get install apt-cacher # nano /etc/apt-cacher/apt-cacher.conf # optional setting, binds the listening daemon to one specified IP. Use IP # ranges for more advanced configuration, see below. daemon_addr=192.168.1.12 # nano /etc/default/apt-cacher and set AUTOSTART=1 /etc/init.d/apt-cacher start All that is left to do now is to edit the sources on every machine # nano /etc/apt/sources.list and change it to look like this deb http://192.168.1.12:3142/security.debian.org/ etch/updates main contrib deb http://192.168.1.12:3142/ftp.nl.debian.org/debian/ etch main contrib non-free deb http://192.168.1.12:3142/www.backports.org/debian etch-backports main contrib non-free So when setting up new Vservers we use –mirror http://192.168.1.12:3142/debian.apt-get.eu/debian For the ubuntu desktops we change it to this deb http://192.168.1.12:3142/archive.ubuntu.com/ubuntu/ [...]]]></description>
			<content:encoded><![CDATA[<p><!-- begin Dokuwiki generated code--></p>
<div class="dokuwiki">
<p>&lt;div id=“dw”&gt;</p>
<h1><a name="apt.cipar.net_192.168.1.12" id="apt.cipar.net_192.168.1.12">apt.cipar.net (192.168.1.12)</a></h1>
<div class="level1">
<p>
A local apt cache for the desktop and server installations and security updates, combine the debian, ubuntu, the medibuntu and a custom repo.
</p>
</div>
<h4><a name="installation" id="installation">installation</a></h4>
<div class="level4">
<pre class="code">newvserver --vsroot /VSERVERS --hostname apt --domain cipar.net --ip 192.168.1.12/24 --dist etch --mirror http://ftp.nl.debian.org/debian/ --interface dummy0</pre>
<pre class="code"># nano /etc/shorewall/rules</pre>
<p>Add the following line</p>
<pre class="code">HTTP/ACCEPT     dmz:192.168.1.12  net
DNS/ACCEPT      dmz:192.168.1.12        net</pre>
<pre class="code"># /etc/init.d/shorewall restart</pre>
<pre class="code">vserver apt start
vserver apt enter
passwd</pre>
<p>Then enter the passwd RED-ENVELOPE
</p>
</div>
<h4><a name="apt-cacher" id="apt-cacher">apt-cacher</a></h4>
<div class="level4">
<p>
<a href="http://manpages.songshu.org/manpages/lenny/en/man1/apt-cacher.1.html" class="urlextern" title="http://manpages.songshu.org/manpages/lenny/en/man1/apt-cacher.1.html"  rel="nofollow">http://manpages.songshu.org/manpages/lenny/en/man1/apt-cacher.1.html</a>
</p>
<pre class="code"># apt-get install apache2</pre>
<pre class="code"># nano /etc/apache2/httpd.conf</pre>
<p>And we make sure that apache binds to its IP address by adding this line</p>
<pre class="code">Listen 192.168.1.12:8080</pre>
<pre class="code"># /etc/init.d/apache2 restart</pre>
<pre class="code"># apt-get install apt-cacher</pre>
<pre class="code"># nano /etc/apt-cacher/apt-cacher.conf</pre>
<pre class="code"># optional setting, binds the listening daemon to one specified IP. Use IP
# ranges for more advanced configuration, see below.
daemon_addr=192.168.1.12 </pre>
<pre class="code"># nano /etc/default/apt-cacher</pre>
<p>and set</p>
<pre class="code">AUTOSTART=1</pre>
<pre class="code">/etc/init.d/apt-cacher start</pre>
<p>
All that is left to do now is to edit the sources on every machine</p>
<pre class="code"># nano /etc/apt/sources.list</pre>
<p>and change it to look like this</p>
<pre class="code">deb http://192.168.1.12:3142/security.debian.org/ etch/updates main contrib
deb http://192.168.1.12:3142/ftp.nl.debian.org/debian/ etch main contrib non-free

deb http://192.168.1.12:3142/www.backports.org/debian etch-backports main contrib non-free</pre>
<p>
So when setting up new Vservers we use –mirror <a href="http://192.168.1.12:3142/debian.apt-get.eu/debian" class="urlextern" title="http://192.168.1.12:3142/debian.apt-get.eu/debian"  rel="nofollow">http://192.168.1.12:3142/debian.apt-get.eu/debian</a>
</p>
<p>For the ubuntu desktops we change it to this</p>
<pre class="code">deb http://192.168.1.12:3142/archive.ubuntu.com/ubuntu/ gutsy main restricted universe multiverse
deb http://192.168.1.12:3142/security.ubuntu.com/ubuntu gutsy-security main restricted universe
deb-src http://192.168.1.12:3142/security.ubuntu.com/ubuntu gutsy-security main restricted universe
deb http://192.168.1.12:3142/archive.ubuntu.com/ubuntu/ gutsy-updates main restricted universe multiverse
deb http://192.168.1.12:3142/packages.medibuntu.org/ gutsy free non-free</pre>
<p>&lt;/div&gt;
</p>
</div>
</div>
<p><!-- end Dokuwiki generated code--></p>
]]></content:encoded>
			<wfw:commentRss>http://www.songshu.org/index.php/apt-cacher/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>setup RAID 10</title>
		<link>http://www.songshu.org/index.php/setup-raid-10</link>
		<comments>http://www.songshu.org/index.php/setup-raid-10#comments</comments>
		<pubDate>Sat, 14 Feb 2009 20:45:21 +0000</pubDate>
		<dc:creator>randall</dc:creator>
				<category><![CDATA[Debian Etch]]></category>
		<category><![CDATA[IT]]></category>
		<category><![CDATA[all posts]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[etch]]></category>
		<category><![CDATA[raid]]></category>
		<category><![CDATA[raid10]]></category>

		<guid isPermaLink="false">http://www.songshu.org/?p=459</guid>
		<description><![CDATA[&#60;div id=“dw”&#62; host.cipar.net (192.168.1.1) The base for this setup is Debian Etch dom0, we will use the 64 bits edition to make use of the little extra speed advantage. We only need a minimal install to start with. Debian install media The most used method for a Linux installation is using the cd method, but just in case you are unlucky like me and you have a motherboard that does not like IDE cd drives i have added the step for an usb installation. make a debian installation cd We will use the 64 bits netinstall iso for debian etch 4.0 to install the base system wich is a +- 145Mb download. $ wget http://cdimage.debian.org/debian-cd/4.0_r2/amd64/iso-cd/debian-40r2-amd64-netinst.iso once we have the .iso we need to burn it to cd. # nice --18 wodim -eject -v speed=2 dev=/dev/cdrom -data -pad debian-40r2-amd64-netinst.iso The cd cover is marked as “host.cipar.net” Debian Etch 4.0_r2 AMD 64 make a debian installation usb To download the installer we do as follows $ wget http://ftp.nl.debian.org/debian/dists/etch/main/installer-amd64/current/images/hd-media/boot.img.gz and we will also need the same iso file as when making an installation cd $ wget http://cdimage.debian.org/debian-cd/4.0_r2/amd64/iso-cd/debian-40r2-amd64-netinst.iso The exact mountpoint of the usb can be found with $ fdisk -l Assuming your usb [...]]]></description>
			<content:encoded><![CDATA[<p><!-- begin Dokuwiki generated code--></p>
<div class="dokuwiki">
<p>&lt;div id=“dw”&gt;</p>
<h1><a name="host.cipar.net_192.168.1.1" id="host.cipar.net_192.168.1.1">host.cipar.net (192.168.1.1)</a></h1>
<div class="level1">
<p>
The base for this setup is Debian Etch dom0, we will use the 64 bits edition to make use of the little extra speed advantage. We only need a minimal install to start with.
</p>
</div>
<h1><a name="debian_install_media" id="debian_install_media">Debian install media</a></h1>
<div class="level1">
<p>The most used method for a Linux installation is using the cd method, but just in case you are unlucky like me and you have a motherboard that does not like IDE cd drives i have added the step for an usb installation.</p>
</div>
<h5><a name="make_a_debian_installation_cd" id="make_a_debian_installation_cd">make a debian installation cd</a></h5>
<div class="level5">
<p>
We will use the 64 bits netinstall iso for debian etch 4.0 to install the base system wich is a +- 145Mb download.</p>
<pre class="code">$ wget http://cdimage.debian.org/debian-cd/4.0_r2/amd64/iso-cd/debian-40r2-amd64-netinst.iso</pre>
<p>
once we have the .iso we need to burn it to cd.</p>
<pre class="code"># nice --18 wodim -eject -v speed=2 dev=/dev/cdrom -data -pad debian-40r2-amd64-netinst.iso</pre>
<p>
The cd cover is marked as “host.cipar.net” Debian Etch 4.0_r2 AMD 64
</p>
</div>
<h2><a name="make_a_debian_installation_usb" id="make_a_debian_installation_usb">make a debian installation usb</a></h2>
<div class="level2">
<p>To download the installer we do as follows</p>
<pre class="code">$ wget http://ftp.nl.debian.org/debian/dists/etch/main/installer-amd64/current/images/hd-media/boot.img.gz</pre>
<p>
and we will also need the same iso file as when making an installation cd</p>
<pre class="code">$ wget http://cdimage.debian.org/debian-cd/4.0_r2/amd64/iso-cd/debian-40r2-amd64-netinst.iso</pre>
<p>The exact mountpoint of the usb can be found with</p>
<pre class="code">$ fdisk -l</pre>
<p>
Assuming your usb is mounted as /dev/sda we can extract the boot.img.gz to the usb stick.</p>
<pre class="code">$ zcat boot.img.gz &amp;gt; /dev/sda</pre>
<p>
Then mount the usb.</p>
<pre class="code"># mount /dev/sda /mnt</pre>
<p>
when this is done simply copy the .iso to the same usb disk</p>
<pre class="code"># cp debian-40r2-amd64-netinst.iso /mnt</pre>
<p>
and then unmount the usb stick</p>
<pre class="code"># umount /mnt</pre>
</div>
<h1><a name="base_install" id="base_install">base install</a></h1>
<div class="level1">
<p><a href="http://www.songshu.org/wp-content/plugins/wp-dokuwiki/lib/exe/detail.php?id=&amp;cache=cache&amp;media=wiki:deb_install1.png" class="media" title="wiki:deb_install1.png"><img src="http://www.songshu.org/wp-content/plugins/wp-dokuwiki/lib/exe/fetch.php?w=&amp;h=&amp;cache=cache&amp;media=wiki:deb_install1.png" class="mediacenter" alt="" /></a>
</p>
<p>Once we have the installation cd we
</p>
<pre class="code"># apt-get install openssh-server</pre>
</div>
<h5><a name="system_preparation" id="system_preparation">system preparation</a></h5>
<div class="level5">
<pre class="code">deb http://security.debian.org/ etch/updates main contrib
deb-src http://security.debian.org/ etch/updates main contrib
deb http://www.backports.org/debian etch-backports main contrib non-free
deb http://debian.apt-get.eu/debian/ etch main contrib non-free</pre>
<pre class="code">apt-get install debian-backports-keyring</pre>
</div>
<h1><a name="replacing_disfuctioning_marvel_ethernet_controller" id="replacing_disfuctioning_marvel_ethernet_controller">replacing disfuctioning Marvel ethernet controller</a></h1>
<div class="level1">
<p>There were problems in the past with the sky2 driver and it still seems to act up once in a while.<br />
to replace it and to have sure the new card is detected as eth0 i did the following afterwards since it was running fine the first two weeks or so.
</p>
<p>
i disabled the first LAN card in the bios.<br />
removed the rule set (could have simply changed it as well, as i had to any way because the firewire popped up as eth1)</p>
<pre class="code"># rm /etc/udev/rules.d/z25_persistent-net.rules</pre>
<p>after a reboot it was automatically regenerated</p>
<pre class="code"># This file was automatically generated by the /lib/udev/write_net_rules
# program, probably run by the persistent-net-generator.rules rules file.
#
# You can modify it, as long as you keep each rule on a single line.
# MAC addresses must be written in lowercase.

# PCI device 0x8086:0x100c (e1000)
SUBSYSTEM==&quot;net&quot;, DRIVERS==&quot;?*&quot;, ATTRS{address}==&quot;00:02:b3:91:64:d0&quot;, NAME=&quot;eth0&quot;

# Firewire device 0011d800016be1a3 (ohci1394)
SUBSYSTEM==&quot;net&quot;, DRIVERS==&quot;?*&quot;, ATTRS{address}==&quot;00:11:d8:00:01:6b:e1:a3&quot;, NAME=&quot;eth2&quot;

# PCI device 0x11ab:0x4364 (sky2)
SUBSYSTEM==&quot;net&quot;, DRIVERS==&quot;?*&quot;, ATTRS{address}==&quot;00:1d:60:33:1b:dc&quot;, NAME=&quot;eth1&quot;
</pre>
<pre class="code"># nano /etc/network/interfaces</pre>
<pre class="code"># This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet static
hwaddress ether 00:02:b3:91:64:d0
        address 212.123.252.242
        netmask 255.255.255.0
        network 212.123.252.0
        broadcast 212.123.252.255
        gateway 212.123.252.1
        # dns-* options are implemented by the resolvconf package, if installed
        dns-nameservers 192.168.0.1
        dns-search cipar.net

auto eth1
iface eth1 inet static
hwaddress ether 00:1D:60:33:1B:DC
        address 192.168.0.1
        netmask 255.255.255.0
        broadcast 192.168.0.255
        network 192.168.0.0

auto dummy0
iface dummy0 inet static
    address 192.168.1.1
    netmask 255.255.255.0</pre>
</div>
<h1><a name="setup_raid_10" id="setup_raid_10">setup RAID 10</a></h1>
<div class="level1">
<p>With thanks to Falko Timme on who&#039;s article this was based on<br />
<a href="http://www.howtoforge.com/software-raid1-grub-boot-debian-etch" class="urlextern" title="http://www.howtoforge.com/software-raid1-grub-boot-debian-etch"  rel="nofollow">http://www.howtoforge.com/software-raid1-grub-boot-debian-etch</a>
</p>
<p>
After the base install we can log in via ssh to set up the <acronym title="Redundant Array of Inexpensive Disks">RAID</acronym>, the end result should become like this</p>
<ul>
<li class="level1">
<div class="li"> RAID1  /dev/md0 (/dev/sdc1, /dev/sdd1, /dev/sde1 and /dev/sdf1): /boot, ext3;</div>
</li>
<li class="level1">
<div class="li"> RAID10 /dev/md1 (/dev/sdc3, /dev/sdd3, /dev/sde3 and /dev/sdf3): /root, ext3;</div>
</li>
<li class="level1">
<div class="li"> RAID10 /dev/md2 (/dev/sdc5, /dev/sdd5, /dev/sde5 and /dev/sdf5): swap</div>
</li>
<li class="level1">
<div class="li"> RAID10 /dev/md3 (/dev/sdc6, /dev/sdd6, /dev/sde6 and /dev/sdf6): LVM</div>
</li>
</ul>
<p>I think we could have done this during the base installation a lot easier (memo to me: figure out how), but this approach at least keeps the base install as simple as possible so that a more experienced admin can pick up the dirty work from a remote location.
</p>
<ul>
<li class="level1">
<div class="li">Aftertought!!!!!</div>
</li>
</ul>
<p>
It might even have been easier still to install the initial install on one of the Terrabyte disks and then create the 4 disk RAID10 array in one go, anyway, i did have some fun doing this ;)
</p>
<p>
Here we can see what happened during the base install:<br />
To get an overview of the disk space available to the running system</p>
<pre class="code"># df -h</pre>
<pre class="code">host:~# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sdc3             4.5G  446M  3.9G  11% /
tmpfs                 4.0G     0  4.0G   0% /lib/init/rw
udev                   10M   76K   10M   1% /dev
tmpfs                 4.0G     0  4.0G   0% /dev/shm
/dev/sdc1              92M   13M   74M  15% /boot</pre>
<p>To get an overview of all the available disks and partitions</p>
<pre class="code"># fdisk -l</pre>
<pre class="code">host:~# fdisk -l

Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System

Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System

Disk /dev/sdc: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1   *           1          12       96358+  83  Linux
/dev/sdc2             609       60801   483500272+   5  Extended
/dev/sdc3              13         608     4787370   83  Linux
/dev/sdc5             609         669      489951   82  Linux swap / Solaris
/dev/sdc6             670       60801   483010258+  8e  Linux LVM

Partition table entries are not in disk order

Disk /dev/sdd: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System

Disk /dev/sde: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System

Disk /dev/sdf: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System</pre>
</div>
<h3><a name="installing_mdadm" id="installing_mdadm">Installing mdadm</a></h3>
<div class="level3">
<p><a href="http://manpages.songshu.org/manpages/lenny/en/man8/mdadm.8.html" class="urlextern" title="http://manpages.songshu.org/manpages/lenny/en/man8/mdadm.8.html"  rel="nofollow">http://manpages.songshu.org/manpages/lenny/en/man8/mdadm.8.html</a>
</p>
<p>
The most important tool for setting up <acronym title="Redundant Array of Inexpensive Disks">RAID</acronym> is mdadm. Let&#039;s install it like this:</p>
<pre class="code"># apt-get install initramfs-tools mdadm</pre>
<p>You will be asked the following question:
</p>
<p>
MD arrays needed for the root filesystem: ←- all
</p>
<p>
Afterwards, we load a few kernel modules (to avoid a reboot):</p>
<pre class="code"># modprobe md
# modprobe linear
# modprobe multipath
# modprobe raid0
# modprobe raid1
# modprobe raid5
# modprobe raid6
# modprobe raid10</pre>
<p>Now run</p>
<pre class="code"># cat /proc/mdstat</pre>
<p>The output should look as follows:</p>
<pre class="code">host:~# cat /proc/mdstat
Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10]
unused devices: &amp;lt;none&amp;gt;</pre>
</div>
<h3><a name="preparing_dev_sdd_dev_sde_and_dev_sdf" id="preparing_dev_sdd_dev_sde_and_dev_sdf">Preparing /dev/sdd, /dev/sde and /dev/sdf</a></h3>
<div class="level3">
<p>To create the arrays on our already running system, we must prepare the /dev/sdd, /dev/sde and /dev/sdf hard drive for <acronym title="Redundant Array of Inexpensive Disks">RAID</acronym>, then copy the contents of our /dev/sdc hard drive to it, and finally add /dev/sdc to the <acronym title="Redundant Array of Inexpensive Disks">RAID</acronym> array.
</p>
<p>First, we copy the partition table from /dev/sdc to the others so that all disks have exactly the same layout:
</p>
<p>
<a href="http://manpages.songshu.org/manpages/lenny/en/man8/sfdisk.8.html" class="urlextern" title="http://manpages.songshu.org/manpages/lenny/en/man8/sfdisk.8.html"  rel="nofollow">http://manpages.songshu.org/manpages/lenny/en/man8/sfdisk.8.html</a>
</p>
<pre class="code"># sfdisk -d /dev/sdc | sfdisk /dev/sdd
# sfdisk -d /dev/sdc | sfdisk /dev/sde
# sfdisk -d /dev/sdc | sfdisk /dev/sdf</pre>
<p>The output should be something as follows:
</p>
<pre class="code">host:~# sfdisk -d /dev/sdc | sfdisk /dev/sde
Checking that no-one is using this disk right now ...
OK

Disk /dev/sde: 60801 cylinders, 255 heads, 63 sectors/track
Old situation:
Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0

   Device Boot Start     End   #cyls    #blocks   Id  System
/dev/sde1          0       -       0          0    0  Empty
/dev/sde2          0       -       0          0    0  Empty
/dev/sde3          0       -       0          0    0  Empty
/dev/sde4          0       -       0          0    0  Empty
New situation:
Units = sectors of 512 bytes, counting from 0

   Device Boot    Start       End   #sectors  Id  System
/dev/sde1   *        63    192779     192717  83  Linux
/dev/sde2       9767520 976768064  967000545   5  Extended
/dev/sde3        192780   9767519    9574740  83  Linux
/dev/sde4             0         -          0   0  Empty
/dev/sde5       9767583  10747484     979902  82  Linux swap / Solaris
/dev/sde6      10747548 976768064  966020517  8e  Linux LVM
Successfully wrote the new partition table

Re-reading the partition table ...

If you created or changed a DOS partition, /dev/foo7, say, then use dd(1)
to zero the first 512 bytes:  dd if=/dev/zero of=/dev/foo7 bs=512 count=1
(See fdisk(8).)</pre>
<p>
The command<br />
<a href="http://manpages.songshu.org/manpages/lenny/en/man8/fdisk.8.html" class="urlextern" title="http://manpages.songshu.org/manpages/lenny/en/man8/fdisk.8.html"  rel="nofollow">http://manpages.songshu.org/manpages/lenny/en/man8/fdisk.8.html</a></p>
<pre class="code"># fdisk -l</pre>
<p>should now show that all 4 HDDs have the same layout:</p>
<pre class="code">host:~# fdisk -l

Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System

Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System

Disk /dev/sdc: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1   *           1          12       96358+  83  Linux
/dev/sdc2             609       60801   483500272+   5  Extended
/dev/sdc3              13         608     4787370   83  Linux
/dev/sdc5             609         669      489951   82  Linux swap / Solaris
/dev/sdc6             670       60801   483010258+  8e  Linux LVM

Partition table entries are not in disk order

Disk /dev/sdd: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdd1   *           1          12       96358+  83  Linux
/dev/sdd2             609       60801   483500272+   5  Extended
/dev/sdd3              13         608     4787370   83  Linux
/dev/sdd5             609         669      489951   82  Linux swap / Solaris
/dev/sdd6             670       60801   483010258+  8e  Linux LVM

Partition table entries are not in disk order

Disk /dev/sde: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sde1   *           1          12       96358+  83  Linux
/dev/sde2             609       60801   483500272+   5  Extended
/dev/sde3              13         608     4787370   83  Linux
/dev/sde5             609         669      489951   82  Linux swap / Solaris
/dev/sde6             670       60801   483010258+  8e  Linux LVM

Partition table entries are not in disk order

Disk /dev/sdf: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdf1   *           1          12       96358+  83  Linux
/dev/sdf2             609       60801   483500272+   5  Extended
/dev/sdf3              13         608     4787370   83  Linux
/dev/sdf5             609         669      489951   82  Linux swap / Solaris
/dev/sdf6             670       60801   483010258+  8e  Linux LVM

Partition table entries are not in disk order</pre>
<p>
Next we must change the partition type of our three partitions on /dev/sdd, /dev/sde and /dev/sdf drives to Linux raid autodetect:
</p>
<pre class="code"># fdisk /dev/sdd</pre>
<pre class="code">host1:~# fdisk /dev/sdd

Command (m for help): &amp;lt;-- m
Command action
   a   toggle a bootable flag
   b   edit bsd disklabel
   c   toggle the dos compatibility flag
   d   delete a partition
   l   list known partition types
   m   print this menu
   n   add a new partition
   o   create a new empty DOS partition table
   p   print the partition table
   q   quit without saving changes
   s   create a new empty Sun disklabel
   t   change a partition&#039;s system id
   u   change display/entry units
   v   verify the partition table
   w   write table to disk and exit
   x   extra functionality (experts only)

Command (m for help): &amp;lt;-- t
Partition number (1-6): &amp;lt;-- 1
Hex code (type L to list codes): &amp;lt;-- L

 0  Empty           1e  Hidden W95 FAT1 80  Old Minix       be  Solaris boot
 1  FAT12           24  NEC DOS         81  Minix / old Lin bf  Solaris
 2  XENIX root      39  Plan 9          82  Linux swap / So c1  DRDOS/sec (FAT-
 3  XENIX usr       3c  PartitionMagic  83  Linux           c4  DRDOS/sec (FAT-
 4  FAT16 &amp;lt;32M      40  Venix 80286     84  OS/2 hidden C:  c6  DRDOS/sec (FAT-
 5  Extended        41  PPC PReP Boot   85  Linux extended  c7  Syrinx
 6  FAT16           42  SFS             86  NTFS volume set da  Non-FS data
 7  HPFS/NTFS       4d  QNX4.x          87  NTFS volume set db  CP/M / CTOS / .
 8  AIX             4e  QNX4.x 2nd part 88  Linux plaintext de  Dell Utility
 9  AIX bootable    4f  QNX4.x 3rd part 8e  Linux LVM       df  BootIt
 a  OS/2 Boot Manag 50  OnTrack DM      93  Amoeba          e1  DOS access
 b  W95 FAT32       51  OnTrack DM6 Aux 94  Amoeba BBT      e3  DOS R/O
 c  W95 FAT32 (LBA) 52  CP/M            9f  BSD/OS          e4  SpeedStor
 e  W95 FAT16 (LBA) 53  OnTrack DM6 Aux a0  IBM Thinkpad hi eb  BeOS fs
 f  W95 Ext&#039;d (LBA) 54  OnTrackDM6      a5  FreeBSD         ee  EFI GPT
10  OPUS            55  EZ-Drive        a6  OpenBSD         ef  EFI (FAT-12/16/
11  Hidden FAT12    56  Golden Bow      a7  NeXTSTEP        f0  Linux/PA-RISC b
12  Compaq diagnost 5c  Priam Edisk     a8  Darwin UFS      f1  SpeedStor
14  Hidden FAT16 &amp;lt;3 61  SpeedStor       a9  NetBSD          f4  SpeedStor
16  Hidden FAT16    63  GNU HURD or Sys ab  Darwin boot     f2  DOS secondary
17  Hidden HPFS/NTF 64  Novell Netware  b7  BSDI fs         fd  Linux raid auto
18  AST SmartSleep  65  Novell Netware  b8  BSDI swap       fe  LANstep
1b  Hidden W95 FAT3 70  DiskSecure Mult bb  Boot Wizard hid ff  BBT
1c  Hidden W95 FAT3 75  PC/IX
Hex code (type L to list codes): &amp;lt;-- fd
Changed system type of partition 1 to fd (Linux raid autodetect)

Command (m for help): &amp;lt;-- t
Partition number (1-6): &amp;lt;-- 1
Hex code (type L to list codes): &amp;lt;-- fd
Changed system type of partition 2 to fd (Linux raid autodetect)

Command (m for help): &amp;lt;-- t
Partition number (1-5): &amp;lt;-- 3
Hex code (type L to list codes): &amp;lt;-- fd
Changed system type of partition 3 to fd (Linux raid autodetect)

Command (m for help): &amp;lt;-- t
Partition number (1-4): &amp;lt;-- 5
Hex code (type L to list codes): &amp;lt;-- fd
Changed system type of partition 3 to fd (Linux raid autodetect)
Command (m for help): &amp;lt;-- w
The partition table has been altered!

Command (m for help): &amp;lt;-- t
Partition number (1-3): &amp;lt;-- 6
Hex code (type L to list codes): &amp;lt;-- fd
Changed system type of partition 3 to fd (Linux raid autodetect)

Calling ioctl() to re-read partition table.
Syncing disks.</pre>
<p>
To make sure that there are no remains from previous <acronym title="Redundant Array of Inexpensive Disks">RAID</acronym> installations on the disks, we run the following commands:</p>
<pre class="code"># mdadm --zero-superblock /dev/sdc1
# mdadm --zero-superblock /dev/sdc3
# mdadm --zero-superblock /dev/sdc5
# mdadm --zero-superblock /dev/sdc6

# mdadm --zero-superblock /dev/sdd1
# mdadm --zero-superblock /dev/sdd3
# mdadm --zero-superblock /dev/sdd5
# mdadm --zero-superblock /dev/sdd6

# mdadm --zero-superblock /dev/sde1
# mdadm --zero-superblock /dev/sde3
# mdadm --zero-superblock /dev/sde5
# mdadm --zero-superblock /dev/sde6

# mdadm --zero-superblock /dev/sdf1
# mdadm --zero-superblock /dev/sdf3
# mdadm --zero-superblock /dev/sdf5
# mdadm --zero-superblock /dev/sdf6</pre>
<p>If there are no remains from previous <acronym title="Redundant Array of Inexpensive Disks">RAID</acronym> installations, each of the above commands will throw an error like this one (which is nothing to worry about):</p>
<pre class="code">host:~# mdadm --zero-superblock /dev/sdd1
mdadm: Unrecognised md component device - /dev/sdd1</pre>
<p>
Otherwise the commands will not display anything at all.
</p>
</div>
<h3><a name="creating_our_raid_arrays" id="creating_our_raid_arrays">Creating Our RAID Arrays</a></h3>
<div class="level3">
<p>Now let&#039;s create our <acronym title="Redundant Array of Inexpensive Disks">RAID</acronym> arrays</p>
<pre class="code"># mdadm --create /dev/md0 --level=1 --raid-disks=4 missing /dev/sdd1 /dev/sde1 /dev/sdf1
# mdadm --create /dev/md1 --level=10 --raid-disks=4 missing /dev/sdd3 /dev/sde3 /dev/sdf3
# mdadm --create /dev/md2 --level=10 --raid-disks=4 missing /dev/sdd5 /dev/sde5 /dev/sdf5
# mdadm --create /dev/md3 --level=10 --raid-disks=4 missing /dev/sdd6 /dev/sde6 /dev/sdf6</pre>
<p>The command</p>
<pre class="code"># cat /proc/mdstat</pre>
<p>should now show that you have three degraded <acronym title="Redundant Array of Inexpensive Disks">RAID</acronym> arrays ([_U] or [U_] means that an array is degraded while [UU] for raid1 and [UUUU] for raid10 means that the array is ok):</p>
<pre class="code">host:~# cat /proc/mdstat
Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10]
md3 : active raid10 sdf6[3] sde6[2] sdd6[1]
      966020352 blocks 64K chunks 2 near-copies [4/3] [_UUU]
        resync=DELAYED

md0 : active raid1 sdf1[3] sde1[2] sdd1[1]
      96256 blocks [4/3] [_UUU]

md2 : active raid10 sdf5[3] sde5[2] sdd5[1]
      979712 blocks 64K chunks 2 near-copies [4/3] [_UUU]
        resync=DELAYED

md1 : active raid10 sdf3[3] sde3[2] sdd3[1]
      9574528 blocks 64K chunks 2 near-copies [4/3] [_UUU]
      [==============&amp;gt;......]  resync = 74.2% (7110976/9574528) finish=0.2min speed=198246K/sec

unused devices: &amp;lt;none&amp;gt;</pre>
<p>Next we create filesystems on our <acronym title="Redundant Array of Inexpensive Disks">RAID</acronym> arrays (ext3 on /dev/md0 and /dev/md2 and swap on /dev/md1):</p>
<pre class="code"># mkfs.ext3 /dev/md0
# mkfs.ext3 /dev/md1
# mkswap /dev/md2</pre>
<p>
Next we must adjust /etc/mdadm/mdadm.conf (which doesn&#039;t contain any information about our new <acronym title="Redundant Array of Inexpensive Disks">RAID</acronym> arrays yet) to the new situation:</p>
<pre class="code"># cp /etc/mdadm/mdadm.conf /etc/mdadm/mdadm.conf_orig
# mdadm --examine --scan &amp;gt;&amp;gt; /etc/mdadm/mdadm.conf</pre>
<p>Display the contents of the file:</p>
<pre class="code"># cat /etc/mdadm/mdadm.conf</pre>
<p>At the bottom of the file you should now see details about our three (degraded) <acronym title="Redundant Array of Inexpensive Disks">RAID</acronym> arrays:</p>
<pre class="code">host:~# cat /etc/mdadm/mdadm.conf
# mdadm.conf
#
# Please refer to mdadm.conf(5) for information about this file.
#

# by default, scan all partitions (/proc/partitions) for MD superblocks.
# alternatively, specify devices to scan, using wildcards if desired.
DEVICE partitions

# auto-create devices with Debian standard permissions
CREATE owner=root group=disk mode=0660 auto=yes

# automatically tag new arrays as belonging to the local system
HOMEHOST &amp;lt;system&amp;gt;

# instruct the monitoring daemon where to send mail alerts
MAILADDR root

# This file was auto-generated on Thu, 31 Jan 2008 15:05:41 +0100
# by mkconf $Id: mkconf 261 2006-11-09 13:32:35Z madduck $
ARRAY /dev/md1 level=raid10 num-devices=4 UUID=b309ee1e:3f9f428e:f41cdd86:04e94251
ARRAY /dev/md2 level=raid10 num-devices=4 UUID=b00323c1:df97cefe:f41cdd86:04e94251
ARRAY /dev/md0 level=raid1 num-devices=4 UUID=724e4049:df159d74:f41cdd86:04e94251
ARRAY /dev/md1 level=raid10 num-devices=4 UUID=5bc34c17:5085803f:f41cdd86:04e94251
ARRAY /dev/md2 level=raid10 num-devices=4 UUID=ff1da358:1dc77a2f:f41cdd86:04e94251
ARRAY /dev/md3 level=raid10 num-devices=4 UUID=ca928896:05e930e6:f41cdd86:04e94251</pre>
</div>
<h3><a name="adjusting_the_system_to_raid" id="adjusting_the_system_to_raid">Adjusting The System To RAID</a></h3>
<div class="level3">
<p>Now let&#039;s mount /dev/md0 and /dev/md2 (we don&#039;t need to mount the swap array /dev/md1):</p>
<pre class="code"># mkdir /mnt/md0
# mkdir /mnt/md1</pre>
<pre class="code"># mount /dev/md0 /mnt/md0
# mount /dev/md1 /mnt/md1</pre>
<p>You should now find both arrays in the output of</p>
<pre class="code"># mount</pre>
<pre class="code">host:~# mount
/dev/sdc3 on / type ext3 (rw,errors=remount-ro)
tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)
proc on /proc type proc (rw,noexec,nosuid,nodev)
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)
procbususb on /proc/bus/usb type usbfs (rw)
udev on /dev type tmpfs (rw,mode=0755)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620)
/dev/sdc1 on /boot type ext3 (rw)
/dev/md0 on /mnt/md0 type ext3 (rw)
/dev/md1 on /mnt/md1 type ext3 (rw)</pre>
<p>
Next we modify /etc/fstab. Replace /dev/sdc1 with /dev/md0, /dev/sdc3 with /dev/md1, /dev/sdc5 with /dev/md2 so that the file looks as follows:</p>
<pre class="code"># nano /etc/fstab</pre>
<pre class="code"># /etc/fstab: static file system information.
#
# &amp;lt;file system&amp;gt; &amp;lt;mount point&amp;gt;   &amp;lt;type&amp;gt;  &amp;lt;options&amp;gt;       &amp;lt;dump&amp;gt;  &amp;lt;pass&amp;gt;
proc            /proc           proc    defaults        0       0
/dev/md1       /               ext3    defaults,errors=remount-ro 0       1
/dev/md0       /boot           ext3    defaults        0       2
/dev/md2       none            swap    sw              0       0
/dev/fd0        /media/floppy0  auto    rw,user,noauto  0       0</pre>
<p>
Next replace /dev/sdc1 with /dev/md0 and /dev/sdc3 with /dev/md1 and /de in /etc/mtab:</p>
<pre class="code"># nano /etc/mtab</pre>
<pre class="code">/dev/md1 / ext3 rw,errors=remount-ro 0 0
tmpfs /lib/init/rw tmpfs rw,nosuid,mode=0755 0 0
proc /proc proc rw,noexec,nosuid,nodev 0 0
sysfs /sys sysfs rw,noexec,nosuid,nodev 0 0
procbususb /proc/bus/usb usbfs rw 0 0
udev /dev tmpfs rw,mode=0755 0 0
tmpfs /dev/shm tmpfs rw,nosuid,nodev 0 0
devpts /dev/pts devpts rw,noexec,nosuid,gid=5,mode=620 0 0
/dev/md0 /boot ext3 rw 0 0
/dev/md0 /mnt/md0 ext3 rw 0 0
/dev/md1 /mnt/md1 ext3 rw 0 0</pre>
<p>
Now up to the GRUB boot loader. Open /boot/grub/menu.lst and add fallback 1 right after default 0:</p>
<pre class="code"># nano /boot/grub/menu.lst</pre>
<pre class="code">
default         0
fallback        1
fallback        2
fallback        3
</pre>
<p>
This makes that if the first kernel (counting starts with 0, so the first kernel is 0) fails to boot, kernel #2 will be booted.
</p>
<p>
In the same file, go to the bottom where you should find some kernel stanzas. Copy the first of them and paste the stanza before the first existing stanza; replace root=/dev/sdc3 with root=/dev/md1 and root (hd0,0) with root (hd1,0):</p>
<pre class="code">## ## End Default Options ##

title           Debian GNU/Linux, kernel 2.6.18-5-amd64
root            (hd1,0)
kernel          /vmlinuz-2.6.18-5-amd64 root=/dev/md1 ro
initrd          /initrd.img-2.6.18-5-amd64
savedefault

title           Debian GNU/Linux, kernel 2.6.18-5-amd64
root            (hd0,0)
kernel          /vmlinuz-2.6.18-5-amd64 root=/dev/sdc3 ro
initrd          /initrd.img-2.6.18-5-amd64
savedefault

title           Debian GNU/Linux, kernel 2.6.18-5-amd64 (single-user mode)
root            (hd2,0)
kernel          /vmlinuz-2.6.18-5-amd64 root=/dev/sdc3 ro single
initrd          /initrd.img-2.6.18-5-amd64
savedefault

### END DEBIAN AUTOMAGIC KERNELS LIST</pre>
<p>root (hd1,0) refers to /dev/sdd which is already part of our <acronym title="Redundant Array of Inexpensive Disks">RAID</acronym> arrays. We will reboot the system in a few moments; the system will then try to boot from our (still degraded) <acronym title="Redundant Array of Inexpensive Disks">RAID</acronym> arrays; if it fails, it will boot from /dev/sdc (→ fallback 1).
</p>
<p>
Next we adjust our ramdisk to the new situation:</p>
<pre class="code"># update-initramfs -u</pre>
<p>Now we copy the contents of /dev/sda1 and /dev/sda3 to /dev/md0 and /dev/md2 (which are mounted on /mnt/md0 and /mnt/md2):</p>
<pre class="code"># cp -dpRx / /mnt/md1</pre>
<pre class="code"># cd /boot
# cp -dpRx . /mnt/md0</pre>
</div>
<h3><a name="preparing_grub_part_1" id="preparing_grub_part_1">Preparing GRUB (Part 1)</a></h3>
<div class="level3">
<p>Afterwards we must install the GRUB bootloader on the drives:</p>
<pre class="code"># grub</pre>
<p>On the GRUB shell, type in the following commands:</p>
<pre class="code"># root (hd3,0)</pre>
<p>
grub&gt; root (hd0,0)<br />
 Filesystem type is ext2fs, partition type 0&times;83
</p>
<p>
grub&gt;<br />
&lt;/code&gt;</p>
<pre class="code"># setup (hd3)</pre>
<pre class="code">grub&amp;gt; setup (hd0)
 Checking if &quot;/boot/grub/stage1&quot; exists... no
 Checking if &quot;/grub/stage1&quot; exists... yes
 Checking if &quot;/grub/stage2&quot; exists... yes
 Checking if &quot;/grub/e2fs_stage1_5&quot; exists... yes
 Running &quot;embed /grub/e2fs_stage1_5 (hd0)&quot;...  15 sectors are embedded.
succeeded
 Running &quot;install /grub/stage1 (hd0) (hd0)1+15 p (hd0,0)/grub/stage2 /grub/menu.lst&quot;... succeeded
Done.

grub&amp;gt;

root (hd4,0)

grub&amp;gt; root (hd1,0)
 Filesystem type is ext2fs, partition type 0xfd

grub&amp;gt;

setup (hd4)

grub&amp;gt; setup (hd1)
 Checking if &quot;/boot/grub/stage1&quot; exists... no
 Checking if &quot;/grub/stage1&quot; exists... yes
 Checking if &quot;/grub/stage2&quot; exists... yes
 Checking if &quot;/grub/e2fs_stage1_5&quot; exists... yes
 Running &quot;embed /grub/e2fs_stage1_5 (hd1)&quot;...  15 sectors are embedded.
succeeded
 Running &quot;install /grub/stage1 (hd1) (hd1)1+15 p (hd1,0)/grub/stage2 /grub/menu.lst&quot;... succeeded
Done.

grub&amp;gt;

root (hd5,0)

grub&amp;gt; root (hd5,0)
 Filesystem type is ext2fs, partition type 0x83

grub&amp;gt;

setup (hd5)

grub&amp;gt; setup (hd5)
 Checking if &quot;/boot/grub/stage1&quot; exists... no
 Checking if &quot;/grub/stage1&quot; exists... yes
 Checking if &quot;/grub/stage2&quot; exists... yes
 Checking if &quot;/grub/e2fs_stage1_5&quot; exists... yes
 Running &quot;embed /grub/e2fs_stage1_5 (hd0)&quot;...  15 sectors are embedded.
succeeded
 Running &quot;install /grub/stage1 (hd0) (hd0)1+15 p (hd0,0)/grub/stage2 /grub/menu.lst&quot;... succeeded
Done.

grub&amp;gt;

root (hd6,0)

grub&amp;gt; root (hd6,0)
 Filesystem type is ext2fs, partition type 0xfd

grub&amp;gt;

setup (hd6)

grub&amp;gt; setup (hd6)
 Checking if &quot;/boot/grub/stage1&quot; exists... no
 Checking if &quot;/grub/stage1&quot; exists... yes
 Checking if &quot;/grub/stage2&quot; exists... yes
 Checking if &quot;/grub/e2fs_stage1_5&quot; exists... yes
 Running &quot;embed /grub/e2fs_stage1_5 (hd1)&quot;...  15 sectors are embedded.
succeeded
 Running &quot;install /grub/stage1 (hd1) (hd1)1+15 p (hd1,0)/grub/stage2 /grub/menu.lst&quot;... succeeded
Done.

grub&amp;gt;
quit</pre>
<p>Now, back on the normal shell, we reboot the system and hope that it boots ok from our <acronym title="Redundant Array of Inexpensive Disks">RAID</acronym> arrays:
</p>
<p>
reboot
</p>
</div>
<h3><a name="preparing_dev_sdc" id="preparing_dev_sdc">Preparing /dev/sdc</a></h3>
<div class="level3">
<p>If all goes well, you should now find /dev/md0 and /dev/md2 in the output of</p>
<pre class="code"># df -h</pre>
<pre class="code">host:~# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/md1              9.0G  458M  8.1G   6% /
tmpfs                 4.0G     0  4.0G   0% /lib/init/rw
udev                   10M  136K  9.9M   2% /dev
tmpfs                 4.0G     0  4.0G   0% /dev/shm
/dev/md0               92M   18M   69M  21% /boot</pre>
<p>
The output of</p>
<pre class="code"># cat /proc/mdstat</pre>
<p>should be as follows:</p>
<pre class="code">host:~# cat /proc/mdstat
Personalities : [raid1] [raid10]
md3 : active raid10 sdd6[1] sdf6[3] sde6[2]
      966020352 blocks 64K chunks 2 near-copies [4/3] [_UUU]

md0 : active raid1 sdd1[1] sdf1[3] sde1[2]
      96256 blocks [4/3] [_UUU]

md2 : active raid10 sdd5[1] sdf5[3] sde5[2]
      979712 blocks 64K chunks 2 near-copies [4/3] [_UUU]

md1 : active raid10 sdd3[1] sdf3[3] sde3[2]
      9574528 blocks 64K chunks 2 near-copies [4/3] [_UUU]

unused devices: &amp;lt;none&amp;gt;</pre>
<p>Now we must change the partition types of our three partitions on /dev/sdc to Linux raid autodetect as well:</p>
<pre class="code"># fdisk /dev/sdc</pre>
<pre class="code">host:~# fdisk /dev/sdc

Command (m for help): &amp;lt;-- t
Partition number (1-6): &amp;lt;-- 1
Hex code (type L to list codes): &amp;lt;-- fd
Changed system type of partition 1 to fd (Linux raid autodetect)

Command (m for help): &amp;lt;-- t
Partition number (1-6): &amp;lt;-- 3
Hex code (type L to list codes): &amp;lt;-- fd
Changed system type of partition 2 to fd (Linux raid autodetect)

Command (m for help): &amp;lt;-- t
Partition number (1-6): &amp;lt;-- 5
Hex code (type L to list codes): &amp;lt;-- fd
Changed system type of partition 3 to fd (Linux raid autodetect)

Command (m for help): &amp;lt;-- t
Partition number (1-6): &amp;lt;-- 6
Hex code (type L to list codes): &amp;lt;-- fd
Changed system type of partition 3 to fd (Linux raid autodetect)

Command (m for help): &amp;lt;-- w
The partition table has been altered!

Calling ioctl() to re-read partition table.

WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table.
The new table will be used at the next reboot.
Syncing disks.</pre>
<p>
Now we can add /dev/sdc1, /dev/sdc3, /dev/sdc5 and /dev/sdc6 to the respective <acronym title="Redundant Array of Inexpensive Disks">RAID</acronym> arrays:</p>
<pre class="code"># mdadm --add /dev/md0 /dev/sdc1
# mdadm --add /dev/md1 /dev/sdc3
# mdadm --add /dev/md2 /dev/sdc5
# mdadm --add /dev/md2 /dev/sdc6</pre>
<p>Now take a look at</p>
<pre class="code"># cat /proc/mdstat</pre>
<pre class="code">host:~# cat /proc/mdstat
Personalities : [raid1] [raid10]
md3 : active raid10 sdc6[4] sdd6[1] sdf6[3] sde6[2]
      966020352 blocks 64K chunks 2 near-copies [4/3] [_UUU]
      [&amp;gt;....................]  recovery =  1.2% (5975552/483010176) finish=123.1min speed=64582K/sec

md0 : active raid1 sdc1[0] sdd1[1] sdf1[3] sde1[2]
      96256 blocks [4/4] [UUUU]

md2 : active raid10 sdc5[0] sdd5[1] sdf5[3] sde5[2]
      979712 blocks 64K chunks 2 near-copies [4/4] [UUUU]

md1 : active raid10 sdc3[0] sdd3[1] sdf3[3] sde3[2]
      9574528 blocks 64K chunks 2 near-copies [4/4] [UUUU]

unused devices: &amp;lt;none&amp;gt;</pre>
<p>
(You can run</p>
<pre class="code"># watch cat /proc/mdstat</pre>
<p>to get an ongoing output of the process. To leave watch, press CTRL+C.)
</p>
<p>
Wait until the synchronization has finished, the output should then look like this:</p>
<pre class="code">host:~# cat /proc/mdstat
Personalities : [raid1] [raid10]
md3 : active raid10 sdc6[0] sdd6[1] sdf6[3] sde6[2]
      966020352 blocks 64K chunks 2 near-copies [4/4] [UUUU]

md0 : active raid1 sdc1[0] sdd1[1] sdf1[3] sde1[2]
      96256 blocks [4/4] [UUUU]

md2 : active raid10 sdc5[0] sdd5[1] sdf5[3] sde5[2]
      979712 blocks 64K chunks 2 near-copies [4/4] [UUUU]

md1 : active raid10 sdc3[0] sdd3[1] sdf3[3] sde3[2]
      9574528 blocks 64K chunks 2 near-copies [4/4] [UUUU]

unused devices: &amp;lt;none&amp;gt;</pre>
<p>Then adjust /etc/mdadm/mdadm.conf to the new situation:</p>
<pre class="code"># cp /etc/mdadm/mdadm.conf_orig /etc/mdadm/mdadm.conf
# mdadm --examine --scan &amp;gt;&amp;gt; /etc/mdadm/mdadm.conf</pre>
<p>/etc/mdadm/mdadm.conf should now look something like this:</p>
<pre class="code"># cat /etc/mdadm/mdadm.conf</pre>
<pre class="code"># mdadm.conf
#
# Please refer to mdadm.conf(5) for information about this file.
#

# by default, scan all partitions (/proc/partitions) for MD superblocks.
# alternatively, specify devices to scan, using wildcards if desired.
DEVICE partitions

# auto-create devices with Debian standard permissions
CREATE owner=root group=disk mode=0660 auto=yes

# automatically tag new arrays as belonging to the local system
HOMEHOST &amp;lt;system&amp;gt;

# instruct the monitoring daemon where to send mail alerts
MAILADDR root

# definitions of existing MD arrays

# This file was auto-generated on Thu, 31 Jan 2008 15:05:41 +0100
# by mkconf $Id: mkconf 261 2006-11-09 13:32:35Z madduck $
ARRAY /dev/md0 level=raid1 num-devices=4 UUID=724e4049:df159d74:f41cdd86:04e94251
ARRAY /dev/md1 level=raid10 num-devices=4 UUID=a43048f6:f9759799:0d2aba67:9fb5aef3
ARRAY /dev/md2 level=raid10 num-devices=4 UUID=af1886bd:8acb329c:0d2aba67:9fb5aef3
ARRAY /dev/md3 level=raid10 num-devices=4 UUID=ca928896:05e930e6:f41cdd86:04e94251</pre>
</div>
<h3><a name="preparing_grub_part_2" id="preparing_grub_part_2">Preparing GRUB (Part 2)</a></h3>
<div class="level3">
<p>We are almost done now. Now we must modify /boot/grub/menu.lst again. Right now it is configured to boot from /dev/sdd (hd1,0). Of course, we still want the system to be able to boot in case /dev/sdd fails. Therefore we copy the first kernel stanza (which contains hd1), paste it below and replace hd1 with hd0. Furthermore we comment out all other kernel stanzas so that it looks as follows:</p>
<pre class="code"># nano /boot/grub/menu.lst</pre>
<pre class="code">## ## End Default Options ##

title           Debian GNU/Linux, kernel 2.6.18-5-amd64
root            (hd3,0)
kernel          /vmlinuz-2.6.18-5-amd64 root=/dev/md1 ro
initrd          /initrd.img-2.6.18-5-amd64
savedefault

title           Debian GNU/Linux, kernel 2.6.18-5-amd64
root            (hd2,0)
kernel          /vmlinuz-2.6.18-5-amd64 root=/dev/md1 ro
initrd          /initrd.img-2.6.18-5-amd64
savedefault

title           Debian GNU/Linux, kernel 2.6.18-5-amd64
root            (hd1,0)
kernel          /vmlinuz-2.6.18-5-amd64 root=/dev/md1 ro
initrd          /initrd.img-2.6.18-5-amd64
savedefault

title           Debian GNU/Linux, kernel 2.6.18-5-amd64
root            (hd0,0)
kernel          /vmlinuz-2.6.18-5-amd64 root=/dev/md1 ro
initrd          /initrd.img-2.6.18-5-amd64
savedefault

title           Debian GNU/Linux, kernel 2.6.18-5-amd64
root            (hd0,0)
kernel          /vmlinuz-2.6.18-5-amd64 root=/dev/sdc3 ro
initrd          /initrd.img-2.6.18-5-amd64
savedefault

title           Debian GNU/Linux, kernel 2.6.18-5-amd64 (single-user mode)
root            (hd2,0)
kernel          /vmlinuz-2.6.18-5-amd64 root=/dev/sdc3 ro single
initrd          /initrd.img-2.6.18-5-amd64
savedefault

### END DEBIAN AUTOMAGIC KERNELS LIST</pre>
<p>In the same file, there&#039;s a kopt line; replace /dev/sdc3 with /dev/md2 (don&#039;t remove the # at the beginning of the line!):
</p>
<pre class="code"># kopt=root=/dev/md1 ro</pre>
<p>
Afterwards, update your ramdisk:</p>
<pre class="code"># update-initramfs -u</pre>
<p>… and reboot the system:</p>
<pre class="code"># reboot</pre>
<p>It should boot without problems.
</p>
<p>
Pffffff!!!!!
</p>
<p>
We still need to add the two terrabyte disks sda and sdb to a new raid1 array for our back-up storage</p>
<pre class="code"># fdisk /dev/sda</pre>
<pre class="code">host:~# fdisk /dev/sda

The number of cylinders for this disk is set to 121601.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-121601, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-121601, default 121601):
Using default value 121601

Command (m for help): t
Selected partition 1
Hex code (type L to list codes): fd
Changed system type of partition 1 to fd (Linux raid autodetect)

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.</pre>
<pre class="code"># mdadm --create /dev/md4 --level=1 --raid-disks=2 /dev/sda1 /dev/sdb1</pre>
<pre class="code"># cp /etc/mdadm/mdadm.conf_orig /etc/mdadm/mdadm.conf
# mdadm --examine --scan &amp;gt;&amp;gt; /etc/mdadm/mdadm.conf</pre>
<pre class="code">apt-get install lvm2</pre>
<pre class="code">host:/home# fdisk /dev/md4

The number of cylinders for this disk is set to 121600.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)

Command (m for help): t
Selected partition 1
Hex code (type L to list codes): l

 0  Empty           1e  Hidden W95 FAT1 80  Old Minix       be  Solaris boot
 1  FAT12           24  NEC DOS         81  Minix / old Lin bf  Solaris
 2  XENIX root      39  Plan 9          82  Linux swap / So c1  DRDOS/sec (FAT-
 3  XENIX usr       3c  PartitionMagic  83  Linux           c4  DRDOS/sec (FAT-
 4  FAT16 &amp;lt;32M      40  Venix 80286     84  OS/2 hidden C:  c6  DRDOS/sec (FAT-
 5  Extended        41  PPC PReP Boot   85  Linux extended  c7  Syrinx
 6  FAT16           42  SFS             86  NTFS volume set da  Non-FS data
 7  HPFS/NTFS       4d  QNX4.x          87  NTFS volume set db  CP/M / CTOS / .
 8  AIX             4e  QNX4.x 2nd part 88  Linux plaintext de  Dell Utility
 9  AIX bootable    4f  QNX4.x 3rd part 8e  Linux LVM       df  BootIt
 a  OS/2 Boot Manag 50  OnTrack DM      93  Amoeba          e1  DOS access
 b  W95 FAT32       51  OnTrack DM6 Aux 94  Amoeba BBT      e3  DOS R/O
 c  W95 FAT32 (LBA) 52  CP/M            9f  BSD/OS          e4  SpeedStor
 e  W95 FAT16 (LBA) 53  OnTrack DM6 Aux a0  IBM Thinkpad hi eb  BeOS fs
 f  W95 Ext&#039;d (LBA) 54  OnTrackDM6      a5  FreeBSD         ee  EFI GPT
10  OPUS            55  EZ-Drive        a6  OpenBSD         ef  EFI (FAT-12/16/
11  Hidden FAT12    56  Golden Bow      a7  NeXTSTEP        f0  Linux/PA-RISC b
12  Compaq diagnost 5c  Priam Edisk     a8  Darwin UFS      f1  SpeedStor
14  Hidden FAT16 &amp;lt;3 61  SpeedStor       a9  NetBSD          f4  SpeedStor
16  Hidden FAT16    63  GNU HURD or Sys ab  Darwin boot     f2  DOS secondary
17  Hidden HPFS/NTF 64  Novell Netware  b7  BSDI fs         fd  Linux raid auto
18  AST SmartSleep  65  Novell Netware  b8  BSDI swap       fe  LANstep
1b  Hidden W95 FAT3 70  DiskSecure Mult bb  Boot Wizard hid ff  BBT
1c  Hidden W95 FAT3 75  PC/IX
Hex code (type L to list codes): 8e
Changed system type of partition 1 to 8e (Linux LVM)</pre>
<pre class="code"># vgcreate backup /dev/md4</pre>
<pre class="code"># vgcreate xen /dev/md3</pre>
</div>
<h1><a name="vserver_installation" id="vserver_installation">Vserver installation</a></h1>
<div class="level1">
<p>We will use the vserver kernel from backports.
</p>
<pre class="code"># apt-get install vserver-debiantools util-vserver</pre>
<pre class="code"># apt-get install -t etch-backports linux-image-2.6.22-3-vserver-amd64</pre>
<p>We set up the network interfaces, eth0 is for the internet, eth1 is for the LAN and dummy0 is for the DMZ</p>
<pre class="code"># nano /etc/network/interfaces</pre>
<pre class="code"># This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet static
        address RED-ENVELOPE
        netmask RED-ENVELOPE
        network RED-ENVELOPE
        broadcast RED-ENVELOPE
        gateway RED-ENVELOPE
        # dns-* options are implemented by the resolvconf package, if installed
        dns-nameservers RED-ENVELOPE
        dns-search cipar.net

auto eth1
iface eth1 inet static
        address 192.168.0.1
        netmask 255.255.255.0
        broadcast 192.168.0.255
        network 192.168.0.0

auto dummy0
iface dummy0 inet static
    address 192.168.1.1
    netmask 255.255.255.0</pre>
<p>
To bring up the interfaces</p>
<pre class="code"># ifup dumm0</pre>
<p>
There seem to be some old functions being depreciated in the new version from backports that produce some error when starting a new Vserver.<br />
To fix this we use a patch from Christian Schenk
</p>
<pre class="code"># cd /usr/local/sbin
# wget http://data.christianschenk.org/upgrading-vserver-from-20-to-22/set-context.sh</pre>
<p>To make it executable</p>
<pre class="code"># chmod a+x set-context.sh</pre>
<p>
We can use this script before starting a new Vserver for the first time by calling this script with the name of the new server.</p>
<pre class="code"># ./set-context.sh name-of-server</pre>
<p>(the script content looks like this</p>
<pre class="code">#!/bin/sh

test ! $# = 1 &amp;amp;&amp;amp; echo &quot;Usage: $0 [vservername]&quot; &amp;amp;&amp;amp; exit 1

NAME=$1
VSERVER_CONFIG=&quot;/etc/vservers/$NAME&quot;
test ! -d $VSERVER_CONFIG &amp;amp;&amp;amp; echo &quot;ERROR: $VSERVER_CONFIG doesn&#039;t exist&quot; &amp;amp;&amp;amp; exit 1

LAST_CTX=`find /etc/vservers/ -name context | xargs -L1 cat | sort -n | tail -1`
NEXT_CTX=`expr $LAST_CTX + 1`

#
# valid static contexts are between 2 and 49151 (daniel_hozac on IRC)
#
test $NEXT_CTX = 1 &amp;amp;&amp;amp; NEXT_CTX=2
test $NEXT_CTX -gt 49151 &amp;amp;&amp;amp; echo &quot;ERROR: Maximum number of contexts reached&quot; &amp;amp;&amp;amp; exit 1

echo $NEXT_CTX &amp;gt; $VSERVER_CONFIG/context</pre>
</div>
<h1><a name="shorewall" id="shorewall">shorewall</a></h1>
<div class="level1">
<p><a href="http://manpages.songshu.org/manpages/lenny/en/man8/shorewall.8.html" class="urlextern" title="http://manpages.songshu.org/manpages/lenny/en/man8/shorewall.8.html"  rel="nofollow">http://manpages.songshu.org/manpages/lenny/en/man8/shorewall.8.html</a>
</p>
<p>
Shorewall will arrange our routing and security settings between the network interfaces.</p>
<pre class="code"># apt-get install shorewall
# apt-get install shorewall-doc</pre>
<pre class="code"># cp /usr/share/doc/shorewall/default-config/modules /etc/shorewall/
# cp /usr/share/doc/shorewall/default-config/zones /etc/shorewall/
# cp /usr/share/doc/shorewall/default-config/policy /etc/shorewall/
# cp /usr/share/doc/shorewall/default-config/interfaces /etc/shorewall/
# cp /usr/share/doc/shorewall/default-config/rules /etc/shorewall/
# cp /usr/share/shorewall/macro.* /etc/shorewall/</pre>
<pre class="code"># nano /etc/shorewall/zones</pre>
<p>
We set up the following zones</p>
<pre class="code">#ZONE   TYPE            OPTIONS         IN                      OUT
#                                       OPTIONS                 OPTIONS
fw      firewall
net     ipv4
loc     ipv4
dmz     ipv4
#LAST LINE - ADD YOUR ENTRIES ABOVE THIS ONE - DO NOT REMOVE</pre>
<pre class="code"># nano /etc/shorewall/policy</pre>
<p>
We set up the following</p>
<pre class="code">loc        net         ACCEPT
net        all         DROP        info
all        all         REJECT      info</pre>
<p><em class="u"><em>!!!!!!!!!THiS WILL LOCK YOU OUT!!!!!!!!!!!!!!!</em></em><br />
check <a href="http://songshu.org/doku/doku.php?id=the_network" class="urlextern" title="http://songshu.org/doku/doku.php?id=the_network"  rel="nofollow">http://songshu.org/doku/doku.php?id=the_network</a> for the actual rules applied<br />
And set up our network interfaces</p>
<pre class="code"># nano /etc/shorewall/interfaces</pre>
<pre class="code">#ZONE   INTERFACE       BROADCAST       OPTIONS
net     eth0            detect          tcpflags,dhcp,routefilter,norfc1918,nosmurfs,logmartians
loc     eth1            detect          tcpflags,detectnets,nosmurfs
dmz     dummy0          detect</pre>
<pre class="code"># nano /etc/default/shorewall</pre>
<p>
change</p>
<pre class="code">startup=0
to
startup=1</pre>
<pre class="code"># nano /etc/shorewall/shorewall.conf</pre>
<p>
change</p>
<pre class="code">IP_FORWARDING=Keep
to
IP_FORWARDING=On</pre>
</div>
<h1><a name="monitoring" id="monitoring">monitoring</a></h1>
<div class="level1">
<p>For the host system we want to set up some automatic monitoring so we receive emails about hard disk status, raid status, UPS etc…</p>
</div>
<h3><a name="postfix" id="postfix">postfix</a></h3>
<div class="level3">
<p><a href="http://manpages.songshu.org/manpages/lenny/en/man1/postfix.1.html" class="urlextern" title="http://manpages.songshu.org/manpages/lenny/en/man1/postfix.1.html"  rel="nofollow">http://manpages.songshu.org/manpages/lenny/en/man1/postfix.1.html</a>
</p>
<p>
To receive emails we need something to send them so we install postfix
</p>
<pre class="code"># apt-get install postfix</pre>
<p>–&gt; we choose “satelite system” here</p>
<pre class="code">--&amp;gt; we choose host.cipar.net</pre>
<pre class="code">--&amp;gt; all mails are send to smtp.cipar.net</pre>
<p>We need all the mail sent to the root account to be sent to an external account.</p>
<pre class="code"># nano /etc/aliases</pre>
<p>here we add the following</p>
<pre class="code">root:   myname@mydomain.org</pre>
<pre class="code"># newaliases</pre>
</div>
<h3><a name="monitoring_tools" id="monitoring_tools">monitoring tools</a></h3>
<div class="level3">
<p><a href="http://manpages.songshu.org/manpages/lenny/en/man1/monit.1.html" class="urlextern" title="http://manpages.songshu.org/manpages/lenny/en/man1/monit.1.html"  rel="nofollow">http://manpages.songshu.org/manpages/lenny/en/man1/monit.1.html</a>
</p>
<pre class="code"># apt-get install monit syslog-ng watchdog apcupsd mailx smartmontools</pre>
</div>
<h3><a name="monit" id="monit">monit</a></h3>
<div class="level3">
</div>
<h3><a name="s.m.a.r.t" id="s.m.a.r.t">S.M.A.R.T.</a></h3>
<div class="level3">
<p><a href="http://manpages.songshu.org/manpages/lenny/en/man8/smartctl.8.html" class="urlextern" title="http://manpages.songshu.org/manpages/lenny/en/man8/smartctl.8.html"  rel="nofollow">http://manpages.songshu.org/manpages/lenny/en/man8/smartctl.8.html</a>
</p>
<pre class="code"># nano /etc/default/smartmontools</pre>
<p>change the value to “yes”</p>
<pre class="code"># uncomment to start smartd on system startup
start_smartd=yes</pre>
<p>
to check if your hard disk(s) support SMART</p>
<pre class="code"># smartctl -i -d ata /dev/sda</pre>
<p>To enable SMART on SATA drives</p>
<pre class="code"># smartctl -s on -d ata /dev/sda</pre>
<p>check the SMART Health Status</p>
<pre class="code"># smartctl -H /dev/sda</pre>
<p>We need to change some values to make sure it works with our SATA disks</p>
<pre class="code"># nano /etc/smartd.conf</pre>
<p>first comment out the device scan so it looks like this:</p>
<pre class="code">#DEVICESCAN -m root -M exec /usr/share/smartmontools/smartd-runner</pre>
<p>Then we manually add our ata type disks, start a selftest for every disk on sunday at 13:00 and send the error reporting message to root and if there is an error report reminders should be sent daily.</p>
<pre class="code">/dev/sda -a -d ata -s L/../../7/01 -m root -M daily
/dev/sdb -a -d ata -s L/../../7/01 -m root -M daily
/dev/sdc -a -d ata -s L/../../7/01 -m root -M daily
/dev/sdd -a -d ata -s L/../../7/01 -m root -M daily
/dev/sde -a -d ata -s L/../../7/01 -m root -M daily
/dev/sdf -a -d ata -s L/../../7/01 -m root -M daily</pre>
<p>To start smart:</p>
<pre class="code"># /etc/init.d/smartmontools start</pre>
</div>
<h3><a name="apc_ups" id="apc_ups">APC UPS</a></h3>
<div class="level3">
<p><a href="http://manpages.songshu.org/manpages/lenny/en/man8/apcupsd.8.html" class="urlextern" title="http://manpages.songshu.org/manpages/lenny/en/man8/apcupsd.8.html"  rel="nofollow">http://manpages.songshu.org/manpages/lenny/en/man8/apcupsd.8.html</a>
</p>
<pre class="code"># nano /etc/apcupsd/apcupsd.conf</pre>
<p>change
</p>
<ul>
<li class="level1">
<div class="li"> UPSCABLE smart to UPSCABLE usb</div>
</li>
</ul>
<p>
and
</p>
<ul>
<li class="level1">
<div class="li"> DEVICE /dev/ttyS0 to DEVICE /dev/usb/hiddev0</div>
</li>
</ul>
<p>
and change
</p>
<ul>
<li class="level1">
<div class="li"> UPSTYPE apcsmart to #UPSTYPE usb</div>
</li>
</ul>
<p>the final file will look as follows</p>
<pre class="code">## apcupsd.conf v1.1 ##
#
#  for apcupsd release 3.12.4 (19 August 2006) - debian
#
# &quot;apcupsd&quot; POSIX config file

#
# ========= General configuration parameters ============
#

# UPSNAME xxx
#   Use this to give your UPS a name in log files and such. This
#   is particulary useful if you have multiple UPSes. This does not
#   set the EEPROM. It should be 8 characters or less.
#UPSNAME

# UPSCABLE &amp;lt;cable&amp;gt;
#   Defines the type of cable connecting the UPS to your computer.
#
#   Possible generic choices for &amp;lt;cable&amp;gt; are:
#     simple, smart, ether, usb
#
#   Or a specific cable model number may be used:
#     940-0119A, 940-0127A, 940-0128A, 940-0020B,
#     940-0020C, 940-0023A, 940-0024B, 940-0024C,
#     940-1524C, 940-0024G, 940-0095A, 940-0095B,
#     940-0095C, M-04-02-2000
#
#UPSCABLE smart
UPSCABLE usb
# To get apcupsd to work, in addition to defining the cable
# above, you must also define a UPSTYPE, which corresponds to
# the type of UPS you have (see the Description for more details).
# You must also specify a DEVICE, sometimes referred to as a port.
# For USB UPSes, please leave the DEVICE directive blank. For
# other UPS types, you must specify an appropriate port or address.
#
# UPSTYPE   DEVICE           Description
# apcsmart  /dev/tty**       Newer serial character device,
#                            appropriate for SmartUPS models using
#                            a serial cable (not USB).
#
#usb       &amp;lt;BLANK&amp;gt;          Most new UPSes are USB.
#                            A blank DEVICE setting enables
#                            autodetection, which is th best choice
#                            for most installations.
#
# net       hostname:port    Network link to a master apcupsd
#                            through apcupsd&#039;s Network Information
#                            Server. This is used if you don&#039;t have
#                            a UPS directly connected to your computer.
#
# snmp      hostname:port:vendor:community
#                            SNMP Network link to an SNMP-enabled
#                            UPS device. Vendor is the MIB used by
#                            the UPS device: can be &quot;APC&quot;, &quot;APC_NOTRAP&quot;
#                            or &quot;RFC&quot; where APC is the powernet MIB,
#                            &quot;APC_NOTRAP&quot; is powernet with SNMP trap
#                            catching disabled, and RFC is the IETF&#039;s
#                            rfc1628 UPS-MIB. Port is usually 161.
#                            Community is &quot;private&quot;.
#
# dumb      /dev/tty**       Old serial character device for use
#                            with simple-signaling UPSes.
#
#UPSTYPE apcsmart
UPSTYPE usb
#DEVICE /dev/ttyS0
DEVICE /dev/usb/hiddev0

# LOCKFILE &amp;lt;path to lockfile&amp;gt;
#   Path for device lock file.
LOCKFILE /var/lock

#
# ======== Configuration parameters used during power failures ==========
#

# The ONBATTERYDELAY is the time in seconds from when a power failure
#   is detected until we react to it with an onbattery event.
#
#   This means that, apccontrol will be called with the powerout argument
#   immediately when a power failure is detected.  However, the
#   onbattery argument is passed to apccontrol only after the
#   ONBATTERYDELAY time.  If you don&#039;t want to be annoyed by short
#   powerfailures, make sure that apccontrol powerout does nothing
#   i.e. comment out the wall.
ONBATTERYDELAY 6

#
# Note: BATTERYLEVEL, MINUTES, and TIMEOUT work in conjunction, so
# the first that occurs will cause the initation of a shutdown.
#

# If during a power failure, the remaining battery percentage
# (as reported by the UPS) is below or equal to BATTERYLEVEL,
# apcupsd will initiate a system shutdown.
BATTERYLEVEL 5

# If during a power failure, the remaining runtime in minutes
# (as calculated internally by the UPS) is below or equal to MINUTES,
# apcupsd, will initiate a system shutdown.
MINUTES 3

# If during a power failure, the UPS has run on batteries for TIMEOUT
# many seconds or longer, apcupsd will initiate a system shutdown.
# A value of 0 disables this timer.
#
#  Note, if you have a Smart UPS, you will most likely want to disable
#    this timer by setting it to zero. That way, you UPS will continue
#    on batteries until either the % charge remaing drops to or below BATTERYLEVEL,
#    or the remaining battery runtime drops to or below MINUTES.  Of course,
#    if you are testing, setting this to 60 causes a quick system shutdown
#    if you pull the power plug.
#  If you have an older dumb UPS, you will want to set this to less than
#    the time you know you can run on batteries.
TIMEOUT 0

#  Time in seconds between annoying users to signoff prior to
#  system shutdown. 0 disables.
ANNOY 300

# Initial delay after power failure before warning users to get
# off the system.
ANNOYDELAY 60

# The condition which determines when users are prevented from
# logging in during a power failure.
# NOLOGON &amp;lt;string&amp;gt; [ disable | timeout | percent | minutes | always ]
NOLOGON disable

# If KILLDELAY is non-zero, apcupsd will continue running after a
# shutdown has been requested, and after the specified time in
# seconds attempt to kill the power. This is for use on systems
# where apcupsd cannot regain control after a shutdown.
# KILLDELAY &amp;lt;seconds&amp;gt;  0 disables
KILLDELAY 0

#
# ==== Configuration statements for Network Information Server ====
#

# NETSERVER [ on | off ] on enables, off disables the network
#  information server. If netstatus is on, a network information
#  server process will be started for serving the STATUS and
#  EVENT data over the network (used by CGI programs).
NETSERVER on

# NISIP &amp;lt;dotted notation ip address&amp;gt;
#  IP address on which NIS server will listen for incoming connections.
#  Default value is 0.0.0.0 that means any incoming request will be
#  serviced but if you want it to listen to a single subnet you can
#  set it up to that subnet address, for example 192.168.10.0
#  Additionally you can listen for a single IP like 192.168.10.1
NISIP 127.0.0.1

# NISPORT &amp;lt;port&amp;gt; default is 3551 as registered with the IANA
#  port to use for sending STATUS and EVENTS data over the network.
#  It is not used unless NETSERVER is on. If you change this port,
#  you will need to change the corresponding value in the cgi directory
#  and rebuild the cgi programs.
NISPORT 3551

# If you want the last few EVENTS to be available over the network
# by the network information server, you must define an EVENTSFILE.
EVENTSFILE /var/log/apcupsd.events

# EVENTSFILEMAX &amp;lt;kilobytes&amp;gt;
#  By default, the size of the EVENTSFILE will be not be allowed to exceed
#  10 kilobytes.  When the file grows beyond this limit, older EVENTS will
#  be removed from the beginning of the file (first in first out).  The
#  parameter EVENTSFILEMAX can be set to a different kilobyte value, or set
#  to zero to allow the EVENTSFILE to grow without limit.
EVENTSFILEMAX 10

#
# ========== Configuration statements used if sharing =============
#            a UPS and controlling it via the network

# The configuration statements below are used if you want to share one
# UPS to power multiple machines and have them communicate by the network.
# Most of these items are for Master/Slave mode only, however NETTIME is
# also used for Client/Server NIS networking with the net driver.

# NETTIME &amp;lt;int&amp;gt;
#   Interval (in seconds) at which the slave or client polls the master
#   or server. This is applicable to BOTH master/slave and client/server
#   (NIS) networking.
#NETTIME 100

#
# Remaining items are for Master/Slave networking ONLY
#

# UPSCLASS [ standalone | shareslave | sharemaster | netslave | netmaster ]
#   Normally standalone unless you share a UPS with multiple machines.
#
UPSCLASS standalone

# UPSMODE [ disable | share | net | sharenet ]
#   Unless you want to share the UPS (power multiple machines),
#   this should be disable.
UPSMODE disable

# NETPORT &amp;lt;int&amp;gt;
#   Port on which master/slave networking communicates.
#NETPORT 6544

# MASTER &amp;lt;machine-name&amp;gt;
#   IP address of the master. Only applicable on slaves.
#MASTER

# SLAVE &amp;lt;machine-name&amp;gt;
#   IP address(es) of the slave(s). Only applicable on master.
#SLAVE slave1
#SLAVE slave2

# USERMAGIC &amp;lt;string&amp;gt;
#   Magic string use by slaves to identify themselves. Only applicable
#   on slaves.
#USERMAGIC

#
# ===== Configuration statements to control apcupsd system logging ========
#

# Time interval in seconds between writing the STATUS file; 0 disables
STATTIME 0

# Location of STATUS file (written to only if STATTIME is non-zero)
STATFILE /var/log/apcupsd.status

# LOGSTATS [ on | off ] on enables, off disables
# Note! This generates a lot of output, so if
#       you turn this on, be sure that the
#       file defined in syslog.conf for LOG_NOTICE is a named pipe.
#  You probably do not want this on.
LOGSTATS off

# Time interval in seconds between writing the DATA records to
#   the log file. 0 disables.
DATATIME 0

# FACILITY defines the logging facility (class) for logging to syslog.
#          If not specified, it defaults to &quot;daemon&quot;. This is useful
#          if you want to separate the data logged by apcupsd from other
#          programs.
#FACILITY DAEMON

#
# ========== Configuration statements used in updating the UPS EPROM =========
#

#
# These statements are used only by apctest when choosing &quot;Set EEPROM with conf
# file values&quot; from the EEPROM menu. THESE STATEMENTS HAVE NO EFFECT ON APCUPSD.
#

# UPS name, max 8 characters
#UPSNAME UPS_IDEN

# Battery date - 8 characters
#BATTDATE mm/dd/yy

# Sensitivity to line voltage quality (H cause faster transfer to batteries)
# SENSITIVITY H M L        (default = H)
#SENSITIVITY H

# UPS delay after power return (seconds)
# WAKEUP 000 060 180 300   (default = 0)
#WAKEUP 60

# UPS Grace period after request to power off (seconds)
# SLEEP 020 180 300 600    (default = 20)
#SLEEP 180

# Low line voltage causing transfer to batteries
# The permitted values depend on your model as defined by last letter
#  of FIRMWARE or APCMODEL. Some representative values are:
#    D 106 103 100 097
#    M 177 172 168 182
#    A 092 090 088 086
#    I 208 204 200 196     (default = 0 =&amp;gt; not valid)
#LOTRANSFER  208

# High line voltage causing transfer to batteries
# The permitted values depend on your model as defined by last letter
#  of FIRMWARE or APCMODEL. Some representative values are:
#    D 127 130 133 136
#    M 229 234 239 224
#    A 108 110 112 114
#    I 253 257 261 265     (default = 0 =&amp;gt; not valid)
#HITRANSFER 253

# Battery change needed to restore power
# RETURNCHARGE 00 15 50 90 (default = 15)
#RETURNCHARGE 15

# Alarm delay
# 0 = zero delay after pwr fail, T = power fail + 30 sec, L = low battery, N = never
# BEEPSTATE 0 T L N        (default = 0)
#BEEPSTATE T

# Low battery warning delay in minutes
# LOWBATT 02 05 07 10      (default = 02)
#LOWBATT 2

# UPS Output voltage when running on batteries
# The permitted values depend on your model as defined by last letter
#  of FIRMWARE or APCMODEL. Some representative values are:
#    D 115
#    M 208
#    A 100
#    I 230 240 220 225     (default = 0 =&amp;gt; not valid)
#OUTPUTVOLTS 230

# Self test interval in hours 336=2 weeks, 168=1 week, ON=at power on
# SELFTEST 336 168 ON OFF  (default = 336)
#SELFTEST 336
</pre>
<p>
# mdadm –monitor –scan –daemonise
</p>
<p>
host:/var/mail# cat /proc/mdstat<br />
Personalities : [raid1] [raid10]<br />
md3 : active raid10 sdc6[0] sdf6[3] sde6[2] sdd6[4](F)
</p>
<pre class="code">    966020352 blocks 64K chunks 2 near-copies [4/3] [U_UU]</pre>
<p>md2 : active raid10 sdc5[0] sdf5[3] sde5[2] sdd5[4](F)
</p>
<pre class="code">    979712 blocks 64K chunks 2 near-copies [4/3] [U_UU]</pre>
<p>md1 : active raid10 sdc3[0] sdf3[3] sde3[2] sdd3[4](F)
</p>
<pre class="code">    9574528 blocks 64K chunks 2 near-copies [4/3] [U_UU]</pre>
<p>md0 : active raid1 sdc1[0] sdf1[3] sde1[2] sdd1[4](F)
</p>
<pre class="code">    96256 blocks [4/3] [U_UU]</pre>
<p>#  mdadm –fail /dev/md0 /dev/sdd1<br />
#  mdadm –fail /dev/md1 /dev/sdd3<br />
#  mdadm –fail /dev/md2 /dev/sdd5<br />
#  mdadm –fail /dev/md3 /dev/sdd6
</p>
<p>
#  mdadm –remove /dev/md0 /dev/sdd1<br />
#  mdadm –remove /dev/md1 /dev/sdd3<br />
#  mdadm –remove /dev/md2 /dev/sdd5<br />
#  mdadm –remove /dev/md3 /dev/sdd6
</p>
<p>
# shutdown -h now
</p>
<p>
# sfdisk -d /dev/sdc | sfdisk /dev/sdd
</p>
<p>
#  mdadm –add /dev/md0 /dev/sdd1<br />
#  mdadm –add /dev/md1 /dev/sdd3<br />
#  mdadm –add /dev/md2 /dev/sdd5<br />
#  mdadm –add /dev/md3 /dev/sdd6
</p>
<p>
<a href="http://manpages.songshu.org/manpages/lenny/en/man8/dnsmasq.8.html" class="urlextern" title="http://manpages.songshu.org/manpages/lenny/en/man8/dnsmasq.8.html"  rel="nofollow">http://manpages.songshu.org/manpages/lenny/en/man8/dnsmasq.8.html</a>
</p>
<pre class="code"># apt-get install dnsmasq</pre>
<pre class="code">nano /etc/dnsmasq.conf</pre>
<pre class="code">listen-address=192.168.1.1
dhcp-range=192.168.0.50,192.168.0.150,12h
dhcp-option=42,0.0.0.0</pre>
<p>&lt;/div&gt;
</p>
</div>
</div>
<p><!-- end Dokuwiki generated code--></p>
]]></content:encoded>
			<wfw:commentRss>http://www.songshu.org/index.php/setup-raid-10/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>replacing disfuctioning Marvel ethernet controller</title>
		<link>http://www.songshu.org/index.php/replacing-disfuctioning-marvel-ethernet-controller</link>
		<comments>http://www.songshu.org/index.php/replacing-disfuctioning-marvel-ethernet-controller#comments</comments>
		<pubDate>Sat, 14 Feb 2009 17:14:32 +0000</pubDate>
		<dc:creator>randall</dc:creator>
				<category><![CDATA[Debian Etch]]></category>
		<category><![CDATA[IT]]></category>
		<category><![CDATA[all posts]]></category>
		<category><![CDATA[hardware]]></category>

		<guid isPermaLink="false">http://www.songshu.org/?p=454</guid>
		<description><![CDATA[There were problems in the past with the sky2 driver and it still seems to act up once in a while. to replace it and to have sure the new card is detected as eth0 i did the following afterwards since it was running fine the first two weeks or so. i disabled the first LAN card in the bios. removed the rule set (could have simply changed it as well, as i had to any way because the firewire popped up as eth1) rm /etc/udev/rules.d/z25_persistent-net.rules after a reboot it was automatically regenerated # This file was automatically generated by the /lib/udev/write_net_rules # program, probably run by the persistent-net-generator.rules rules file. # # You can modify it, as long as you keep each rule on a single line. # MAC addresses must be written in lowercase. # PCI device 0&#215;8086:0x100c (e1000) SUBSYSTEM==&#8221;net&#8221;, DRIVERS==&#8221;?*&#8221;, ATTRS{address}==&#8221;00:02:b3:91:64:d0&#8243;, NAME=&#8221;eth0&#8243; # Firewire device 0011d800016be1a3 (ohci1394) SUBSYSTEM==&#8221;net&#8221;, DRIVERS==&#8221;?*&#8221;, ATTRS{address}==&#8221;00:11:d8:00:01:6b:e1:a3&#8243;, NAME=&#8221;eth2&#8243; # PCI device 0x11ab:0&#215;4364 (sky2) SUBSYSTEM==&#8221;net&#8221;, DRIVERS==&#8221;?*&#8221;, ATTRS{address}==&#8221;00:1d:60:33:1b:dc&#8221;, NAME=&#8221;eth1&#8243; nano /etc/network/interfaces # This file describes the network interfaces available on your system # and how to activate them. For more information, see interfaces(5). # The loopback network interface auto lo iface lo inet loopback # The [...]]]></description>
			<content:encoded><![CDATA[<p>There were problems in the past with the sky2 driver and it still seems to act up once in a while. to replace it and to have sure the new card is detected as eth0 i did the following afterwards since it was running fine the first two weeks or so.<br />
i disabled the first LAN card in the bios. removed the rule set (could have simply changed it as well, as i had to any way because the firewire popped up as eth1)</p>
<blockquote><p>rm /etc/udev/rules.d/z25_persistent-net.rules</p></blockquote>
<p>after a reboot it was automatically regenerated</p>
<blockquote><p># This file was automatically generated by the /lib/udev/write_net_rules<br />
# program, probably run by the persistent-net-generator.rules rules file.<br />
#<br />
# You can modify it, as long as you keep each rule on a single line.<br />
# MAC addresses must be written in lowercase.</p>
<p># PCI device 0&#215;8086:0x100c (e1000)<br />
SUBSYSTEM==&#8221;net&#8221;, DRIVERS==&#8221;?*&#8221;, ATTRS{address}==&#8221;00:02:b3:91:64:d0&#8243;, NAME=&#8221;eth0&#8243;</p>
<p># Firewire device 0011d800016be1a3 (ohci1394)<br />
SUBSYSTEM==&#8221;net&#8221;, DRIVERS==&#8221;?*&#8221;, ATTRS{address}==&#8221;00:11:d8:00:01:6b:e1:a3&#8243;, NAME=&#8221;eth2&#8243;</p>
<p># PCI device 0x11ab:0&#215;4364 (sky2)<br />
SUBSYSTEM==&#8221;net&#8221;, DRIVERS==&#8221;?*&#8221;, ATTRS{address}==&#8221;00:1d:60:33:1b:dc&#8221;, NAME=&#8221;eth1&#8243;</p></blockquote>
<blockquote><p>nano /etc/network/interfaces</p></blockquote>
<blockquote><p># This file describes the network interfaces available on your system<br />
# and how to activate them. For more information, see interfaces(5).</p>
<p># The loopback network interface<br />
auto lo<br />
iface lo inet loopback</p>
<p># The primary network interface<br />
auto eth0<br />
iface eth0 inet static<br />
hwaddress ether 00:02:b3:91:64:d0<br />
address 212.123.252.242<br />
netmask 255.255.255.0<br />
network 212.123.252.0<br />
broadcast 212.123.252.255<br />
gateway 212.123.252.1<br />
# dns-* options are implemented by the resolvconf package, if installed<br />
dns-nameservers 192.168.0.1<br />
dns-search cipar.net</p>
<p>auto eth1<br />
iface eth1 inet static<br />
hwaddress ether 00:1D:60:33:1B:DC<br />
address 192.168.0.1<br />
netmask 255.255.255.0<br />
broadcast 192.168.0.255<br />
network 192.168.0.0</p>
<p>auto dummy0<br />
iface dummy0 inet static<br />
address 192.168.1.1<br />
netmask 255.255.255.0</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.songshu.org/index.php/replacing-disfuctioning-marvel-ethernet-controller/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
