Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.os.linux.setup > #2670

Re: No success repairing my ext4 file system so far, PLEASE HELP!

From Robert Nichols <SEE_SIGNATURE@localhost.localdomain.invalid>
Newsgroups comp.os.linux.setup
Subject Re: No success repairing my ext4 file system so far, PLEASE HELP!
Date 2012-04-17 10:58 -0500
Organization Exiguous
Message-ID <jmk3vk$msn$1@omega-3a.local> (permalink)
References (13 earlier) <6086077.2030.1334569167288.JavaMail.geo-discussion-forums@pbep2> <jmh836$rte$1@omega-3a.local> <15869324.2180.1334597948632.JavaMail.geo-discussion-forums@pbckz3> <jmi14v$3fj$1@omega-3a.local> <12263514.182.1334642548574.JavaMail.geo-discussion-forums@pbag4>

Show all headers | View raw


On 04/17/2012 01:02 AM, Harry wrote:
> On Tuesday, April 17, 2012 2:28:07 AM UTC+5:30, Robert Nichols wrote:
...
>> I ran the program on an LVM device where I had some known file systems
>> and was able to do a successful e2fsck.  But, ...
>>
>> 1. You need to make the "num_sectors" arg to dmsetup at least large enough
>>      to contain the file system or the fsck will surely fail.
>
> Ok.
>
>> 2. It is not sufficient to begin the virtual device 2 sectors before the
>>      candidate superblock.  Remember that an alternate superblock at
>>      offset XXX still expects the file system to begin at its real starting
>>      point, not just 2 blocks before this alternate superblock.  Consider:
>>
>>        0x0000100400 (    2050), label="SL6-var", bs=4k    # Real SB
>>        0x0008100000 (  264192), label="SL6-var", bs=4k    # 1st alternate
>>        0x0018100000 (  788480), label="SL6-var", bs=4k    # 2nd alternate
>>
>>      All of these expect the file system to begin at sector offset 2048,
>>      and would need you to run "e2fsck -b 32768" or "e2fsck -b 98304" for
>>      the alternate SBs.
>>
>> WARNING: I get a ton of group descriptor checksum errors and block bitmap
>>            differences whenever I try to use an alternate super block, and
>>            this also happens for a regular file system where I have not
>>            been playing dmsetup games.  Seems dangerous, but I ran e2fsck
>>            with the "-y" option to let it fix everything, and the file
>>            system still checked OK from the primary SB.  Be careful, and
>>            run e2fsck with the "-n" option until you're reasonably sure
>>            you've got things set up right.
>>
>> Here's what I used to set up the mapper:
>>
>>      Find=2050; dmsetup create foo --table \
>>                 "0 $((159260346*2-(Find-2) )) linear /dev/sda12 $((Find-2))"
>>
>> where that "159260346" is the total number of 1K blocks in the partition,
>> as reported by "fdisk -l".
>
>
> Bob, would you please confirm or clarify the following:
>
> 1. My fdisk -l shows this:
>
> $ fdisk -l
>    ...
> Disk /dev/sdb: 80.0 GB, 80026361856 bytes
> 255 heads, 63 sectors/track, 9729 cylinders, total 156301488 sectors
> Units = sectors of 1 * 512 = 512 bytes
> Sector size (logical/physical): 512 bytes / 512 bytes
> I/O size (minimum/optimal): 512 bytes / 512 bytes
> Disk identifier: 0x00000000
>
>     Device Boot      Start         End      Blocks   Id  System
> /dev/sdb1   *        2048     1026047      512000   83  Linux
> /dev/sdb2         1026048   156301311    77637632   8e  Linux LVM
>
> Question: Given this, I should be issuing a `e2finder /dev/sdb2`, isn't it?
> Based on what I understand about LVMs, /dev/sdb2 is like a device or a disk -
> only logical instead of physical. Would you please confirm this (or deny, with a
> sentence or two of explanation)?

Yes, you should be running e2finder on /dev/sdb2.

At this point you aren't yet into LVMs, just an ordinary disk that has been
divided into two physical partitions.  The ID on the second partition indicates
that the space therein is managed by the Logical Volume Manager.  The LV
manager would, if things were working correctly, identify data structures
within that partition and set up virtual devices to access the space.

