All of lore.kernel.org
 help / color / mirror / Atom feed
From: "David C. Rankin" <drankinatty@suddenlinkmail.com>
To: mdraid <linux-raid@vger.kernel.org>
Subject: Re: GPT corruption on Primary Header, backup OK, fixing primary nuked array -- help?
Date: Tue, 26 Jul 2016 17:47:05 -0500	[thread overview]
Message-ID: <5797E869.8080403@suddenlinkmail.com> (raw)
In-Reply-To: <CAJCQCtSkE+-C5U9OEm0-zazLW2KHCMUqduDTA=UHsMxmf4DVrQ@mail.gmail.com>

On 07/26/2016 03:47 PM, Chris Murphy wrote:
>> So basically I just need to fix the partition table on sdc,
> No just remove the GPT signatures, "45 46 49 20 50 41 52 54" and the
> PMBR signature "55 aa" from the two drives.
> 
> Restoring the primary GPT on sdd overwrote part of the mdadm metadata.
> I'm not sure if --readd alone will fix that, or if one of the
> --update= options is necessary as well, and if so which one.

OK,

  Here is where I need a bit more help. Would I use 'dd' to write the zeros at
some offset?, or was your mention of wipefs earlier intended as the approach to
take (e.g., "wipefs -b -t or -o to remove the GPT signatures, while avoiding the
mdadm and file system signatures.")


  The real question for me is what is the effect of having /dev/sdc1 and
/dev/sdd1 as unused partitions on the drive while I'm using the whole drive. Is
that something that can bite me later? Right now I understand I have a couple of
options:

Option 1:  attempt a re-add of /dev/sdd to the md4 array currently running in
degraded mode.

 Do I need to delete sdd1 now while the disk is not being used before attempting
a re-add sdd to the md4 array? Does it matter? Then if that can be successfully
readded/synced, do I care about the fact that sdc has sdc1 on it and should I
then --fail --remove sdc, fix the GPT header, delete sdc1 and then readd sdc to
the md4 array? (or just leave as and ignore the GPT header issue reported by gdisk?)

Option 2:  shrink the filesystem on sdc so it will fit in sdc1 and move the
filesystem to the sdc1 partition before re-adding. (this I don't understand as
well -- how to move the shrunken filesystem from sdc to sdc1?) If I understand,
moving to sdc1 doesn't buy me anything and isn't necessary here. So we can
strike option 2 if this is correct.

Option 3:  If it all fails, and I start from scratch, what is the best way to
wipe both drives completely to make sure there is no lingering trace of a
superblock, etc. before recreating array?

 # mdadm -S /dev/md4
 # mdadm --zero-superblock /dev/sdc
 # mdadm --zero-superblock /dev/sdd
 # gdisk to 'fix' /dev/sdc
 # mdadm --create --verbose /dev/md4 --level=1 --metadata=1.2 \
--raid-devices=2 /dev/sdc1 /dev/sdd1
 # mkfs.ext4 -v -L data -m 0.005 -b 4096 -E stride=16,stripe-width=32 /dev/md4
 # update mdadm.conf
 # (recopy data)

So it looks like it boils down to:

(a) do I need to worry about removing unused sdc1/sdd1? Then do I need to use
'dd' or 'wipefs' to fix the GPT and PMBR signatures on sdc (and I assume do
nothing to sdd if I don't need to delete sdd1)

(b) nuke it all and start over (if so what is the plan above OK?)

I'll try the re-add of sdd to a and report back after your response.

-- 
David C. Rankin, J.D.,P.E.

  reply	other threads:[~2016-07-26 22:47 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-26  0:52 GPT corruption on Primary Header, backup OK, fixing primary nuked array -- help? David C. Rankin
2016-07-26  4:18 ` Adam Goryachev
2016-07-26  5:28   ` David C. Rankin
2016-07-26  8:20     ` David C. Rankin
2016-07-26  9:52       ` Adam Goryachev
2016-07-26 17:14         ` Phil Turmel
2016-07-26 20:24           ` David C. Rankin
2016-07-26 20:12         ` David C. Rankin
2016-07-26 20:47           ` Chris Murphy
2016-07-26 22:47             ` David C. Rankin [this message]
2016-07-26 23:18               ` Chris Murphy
2016-07-27  7:13                 ` SOLVED [was Re: GPT corruption on Primary Header, backup OK, fixing primary nuked array -- help?] David C. Rankin
2016-07-27 13:04                   ` Anthony Youngman
2016-07-27 23:10                     ` David C. Rankin
2016-07-28 12:53                       ` Anthony Youngman
2016-07-28 20:51                         ` Andreas Dröscher
2016-07-28 21:25                         ` Phil Turmel
2016-07-27 14:22                   ` Phil Turmel
2016-07-27 23:12                     ` David C. Rankin
2016-07-27 13:10                 ` GPT corruption on Primary Header, backup OK, fixing primary nuked array -- help? Anthony Youngman
2016-07-26 15:19       ` Chris Murphy
2016-07-26 15:55         ` Chris Murphy
2016-07-26 21:12           ` David C. Rankin
2016-07-26 22:10             ` Phil Turmel
2016-07-26 22:59               ` David C. Rankin
2016-07-26 23:23                 ` Chris Murphy
2016-07-27  0:19                   ` David C. Rankin
2016-07-26 20:34         ` David C. Rankin

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=5797E869.8080403@suddenlinkmail.com \
    --to=drankinatty@suddenlinkmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.