Gentoo Archives: gentoo-user

From: Andrea Conti <alyf@××××.net>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Trouble with backup harddisks
Date: Thu, 30 Apr 2020 13:44:55
Message-Id: 22faa7cf-7291-b430-c646-b96c6d428f19@alyf.net
In Reply to: Re: [gentoo-user] Trouble with backup harddisks by Wols Lists
1 Hi,
2
3 >> CONFIG_PARTITION_ADVANCED=y
4 >> CONFIG_MSDOS_PARTITION=y
5 >> CONFIG_EFI_PARTITION=y
6
7 That's all you need.
8
9 > This could be the key. Sector sizes have been changing from 512 to 4096
10 > over many years. If your kernel has been updated to expect/use 4096 byte
11 > sectors, it might not be able to read the disk properly.
12
13 Sector size is only a (fixed) property of a specific block device, not something expected or required by the kernel.
14 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).
15
16 > Disklabel type: dos
17
18 > Device Boot Start End Sectors Size Id Type
19 > /dev/sdb1 1 1953458175 1953458175 931.5G ee GPT
20
21 That looks... broken.
22 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.
23
24 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.
25 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.
26
27 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.
28
29 Try running "gdisk -l /dev/sdb"; for a valid GPT disk it will say:
30
31 Partition table scan:
32 MBR: protective
33 BSD: not present
34 APM: not present
35 GPT: present
36
37 If that's not the case and you have no GPT, you will have to fix things manually.
38 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'.
39
40 andrea

Replies

Subject Author
Re: [gentoo-user] Trouble with backup harddisks tuxic@××××××.de