Recent Changes - Search:




Using e2fsck

shibu@shibu-laptop:~$ apt-cache search ddrescue

ddrescue - copies data from one file or block device to another

gddrescue - the GNU data recovery tool

fsck -y /dev/hdb1 -checking the consistency

lost+found directory at the root of the cloned drive (i.e., in the directory where you mounted it), which is where fsck and its friends place files and directories that could not be correctly linked into the recovered filesystem.

The ext3 filesystem is a journaling version of the ext2 filesystem, and the two types of filesystems therefore share most data structures and all repair/recovery utilities.

The superblock contains basic information about the filesystem, including primary pointers to the blocks that contain information about the filesystem (known as inodes). Luckily, when you create an ext2 or ext3 filesystem, the filesystem-creation utility (mke2fs or a symbolic link to it named mkfs.ext2 or mkfs.ext3) automatically creates backups copies of your disk's superblock, just in case. You can tell the e2fsck program to check the filesystem using one of these alternate superblocks by using its -b option, followed by the block number of one of these alternate superblocks within the filesystem with which you're having problems. The first of these alternate superblocks is usually created in block 8193, 16384, or 32768, depending on the size of your disk. Assuming that this is a large disk, we'll try the last as an alternative:

	# e2fsck -b 32768 /dev/hda1

You can determine the locations of the alternate superblocks on an unmounted ext3 filesystem by running the mkfs.ext3 command with the n option, which reports on what the mkfs utility would do but doesn't actually create a filesystem or make any modifications.

To copy one disk to another using dd, telling it not to stop on errors, you would use a command like the following:

	# dd if=/dev/hda of=/dev/hdb conv=noerror,sync

This command would copy the bad disk (here, /dev/hda) to a new disk (here, /dev/hdb), ignoring errors encountered when reading (noerror) and padding the output with an appropriate number of nulls when unreadable blocks are encountered (sync).

Use a utility called ddrescue, which is available from This utility is not included in any Linux distribution

When checking an ext2 or ext3 filesystem partition, you should use e2fsck, which runs badblocks in the background.

You should use this when checking an ext2 or ext3 filesystem. These 2 methods automatically save the bad blocks found into the filesystem so that those parts of the hard drive are no longer used.

         Read-only method: e2fsck -c -C /dev/hda1 
         e2fsck -c -C -y /dev/hda1 (This answers yes to all questions, so it is sure to finish by itself.)

         Non-destructive read/write method: e2fsck -c -c -C /dev/hda1 
         e2fsck -c -c -C -y /dev/hda1 
        (This answers yes to all questions, so it is sure to finish by itself.)

Edit - History - Print - Recent Changes - Search
Page last modified on March 04, 2008, at 12:37 PM