Showing posts with label recover. Show all posts
Showing posts with label recover. Show all posts

2013-11-25

dd utility: the rescue versions

Apart from the traditional implementations of a Unix dd utility (e. g., one found in the GNU Core Utilities), there are some special versions of it, dedicated for rescuing the data from damaged (badly readable) disks:
  1. GNU ddrescue (by Antonio Diaz Diaz);
    seems to be the best choice from these two ones [1, 2];
    there's a GUI log viewer for it (ddrescueview), and also some other helper utilities (ddrutility);
  2. dd_rescue (by Kurt Garloff);
    there's also a wrapper script for it called dd_rhelp.
The Debian distribution software archives, starting from version 7.0 ("Wheezy"), have only the GNU ddrescue; you can install it the following way:
# apt-get install gddrescue
The convenient way to use this utility is to make an image (a binary dump) of the whole defective disk (FDD, HDD, CD, DVD etc.) with its help, and then apply data recovery / content extraction programs (e. g., TestDisk) directly to the disk image.

Anyway, regular backups & redundant data storage solutions should save you from data recovery problems :-)

References:
  1. Disk drive recovery: ddrescue, dd_rescue, dd_rhelp - System Administration Bits of Knowledge (by John Gilmore)
  2. Damaged Hard Disk - CGSecurity
---
Last updated: 2013-12-08

2013-07-18

TestDisk & PhotoRec: nice tools to recover lost partitions & files

TestDisk + PhotoRec is a nice toolset to recover lost disk partitions (or at least rescue some files from corrupted filesystems) in case of storage media failures, re-partitioning errors etc.
Works for disk images too.
More to say, it's a free & open source (GPL v2+) cross-platform (Linux, *BSD, Apple Mac OS X, Oracle / Sun Solaris, MS-DOS, MS Windows) software.

Presently, in Debian-based Linux distros, TestDisk & PhotoRec have been packaged into a single testdisk package, so you can install both tools at once:
# apt-get install testdisk

2012-07-29

HOWTO: GRUB 2 rescue mode

Sometimes (e. g., after some disk re-partitioning) your GRUB 2 installation may get corrupted, so after the power-on you get only a "grub rescue> _" command prompt.
In such cases you'll need to know which disk partitions Linux & GRUB are installed on. In our example, it's 'sda7' (the 7th partition of the 1st HDD).

Type the following commands into the GRUB rescue prompt:
set root=(hd0,7)
set prefix=/boot/grub
insmod linux
linux /vmlinuz root=/dev/sda7 ro
initrd /initrd.img
boot
Notes:
  1. instead of '(hd0,7)', '(hd0,msdos7)' can be used for root;
  2. an alternative prefix is '(hd0,7)/boot/grub';
  3. an alternative insmod command argument path is '(hd0,7)/boot/grub/linux.mod'.
After successfully booting your GNU/Linux system, you should repair your GRUB 2 installation (execute these command as root, use su, or even better, sudo):
# grub-install /dev/sda
# update-grub2
Note: some people like to execute not update-grub2, but update-grub or even grub-mkconfig.

On the next reboot, it should work fine.

Some more useful GRUB2 reading:
  1. GNU GRUB Manual
  2. GRUB2 - ArchWiki
  3. Grub2 - Debian Wiki
  4. Grub2 - Community Ubuntu Documentation
  5. How To Fix GRUB 2 [Linux] ~ Web Upd8: Ubuntu / Linux blog
  6. linux - Making "default saved" work with GRUB2...? - Super User
---
Last updated: 2013-08-31