> 2. Now, when I do issue `e2finder /dev/sdb2`, the list starts out as follows:
>
> $ ./e2finder /dev/sdb2
> Byte offset  sector (512B)
> ------------  --------
> 0x0004100000 ( 8521728), label="", bs=4k
> 0x0014100000 ( 9046016), label="", bs=4k
>   ...
>
> Given this list and given your example just above, would the value of 'Find'
> for me be: 8521728?

Yes, that command line:

    dmsetup create foo --table \
          "0 $((159260346*2-(Find-2) )) linear /dev/sda12 $((Find-2))"

does the necessary arithmetic so that you can just plug in the sector offset
for the primary superblock.

> 3. In your example, does 'Find' progressively take on values 2050, 264192,
> 788480... or, does it remain fixed at 2050?

For all cases the file system actually starts at sector 2048 with the
primary superblock at sector 2050.

> If it's the former, then I wonder what would be the use of printing 2nd and
> subsequent entries?

Either you've got "former" and "latter" backwards, or I'm completely
confused by what you are asking.

Consider what you would see if the primary superblock were damaged.  There
would be a number of alternate superblocks that you would have to identify
by looking at the repeated low-order hex digits of the byte offset, make an
educated guess about where the primary superblock would have been, and then
plug that sector offset in for "Find=xxxx".

The key is to find several potential superblocks where the low-order 6 hex
digits of the byte offset repeat, except that the first one has 0x400 added.
If you can find that pattern, that very likely identifies the first
superblock.  If you don't find one with that 0x400 offset, then perhaps
that primary superblock got overwritten, and you'll have to calculate the
likely location for that primary.

> And if it's the latter, then why in setting up the device mapping table
> would  you use a varying 'num_sectors' -- namely, '$((159260346*2-(Find-2) ))' --
> instead of a fixed value that is 'some, fixed transformation' of the Blocks
> value reported by fdisk? In other words, based on this statement of yours above,
>
>       "Remember that an alternate superblock at offset XXX still
>        expects the file system to begin at its real starting point,
>        not just 2 blocks before this alternate superblock."
>
> (which I understand and appreciate, btw), why should the dmsetup invocation
> beparameterized on 'Find'?

Since I don't know the correct size, and the only constraint is that the
size must be at least large enough to contain the file system, I just
calculate the largest possible size, i.e., the number of sectors between
the starting point and the physical end of the partition.

> 4. You say above,
>
>       "All of these expect the file system to begin at sector offset 2048,
>       and would need you to run "e2fsck -b 32768" or "e2fsck -b 98304" for
>       the alternate SBs."
>
> Is the concept here that only the first entry printed is *always* the Real,
> and any and all subsequent ones just 'alternates' or backups of the first
> one? Would you please confirm this?

The first entry might be the real primary superblock, but is could be just
a copy of the superblock that got written to some random location for
reasons unknown.  I've got disk partitions that have been used for several
test installations, and there are copies of what look like valid superblocks
scattered all over.

> Further, in your example, what is the correlation between the -b argument
> values of 32768, 98304, ... and the corresponding SBs? The reason I ask this
> is: The man page of e2fsck says that '-b 32768' may be specified when the
> blocksize is 4k. Mine looks to be 4k, indeed. But then, shouldn't I always
> use 32768 instead of various numbers? Also, e2fsck suggests using 32768 only
> when you're relying in its own notion of things to carry out the repair. But,
> here, we are using a custom program (e2finder) and ought to be using the
> number *it* is printing out. Even in our example, I fail to find any
> correlation between e2finder numbers and those that you specify in e2fsck
> -b.

Recognize that the argument to "-b" represents 4k-sized blocks.  So,

   0x0000100400  # Real SB
  -       0x400  # byte offset of real SB
   ------------
   0x0000100000  # actual start of file system

   0x0008100000  # 1st alternate
  -0x0000100000  # start of file system
   ------------
   0x0008000000  # byte offset of 1st alternate

   Divide that number by the block size (4k = 0x1000) and you get
   0x8000, or 32768 decimal.

For the 2nd alternate at 0x0018100000, you get a byte offset of 0x18000000,
or 98304 blocks of 4k.

-- 
Bob Nichols         AT comcast.net I am "RNichols42"

Back to comp.os.linux.setup | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

