Réanimation partition reiser

bonjour à tous, je tente de sauver une partition reiser qui ne veut plus se monter après une coupure de courant. Le disque est un maxtor, voici le fdisk :

[code]
Disk /dev/hdb: 81.9 GB, 81964302336 bytes
255 heads, 63 sectors/track, 9964 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xa1fb74bf

Device Boot Start End Blocks Id System
/dev/hdb1 1 1824 14651248+ 83 Linux
/dev/hdb2 1825 1885 489982+ 82 Linux swap / Solaris
/dev/hdb3 1886 9964 64894567+ 83 Linux[/code]

la partition à récupérer est hdb3. Elle était montée en reiserfs avant le crash (spécifié dans fstab).

Bon pour commencer j’ai fait un ddrescue sur un autre dd (maxtor 80go). La partition de sortie est maintenant hda1.

j’ai tenté un testdisk, mais l’analyse bloque à 17%.

puis j’ai tenté ça :

[code]# reiserfsck --check /dev/hda1
reiserfsck 3.6.19 (2003 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/hda1
Will put log info to ‘stdout’

Do you want to run this program?[N/Yes] (note need to type Yes if you do):Yes
###########
reiserfsck --check started at Tue Mar 25 09:02:02 2008
###########
Replaying journal…
Reiserfs journal ‘/dev/hda1’ in blocks [18…8211]: 0 transactions replayed

The problem has occurred looks like a hardware problem. If you have
bad blocks, we advise you to get a new hard drive, because once you
get one bad block that the disk drive internals cannot hide from
your sight,the chances of getting more are generally said to become
much higher (precise statistics are unknown to us), and this disk
drive is probably not expensive enough for you to you to risk your
time and data on it. If you don’t want to follow that follow that
advice then if you have just a few bad blocks, try writing to the
bad blocks and see if the drive remaps the bad blocks (that means
it takes a block it has in reserve and allocates it for use for
of that block number). If it cannot remap the block, use badblock
option (-B) with reiserfs utils to handle this block correctly.

bread: Cannot read the block (3506176): (Input/output error).

Abandon[/code]

et pour finir ça :

[code]reiserfsck --rebuild-sb /dev/hda1
reiserfsck 3.6.19 (2003 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 check superblock and rebuild it if needed
Will put log info to ‘stdout’

Do you want to run this program?[N/Yes] (note need to type Yes if you do):Yes

reiserfs_open: the reiserfs superblock cannot be found on /dev/hda1.

what the version of ReiserFS do you use[1-4]
(1) 3.6.x
(2) >=3.5.9 (introduced in the middle of 1999) (if you use linux 2.2, choose this one)
(3) < 3.5.9 converted to new format (don’t choose if unsure)
(4) < 3.5.9 (this is very old format, don’t choose if unsure)
(X) exit
1

Enter block size [4096]:

No journal device was specified. (If journal is not available, re-run with --no-journal-available option specified).
Is journal default? (y/n)[y]: y

Did you use resizer(y/n)[n]: n
rebuild-sb: no uuid found, a new uuid was generated (cd32abcb-e855-4b14-9538-15d35dddf1dd)

rebuild-sb: You either have a corrupted journal or have just changed
the start of the partition with some partition table editor. If you are
sure that the start of the partition is ok, rebuild the journal header.
Do you want to rebuild the journal header? (y/n)[n]: y
Reiserfs super block in block 16 on 0x301 of format 3.6 with standard journal
Count of blocks on the device: 19478800
Number of bitmaps: 595
Blocksize: 4096
Free blocks (count of blocks - used [journal, bitmaps, data, reserved] blocks): 0
Root block: 0
Filesystem is NOT clean
Tree height: 0
Hash function used to sort names: not set
Objectid map size 0, max 972
Journal parameters:
Device [0x0]
Magic [0x0]
Size 8193 blocks (including 1 for journal header) (first block 18)
Max transaction length 1024 blocks
Max batch size 900 blocks
Max commit age 30
Blocks reserved by journal: 0
Fs state field: 0x1:
some corruptions exist.
sb_version: 2
inode generation number: 0
UUID: cd32abcb-e855-4b14-9538-15d35dddf1dd
LABEL:
Set flags in SB:
Is this ok ? (y/n)[n]: y
The fs may still be unconsistent. Run reiserfsck --check.[/code]

que me conseillez-vous ? ai-je une chance de récupérer mes données?
merci beaucoup
Pierre

[quote=“peasse”]
Bon pour commencer j’ai fait un ddrescue sur un autre dd (maxtor 80go). La partition de sortie est maintenant hda1.[/quote]

Je suppose que ddrescue c’est une sorte de dd. Mais de secours (je sais je suis une bête d’anglais ^^ )

Si un dd passe pourquoi ne monte tu pas l’image sur un dossier ?

merci pour ta réponse Ludo, ddrescue est un peu pareil que dd, mais peut logiquement gérer les problèmes matériels.
voici la commande :

mon problème : je n’arrive pas à monter hda1 après la copie. (mount -t reiserfs /dev/hda1 /mnt/hda1 -> erreur)

donc je tente la commande dd suivant ton conseil.
J’ai essayé cette commande, sans succès :

dd if=/dev/hdb3 of=/mnt/hdd1/maxtor-caput.img bs=1M dd: ouverture de `/mnt/hdd1/maxtor-caput.img': Aucun fichier ou répertoire de ce type

pourquoi ne crée-t-il pas une image?
merci

[quote=“peasse”]
pourquoi ne crée-t-il pas une image?[/quote]

surement pour la simple et bonne raison que ddrescue existe ? :stuck_out_tongue:

Sinon si tu remplace dd par ddrescue (d’après ce que j’ai vite lu du man, la syntaxe n’a pas l’air différente)

bon j’ai un peu de temps pour résoudre ce problème. j’ai fait une image de la partition corrompue :

[code]
/mnt/hdd/VueScan# ddrescue /dev/hdb3 /mnt/hdd/bck/backup.img

Press Ctrl-C to interrupt
rescued: 66451 MB, errsize: 45056 B, current rate: 512 B/s
ipos: 5235 MB, errors: 90, average rate: 10440 kB/s
opos: 5235 MB[/code]

donc il y a des erreurs. Après j’ai essayé un fsck :

[code]fsck -y /mnt/hdd/bck/backup.img
fsck 1.40.8 (13-Mar-2008)
e2fsck 1.40.8 (13-Mar-2008)
fsck.ext2: Superblock invalid, trying backup blocks…
fsck.ext2: Bad magic number in super-block lors de la tentative d’ouverture de /mnt/hdd/bck/backup.img

Le superbloc n’a pu être lu ou ne contient pas un système de fichiers
ext2 correct. Si le périphérique est valide et qu’il contient réellement
un système de fichiers ext2 (et non pas de type swap, ufs ou autre),
alors le superbloc est corrompu, et vous pourriez tenter d’exécuter
e2fsck avec un autre superbloc :
e2fsck -b 8193 <périphérique>[/code]

comme la partition à récupérer est en reiserfs, j’ai essayé ça :

[code]reiserfsck /mnt/hdd/bck/backup.img
reiserfsck 3.6.19 (2003 www.namesys.com)

Do you want to run this program?[N/Yes] (note need to type Yes if you do):Yes

reiserfs_open: the reiserfs superblock cannot be found on /mnt/hdd/bck/backup.img.
Failed to open the filesystem.

If the partition table has not been changed, and the partition is
valid and it really contains a reiserfs partition, then the
superblock is corrupted and you need to run this utility with
–rebuild-sb.[/code]

puis j’ai essayé avec l’option rebuild :

[code]reiserfsck --rebuild-sb /mnt/hdd/bck/backup.img
reiserfsck 3.6.19 (2003 www.namesys.com)

Do you want to run this program?[N/Yes] (note need to type Yes if you do):Yes

reiserfs_open: the reiserfs superblock cannot be found on /mnt/hdd/bck/backup.img.

what the version of ReiserFS do you use[1-4]
(1) 3.6.x
(2) >=3.5.9 (introduced in the middle of 1999) (if you use linux 2.2, choose this one)
(3) < 3.5.9 converted to new format (don’t choose if unsure)
(4) < 3.5.9 (this is very old format, don’t choose if unsure)
(X) exit
1

Enter block size [4096]:

No journal device was specified. (If journal is not available, re-run with --no-journal-available option specified).
Is journal default? (y/n)[y]: y

Did you use resizer(y/n)[n]: n
rebuild-sb: no uuid found, a new uuid was generated (de91e82a-4f97-402c-8234-2ac231989cc8)

rebuild-sb: You either have a corrupted journal or have just changed
the start of the partition with some partition table editor. If you are
sure that the start of the partition is ok, rebuild the journal header.
Do you want to rebuild the journal header? (y/n)[n]: y
Reiserfs super block in block 16 on 0x0 of format 3.6 with standard journal
Count of blocks on the device: 16223641
Number of bitmaps: 496
Blocksize: 4096
Free blocks (count of blocks - used [journal, bitmaps, data, reserved] blocks): 0
Root block: 0
Filesystem is NOT clean
Tree height: 0
Hash function used to sort names: not set
Objectid map size 0, max 972
Journal parameters:
Device [0x0]
Magic [0x0]
Size 8193 blocks (including 1 for journal header) (first block 18)
Max transaction length 1024 blocks
Max batch size 900 blocks
Max commit age 30
Blocks reserved by journal: 0
Fs state field: 0x1:
some corruptions exist.
sb_version: 2
inode generation number: 0
UUID: de91e82a-4f97-402c-8234-2ac231989cc8
LABEL:
Set flags in SB:
Is this ok ? (y/n)[n]: y
The fs may still be unconsistent. Run reiserfsck --check.[/code]

bon je tourne en rond! help!

évidemment, quand j’essaie de monter l’image ça passe pas :

mount /mnt/hdd/bck/backup.img /mnt/hda3 mount: you must specify the filesystem type

mount -t reiserfs /mnt/hdd/bck/backup.img /mnt/hda3 mount: /mnt/hdd/bck/backup.img is not a block device (maybe try `-o loop'?)

:smt006

bonne nouvelle : j’ai récupéré ma partition, grâce à cette commande :

il a refait tout le journal, mais il y a beaucoup de choses de lost+found.

je pense que je vais changer ce dd (un maxtor 80Go de 2002!)

merci encore pour votre aide B)

Salut,

Fait un test Smart sur ton DD avant de le changer ; il n’a peut être rien du tout, se retrouver avec un système de fichier corrompu après une coupure de courant est assez fréquent, à fortiori avec Reiserfs.

[code]smartctl -l selftest /dev/hdb3
smartctl version 5.38 [i686-pc-linux-gnu] Copyright © 2002-8 Bruce Allen
Home page is http://smartmontools.sourceforge.net/

=== START OF READ SMART DATA SECTION ===
SMART Self-test log structure revision number 1
Num Test_Description Status Remaining LifeTime(hours) LBA_of_first_error

1 Short offline Completed: read failure 60% 13673 30545325

2 Extended offline Aborted by host 40% 13673 -

3 Extended offline Completed: read failure 40% 13673 30545325[/code]

si j’ai bien compris il y a des erreurs.

un test rapide des badblocks :

badblocks /dev/hdb3 131392 131396 131397 131398 131399 131400 131401 131402 131403

je ne vais pas m’acharner! au prix où sont les dd…