Linux RAID subsystem development
 help / color / mirror / Atom feed
From: NeilBrown <neilb@suse.de>
To: Eduard Rozenberg <eduardr@pobox.com>
Cc: linux-raid@vger.kernel.org
Subject: Re: Can't mount partitions after "mdadm --zero-superblock"
Date: Tue, 7 Apr 2015 10:52:30 +1000	[thread overview]
Message-ID: <20150407105230.4ff9a97a@notabene.brown> (raw)
In-Reply-To: <F271C907-A2A7-4132-BA11-D33353AE9FFF@pobox.com>

[-- Attachment #1: Type: text/plain, Size: 2697 bytes --]

On Mon, 6 Apr 2015 16:45:58 -0700 Eduard Rozenberg <eduardr@pobox.com> wrote:

> Hello folks,
> 
> I previously had the following setup:
> 
> sda & sdb partitioned w/ GPT, 7 partitions each (usr, opt, var etc...)
> 7 raid1’s with 2 devices for each pair of partitions (/dev/sda1 & /dev/sdab1, etc)
> They’d been created under Slackware 13.37.
> 
> I was trying to clean out mdadm from those partitions but keep the data so I ran 
> "mdadm --zero-superblock” on each of those previously RAID1 mdadm 1.2 ext4 
> partitions.

The "1.2" metadata is stored 4k from the start of the device.  The actual
data is some megabytes further in.  I don't suppose you still have the output
of "mdadm --examine" from before you destroyed the superblocks??

> 
> As a result I am now currently unable to mount any partition after the first one on either
> disk. The first partition does mount. The partition table is visible and looks fine in gdisk.
> 
> mount -t ext4 /dev/sdac2 /mnt
> mount: wrong fs type, bad option, bad superblock on /dev/sdac2,
> missing codepage or helper program, or other error
> In some cases useful info is found in syslog - try
> dmesg | tail or so
> 
> I did try superblock recovery with each backup superblock that ext4 normally creates,
> but none of the superblock locations worked.
> 
> For example:
> 
> fsck.ext4 -b 4096000 /dev/sdac2 
> e2fsck 1.42.8 (20-Jun-2013)
> /sbin/e2fsck: Invalid argument while trying to open /dev/sdac2
> 
> The superblock could not be read or does not describe a correct ext2
> filesystem. If the device is valid and it really contains an ext2
> filesystem (and not swap or ufs or something else), then the superblock
> is corrupt, and you might try running e2fsck with an alternate superblock:
> e2fsck -b 8193 <device>
> 
> 
> Would be grateful for any advice on anything else I can try.

You need to find where the filesystem actually starts, then you need to
create some way to access it as a block device, then it should "just work".

An ext4 filesystem superblock has 0xef53 at an offset of 0x38, and the
superblock is typically 1K from the start of the partition.

So you could:
   od -x /dev/sdac2 | awk '$6 == "ef53"'

Then subtrace 0002060 (octal) from the leading number, and that might be the
start of the partition.

Then
  losetup -o "start in decimal" /dev/loop0 /dev/sdac2

and try 'fsck' on /dev/loop0

Good luck.

NeilBrown



> 
> Regards,
> —Ed--
> To unsubscribe from this list: send the line "unsubscribe linux-raid" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 811 bytes --]

  reply	other threads:[~2015-04-07  0:52 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-06 23:45 Can't mount partitions after "mdadm --zero-superblock" Eduard Rozenberg
2015-04-07  0:52 ` NeilBrown [this message]
2015-04-07  1:33   ` Eduard Rozenberg
2015-04-07  1:52     ` NeilBrown
2015-04-07  3:31   ` Eduard Rozenberg
2015-04-10  2:53     ` Personal insight - " Eduard Rozenberg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150407105230.4ff9a97a@notabene.brown \
    --to=neilb@suse.de \
    --cc=eduardr@pobox.com \
    --cc=linux-raid@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox