<?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>Kevin Deldycke &#187; Hardware</title> <atom:link href="http://kevin.deldycke.com/tag/hardware/feed/" rel="self" type="application/rss+xml" /><link>http://kevin.deldycke.com</link> <description>Free software engineer &#38; wannabe videomaker</description> <lastBuildDate>Fri, 03 Feb 2012 19:08:27 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.1</generator> <item><title>Using Munin to monitor a Debian Squeeze server</title><link>http://kevin.deldycke.com/2011/06/munin-monitor-debian-squeeze-server/</link> <comments>http://kevin.deldycke.com/2011/06/munin-monitor-debian-squeeze-server/#comments</comments> <pubDate>Mon, 06 Jun 2011 10:25:41 +0000</pubDate> <dc:creator>Kev</dc:creator> <category><![CDATA[English]]></category> <category><![CDATA[acpi]]></category> <category><![CDATA[Debian]]></category> <category><![CDATA[fail2ban]]></category> <category><![CDATA[Hardware]]></category> <category><![CDATA[Linux]]></category> <category><![CDATA[lm-sensors]]></category> <category><![CDATA[munin]]></category> <category><![CDATA[nginx]]></category> <category><![CDATA[nut]]></category> <category><![CDATA[RAID]]></category> <category><![CDATA[Server]]></category> <category><![CDATA[squeeze]]></category><guid isPermaLink="false">http://kevin.deldycke.com/?p=3192</guid> <description><![CDATA[Again, here is a tutorial article exposing the recipe I use to cook a Munin on a Debian Squeeze. As usual, let&#8217;s start by installing the main Munin package: FYI, the version that aptitude choose to install was Munin 1.4.5. &#8230; <a href="http://kevin.deldycke.com/2011/06/munin-monitor-debian-squeeze-server/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<p>Again, here is a tutorial article exposing the recipe I use to cook a <a href="http://en.wikipedia.org/wiki/Munin_(network_monitoring_application)">Munin</a> on a Debian Squeeze.</p><p>As usual, let&#8217;s start by installing the main Munin package:</p><pre class="brush: bash; title: ; notranslate">
$ aptitude install munin
</pre><p>FYI, the version that aptitude choose to install was Munin 1.4.5. The default configuration coming along will make it produce graphs and HTML content to <code>/var/cache/munin/www</code>. Now we need to serve these pages via a web server.</p><p>As I wanted to play with <a href="http://en.wikipedia.org/wiki/Nginx">nginx</a> for a long time, I will use this opportunity to serve Munin&#8217;s content. The default version coming with Squeeze is quite old, so we&#8217;ll get the latest version from the <a href="http://www.dotdeb.org/">Dotdeb</a> repository:</p><pre class="brush: bash; title: ; notranslate">
$ echo &quot;deb http://packages.dotdeb.org squeeze all&quot; &gt; /etc/apt/sources.list.d/squeeze-dotdeb.list
$ aptitude update
$ aptitude install nginx
</pre><p>And if you don&#8217;t want to get those error messages about untrusted packages, don&#8217;t forget to <a href="http://www.dotdeb.org/2010/07/11/dotdeb-packages-are-now-signed/">add Dotdeb&#8217;s keys to your keyring</a>.</p><p>We can now test that nginx is working by starting it up then fetch the default served page:</p><pre class="brush: bash; title: ; notranslate">
$ /etc/init.d/nginx start
$ wget --output-document=- http://localhost | grep &quot;Welcome to nginx&quot;
</pre><p>Then we&#8217;ll disable the default nginx config and create a new one for Munin:</p><pre class="brush: bash; title: ; notranslate">
$ rm /etc/nginx/sites-enabled/default
$ touch /etc/nginx/sites-available/munin
</pre><p>In the latter, we put this minimal configuration:</p><pre class="brush: plain; title: ; notranslate">
server {
  server_name munin.example.com;
  root /var/cache/munin/www/;
  location / {
    index index.html;
    access_log off;
  }
}
</pre><p>Now we have to activate it before restarting nginx:</p><pre class="brush: bash; title: ; notranslate">
$ ln -s  /etc/nginx/sites-available/munin /etc/nginx/sites-enabled/munin
$ /etc/init.d/nginx restart
</pre><p>Now we are free to point our browser to the <code>http://munin.example.com</code> URL to get our graphs.</p><p>You&#8217;ll see that by default, Munin refer to your machine as <code>localhost.localdomain</code>. It&#8217;s time to tweak Munin a little to get nice reports:</p><pre class="brush: bash; title: ; notranslate">
$ sed -i 's/\[localhost\.localdomain\]/\[munin\.example\.com\]/g' /etc/munin/munin.conf
</pre><p>By default Munin activate a lot of great graphs. But I always find that some crucial monitoring are missing. Let&#8217;s add some more monitoring scripts:</p><pre class="brush: bash; title: ; notranslate">
$ aptitude install munin-plugins-extra
</pre><p>Here is a collection of general purpose graphs I automatically add to Munin:</p><pre class="brush: bash; title: ; notranslate">
$ ln -s /usr/share/munin/plugins/df_abs  /etc/munin/plugins/
$ ln -s /usr/share/munin/plugins/netstat /etc/munin/plugins/
$ echo &quot;[netstat]
user root
&quot; &gt; /etc/munin/plugin-conf.d/netstat
</pre><p>It&#8217;s also good to have a clue about your connectivity to the rest of the world:</p><pre class="brush: bash; title: ; notranslate">
$ ln -s /usr/share/munin/plugins/ping_  /etc/munin/plugins/ping_google.com
$ ln -s /usr/share/munin/plugins/ping_  /etc/munin/plugins/ping_ovh.fr
$ ln -s /usr/share/munin/plugins/ping_  /etc/munin/plugins/ping_example.com
</pre><p>I also like to have insight about my <a href="http://kevin.deldycke.com/2011/09/cloud-based-server-backups-duplicity-amazon-s3/">automated backups</a>:</p><pre class="brush: bash; title: ; notranslate">
$ ln -s /usr/share/munin/plugins/ps_ /etc/munin/plugins/ps_duplicity
$ ln -s /usr/share/munin/plugins/ps_ /etc/munin/plugins/ps_sshd
</pre><p>Monitoring temperatures, voltages and other hardware metrics is a must, unless your machine is a virtual server <img src='http://kevin.deldycke.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> :</p><pre class="brush: bash; title: ; notranslate">
$ ln -s /usr/share/munin/plugins/cpuspeed         /etc/munin/plugins/
$ ln -s /usr/share/munin/plugins/acpi             /etc/munin/plugins/
$ ln -s /usr/share/munin/plugins/hddtemp_smartctl /etc/munin/plugins/
$ aptitude install i2c-tools lm-sensors
$ sensors-detect
$ ln -s /usr/share/munin/plugins/sensors_ /etc/munin/plugins/sensors_temp
$ ln -s /usr/share/munin/plugins/sensors_ /etc/munin/plugins/sensors_volt
</pre><p>I sometimes have a Fail2Ban deamon running on a server, so that&#8217;s a good thing to monitor it:</p><pre class="brush: bash; title: ; notranslate">
$ ln -s /usr/share/munin/plugins/fail2ban /etc/munin/plugins/
$ echo &quot;[fail2ban*]
user root
&quot; &gt; /etc/munin/plugin-conf.d/fail2ban
</pre><p><a href="http://kevin.deldycke.com/2011/05/mge-ellipse-750-ups-debian-squeeze/">Having an UPS</a>, it&#8217;s good to monitor it too. Here is for the UPS on the local system having the <code>MGE-Ellipse750</code> ID (as defined in your <code>/etc/nut/ups.conf</code> file):</p><pre class="brush: bash; title: ; notranslate">
$ ln -s /usr/share/munin/plugins/nutups_   /etc/munin/plugins/nutups_MGE-Ellipse750_voltages
$ ln -s /usr/share/munin/plugins/nutups_   /etc/munin/plugins/nutups_MGE-Ellipse750_charge
$ ln -s /usr/share/munin/plugins/nutups_   /etc/munin/plugins/nutups_MGE-Ellipse750_freq
$ ln -s /usr/share/munin/plugins/nutups_   /etc/munin/plugins/nutups_MGE-Ellipse750_current
$ ln -s /usr/share/munin/plugins/nut_misc  /etc/munin/plugins/
$ ln -s /usr/share/munin/plugins/nut_volts /etc/munin/plugins/
$ echo &quot;[nut*]
user root