No success repairing my ext4 file system so far, PLEASE HELP! Harry <simonsharry@gmail.com> - 2012-04-12 03:29 -0700
  Re: No success repairing my ext4 file system so far, PLEASE HELP! Richard Kettlewell <rjk@greenend.org.uk> - 2012-04-12 11:46 +0100
    Re: No success repairing my ext4 file system so far, PLEASE HELP! Harry <simonsharry@gmail.com> - 2012-04-12 04:08 -0700
      Re: No success repairing my ext4 file system so far, PLEASE HELP! Richard Kettlewell <rjk@greenend.org.uk> - 2012-04-12 12:36 +0100
        Re: No success repairing my ext4 file system so far, PLEASE HELP! Harry <simonsharry@gmail.com> - 2012-04-12 05:25 -0700
          Re: No success repairing my ext4 file system so far, PLEASE HELP! Richard Kettlewell <rjk@greenend.org.uk> - 2012-04-12 13:49 +0100
            Re: No success repairing my ext4 file system so far, PLEASE HELP! Harry <simonsharry@gmail.com> - 2012-04-12 06:09 -0700
              Re: No success repairing my ext4 file system so far, PLEASE HELP! Richard Kettlewell <rjk@greenend.org.uk> - 2012-04-12 19:18 +0100
                Re: No success repairing my ext4 file system so far, PLEASE HELP! Harry <simonsharry@gmail.com> - 2012-04-12 11:49 -0700
              Re: No success repairing my ext4 file system so far, PLEASE HELP! Doug Freyburger <dfreybur@yahoo.com> - 2012-04-12 18:27 +0000
              Re: No success repairing my ext4 file system so far, PLEASE HELP! Doug Freyburger <dfreybur@yahoo.com> - 2012-04-12 18:51 +0000
                Re: No success repairing my ext4 file system so far, PLEASE HELP! Harry <simonsharry@gmail.com> - 2012-04-12 12:12 -0700
                Re: No success repairing my ext4 file system so far, PLEASE HELP! "David W. Hodgins" <dwhodgins@nomail.afraid.org> - 2012-04-12 17:15 -0400
                Re: No success repairing my ext4 file system so far, PLEASE HELP! Harry <simonsharry@gmail.com> - 2012-04-12 20:30 -0700
                Re: No success repairing my ext4 file system so far, PLEASE HELP! Harry <simonsharry@gmail.com> - 2012-04-13 06:58 -0700
                Re: No success repairing my ext4 file system so far, PLEASE HELP! Harry <simonsharry@gmail.com> - 2012-04-13 07:13 -0700
                Re: No success repairing my ext4 file system so far, PLEASE HELP! Robert Nichols <SEE_SIGNATURE@localhost.localdomain.invalid> - 2012-04-13 19:29 -0500
                Re: No success repairing my ext4 file system so far, PLEASE HELP! Harry <simonsharry@gmail.com> - 2012-04-13 21:27 -0700
                Re: No success repairing my ext4 file system so far, PLEASE HELP! Robert Nichols <SEE_SIGNATURE@localhost.localdomain.invalid> - 2012-04-14 07:58 -0500
                Re: No success repairing my ext4 file system so far, PLEASE HELP! Harry <simonsharry@gmail.com> - 2012-04-14 06:35 -0700
                Re: No success repairing my ext4 file system so far, PLEASE HELP! Robert Nichols <SEE_SIGNATURE@localhost.localdomain.invalid> - 2012-04-14 19:59 -0500
                Re: No success repairing my ext4 file system so far, PLEASE HELP! Harry <simonsharry@gmail.com> - 2012-04-14 19:58 -0700
                Re: No success repairing my ext4 file system so far, PLEASE HELP! Harry <simonsharry@gmail.com> - 2012-04-14 20:13 -0700
                Re: No success repairing my ext4 file system so far, PLEASE HELP! Robert Nichols <SEE_SIGNATURE@localhost.localdomain.invalid> - 2012-04-15 15:14 -0500
                Re: No success repairing my ext4 file system so far, PLEASE HELP! Harry <simonsharry@gmail.com> - 2012-04-16 02:39 -0700
                Re: No success repairing my ext4 file system so far, PLEASE HELP! Robert Nichols <SEE_SIGNATURE@localhost.localdomain.invalid> - 2012-04-16 08:50 -0500
                Re: No success repairing my ext4 file system so far, PLEASE HELP! Harry <simonsharry@gmail.com> - 2012-04-16 08:02 -0700
                Re: No success repairing my ext4 file system so far, PLEASE HELP! Harry <simonsharry@gmail.com> - 2012-04-16 10:39 -0700
                Re: No success repairing my ext4 file system so far, PLEASE HELP! Harry <simonsharry@gmail.com> - 2012-04-16 11:08 -0700
                Re: No success repairing my ext4 file system so far, PLEASE HELP! Robert Nichols <SEE_SIGNATURE@localhost.localdomain.invalid> - 2012-04-16 15:58 -0500
                Re: No success repairing my ext4 file system so far, PLEASE HELP! Harry <simonsharry@gmail.com> - 2012-04-16 23:02 -0700
                Re: No success repairing my ext4 file system so far, PLEASE HELP! Robert Nichols <SEE_SIGNATURE@localhost.localdomain.invalid> - 2012-04-17 10:58 -0500
                Re: No success repairing my ext4 file system so far, PLEASE HELP! Harry <simonsharry@gmail.com> - 2012-04-18 21:53 -0700
                Re: No success repairing my ext4 file system so far, PLEASE HELP! Doug Freyburger <dfreybur@yahoo.com> - 2012-04-19 16:45 +0000
                Re: No success repairing my ext4 file system so far, PLEASE HELP! Harry <simonsharry@gmail.com> - 2012-04-19 18:34 -0700
                Re: No success repairing my ext4 file system so far, PLEASE HELP! Doug Freyburger <dfreybur@yahoo.com> - 2012-04-20 17:19 +0000
                Re: No success repairing my ext4 file system so far, PLEASE HELP! Harry <simonsharry@gmail.com> - 2012-04-21 20:37 -0700
                Re: No success repairing my ext4 file system so far, PLEASE HELP! Doug Freyburger <dfreybur@yahoo.com> - 2012-04-25 16:01 +0000
                Re: No success repairing my ext4 file system so far, PLEASE HELP! Harry <simonsharry@gmail.com> - 2012-04-28 16:32 -0700
                Re: No success repairing my ext4 file system so far, PLEASE HELP! Doug Freyburger <dfreybur@yahoo.com> - 2012-04-16 19:15 +0000
                Re: No success repairing my ext4 file system so far, PLEASE HELP! Harry <simonsharry@gmail.com> - 2012-04-16 21:20 -0700
                Re: No success repairing my ext4 file system so far, PLEASE HELP! Harry <simonsharry@gmail.com> - 2012-04-13 21:40 -0700
                Re: No success repairing my ext4 file system so far, PLEASE HELP! Harry <simonsharry@gmail.com> - 2012-04-13 21:56 -0700
                Re: No success repairing my ext4 file system so far, PLEASE HELP! Doug Freyburger <dfreybur@yahoo.com> - 2012-04-16 18:47 +0000
                Re: No success repairing my ext4 file system so far, PLEASE HELP! Harry <simonsharry@gmail.com> - 2012-04-16 20:19 -0700
                Re: No success repairing my ext4 file system so far, PLEASE HELP! unruh <unruh@invalid.ca> - 2012-04-13 15:22 +0000
                Re: No success repairing my ext4 file system so far, PLEASE HELP! J G Miller <miller@yoyo.ORG> - 2012-04-13 17:13 +0000
                Re: No success repairing my ext4 file system so far, PLEASE HELP! Harry <simonsharry@gmail.com> - 2012-04-13 21:58 -0700
          Re: No success repairing my ext4 file system so far, PLEASE HELP! unruh <unruh@invalid.ca> - 2012-04-12 15:50 +0000
            Re: No success repairing my ext4 file system so far, PLEASE HELP! The Natural Philosopher <tnp@invalid.invalid> - 2012-04-12 21:37 +0100
      Re: No success repairing my ext4 file system so far, PLEASE HELP! unruh <unruh@invalid.ca> - 2012-04-12 15:46 +0000
        Re: No success repairing my ext4 file system so far, PLEASE HELP! Harry <simonsharry@gmail.com> - 2012-04-12 09:35 -0700
          Re: No success repairing my ext4 file system so far, PLEASE HELP! unruh <unruh@invalid.ca> - 2012-04-12 18:57 +0000
  Re: No success repairing my ext4 file system so far, PLEASE HELP! Doug Freyburger <dfreybur@yahoo.com> - 2012-04-12 15:59 +0000
    Re: No success repairing my ext4 file system so far, PLEASE HELP! unruh <unruh@invalid.ca> - 2012-04-12 16:39 +0000
      Re: No success repairing my ext4 file system so far, PLEASE HELP! Harry <simonsharry@gmail.com> - 2012-04-12 09:53 -0700
        Re: No success repairing my ext4 file system so far, PLEASE HELP! unruh <unruh@invalid.ca> - 2012-04-12 19:03 +0000
    Re: No success repairing my ext4 file system so far, PLEASE HELP! Harry <simonsharry@gmail.com> - 2012-04-12 09:48 -0700
      Re: No success repairing my ext4 file system so far, PLEASE HELP! unruh <unruh@invalid.ca> - 2012-04-12 19:07 +0000
    Re: No success repairing my ext4 file system so far, PLEASE HELP! Richard Kettlewell <rjk@greenend.org.uk> - 2012-04-12 18:43 +0100
      Re: No success repairing my ext4 file system so far, PLEASE HELP! Harry <simonsharry@gmail.com> - 2012-04-12 10:55 -0700
      Re: No success repairing my ext4 file system so far, PLEASE HELP! Doug Freyburger <dfreybur@yahoo.com> - 2012-04-12 18:07 +0000
        Re: No success repairing my ext4 file system so far, PLEASE HELP! Richard Kettlewell <rjk@greenend.org.uk> - 2012-04-12 19:20 +0100
          Re: No success repairing my ext4 file system so far, PLEASE HELP! unruh <unruh@invalid.ca> - 2012-04-12 19:11 +0000
            Re: No success repairing my ext4 file system so far, PLEASE HELP! Richard Kettlewell <rjk@greenend.org.uk> - 2012-04-12 20:39 +0100
              Re: No success repairing my ext4 file system so far, PLEASE HELP! Doug Freyburger <dfreybur@yahoo.com> - 2012-04-13 16:50 +0000
                Re: No success repairing my ext4 file system so far, PLEASE HELP! Harry <simonsharry@gmail.com> - 2012-04-13 21:24 -0700
                Re: No success repairing my ext4 file system so far, PLEASE HELP! Doug Freyburger <dfreybur@yahoo.com> - 2012-04-16 19:04 +0000
                Re: No success repairing my ext4 file system so far, PLEASE HELP! Harry <simonsharry@gmail.com> - 2012-04-16 21:44 -0700
                Re: No success repairing my ext4 file system so far, PLEASE HELP! unruh <unruh@invalid.ca> - 2012-04-17 17:18 +0000
                Re: No success repairing my ext4 file system so far, PLEASE HELP! Harry <simonsharry@gmail.com> - 2012-04-17 18:41 -0700
      Re: No success repairing my ext4 file system so far, PLEASE HELP! unruh <unruh@invalid.ca> - 2012-04-12 19:09 +0000
    Re: No success repairing my ext4 file system so far, PLEASE HELP! Harry <simonsharry@gmail.com> - 2012-04-12 10:46 -0700
      Re: No success repairing my ext4 file system so far, PLEASE HELP! unruh <unruh@invalid.ca> - 2012-04-12 19:13 +0000
        Re: No success repairing my ext4 file system so far, PLEASE HELP! Harry <simonsharry@gmail.com> - 2012-04-12 12:21 -0700
          Re: No success repairing my ext4 file system so far, PLEASE HELP! unruh <unruh@invalid.ca> - 2012-04-12 20:12 +0000
  Re: No success repairing my ext4 file system so far, PLEASE HELP! g.fink@gmx.net (Gernot Fink) - 2012-04-12 18:20 +0000
  Re: No success repairing my ext4 file system so far, PLEASE HELP! The Natural Philosopher <tnp@invalid.invalid> - 2012-04-12 21:35 +0100
  Re: No success repairing my ext4 file system so far, PLEASE HELP! Harry <simonsharry@gmail.com> - 2012-04-19 06:43 -0700
    Re: No success repairing my ext4 file system so far, PLEASE HELP! Bob <SEE_SIGNATURE@localhost.localdomain.invalid> - 2012-04-19 11:29 -0500
      Re: No success repairing my ext4 file system so far, PLEASE HELP! Harry <simonsharry@gmail.com> - 2012-04-19 18:50 -0700

csiph-web