<?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>maduixa &#187; recuperació</title>
	<atom:link href="http://blog.jau.cat/tag/recuperacio/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.jau.cat</link>
	<description>Blog personal d&#039;en minterior amb gust a maduixa</description>
	<lastBuildDate>Sun, 16 Oct 2011 22:02:20 +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>GNU ddrescue per recuperar dades de discs durs</title>
		<link>http://blog.jau.cat/2010/03/24/gnu-ddrescue-per-recuperar-dades-de-discs-durs/</link>
		<comments>http://blog.jau.cat/2010/03/24/gnu-ddrescue-per-recuperar-dades-de-discs-durs/#comments</comments>
		<pubDate>Wed, 24 Mar 2010 22:43:19 +0000</pubDate>
		<dc:creator>minterior</dc:creator>
				<category><![CDATA[Maquinari]]></category>
		<category><![CDATA[Programari]]></category>
		<category><![CDATA[com es fa]]></category>
		<category><![CDATA[dades]]></category>
		<category><![CDATA[ddrescue]]></category>
		<category><![CDATA[disc dur]]></category>
		<category><![CDATA[GNU/Linux]]></category>
		<category><![CDATA[recuperació]]></category>

		<guid isPermaLink="false">http://blog.jau.cat/?p=291</guid>
		<description><![CDATA[L&#8217;altre dia (uf, ja fa un mes d&#8217;això!) vaig explicar la mala sort que vaig tenir quan  dels tres que tinc al meu ordinador. Abans d&#8217;ahir vaig començar les tasques de recuperació de dades, amb el programa GNU ddrescue. Al mateix manual en línia de ddrescue hi ha exemples molt útils, el primer dels quals [...]]]></description>
			<content:encoded><![CDATA[<p>L&#8217;altre dia (uf, ja fa un mes d&#8217;això!) vaig explicar la mala sort que vaig tenir quan <a href="http://blog.jau.cat/2010/02/21/dos-discs-durs-comprats-alhora-amb-errors/">dos discs durs tenien errors</a> dels tres que tinc al meu ordinador. Abans d&#8217;ahir vaig començar les tasques de recuperació de dades, amb el programa GNU ddrescue. Al mateix <a href="http://www.gnu.org/software/ddrescue/manual/ddrescue_manual.html#Examples">manual en línia de ddrescue</a> hi ha exemples molt útils, el primer dels quals és el que necessito jo. Anem per feina.</p>
<p>Recordo que l&#8217;objectiu és recuperar les dades de dos discos idèntics de 500 GB a un tercer disc auxiliar de la mateixa capacitat, que em va deixar un bon amic meu. És obvi que l&#8217;auxiliar ha de ser de la mateixa capacitat o major que el disc que volem recuperar. Primer ho intentaré amb un disc i després amb l&#8217;altre. El paràmetre de ddrescue <em>-n</em> o <em>&#8211;no-split</em> no intenta dividir o reintentar blocs fallits, i això faig a la primera passada:</p>
<pre class="brush: plain; title: ; notranslate">root@jau:~# ddrescue -n /dev/sda /dev/sdb ddrescue-sda-a-sdb.log

Press Ctrl-C to interrupt
Initial status (read from logfile)
rescued:         0 B,  errsize:       0 B,  errors:       0
Current status
rescued:   500107 MB,  errsize:    143 kB,  current rate:    10265 B/s
ipos:       29744 kB,   errors:      36,    average rate:   14150 kB/s
opos:       29744 kB,     time from last successful read:       0 s
Finished</pre>
<p>El procés ha trigat unes <strong>10 hores</strong>. Cosa que podem comprovar a partir de les dades informatives anteriors:<br />
500107 MB / 14,150 MB/s / 3600 s/h ≈ 9,8 hores.</p>
<p>Tot seguit executo ddrescue amb les opcions <em>-d</em> o <em>&#8211;direct</em> , que usa accés directe al disc d&#8217;entrada, i <em>-r</em> o <em>&#8211;max-retries=&lt;n&gt;</em>, que surt després de n intents. Li passo el mateix nom de fitxer de log que a la comanda anterior i així ddrescue sap que només ha de buscar els sectors on ha tingut problemes durant la primera lectura:<br />
<span id="more-291"></span></p>
<pre class="brush: plain; title: ; notranslate">root@jau:~# ddrescue -dr3 /dev/sda /dev/sdb ddrescue-sda-a-sdb.log

Press Ctrl-C to interrupt
Initial status (read from logfile)
rescued:   500107 MB,  errsize:    143 kB,  errors:      36
Current status
rescued:   500107 MB,  errsize:   17920 B,  current rate:        0 B/s
   ipos:    34765 MB,   errors:      35,    average rate:       48 B/s
   opos:    34765 MB,     time from last successful read:    23.7 m
Finished</pre>
<p>Després de 3 intents i uns <strong>45 minuts</strong> més, he passat de 143 kB amb errors a 17,92 kB. No està malament.</p>
<p>A partir d&#8217;ara ja treballarem amb el disc rèplica de l&#8217;afectat; sdb en aquest cas. Ara toca refer la taula de particions del disc:</p>
<pre class="brush: bash; title: ; notranslate">fdisk /dev/sdb</pre>
<p>Teclejo:</p>
<p><strong>p</strong> imprimeix la taula de particions, per veure si aquesta és correcta. Té una única partició, com esperava.<br />
<strong> w</strong> escriu la taula al disc i surt, ﻿per desar-la i sortir.</p>
<p>A continuació cal revisar el sistema de fitxers d&#8217;aquesta partició. En el meu cas ja sé que els dos discos durs tenien el sistema de fitxers <a title="ReiserFS a la Wikipedia (en castellà)" href="http://es.wikipedia.org/wiki/ReiserFS">reisersfs</a>. Per tant:</p>
<pre class="brush: plain; title: ; notranslate">reiserfsck -f --logfile reiserfsck-check-sdb1.log /dev/sdb1
reiserfsck 3.6.21 (2009 www.namesys.com)

*************************************************************
** If you are using the latest reiserfsprogs and  it fails **
** please  email bug reports to reiserfs-list@namesys.com, **
** providing  as  much  information  as  possible --  your **
** hardware,  kernel,  patches,  settings,  all reiserfsck **
** messages  (including version),  the reiserfsck logfile, **
** check  the  syslog file  for  any  related information. **
** If you would like advice on using this program, support **
** is available  for $25 at  www.namesys.com/support.html. **
*************************************************************

Will read-only check consistency of the filesystem on /dev/sdb1
Will put log info to 'reiserfsck-check-sdb1.log'

Do you want to run this program?[N/Yes] (note need to type Yes if you do):Yes
###########
reiserfsck --check started at Tue Mar 23 05:58:48 2010
###########
Replaying journal: Done.
Reiserfs journal '/dev/sdb1' in blocks [18..8211]: 0 transactions replayed
Checking internal tree.. finished
Comparing bitmaps..Fatal corruptions were found, Semantic pass skipped
1 found corruptions can be fixed only when running with --rebuild-tree
###########
reiserfsck finished at Tue Mar 23 06:09:54 2010
###########
</pre>
<p>Ha trigat poc més d&#8217;<strong>11 minuts</strong>, però ara demana executar la comanada amb l&#8217;opció <em>&#8211;rebuild-tree</em>. Som-hi:</p>
<pre class="brush: plain; title: ; notranslate">
reiserfsck -f --rebuild-tree --logfile reiserfsck-rebuild-tree-sdb1.log /dev/sdb1
reiserfsck 3.6.21 (2009 www.namesys.com)

*************************************************************
** Do not  run  the  program  with  --rebuild-tree  unless **
** something is broken and MAKE A BACKUP  before using it. **
** If you have bad sectors on a drive  it is usually a bad **
** idea to continue using it. Then you probably should get **
** a working hard drive, copy the file system from the bad **
** drive  to the good one -- dd_rescue is  a good tool for **
** that -- and only then run this program.                 **
** If you are using the latest reiserfsprogs and  it fails **
** please  email bug reports to reiserfs-list@namesys.com, **
** providing  as  much  information  as  possible --  your **
** hardware,  kernel,  patches,  settings,  all reiserfsck **
** messages  (including version),  the reiserfsck logfile, **
** check  the  syslog file  for  any  related information. **
** If you would like advice on using this program, support **
** is available  for $25 at  www.namesys.com/support.html. **
*************************************************************

Will rebuild the filesystem (/dev/sdb1) tree
Will put log info to 'reiserfsck-rebuild-tree-sdb1.log'

Do you want to run this program?[N/Yes] (note need to type Yes if you do):Yes
Replaying journal: Done.
Reiserfs journal '/dev/sdb1' in blocks [18..8211]: 0 transactions replayed
###########
reiserfsck --rebuild-tree started at Tue Mar 23 06:21:26 2010
###########

Pass 0:
Loading on-disk bitmap .. ok, 113159770 blocks marked used
Skipping 11937 blocks (super block, journal, bitmaps) 113147833 blocks will be read
0%....20%....                                                   left 0, 16287 /seccseccccc
	&quot;r5&quot; hash is selected
Flushing..finished
	Read blocks (but not data blocks) 113147833
		Leaves among those 112068
		Objectids found 3049

Pass 1 (will try to insert 112068 leaves):
Looking for allocable blocks .. finished
0%....20%....40%....60%....80%....100%                          left 0, 98 /sec
Flushing..finished
	112068 leaves read
		112048 inserted
		20 not inserted

Pass 2:
0%....20%....40%....60%....80%....100%                          left 0, 40 /sec
Flushing..finished
	Leaves inserted item by item 20
Pass 3 (semantic):
Flushing..finished
	Files found: 2809
	Directories found: 198
	Symlinks found: 34
Pass 3a (looking for lost dir/files):
Looking for lost directories:
Looking for lost files:3 /sec
Flushing..finished18, 74 /sec
	Objects without names 7
	Files linked to /lost+found 7
Pass 4 - finished done 105303, 99 /sec
Flushing..finished
Syncing..finished
###########
reiserfsck finished at Tue Mar 23 08:54:56 2010
###########
</pre>
<p>Aquesta operació ja ha trigat bastant, unes <strong>dues hores i mitja</strong>. Muntem el nou disc ja net i polit:</p>
<pre class="brush: bash; title: ; notranslate">mount /dev/sdb1 /media/recuperat/</pre>
<p>I tot ha anat bé! Dades recuperades!!! Genial <img src='http://blog.jau.cat/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Només han calgut quasi 14 hores i una mica de paciència. Ara toca fer el mateix amb el segon disc dur&#8230; uf.</p>
<p><strong>Actualització</strong> (25-03-2010): el segon disc s&#8217;ha copiat en només 4 hores i 16 minuts, a 32,484 MB/s, i no ha tingut cap error després de la primera passada! Per tant he reescrit la taula de particions i executat només un cop reiserfsck (el rebuild tree tampoc calia). I finalment muntar la partició i veure que totes les dades estan intactes. Magnífic!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.jau.cat/2010/03/24/gnu-ddrescue-per-recuperar-dades-de-discs-durs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

