[Top] [All Lists]

Re: xfs_repair force_geometry

To: benediktibk@xxxxxx
Subject: Re: xfs_repair force_geometry
From: "Michael L. Semon" <mlsemon35@xxxxxxxxx>
Date: Tue, 14 May 2013 03:50:37 -0400
Cc: Benedikt Schmidt <benedikt.schmidt@xxxxxx>, xfs@xxxxxxxxxxx
Delivered-to: xfs@xxxxxxxxxxx
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:message-id:date:from:user-agent:mime-version:to:cc :subject:references:in-reply-to:content-type :content-transfer-encoding; bh=3rT88kA2RIABgBPaAgwSE29BMZ57KPwvMKRCpg+46zU=; b=VErjLZxf8eS8LcNYl0TVXuL1CNKbQxhwDbZ/9fjHvla7OySYySr/h+FWbCCBIp985W n7iw43oNsMOwoQCYPYzFYKtDKQ/Jb9tLYnYuFXSwdTpwZChsg7Z8vgh1kC/LH99hPEwG UkI9bKWtpoN56pt4noDHP8JO/FAWvsKL7TdU9G5gCTnrJQ0mVpo6m92UAMb4YuLIVRbm 9Cci29Trl1Zxn1Vs3pmLK2p7XPFPmuPGEzYj7vOCYuuYIBAeh82Zxfzaf9t6m8golHBE Rmtpm6eaVbtJlJlyuDn2DDR72fnYqtp0XFjF2hGxeLXAGJxceW14tYIRj46otn7K2uhq Fs6g==
In-reply-to: <5191C772.4020607@xxxxxx>
References: <5190DB7F.2050505@xxxxxx> <519165F2.80902@xxxxxxxxxxx> <5191C772.4020607@xxxxxx>
User-agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130328 Thunderbird/17.0.5
On 05/14/2013 01:11 AM, Benedikt Schmidt wrote:
First of all: Thanks for your very fast and helpful response.

I copied actually only the partition, not the whole disk: /dd_rescue
--force -r1 /dev/sdd1 /dev/sdc1/
The cause for this is that I don't have enough space left on another
device to store a whole copy of the faulty disk. I thought it would be
possible, like in some examples I found with google, that you can rescue
a partition directly.

Understood. This seems like a valid option. Had fdisk, cfdisk, and gdisk been more cooperative over the past year, this would have been my first option.

/file -s /dev/sdc1/ says:
//dev/sdc1: data/

This is different from what I got, but maybe Eric sees something in your answer.

The disks look like this (/fdisk -l/):
/Disk /dev/sdc: 3000.6 GB, 3000592982016 bytes, 5860533168 sectors//
//Units = Sektoren of 1 * 512 = 512 bytes//
//Sector size (logical/physical): 512 bytes / 4096 bytes//
//I/O size (minimum/optimal): 4096 bytes / 4096 bytes//
//Disk identifier: 0xcba506ee//
//   Gerät  boot.     Anfang        Ende     Blöcke   Id System//
///dev/sdc1             256   732566645   366283195   83 Linux//
//Disk /dev/sdd: 2000.4 GB, 2000397852160 bytes, 3907027055 sectors//
//Units = Sektoren of 1 * 512 = 512 bytes//
//Sector size (logical/physical): 512 bytes / 512 bytes//
//I/O size (minimum/optimal): 512 bytes / 512 bytes//
//Disk identifier: 0x3c34826b//
//   Gerät  boot.     Anfang        Ende     Blöcke   Id System//
///dev/sdd1              63  3907024064  1953512001   83 Linux/

If it is not possible to rescue the partition this way I will have to
extend my to RAID5 so that I can put the copy of the faulty disk on this
one, like Michael explained in his answer. I just hoped that I can avoid
this, because it would save me more than 100€.

I had not much information to use, so I set up the safest possible scenario and hoped that you were getting results that were close to that.

If the few extra files that you're rescuing aren't worth 100 euros, then it's not worth 100 euros to make a duplicate of a dump of an already-damaged filesystem.

The crazy, reckless guide is this:

1) use `xfs_repair -n /dev/sdc1`.  If that looks nice,...

2) use `xfs_repair /dev/sdc1`...

  a) A repaired partition is a good sign.  Mount that partition!

b) If the "attempting to find secondary superblock" search ends in "Sorry, could not find valid secondary superblock," then maybe something went wrong in the original data transfer. You might have to give this step some time to complete, and it will print dots for a while. Either that or the failures in your hard drive really did hit all of the superblocks.

c) If the "attempting to find secondary superblock" finds something, it might make everything well but spit some files into lost+found. If the repair goes badly, there's a chance you'll be using dd to look for your data.

d) If it's something else--xfs_repair segfaults, needs to be run again, whatever, mention it--and at least you'll be closer to the real answer.

3) If all else fails, and especially when a backup is handy, you could try `xfs_repair -L` to zero the log. This helps when xfs_repair asks you to mount the filesystem to allow metadata updates to happen, but Linux has an oops as the filesystem is mounted. In many other scenarios, it can work against you. This is the second-to-last resort.

As last information: The content of this copy is not totally lost,
actually only the last few files I have added. All the other stuff is
already stored on the RAID5, only the latest stuff is not contained in
this backup. So I don't loose everything if something goes wrong (at
least one thing :-) ).

Really, it becomes a question of whether it would be faster to search for the data using dd and grep, use xfs_repair and hope it works, or recreate the data from scratch.

The hope is that dd_rescue does a credible job for you, and that XFS can be made to mount something, somewhere, so that you can grab those last few files. The very last resort would be to do all of this repair stuff on the original damaged partition, but the safety net goes away after that.


<Prev in Thread] Current Thread [Next in Thread>