[nut_*]
env.upsname MGE-Ellipse750@localhost
&quot; &gt; /etc/munin/plugin-conf.d/nut
</pre><p>And if you have a MySQL server running on the machine, that&#8217;s a good idea to get stats:</p><pre class="brush: bash; title: ; notranslate">
$ ln -s /usr/share/munin/plugins/mysql_threads     /etc/munin/plugins/
$ ln -s /usr/share/munin/plugins/mysql_slowqueries /etc/munin/plugins/
$ ln -s /usr/share/munin/plugins/mysql_queries     /etc/munin/plugins/
$ ln -s /usr/share/munin/plugins/mysql_bytes       /etc/munin/plugins/
</pre><p>I also use some other Munin plugins coming from <a href="http://exchange.munin-monitoring.org">Munin exchange</a>:</p><pre class="brush: bash; title: ; notranslate">
$ wget http://exchange.munin-monitoring.org/plugins/mysql_size_all/version/1/download --output-document=/usr/share/munin/plugins/mysql_size_all
$ ln -s /usr/share/munin/plugins/mysql_size_all /etc/munin/plugins/
</pre><p>An here is how I monitor my RAID array:</p><pre class="brush: bash; title: ; notranslate">
$ wget http://exchange.munin-monitoring.org/plugins/raid/version/3/download --output-document=/usr/share/munin/plugins/raid
$ ln -s /usr/share/munin/plugins/raid /etc/munin/plugins/
$ echo &quot;[raid]
user root
&quot; &gt; /etc/munin/plugin-conf.d/raid
</pre><p>Finally, it&#8217;s time to monitor nginx itself:</p><pre class="brush: bash; title: ; notranslate">
$ ln -s /usr/share/munin/plugins/nginx_status  /etc/munin/plugins/
$ ln -s /usr/share/munin/plugins/nginx_request /etc/munin/plugins/
$ echo &quot;[nginx_*]
env.url http://localhost/nginx_status
&quot; &gt; /etc/munin/plugin-conf.d/nginx
</pre><p>These two scripts above have some Perl module dependencies:</p><pre class="brush: bash; title: ; notranslate">
$ aptitude install libio-all-lwp-perl
</pre><p>If you don&#8217;t install the libraries above, you&#8217;ll get these kind of errors in <code>/var/log/munin/munin-node.log</code>:</p><pre class="brush: plain; title: ; notranslate">
2011/05/03-17:50:10 [2009] Error output from nginx_request:
2011/05/03-17:50:10 [2009]      Can't locate object method &quot;new&quot; via package &quot;LWP::UserAgent&quot; at /etc/munin/plugins/nginx_request line 106.
2011/05/03-17:50:10 [2009] Service 'nginx_request' exited with status 9/0.
2011/05/03-17:50:10 [2009] Error output from nginx_status:
2011/05/03-17:50:10 [2009]      Can't locate object method &quot;new&quot; via package &quot;LWP::UserAgent&quot; at /etc/munin/plugins/nginx_status line 109.
2011/05/03-17:50:10 [2009] Service 'nginx_status' exited with status 2/0.
</pre><p>But for this to work, we have to update the <code>/etc/nginx/sites-enabled/munin</code> file. Now it looks like this:</p><pre class="brush: plain; title: ; notranslate">
server {
  server_name munin.example.com;
  root /var/cache/munin/www/;
  # Restrict Munin access
  auth_basic &quot;Restricted&quot;;
  auth_basic_user_file /etc/nginx/htpasswd;
  location / {
    index index.html;
    access_log off;
  }
}
server {
  allow 127.0.0.1;
  deny all;
  location /nginx_status {
    stub_status on;
    access_log off;
  }
}
</pre><p>Note that I&#8217;ve added a simple HTTP authentication to Munin webpages and restricted access to nginx statistics from the local machine only.</p><p>At last, before rebooting Munin and Nginx, make sure all downloaded plugins are executables. This is important and always forgotten:</p><pre class="brush: bash; title: ; notranslate">
$ chmod -R 755 /usr/share/munin/plugins/
$ /etc/init.d/nginx restart
$ /etc/init.d/munin-node restart
</pre>]]></content:encoded> <wfw:commentRss>http://kevin.deldycke.com/2011/06/munin-monitor-debian-squeeze-server/feed/</wfw:commentRss> <slash:comments>5</slash:comments> </item> <item><title>2 x iFixit $5 voucher</title><link>http://kevin.deldycke.com/2010/10/two-ifixit-vouchers/</link> <comments>http://kevin.deldycke.com/2010/10/two-ifixit-vouchers/#comments</comments> <pubDate>Tue, 19 Oct 2010 19:26:44 +0000</pubDate> <dc:creator>Kev</dc:creator> <category><![CDATA[English]]></category> <category><![CDATA[Apple]]></category> <category><![CDATA[coupon]]></category> <category><![CDATA[discount]]></category> <category><![CDATA[Hardware]]></category> <category><![CDATA[ifixit]]></category> <category><![CDATA[ipad]]></category> <category><![CDATA[iphone]]></category> <category><![CDATA[ipod]]></category> <category><![CDATA[Mac]]></category> <category><![CDATA[shop]]></category> <category><![CDATA[store]]></category> <category><![CDATA[voucher]]></category><guid isPermaLink="false">http://kevin.deldycke.com/?p=2228</guid> <description><![CDATA[I&#8217;ve just got 2 coupons from iFixit. They&#8217;ll give you $5 off on your next purchase. As I plan to get rid off of all my Apple hardware very soon, I don&#8217;t need them anymore. If you want one, please &#8230; <a href="http://kevin.deldycke.com/2010/10/two-ifixit-vouchers/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<p>I&#8217;ve just got 2 coupons from <a href="http://www.ifixit.com/Parts-Store">iFixit</a>. They&#8217;ll give you $5 off on your next purchase. As I plan to get rid off of all my Apple hardware very soon, I don&#8217;t need them anymore.</p><p><a href="http://kevin.deldycke.com/wp-content/uploads/2010/10/ifixit-voucher.jpg"><img src="http://kevin.deldycke.com/wp-content/uploads/2010/10/ifixit-voucher-300x107.jpg" alt="" title="ifixit-voucher" width="300" height="107" class="aligncenter size-medium wp-image-2229" /></a></p><p>If you want one, please leave a comment below and don&#8217;t forget to fill the appropriate field with your email. I&#8217;ll then be able to contact you and send you the coupon&#8217;s code.</p> ]]></content:encoded> <wfw:commentRss>http://kevin.deldycke.com/2010/10/two-ifixit-vouchers/feed/</wfw:commentRss> <slash:comments>4</slash:comments> </item> <item><title>Enttec DMX-USB firmware upgrade with Qemu</title><link>http://kevin.deldycke.com/2009/05/enttec-dmx-usb-firmware-upgrade-with-qemu/</link> <comments>http://kevin.deldycke.com/2009/05/enttec-dmx-usb-firmware-upgrade-with-qemu/#comments</comments> <pubDate>Thu, 14 May 2009 19:55:57 +0000</pubDate> <dc:creator>Kev</dc:creator> <category><![CDATA[English]]></category> <category><![CDATA[dmx]]></category> <category><![CDATA[enttec]]></category> <category><![CDATA[firmware]]></category> <category><![CDATA[Hardware]]></category> <category><![CDATA[lighting]]></category> <category><![CDATA[lights]]></category> <category><![CDATA[Linux]]></category> <category><![CDATA[Qemu]]></category> <category><![CDATA[stage lightning]]></category> <category><![CDATA[USB]]></category><guid isPermaLink="false">http://kevin.deldycke.com/?p=359</guid> <description><![CDATA[A year ago, I brought a Enttec Pro USB/DMX widget. Since then, a new firmware was released. If it doesn&#8217;t fix any critical bug to me, I still have to upgrade it (don&#8217;t mind asking why&#8230; ). And to make &#8230; <a href="http://kevin.deldycke.com/2009/05/enttec-dmx-usb-firmware-upgrade-with-qemu/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<p>A year ago, I brought a <a href="http://www.enttec.com/dmxusb.php">Enttec Pro USB/DMX widget</a>. Since then, a new firmware was released. If it doesn&#8217;t fix any critical bug to me, I still <em>have to</em> upgrade it (don&#8217;t mind asking why&#8230; <img src='http://kevin.deldycke.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> ). And to make things fun (read &#8220;dangerous&#8221;), I choose to do it with Qemu.</p><p>This article explains how I upgraded the firmware of my Enttec DMX/USB widget under linux thanks to Qemu.</p><p>First, plug your device in one of your computer&#8217;s USB port. We need to get the hardware UID of the widget. We can do so as root in a linux terminal:</p><pre class="brush: bash; title: ; notranslate">
cat /proc/bus/usb/devices
</pre><p>This command output a big mess in which you should find a block of lines separated by two blank lines (one above and one below) corresponding to your USB device. It&#8217;s easy to spot, as it contain the <code>ENTTEC</code> string. Mine look like this:</p><pre class="brush: bash; title: ; notranslate">
T:  Bus=02 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  2 Spd=12  MxCh= 0
D:  Ver= 2.00 Cls=00(&gt;ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1
P:  Vendor=0403 ProdID=6001 Rev= 6.00
S:  Manufacturer=ENTTEC
S:  Product=DMX USB PRO
S:  SerialNumber=ENQXXXXX
C:* #Ifs= 1 Cfg#= 1 Atr=a0 MxPwr=300mA
I:* If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=ftdi_sio
E:  Ad=81(I) Atr=02(Bulk) MxPS=  64 Ivl=0ms
E:  Ad=02(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms
</pre><p>What we are looking for is the vendor&#8217;s ID and the product&#8217;s ID, that&#8217;s all Qemu needs to talk to the device. This is found on the line starting with <code>P:</code>. For me:</p><ul><li>Vendor ID: <code>0403</code></li><li>Products ID: <code>6001</code></li></ul><p>With this information, we can launch Qemu and bind it to the device. Assuming you already have a Qemu image containing a working version of windows XP, the command looks like this:</p><pre class="brush: bash; title: ; notranslate">
qemu -m 512 -usb -usbdevice host:0403:6001 -hda ./qemu-win-xp-with-freestyler.qcow
</pre><p>Alternatively, you can &#8220;hotplug&#8221; the USB device once inside Qemu. This can be done by calling the <a href="http://www.nongnu.org//qemu/qemu-doc.html#SEC11">Qemu interactive shell</a> by pressing <code>Ctrl + Alt + 2</code> simultaneously. Then, to hotplug the USB device, type:</p><pre class="brush: bash; title: ; notranslate">
usb_add host:0403:6001
</pre><p>If you&#8217;re as unlucky as I am, you&#8217;ll get this error message:</p><pre class="brush: bash; title: ; notranslate">
Could not add USB device 'host:0403:6001'
</pre><p>Which is doubled by the following message from your legacy console:</p><pre class="brush: bash; title: ; notranslate">
/proc/bus/usb/002/002: Permission denied
</pre><p>The latter point to the restrictive access rights on our device, which can be fixed by:</p><pre class="brush: bash; title: ; notranslate">
chmod -R a+rw /proc/bus/usb/002/002
</pre><p><a href="http://kevin.deldycke.com/wp-content/uploads/2009/05/qemu-usb-console.png"><img src="http://kevin.deldycke.com/wp-content/uploads/2009/05/qemu-usb-console-300x192.png" alt="qemu-usb-console" title="qemu-usb-console" width="300" height="192" class="aligncenter size-medium wp-image-623" /></a></p><p>Instead, if you get the following error message:</p><pre class="brush: bash; title: ; notranslate">
usb_host: device already grabbed
</pre><p>It probably mean that your linux kernel has already identified the device when you plugged in and has loaded some drivers. To unload them and free the device, I had to do:</p><pre class="brush: bash; title: ; notranslate">
lsmod
rmmod dmx_usb
rmmod ftdi_sio
</pre><p>At last, you can check under the emulated Windows that your Enttec widget is recognized by windows:</p><p><a href="http://kevin.deldycke.com/wp-content/uploads/2009/05/enttec-usb-dmx-widget-on-windows-xp-through-qemu.png"><img src="http://kevin.deldycke.com/wp-content/uploads/2009/05/enttec-usb-dmx-widget-on-windows-xp-through-qemu-300x231.png" alt="enttec-usb-dmx-widget-on-windows-xp-through-qemu" title="enttec-usb-dmx-widget-on-windows-xp-through-qemu" width="300" height="231" class="aligncenter size-medium wp-image-627" /></a></p><p>And finally you&#8217;re free to upgrade (at your own risks) your widget&#8217;s firmware with the tools available on Enttec&#8217;s official website:</p><p><a href="http://kevin.deldycke.com/wp-content/uploads/2009/05/enttec-dmx-usb-widget-firmware-upgrade-on-windows-xp-through-qemu.png"><img src="http://kevin.deldycke.com/wp-content/uploads/2009/05/enttec-dmx-usb-widget-firmware-upgrade-on-windows-xp-through-qemu-300x231.png" alt="enttec-dmx-usb-widget-firmware-upgrade-on-windows-xp-through-qemu" title="enttec-dmx-usb-widget-firmware-upgrade-on-windows-xp-through-qemu" width="300" height="231" class="aligncenter size-medium wp-image-628" /></a></p><p>FYI, all these operations where performed on a Mandriva 2008.1, Qemu 0.9.0 and linux kernel 2.6.24.</p> ]]></content:encoded> <wfw:commentRss>http://kevin.deldycke.com/2009/05/enttec-dmx-usb-firmware-upgrade-with-qemu/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> <item><title>Heroic journey to RAID-5 data recovery</title><link>http://kevin.deldycke.com/2008/07/heroic-journey-to-raid-5-data-recovery/</link> <comments>http://kevin.deldycke.com/2008/07/heroic-journey-to-raid-5-data-recovery/#comments</comments> <pubDate>Thu, 24 Jul 2008 21:20:27 +0000</pubDate> <dc:creator>Kev</dc:creator> <category><![CDATA[English]]></category> <category><![CDATA[array]]></category> <category><![CDATA[Backup]]></category> <category><![CDATA[disk]]></category> <category><![CDATA[drive]]></category> <category><![CDATA[Hardware]]></category> <category><![CDATA[HDD]]></category> <category><![CDATA[Linux]]></category> <category><![CDATA[mdadm]]></category> <category><![CDATA[monitoring]]></category> <category><![CDATA[RAID]]></category> <category><![CDATA[Server]]></category> <category><![CDATA[system]]></category> <category><![CDATA[UPS]]></category><guid isPermaLink="false">http://kevin.deldycke.com/?p=246</guid> <description><![CDATA[Last week there was a power grid failure which break down my server&#8217;s RAID array. I have no UPS (as I&#8217;m a skinflint) and no automatic email alerts (because I&#8217;m too lazy to set it up). As a result, for &#8230; <a href="http://kevin.deldycke.com/2008/07/heroic-journey-to-raid-5-data-recovery/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<p>Last week there was a power grid failure which break down my server&#8217;s RAID array. I have no <a href="http://en.wikipedia.org/wiki/Uninterruptible_power_supply">UPS</a> (as I&#8217;m a skinflint) and no automatic email alerts (because I&#8217;m too lazy to set it up). As a result, for 5 days, my 3-disk <a href="http://en.wikipedia.org/wiki/RAID_5">RAID-5 array</a> was relying on only 2 disks until I noticed the issue&#8230;</p><p>By using a combination of following commands, I was soon aware of the gravity of the situation:</p><pre class="brush: bash; title: ; notranslate">
cat /proc/mdstat
mdadm --examine /dev/sda1
</pre><p>My <code>/dev/sda1</code> disk was kicked out of the array, so I did the right stuff which consisted of reconstructing the array:</p><pre class="brush: bash; title: ; notranslate">
mdadm /dev/md0 -a /dev/sda1
</pre><p>Then, in an unlucky combination of cosmic ray bombardment, spooky action at a distance and astrological misalignment, half-way to the end of the rebuilding process (which can take up to 5 hours), another disk failed ! It was late, I was tired and utterly worried about losing 1.5 To of precious data. In such a bad shape, I was afraid to worsen the situation. So I decided to shutdown the server and sleep on the problem.</p><p>The next day I tried to boot my server to find it (surprise !) stuck in the middle of the boot process, with the famous message:</p><pre class="brush: bash; title: ; notranslate">
hit control-D to continue or give root password to fix manually
</pre><p>This is &#8220;normal&#8221; as my server tried to mount the <a href="http://en.wikipedia.org/wiki/Ext3">ext3 filesystem</a> from the <code>/dev/md0</code> partition that was just assembled by <code>mdadm</code>. Of course <code>md0</code>, if assembled and available to the system, was not running because only one disk, out of three, was in a clean state.</p><p>I skip here the epic substory in which I wasted days in a search of a working keyboard, but I let you imagine how such adventures makes my week&#8230;</p><p>Eventually, I was able to analyze the situation in details. My first reflex ? Check that disks are not physically dead:</p><pre class="brush: bash; title: ; notranslate">
fdisk -l /dev/sda
fdisk -l /dev/sdb
fdisk -l /dev/sdc
</pre><p>&#8220;Linux raid partitions&#8221; (type code &#8220;<code>fd</code>&#8220;) are still there. Good. I assumed here that disks where not physically damaged. Maybe I should have looked at <a href="http://en.wikipedia.org/wiki/Self-Monitoring,_Analysis,_and_Reporting_Technology">S.M.A.R.T.</a> datas and statistics (via <a href="http://smartmontools.sourceforge.net">smartmontools</a>). But remember, I&#8217;m lazy (and a bit crazy).</p><p>The next step was to get informations about the RAID array itself using:</p><pre class="brush: bash; title: ; notranslate">
mdadm --detail /dev/md0
</pre><p>which output the status table below (probably inaccurate as I reconstructed it afterwards):</p><pre class="brush: bash; title: ; notranslate">
Number   Major   Minor   RaidDevice State
   0       0        0        0      removed
   1       0        0        1      faulty removed
   2       8       33        2      active sync   /dev/sdc1
   3       8       17        3      spare
</pre><p>What this table told us ?</p><ul><li>The array is up, but not running. One of its device (<code>sdc1</code>) was clean and active, but it&#8217;s not enough to get a working RAID-5.</li><li>My first attempt to rebuild the array lead to an unexpected result: it added <code>sda1</code> as a spare device (in slot #3).</li><li>It confirm that <code>sdb1</code> unexpectedly failed and is now in a bad state (&#8220;<code>faulty removed</code>&#8220;).</li></ul><p>Then I stopped the array and tried to fearlessly (re)assemble it using 3 differents methods:</p><pre class="brush: bash; title: ; notranslate">
mdadm -S /dev/md0
mdadm -A /dev/md0
mdadm --assemble /dev/md0 --verbose /dev/sd[abc]1
mdadm --assemble --force --scan /dev/md0 --verbose
</pre><p>It always failed with messages like:</p><pre class="brush: bash; title: ; notranslate">
mdadm: failed to RUN_ARRAY /dev/md0: Input/output error
mdadm: /dev/md0 assembled from 1 drives and 1 spare - not enough to start the array.
</pre><p>So I examined each drive from <code>mdadm</code>&#8216;s point of view:</p><pre class="brush: bash; title: ; notranslate">
mdadm -E /dev/sda1
mdadm -E /dev/sdb1
mdadm -E /dev/sdc1
mdadm -E /dev/sd[abc]1 | grep Event
</pre><p>The lastest command compare the &#8220;<code>Event</code>&#8221; attribute of all devices. It output something like:</p><pre class="brush: bash; title: ; notranslate">
Events : 0.53120
Events : 0.53108
Events : 0.53120
</pre><p>which indicate that <code>sda1</code> and <code>sdc1</code> are somewhat synced (share the same number) and <code>sdb1</code> &#8220;late&#8221; (lower number).</p><p>Here I&#8217;ve got the idea of recreating the raid array without <code>sdb1</code>, relying only on <code>sda1</code> and <code>sdc1</code>, by using the &#8220;magic&#8221; (hence dangerous) <code>--assume-clean</code> option. The latter doesn&#8217;t build, erase or initialize a new array. It just try to assemble it &#8220;as is&#8221;. Here is the command:</p><pre class="brush: bash; title: ; notranslate">
mdadm --create /dev/md0 --assume-clean --level=5 --verbose --raid-devices=3 /dev/sda1 missing /dev/sdc1
</pre><p>And it worked ! <img src='http://kevin.deldycke.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /></p><p>I mounted the <code>md0</code> partition and cleaned it up:</p><pre class="brush: bash; title: ; notranslate">
fsck.ext3 -v /dev/md0
mount /dev/md0
</pre><p>I updated my <a href="http://neil.brown.name/blog/mdadm">mdadm</a> configuration before rebooting my server:</p><pre class="brush: bash; title: ; notranslate">
mdadm --detail --scan &gt;&gt; /etc/mdadm/mdadm.conf
vi /etc/mdadm/mdadm.conf
reboot
</pre><p>But history repeat itself, and again, the system hang up during boot. Except this time I knew what was happening: the boot process detected the remaining <code>sdb1</code> device as part of the old array (the one before the regeneration I did above) and tried to run it. <a href="http://kevin.deldycke.com/2007/03/how-to-recover-a-raid-array-after-having-zero-ized-superblocks/">Remembering my last year post</a>, I zero-ized the superblock of <code>sdb1</code>:</p><pre class="brush: bash; title: ; notranslate">
mdadm -S /dev/md0
mdadm --zero-superblock /dev/sdb1
</pre><p>A server reboot proved I was right and my <code>md0</code> partition was automagically mounted in altered state:</p><pre class="brush: bash; title: ; notranslate">
localhost:~# cat /proc/mdstat
Personalities : [raid6] [raid5] [raid4]
md0 : active raid5 sdb1[3] sda1[0] sdc1[2]
      1465143808 blocks level 5, 64k chunk, algorithm 2 [3/2] [U_U]

unused devices: &lt;none&gt;
</pre><p>I just had to re-add <code>sdb1</code> to fill the available slot and update the mdadm configuration to get back my array in its initial state:</p><pre class="brush: bash; title: ; notranslate">
mdadm --manage /dev/md0 --add /dev/sdb1
mdadm --detail --scan &gt;&gt; /etc/mdadm/mdadm.conf
vi /etc/mdadm/mdadm.conf
</pre>]]></content:encoded> <wfw:commentRss>http://kevin.deldycke.com/2008/07/heroic-journey-to-raid-5-data-recovery/feed/</wfw:commentRss> <slash:comments>10</slash:comments> </item> <item><title>How to fix Samsung Q35 random freeze</title><link>http://kevin.deldycke.com/2008/02/how-to-fix-samsung-q35-random-freeze/</link> <comments>http://kevin.deldycke.com/2008/02/how-to-fix-samsung-q35-random-freeze/#comments</comments> <pubDate>Sat, 02 Feb 2008 17:36:47 +0000</pubDate> <dc:creator>Kev</dc:creator> <category><![CDATA[English]]></category> <category><![CDATA[firmware]]></category> <category><![CDATA[Hardware]]></category> <category><![CDATA[optical drive]]></category><guid isPermaLink="false">http://kevin.deldycke.com/2008/02/how-to-fix-samsung-q35-random-freeze/</guid> <description><![CDATA[If like me you have a Samsung Q35, do not forget to update your optical drive firmware. I&#8217;ve upgraded my TSSTcorp CD/DVDW TS-L632D drive from the SC02 to SC04 firmware revision and my laptop is stable now ! By the &#8230; <a href="http://kevin.deldycke.com/2008/02/how-to-fix-samsung-q35-random-freeze/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<p>If like me you have a <a href="http://kevin.deldycke.com/2006/10/samsung-q35-xic-5500-tiny-review-of-a-strong-compact-laptop/">Samsung Q35</a>, do not forget to <a href="https://bugs.launchpad.net/linux/+bug/75295/comments/97">update your optical drive firmware</a>.</p><p>I&#8217;ve upgraded my <code>TSSTcorp CD/DVDW TS-L632D</code> drive from the <code>SC02</code> to <code>SC04</code> firmware revision and my laptop is stable now ! <img src='http://kevin.deldycke.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p><p>By the way, to get the model name and revision of your optical drive under linux, use:</p><pre class="brush: bash; title: ; notranslate">
cdrdao scanbus
</pre>]]></content:encoded> <wfw:commentRss>http://kevin.deldycke.com/2008/02/how-to-fix-samsung-q35-random-freeze/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>How-to Recover a RAID array after having Zero-ized Superblocks</title><link>http://kevin.deldycke.com/2007/03/how-to-recover-a-raid-array-after-having-zero-ized-superblocks/</link> <comments>http://kevin.deldycke.com/2007/03/how-to-recover-a-raid-array-after-having-zero-ized-superblocks/#comments</comments> <pubDate>Wed, 07 Mar 2007 21:48:52 +0000</pubDate> <dc:creator>Kev</dc:creator> <category><![CDATA[English]]></category> <category><![CDATA[Backup]]></category> <category><![CDATA[Hardware]]></category> <category><![CDATA[Linux]]></category> <category><![CDATA[mdadm]]></category> <category><![CDATA[RAID]]></category> <category><![CDATA[Server]]></category><guid isPermaLink="false">http://kevin.deldycke.com/2007/03/how-to-recover-a-raid-array-after-having-zero-ized-superblocks/</guid> <description><![CDATA[Today mdadm send me a mail to warn that one of my hard drive (/dev/hdd1) was ejected from my RAID-5 array. After some manipulations (no writes, just reads on the file system to get informations) and reboots, I ended up &#8230; <a href="http://kevin.deldycke.com/2007/03/how-to-recover-a-raid-array-after-having-zero-ized-superblocks/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<p>Today <code>mdadm</code> send me a mail to warn that one of my hard drive (<code>/dev/hdd1</code>) was ejected from my RAID-5 array. After some manipulations (no writes, just reads on the file system to get informations) and reboots, I ended up with a file system in a strange state: the folder structure was totally messed up and lots of files disappeared.</p><p>Assuming that this situation was about an inconsistent file index, I decided to reset the superblocks of the remaining physical disks:</p><pre class="brush: bash; title: ; notranslate">
mdadm --zero-superblock /dev/hdc1
mdadm --zero-superblock /dev/hdb1
</pre><p>I don&#8217;t know why I decided to do so, but it was the stupidest idea of the week. After such a violent treatment, my array refused to start:</p><pre class="brush: bash; title: ; notranslate">
[root@localhost ~]$ mdadm --assemble /dev/md0 --auto --scan --update=summaries --verbose
mdadm: looking for devices for /dev/md0
mdadm: no RAID superblock on /dev/hdc1
mdadm: /dev/hdc1 has wrong raid level.
mdadm: no RAID superblock on /dev/hdb1
mdadm: /dev/hdb1 has wrong raid level.
mdadm: no devices found for /dev/md0
</pre><p>At this moment I was sure that all my data assets were lost. I was desperate. My only alternative was to ask Google. So I did.</p><p>I spend several minutes browsing the web without hope. I finally found <a href="http://lists.debian.org/debian-user-french/2006/03/msg00602.html">someone in the same situation as mine</a> (sorry, in french) on debian-user-french mailing list.</p><p>The solution was to recreate the RAID array. This sound counter-intuitive: if we recreate a raid array over an existing one, it will be erased ! Right ? Wrong ! <a href="http://lists.debian.org/debian-user-french/2006/03/msg00607.html">As it is said on debian-user-french</a>, <code>mdadm</code> is smart enough to &#8220;see&#8221; that HDD of the new array were elements of a previous one. Knowing that, <code>mdadm</code> will try to do its best (i.e. if parameters match the previous array configuration) and rebuild the new array upon the previous one in a non-destructive way, by keeping HDD content.</p><p>So, here is how I finally recovered my RAID array:</p><pre class="brush: bash; title: ; notranslate">
[root@localhost ~]$ mdadm --create /dev/md0 --verbose --level=5 --raid-devices=3 /dev/hdc1 missing /dev/hdb1
mdadm: layout defaults to left-symmetric
mdadm: chunk size defaults to 64K
mdadm: size set to 312568576K
mdadm: array /dev/md0 started.
</pre><p>Of course this doesn&#8217;t solve my initial problem about the <code>/dev/md0</code> file system: it is still in an altered state. Maybe it&#8217;s too late to recover data. But at least I reverted all my today&#8217;s mistakes, and the situation will not deteriorate until I power up my RAID ! <img src='http://kevin.deldycke.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p> ]]></content:encoded> <wfw:commentRss>http://kevin.deldycke.com/2007/03/how-to-recover-a-raid-array-after-having-zero-ized-superblocks/feed/</wfw:commentRss> <slash:comments>34</slash:comments> </item> <item><title>Hardware commands</title><link>http://kevin.deldycke.com/2006/12/hardware-commands/</link> <comments>http://kevin.deldycke.com/2006/12/hardware-commands/#comments</comments> <pubDate>Wed, 06 Dec 2006 21:18:55 +0000</pubDate> <dc:creator>Kev</dc:creator> <category><![CDATA[English]]></category> <category><![CDATA[CLI]]></category> <category><![CDATA[Hardware]]></category> <category><![CDATA[HDD]]></category> <category><![CDATA[kernel]]></category> <category><![CDATA[Linux]]></category> <category><![CDATA[MBR]]></category> <category><![CDATA[partitions]]></category> <category><![CDATA[X.org]]></category><guid isPermaLink="false">http://kevin.deldycke.com/2006/12/usefull-commands-hardware/</guid> <description><![CDATA[Change the keyboard layout in Debian (don&#8217;t forget to logoff and logon to activate the new setting): Low-level format of the hda device: Same as above but for paranoïd, as random bits will be written 3 times before performing the &#8230; <a href="http://kevin.deldycke.com/2006/12/hardware-commands/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<ul><li>Change the keyboard layout in Debian (don&#8217;t forget to logoff and logon to activate the new setting):<pre class="brush: bash; title: ; notranslate">
dpkg-reconfigure keyboard-configuration
</pre></li><li>Low-level format of the <code>hda</code> device:<pre class="brush: bash; title: ; notranslate">
dd if=/dev/zero of=/dev/hda
</pre></li><li>Same as above but for paranoïd, as random bits will be written 3 times before performing the &#8220;low-level format&#8221; (i.e. writting zeros):<pre class="brush: bash; title: ; notranslate">
shred --verbose --force --iterations=3 --zero /dev/hda
</pre></li><li>Remove the MBR:<pre class="brush: bash; title: ; notranslate">
dd if=/dev/null of=/dev/hda bs=446 count=1
</pre></li><li>Restore the original Windows MBR:<pre class="brush: bash; title: ; notranslate">
apt-get install mbr
install-mbr -i n -p D -t 0 /dev/hda
</pre></li><li>To add touchpad kernel support, add the following option to kernel at boot time:<pre class="brush: bash; title: ; notranslate">
psmouse.proto=imps
</pre></li><li>Sometimes, depending of the laptop I use, the mouse pointer disappear from the screen when I plug a VGA cable to a projector. In this case, I do a <code>CTRL + ALT + F1</code>, then I login as a normal user and finally I start a new X session:<pre class="brush: bash; title: ; notranslate">
startx -- :1
</pre></li></ul> ]]></content:encoded> <wfw:commentRss>http://kevin.deldycke.com/2006/12/hardware-commands/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> <item><title>Samsung Q35 XIC-5500 : Tiny Review of a Strong Compact Laptop.</title><link>http://kevin.deldycke.com/2006/10/samsung-q35-xic-5500-tiny-review-of-a-strong-compact-laptop/</link> <comments>http://kevin.deldycke.com/2006/10/samsung-q35-xic-5500-tiny-review-of-a-strong-compact-laptop/#comments</comments> <pubDate>Sat, 28 Oct 2006 22:53:36 +0000</pubDate> <dc:creator>Kev</dc:creator> <category><![CDATA[English]]></category> <category><![CDATA[fdisk]]></category> <category><![CDATA[Hardware]]></category> <category><![CDATA[laptop]]></category> <category><![CDATA[life]]></category> <category><![CDATA[MacBook]]></category><guid isPermaLink="false">http://kevin.deldycke.com/2006/10/samsung-q35-xic-5500-tiny-review-of-a-strong-compact-laptop/</guid> <description><![CDATA[I&#8217;m the happy owner of a brand new Samsung Q35 XIC-5500 laptop. Here is a review of the machine hardware, not the software. The hard disk of the machine is supposed to be a 120 GB one, and as usual &#8230; <a href="http://kevin.deldycke.com/2006/10/samsung-q35-xic-5500-tiny-review-of-a-strong-compact-laptop/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<p><a href="http://kevin.deldycke.com/wp-content/uploads/2006/10/samsung-q35-xic-5500.jpg"><img src="http://kevin.deldycke.com/wp-content/uploads/2006/10/samsung-q35-xic-5500-150x150.jpg" alt="samsung-q35-xic-5500" title="samsung-q35-xic-5500" width="150" height="150" class="alignleft size-thumbnail wp-image-563" /></a> I&#8217;m the happy owner of a brand new <a href="http://www.samsung.com/fr/products/notebookcomputer/design/serieq/np_q35g001sef.asp?page=Specifications">Samsung Q35 XIC-5500 laptop</a>. Here is a review of the machine hardware, not the software.</p><p>The hard disk of the machine is supposed to be a 120 GB one, and as usual a hidden partition is reserved for windows backups. I deleted this one and reformatted the whole disk. After this operation, fdisk (<code>fdisk -l /dev/hda</code>) report me a total usable space of 112.4 GiB. Not bad.</p><p>Now I&#8217;ll tell you what I noticed about the aesthetic and the usability of the machine itself.</p><p><a href="http://kevin.deldycke.com/wp-content/uploads/2006/10/samsung-q35-touchpad.jpg"><img src="http://kevin.deldycke.com/wp-content/uploads/2006/10/samsung-q35-touchpad-150x150.jpg" alt="samsung-q35-touchpad" title="samsung-q35-touchpad" width="150" height="150" class="alignleft size-thumbnail wp-image-564" /></a> The touchpad has a good soft touch, but is located so close of the keyboard that I inadvertently activate it while typing. This is quite bad, especially when you write long texts. I think with some practice I&#8217;ll be able to move my fingers to avoid this unintended behavior.</p><p>I feared having a glossy screen but I&#8217;m finally happy. This one is not as reflexive as I thought, and bright colors are welcomed for watching movies. I still hadn&#8217;t the opportunity to test it in a sunny environment. October is not the sunniest month in the north of France ! <img src='http://kevin.deldycke.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /></p><p><a href="http://kevin.deldycke.com/wp-content/uploads/2006/10/samsung-q35-strange-keys.jpg"><img src="http://kevin.deldycke.com/wp-content/uploads/2006/10/samsung-q35-strange-keys-150x150.jpg" alt="samsung-q35-strange-keys" title="samsung-q35-strange-keys" width="150" height="150" class="alignleft size-thumbnail wp-image-565" /></a> To keep the machine as compact as possible, some keys of the keyboard were located in unusual places. <code>Page Up / Page Down</code> keys are for example on the right and on the left of the <code>Upper</code> key. <code>Home</code> and <code>End</code> need the function (<code>Fn</code>) key to work. This slow me down because I use them a lot when programming or editing blog posts.</p><p>The fan is located on the right side of the machine. I&#8217;m right handed so it&#8217;s not cool (pun intended). In reality it&#8217;s not a problem at all since the fan is not often activated during &#8220;normal&#8221; use (Internet surfing, mails, etc&#8230;).</p><p>I don&#8217;t like having sounds connectors in front of the machine.</p><p>The battery is unpleasant because half of it appear outside the laptop case. But having twice the capacity (6 cells instead of 3) is welcomed.</p><p>Finally the laptop is not ultra-mobile. It&#8217;s a very compact laptop (only 1.9 Kg), but not &#8220;ultra&#8221;: it has big margins around the keyboard and the screen, and is as large as usual 14” laptops. It is also as thick as others, because of the optical drive.</p><p><u>My Conclusion</u>: If you need an ultra light laptop or if you are a gamer, this is not a machine for you. But if you need a light-weight notebook with everything heavy laptops have (including the optical drive), it&#8217;s a very good deal. I paid mine 1160 € on a French online store. This laptop is not an object of design. But for 100 € more than a <a href="http://www.amazon.com/gp/product/B002C7489S/ref=as_li_tf_tl?ie=UTF8&#038;tag=kevideld-20&#038;linkCode=as2&#038;camp=217145&#038;creative=399381&#038;creativeASIN=B002C7489S">13” MacBook</a>,<img src="http://www.assoc-amazon.com/e/ir?t=kevideld-20&#038;l=as2&#038;o=1&#038;a=B002C7489S&#038;camp=217145&#038;creative=399381" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" /> you have a compact machine with superior hardware: Core 2 Duo, 1GB of RAM, 120GB HDD, 7 hours of max autonomy and 1280&#215;800 screen. This is why I choose this machine, and I&#8217;m very happy with it ! <img src='http://kevin.deldycke.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p> ]]></content:encoded> <wfw:commentRss>http://kevin.deldycke.com/2006/10/samsung-q35-xic-5500-tiny-review-of-a-strong-compact-laptop/feed/</wfw:commentRss> <slash:comments>6</slash:comments> </item> <item><title>CD Burning commands</title><link>http://kevin.deldycke.com/2006/10/cd-burning-commands/</link> <comments>http://kevin.deldycke.com/2006/10/cd-burning-commands/#comments</comments> <pubDate>Tue, 24 Oct 2006 22:49:46 +0000</pubDate> <dc:creator>Kev</dc:creator> <category><![CDATA[English]]></category> <category><![CDATA[burning]]></category> <category><![CDATA[cd]]></category> <category><![CDATA[cdrdao]]></category> <category><![CDATA[cdrecord]]></category> <category><![CDATA[CLI]]></category> <category><![CDATA[dvd]]></category> <category><![CDATA[Hardware]]></category> <category><![CDATA[Linux]]></category> <category><![CDATA[mkisofs]]></category><guid isPermaLink="false">http://kevin.deldycke.com/2006/11/usefull-commands-cd-burning/</guid> <description><![CDATA[List all CD devices: Blank a CD-RW: Burn an ISO: Generate an ISO image of a CD-ROM: Create an ISO from a local directory: volid is the volume ID to be written into the master block; /tmp/cdrom-image.iso is the destination &#8230; <a href="http://kevin.deldycke.com/2006/10/cd-burning-commands/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<ul><li>List all CD devices:<pre class="brush: bash; title: ; notranslate">
cdrdao scanbus
</pre></li><li>Blank a CD-RW:<pre class="brush: bash; title: ; notranslate">
cdrdao blank --device ATA:0,1,0 --driver generic-mmc
</pre></li><li>Burn an ISO:<pre class="brush: bash; title: ; notranslate">
cdrecord -v speed=8 dev=ATA:0,1,0 ./geexbox-0.98-fr.iso
</pre></li><li>Generate an ISO image of a CD-ROM:<pre class="brush: bash; title: ; notranslate">
dd if=/dev/cdrom of=/tmp/cdrom-image.iso
</pre></li><li>Create an ISO from a local directory:<pre class="brush: bash; title: ; notranslate">
mkisofs -R -r -l -J -V volid -o /tmp/cdrom-image.iso src
</pre><p><code>volid</code> is the volume ID to be written into the master block;<br /> <code>/tmp/cdrom-image.iso</code> is the destination filename of the newly created ISO image;<br /> <code>src</code> is the temporary ISO directory containing the files and file structure you wish to have included in the ISO image.</li><li>Mount a local ISO image as if it&#8217;s a physical CD-Rom:<pre class="brush: bash; title: ; notranslate">
mount -t iso9660 -o loop /tmp/cdrom-image.iso /media/cd-image/
</pre></li><li>Mount an UDF file system image:<pre class="brush: bash; title: ; notranslate">
fuseiso -p dvd.img /media/dvd-image/
</pre></li><li>Convert a <a href="http://en.wikipedia.org/wiki/NRG_(file_format)">Nero&#8217;s proprietary <code>.nrg</code> CD image</a> to standard ISO file:<pre class="brush: bash; title: ; notranslate">
nrg2iso dvd-image.nrg dvd-image.iso
</pre></li></ul> ]]></content:encoded> <wfw:commentRss>http://kevin.deldycke.com/2006/10/cd-burning-commands/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> <item><title>Easy Mirroring Without RAID: the Poor Man&#8217;s Disk Array</title><link>http://kevin.deldycke.com/2005/07/easy-mirroring-without-raid-the-poor-mans-disk-array/</link> <comments>http://kevin.deldycke.com/2005/07/easy-mirroring-without-raid-the-poor-mans-disk-array/#comments</comments> <pubDate>Sun, 24 Jul 2005 15:06:19 +0000</pubDate> <dc:creator>Kev</dc:creator> <category><![CDATA[English]]></category> <category><![CDATA[Backup]]></category> <category><![CDATA[CLI]]></category> <category><![CDATA[Hardware]]></category> <category><![CDATA[kernel]]></category> <category><![CDATA[Linux]]></category> <category><![CDATA[openbrick]]></category> <category><![CDATA[RAID]]></category> <category><![CDATA[rsync]]></category> <category><![CDATA[USB]]></category> <category><![CDATA[XFS]]></category><guid isPermaLink="false">http://kevin.deldycke.com/2005/07/easy-mirroring-without-raid-the-poor-mans-disk-array/</guid> <description><![CDATA[This howto explain how to use rsync to build a data mirroring mechanism on a local machine, with two hard drives, ala RAID 1, but without RAID 1 (!). I had the project to setup a RAID 5 array using &#8230; <a href="http://kevin.deldycke.com/2005/07/easy-mirroring-without-raid-the-poor-mans-disk-array/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<p>This howto explain how to use <code>rsync</code> to build a data mirroring mechanism on a local machine, with two hard drives, ala <a href="http://en.wikipedia.org/wiki/RAID1">RAID 1</a>, but without RAID 1 (!).</p><p>I had the <a href="http://kevin.deldycke.com/2005/04/creer-un-espace-de-stockage-fiable-avec-raid-5-et-lvm-sous-linux/">project to setup a RAID 5 array using 3*120 Gb hard drives in USB enclosures</a>. Unfortunately my project stalled due to instability in early 2.6.x kernels (I heard that 2.6.12 and upper are now useable for &#8220;RAID over USB&#8221;).</p><p>Because of the urgency of reliable storage (and because I don&#8217;t want to waste time compiling and fine-tuning kernels), I decided to do it using traditionnal IDE host. So I plugged two 120Gb HDD on my machine as master device, one on each IDE channel.</p><p><a href="http://kevin.deldycke.com/wp-content/uploads/2005/07/photo_f3.jpg"><img src="http://kevin.deldycke.com/wp-content/uploads/2005/07/photo_f3-300x225.jpg" alt="Open Brick NG and RAID-1-like setup" title="Open Brick NG and RAID-1-like setup" width="300" height="225" class="aligncenter size-medium wp-image-766" /></a></p><p>Then I made a big XFS partition on each, and update my <code>/etc/fstab</code>:</p><pre class="brush: bash; title: ; notranslate">
/dev/sda1 /                auto  noatime   1 1
/dev/hda1 /mnt/hd1         xfs   defaults  1 2
/dev/hdc1 /mnt/hd1_mirror  xfs   defaults  1 2
</pre><p>At that moment I have to explain you that my machine is an <a href="http://web.archive.org/web/20060822232700/http://www.storever.com/product/openbrick/openbrick-ng">OpenBrick NG</a>, with a USB 2.0 512 Mb thumb drive (<code>/dev/sda1</code> in the fstab) on which all my linux system is installed. That explain why my two IDE channels are free for use.</p><p>The idea is now to use <code>/mnt/hd1</code> to store and manipulate my datas, then <code>rsync</code> that drive with his alter-ego (<code>/mnt/hd1_mirror</code>) every night. To do that, I&#8217;ve just added the following command in a cron entry:</p><pre class="brush: bash; title: ; notranslate">
rsync -a --delete --delete-excluded --delete-after /mnt/hd1/ /mnt/hd1_mirror/
</pre><p>And voilà !</p><p>As you guess, this solution is far from perfect, and has major inconvenients regarding RAID 1:</p><ul><li>No immediate backup : the backuped datas are 1-day old;</li><li>Seek time is not reduce by half;</li><li>Transfer rate is not doubled.</li></ul><p>Oh, and by the way, be careful to not write files on <code>/mnt/hd1_mirror/</code> because they will be deleted each night during the mirroring process.</p> ]]></content:encoded> <wfw:commentRss>http://kevin.deldycke.com/2005/07/easy-mirroring-without-raid-the-poor-mans-disk-array/feed/</wfw:commentRss> <slash:comments>3</slash:comments> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced
Database Caching 2/48 queries in 0.029 seconds using apc
Object Caching 1210/1335 objects using apc

Served from: kevin.deldycke.com @ 2012-02-08 10:48:01 -->
