From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 2F6B4138350 for ; Thu, 30 Apr 2020 18:08:56 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 0B725E0897; Thu, 30 Apr 2020 18:08:49 +0000 (UTC) Received: from mout01.posteo.de (mout01.posteo.de [185.67.36.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 8B641E0837 for ; Thu, 30 Apr 2020 18:08:47 +0000 (UTC) Received: from submission (posteo.de [89.146.220.130]) by mout01.posteo.de (Postfix) with ESMTPS id 74327160065 for ; Thu, 30 Apr 2020 20:08:45 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.de; s=2017; t=1588270125; bh=SturQQbxda9v+ij+5AnIODpetTE3t3L8vQtoXRY7kak=; h=Date:From:To:Subject:From; b=BSHGAQrFxxpIZJeP2vLFTt/ov4TC+iQMSiHwJuKbfXU08xRzIIzjkzSNHHB+3jc7j 4pB6+tcUG80VSt0macbNTYrvAuzj+2lUT63exyJ5EjHfxKEakNTTEaYPX3WC58tlyY Zzl0Hy20HCvRI0g+1p+Op3Wllm6IMqUkCydBpi/43Npx3I7JJK2FaD+gdZZG1kiY2K Ds370HtxkpkEaOLNDCftCJx4u0RfSCfzQ12dZHBuSxmBgdT7LbkXoJz/jIILbfnryi QbFdgWwgGZPqF9ISi5c4GQuV9AdrCHNqvaMjyZyDdFlJ5BjtdC0NPP9QRQE48wDFu9 3vrPXQMARkkdg== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 49Ck081fClz9ryJ for ; Thu, 30 Apr 2020 20:08:40 +0200 (CEST) Date: Thu, 30 Apr 2020 20:08:39 +0200 From: tuxic@posteo.de To: gentoo-user@lists.gentoo.org Subject: Re: [gentoo-user] Trouble with backup harddisks Message-ID: <20200430180839.iz4kxipst2i5stwp@solfire> Mail-Followup-To: gentoo-user@lists.gentoo.org References: <20200430093217.efprkpt4kbvir7nr@solfire> <5EAAA0AB.3050505@youngman.org.uk> <22faa7cf-7291-b430-c646-b96c6d428f19@alyf.net> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <22faa7cf-7291-b430-c646-b96c6d428f19@alyf.net> X-Archives-Salt: 62f8f1a7-b690-43c6-b669-229e45688a1c X-Archives-Hash: d679d80d156a4d1c73c0e7ec10a5e31a On 04/30 03:44, Andrea Conti wrote: > Hi, > > > > CONFIG_PARTITION_ADVANCED=y > > > CONFIG_MSDOS_PARTITION=y > > > CONFIG_EFI_PARTITION=y > > That's all you need. > > > This could be the key. Sector sizes have been changing from 512 to 4096 > > over many years. If your kernel has been updated to expect/use 4096 byte > > sectors, it might not be able to read the disk properly. > > Sector size is only a (fixed) property of a specific block device, not something expected or required by the kernel. > Sector sizes other than 512B have been around for ages without any problems, even in consumer hardware (e.g. CDs and DVDs have 2KB sectors). > > > Disklabel type: dos > > > Device Boot Start End Sectors Size Id Type > > /dev/sdb1 1 1953458175 1953458175 931.5G ee GPT > > That looks... broken. > fdisk is recognizing the disk as MBR (a GPT disk would have "Disklabel type: gpt"), but the partition table is a protective MBR, which makes no sense in a non-GPT disk. > > My guess is that this disk was at some time partitioned with GPT (possibly it came that way from WD?), but then it was only used in machines with no kernel support for GPT. > Such a machine will happily treat that as a normal MBR and allow you to access the protective entry as a normal partition, which means you can create a filesystem on it and fill it with data, destroying the GPT structures. > > A GPT-aware kernel on the other hand will recognize that as a protective MBR and it will ignore it --but since the disk does not contain any valid GPT structures, it will not show any partitions. > > Try running "gdisk -l /dev/sdb"; for a valid GPT disk it will say: > > Partition table scan: > MBR: protective > BSD: not present > APM: not present > GPT: present > > If that's not the case and you have no GPT, you will have to fix things manually. > Since the disk is only 1TB, there is no reason to use GPT at all, so your best bet is to use fdisk to make that a standard MBR by changing the partition type from 'ee' to '83'. > > andrea > Hi Andreas, thank you very much for your analysis! :) when doing a gdisk -l /dev/sdb I get this Rocky Horror Picture Show: PT fdisk (gdisk) version 1.0.5 Caution: invalid main GPT header, but valid backup; regenerating main header from backup! Caution! After loading partitions, the CRC doesn't check out! Warning: Invalid CRC on main header data; loaded backup partition table. Warning! Main and backup partition tables differ! Use the 'c' and 'e' options on the recovery & transformation menu to examine the two tables. Warning! One or more CRCs don't match. You should repair the disk! Main header: ERROR Backup header: OK Main partition table: ERROR Backup partition table: ERROR Partition table scan: MBR: protective BSD: not present APM: not present GPT: damaged **************************************************************************** Caution: Found protective or hybrid MBR and corrupt GPT. Using GPT, but disk verification and recovery are STRONGLY recommended. **************************************************************************** Disk /dev/sdb: 1953458176 sectors, 931.5 GiB Model: Elements 25A2 Sector size (logical/physical): 512/512 bytes Disk identifier (GUID): BCA95A74-1E0A-4648-9971-20ED4049CAE5 Partition table holds up to 128 entries Main partition table begins at sector 2 and ends at sector 33 First usable sector is 34, last usable sector is 1953458142 Partitions will be aligned on 2048-sector boundaries Total free space is 1953458109 sectors (931.5 GiB) Number Start (sector) End (sector) Size Code Name "fix manually" scares me...especially because I have no place for 1TB of an image file to with which I can experiment ... Any ideas which could ease my burden and to un-scare my "need to fix it manually" ??? ;) ;) Cheers! Meino