Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.os.linux.setup > #2664
| From | Harry <simonsharry@gmail.com> |
|---|---|
| Newsgroups | comp.os.linux.setup |
| Subject | Re: No success repairing my ext4 file system so far, PLEASE HELP! |
| Date | 2012-04-16 23:02 -0700 |
| Organization | http://groups.google.com |
| Message-ID | <12263514.182.1334642548574.JavaMail.geo-discussion-forums@pbag4> (permalink) |
| References | (14 earlier) <jmfa77$v18$1@omega-3a.local> <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> |
On Tuesday, April 17, 2012 2:28:07 AM UTC+5:30, Robert Nichols wrote:
> On 04/16/2012 12:39 PM, Harry wrote:
>
> >
> > I had to add this line before include<stdio.h> to get the program to compile:
> > #define umode_t mode_t
> >
> > Because mode_t itself is defined as 'unsigned<something>', I took the quick liberty of doing the above without a sufficiently deeper thought on all its ramifications.
> >
> > There were 1601 entries printed. I extracted the base 10 number (from the parentheses), subtracted 2 (sectors) from it, and used the resulting number in device mapping code as follows:
> >
> >
> > # This just extracts the sector that has the e2 fs signature.
> > # Actual subtraction will be done later below, in the script.
> >
> > $ cat e2finder.log | sed -r 's/\(|\)|,//g' | field 2> tmp
> > $ cat tmp
> > 8521728
> > ...
> > 98174976
> >
> >
> > ---------------------------------
> > #!/bin/bash
> > set -u
> >
> > if [ -b /dev/mapper/foo ]; then
> > dmsetup remove foo
> > fi
> >
> > bogusMax=100
> > cat tmp | while read x; do
> > # superblock starts 2 sectors earlier
> > (( x = x - 2 ))
> >
> > echo "Trying superblock at sector $x ..."
> > if dmsetup create foo --table "0 $bogusMax linear /dev/sdb2 $x"; then
> > if e2fsck -n /dev/mapper/foo&>/dev/null; then
> > echo "Found superblock at sector $x ."
> > else
> > echo "FAILED to find superblock at sector $x ."
> > fi
> > dmsetup remove foo
> > else
> > echo "FAILED to dmsetup at sector $x"
> > fi
> > done
> > ---------------------------------
> >
> >
> > Unfortunately, every single superblock offset failed!
> >
> >
> > Trying superblock at sector 8521726 ...
> > FAILED to find superblock at sector 8521726 .
> > ...
> > Trying superblock at sector 98174974 ...
> > FAILED to find superblock at sector 98174974 .
>
> First, for this program it doesn't matter how you define umode_t since
> the program never uses the one macro where that name appears. Anything
> that keeps the compiler happy should be fine.
>
> 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)?
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?
3. In your example, does 'Find' progressively take on values 2050, 264192, 788480... or, does it remain fixed at 2050?
If it's the former, then I wonder what would be the use of printing 2nd and subsequent entries?
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 be parameterized on 'Find'?
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?
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.
Would /greatly/ appreciate if you could clarify these few points of confusion for me.
Back to comp.os.linux.setup | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll 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