User Tools

Site Tools


doc:appunti:linux:sa:hd_repair

This is an old revision of the document!


Recuperare il contenuto di un disco fisso

Un disco può dare errori di lettura hardware non recuperabili, ad esempio nel /var/log/kern.log si legge:

Oct 30 11:22:52 ipbox kernel: hdc: dma_intr: status=0x51 { DriveReady SeekComplete Error }
Oct 30 11:22:52 ipbox kernel: hdc: dma_intr: error=0x40 { UncorrectableError }, LBAsect=11012416, sector=11012416
Oct 30 11:22:52 ipbox kernel: end_request: I/O error, dev hdc, sector 11012416
Oct 30 11:22:52 ipbox kernel: Buffer I/O error on device hdc, logical block 1376552

Si può tentare di recuperare il recuperabile con:

dd if=/dev/hdc1 of=/home/ipbox/hdc1.dmp conv=noerror,sync
fsck.ext3 -f /home/ipbox/hdc1.dmp
mount -o loop,ro -t ext3 /home/ipbox/hdc1.dmp /mnt

Il primo comando legge tutta la partizione riversandola in un file, non si ferma sugli errori e mette degli zero al posto dei settori illeggibili. Il secondo comando tenta di recuperare il filesystem contenuto nell'immagine salvata, il terzo comando monta il file come filesystem. L'esempio ovviamente è per un filesystem ext3.

Vedere anche l'utility ddrescue che potrebbe sostituire dd nei casi più difficili.

doc/appunti/linux/sa/hd_repair.1162205307.txt.gz · Last modified: 2011/01/03 09:04 (external edit)