From nobody Thu Mar 31 16:51:57 2022 X-Original-To: freebsd-questions@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 89F431A492BA for ; Thu, 31 Mar 2022 16:52:17 +0000 (UTC) (envelope-from greg.bal4@gmail.com) Received: from mail-lj1-x22b.google.com (mail-lj1-x22b.google.com [IPv6:2a00:1450:4864:20::22b]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4KTq8w1FQxz4hLv; Thu, 31 Mar 2022 16:52:16 +0000 (UTC) (envelope-from greg.bal4@gmail.com) Received: by mail-lj1-x22b.google.com with SMTP id q14so520229ljc.12; Thu, 31 Mar 2022 09:52:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=faWxrMuiPPZyPEasyr8NuxnU+TJamITfJKBpetpMwXc=; b=jkDQ/AgaZPTeQDHJk1T4usFfqsKF+UBPOFaoKwguGDgAAnbBdcgd9CU/HPss6b0/bz kLZqh5rTcfIM8JXcEGZ/eZxPhJirFVY3uhfNNT01OS6jahZrDFZG17bdEC9201LQiU8C f0PUJSFhORzica/du48oreAL5h65rF9xI7LwGnPi+0SgVmyh16hvT8l2R/sqoriXg60m AsaYOlM/0SDKqp7qxS1TKwVMFAQMiHszLPm7j/ofwA6QQCJcIe6tL5W7uh7cFb7ukSCs p3nHcR/l/Mi/ioM3C+ouZLPmdgyR72DkpTdRH9c+ih95ojAn83jew3JdOSTc1IW52Grb KW/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=faWxrMuiPPZyPEasyr8NuxnU+TJamITfJKBpetpMwXc=; b=UmVdeJ2xzYOwB3C9ZJKJDutJRsIm2QY3PhLs6/BYI/9YW6G8NgROItkSZAbdXUfKpz d/zh0jUD42k0TP5NLRr7RXsFG2772iYwO6uczTE0UIiRr0efVcyJs3WPVPWcg0OHd8H6 lQHfqufkWNHMRtlvTdXKam9uoNri+NesehYmPfFRawmMW2+7NRNUxwR/UBh56LRWX/NL 6xCEZyY5sm+S7+aZfFI5rkk4ulnLajWjO/uuOPDc+lWPZRn9lBLe8mpadaWpFHtkcxcL c6+rNnGrZDR37r5XFMJWOxJPL3yNKysT0n3z7mhEfYwCd74KQiGqI7iKB57XR6KAy8Kv 5O4w== X-Gm-Message-State: AOAM5328+hnXbBKWgsQrdEcTAhRmGJB40qjQK4cI/SdbfQkWOgxDYL5N 4yANEoOk1ZmKilVBs3kGdeg3tOvIPsk0fiVKOIHMeKSR X-Google-Smtp-Source: ABdhPJzXsyYcAD64qqSg6fw7QAFPax4DgomAluPpR3E1o48wssCvSvEXSPOdKx0C86GUrUzykyNwX/nMYRJmOIWqleI= X-Received: by 2002:a2e:a7c7:0:b0:249:8273:b488 with SMTP id x7-20020a2ea7c7000000b002498273b488mr11331402ljp.238.1648745528354; Thu, 31 Mar 2022 09:52:08 -0700 (PDT) List-Id: User questions List-Archive: https://lists.freebsd.org/archives/freebsd-questions List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-questions@freebsd.org X-BeenThere: freebsd-questions@freebsd.org MIME-Version: 1.0 References: <20220331003622.GK60301@eureka.lemis.com> In-Reply-To: <20220331003622.GK60301@eureka.lemis.com> From: Greg Balfour Date: Thu, 31 Mar 2022 11:51:57 -0500 Message-ID: Subject: Re: GPT header checksum mismatch To: "Greg 'groggy' Lehey" , dpchrist@holgerdanske.com, grarpamp@gmail.com Cc: Arthur Chance , freebsd-questions@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4KTq8w1FQxz4hLv X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20210112 header.b="jkDQ/Aga"; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of gregbal4@gmail.com designates 2a00:1450:4864:20::22b as permitted sender) smtp.mailfrom=gregbal4@gmail.com X-Spamd-Result: default: False [-4.00 / 15.00]; TO_DN_SOME(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36]; RCPT_COUNT_FIVE(0.00)[5]; MID_RHS_MATCH_FROMTLD(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; NEURAL_HAM_SHORT(-1.00)[-1.000]; FREEMAIL_TO(0.00)[freebsd.org,holgerdanske.com,gmail.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; TAGGED_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20210112]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::22b:from]; MLMMJ_DEST(0.00)[freebsd-questions]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[] X-ThisMailContainsUnwantedMimeParts: N On Wed, Mar 30, 2022 at 7:36 PM Greg 'groggy' Lehey wrote: > On Wednesday, 30 March 2022 at 11:23:38 -0500, Greg Balfour wrote: > > On Tue, Mar 29, 2022 at 11:47 AM Arthur Chance wrote: > >> On 29/03/2022 15:45, Greg Balfour wrote: > >>> Running 12.3-RELEASE I had a UPS failure and my machine did a reboot > >>> without properly shutting down. Now when it boots I see this > >>> message: > >>> > >>> gptboot: backup GPT header checksum mismatch > >>> > >>> Doing a "gpart show ada0" shows > >>> > >>> 34 976773101 ada0 GPT (466G) [CORRUPT] > >>> > >>> The machine still boots fine. I don't have a prior dump of the > >>> partition table saved. How can I clean up these errors? > >> > >> Try gpart recover. > > > > So I did a recover and it appeared to work... > > > > # gpart recover ada0 > > ada0 recovered > > > > And a gpart status on ada0 was no longer showing as corrupted. But after > > rebooting I still get the header checksum mismatch error and a gpart > > status on ada0 will show again as corrupted. Also seen on boot: > > > > Mar 30 08:21:01 desktop kernel: GEOM: ada0: the secondary GPT table is corrupt or invalid. > > Mar 30 08:21:01 desktop kernel: GEOM: ada0: using the primary only -- recovery suggested. > > > > This is repeatable. A gpart recover appears to work but on reboot > > everything shows as corrupted again. > > Interesting. Could you enter a PR, please? Start at > https://bugs.freebsd.org/bugzilla/enter_bug.cgi > We need at least the following information: > > 1. Output of 'grep ada /var/run/dmesg.boot'. This will give details > about the disk, and also the number of sectors, which you'll need > below. Take the number of sectors and subtract 32 for the next > steps (noted as SECS-32). > > 2. After 'gpart recover', the files created by > dd if=/dev/ada0 count=33 of=gpt-before.start > dd if=/dev/ada0 iseek=SECS-32 of=gpt-before.end > The second dd should transfer exactly 16384 bytes. > > 3. After reboot, the files created by > dd if=/dev/ada0 count=33 of=gpt-after.start > dd if=/dev/ada0 iseek=SECS-32 of=gpt-after.end > The second dd should transfer exactly 16384 bytes. > > Supply this information as attachments to the bug report. I'd also > appreciate being informed, though I don't promise to be the one to > investigate the problem. > > Greg The link to the Wikipedia article in a previous response was very informative. While digging through it I realized what happened. When the PC lost power it also lost all BIOS settings due to a dead CMOS battery. When the system booted the SATA Operation setting was configured to the default of RAID On. When FreeBSD was originally installed on this machine the SATA Operation setting had been configured to AHCI. After changing it back to AHCI I was able to do a gpart recover which was now successful. It was a long time ago, but I think I had originally changed it to AHCI because of trying to install some Linux distribution. Thanks for the all the responses. I learned a bit.