[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: Corrupt Superblock on /home - semi-hijack

Jeff Vian wrote:
> On Mon, 2006-02-20 at 13:00 +0000, Anne Wilson wrote:
>>On Saturday 11 February 2006 19:39, Mikkel L. Ellertson wrote:
>>>If you are not going to use a specialist, there is one thing you can
>>>try if you have another drive of the same type, or possible a larger
>>>drive. You can use dd with the conv=noerror option to copy the
>>>drive, and then use testdisk on the copy to recover things. The
>>>noerror option will let dd continue after the unreadable block.
>>Does the new drive need preparation of any kind, formatting, for instance?
> To use it as a file system it must be partitioned and formatted as well
> as mounted.
>>I've looked at both man page and info page for dd, but both assume that you 
>>know what you are doing.
>>>If you are fairly sure that the error is only on the first sector,
>>>you you use seek=1 and skip=1 to bypass coping the first block.
>>>(You have to use both, or the output will be offset 1 block.)
> It is not advisable to use dd for copying data from one drive to another
> *unless* they are EXACTLY the same geometry. and especially when the
> source is known to have errors.  The command dd used as
>    "dd if=/dev/hda of=/dev/hdb"
> will exactly copy the first drive to the second.  The problem becomes
> that the drive hdb will now have exactly the same geometry, partiton
> table, errors, etc as hda originally had, and if the drives are
> physically different this may not be what you want.
> I would recommend to use dd to copy the partition to an image file which
> would work well for your needs.
>    dd if=<old partitions> of=<image file> bs=32768 
> is a command I use and there are no problems with doing it this way that
> I am aware of.  Add the conv=noerror and other options Mikkel recommends
> to prevent premature failure of the copy.
> After the image file is created, it can be mounted with the loop option
> and then the data moved to the new drive.
The problem with doing that in this case is that the source drive
has an error in the partition table, and it also happens to have a
problem in that you can not write a new partition table back to the
drive. So what she is trying to do is copy the bad drive, fix the
partition table, and get the data off of it. After that, the new
drive will get the MBR and partition table zeroed out. The it can
be partitioned/formatted properly.

If the partition table was ok, then she could copy the partitions.
Unfortunitly, programs like testdisk are not designed to work on an
image file of the entire drive. (You can feed it the image file as
the drive, but it has problems with drive geometry.) It is also a
problem trying to mount just one partition from a drive image. (If
anyone knows how to mount a partition from inside a full drive
image, let me know!)


  Do not meddle in the affairs of dragons,
for thou art crunchy and taste good with Ketchup!

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]