I did this days ago but I guess I never sent it.
On 07/03/2018 08:04 AM, Nicolas Dechesne wrote:
On Tue, Jul 3, 2018 at 1:13 PM William Mills wmills@ti.com wrote:
On 07/03/2018 05:08 AM, Nicolas Dechesne wrote:
On Mon, Jul 2, 2018 at 11:59 PM Alexander Graf agraf@suse.de wrote:
On 02.07.18 20:40, William Mills wrote:
On 07/02/2018 12:15 PM, Daniel Thompson wrote:
On Sun, Jul 01, 2018 at 10:37:49AM -0400, William Mills wrote:
I am still trying to figure out if a real issue exists or will soon exist. If this issue is real, I think it should be addressed in UEFI but if not there then in EBBR. We move "disks" around a lot more than other people do.
Yes, let's double check with Hannes :).
On Dragonboard 820c, that has on board UFS disk:
Found valid GPT with protective MBR; using GPT. Disk /dev/sda: 6335488 sectors, 24.2 GiB Model: THGBF7G8K4LBATRB Sector size (logical/physical): 4096/4096 bytes
Interesting. Can you also "hd" the first 8K of that device? (should be <1K of data with >7k of zeros mixed in. hd suppresses repeated lines so the dump should not be too long.)
Decoding mostly for myself but you all can listen in...
root@db820c:~# hd -n 8192 /dev/sda 00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
No X86 boot code
[ 000001b8 00 00 00 00 ] MBR disk sig == 0 as required
[ 000001bc 00 00 ] reserved
[ 000001be 00 00 ]
000001c0 02 00 ee ff ff ff 01 00 00 00 ff ab 60 00 00 00 |............`...| 000001d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
Only 1 partition Not bootable Starting CHS = 0x00,0x02,0x00 C = 0 H = 0 S = 2 (1 based)
OSType = 0xee == GPT Protective
Ending CHS = 0xff, 0xff, 0xff C = 1023 (0 based, 1024 cylinders) H = 255 (0 based, 256 heads per cyl) S = 63 (1 based, 63 sectors per track)
StartingLBA = 0x0000_0001 EndingLBA = 0x0060_abff
000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 aa |..............U.|
MBR signature
00000200 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
Yes, the rest of the MBR LBA is in fact 0 filled
00001000 45 46 49 20 50 41 52 54 00 00 01 00 5c 00 00 00 |EFI PART
GPT Header sig
00 00 01 00 5c 00 00 00
GPT Version 1 and header length of 92 bytes
00001010 5e 01 f2 67
Header CRC
00 00 00 00
4 bytes resv
01 00 00 00 00 00 00 00
MyLBA=1
00001020 ff ab 60 00 00 00 00 00
AlternateLBA=0x60abff = 6,335,488 "sectors" - 1 (matches above exactly)
06 00 00 00 00 00 00 00
FirstUsableLBA = 6
00001030 fa ab 60 00 00 00 00 00
LastUsableLBA=0x60abfa
So any of the LBA's 0x60ab{fb,fc,fd,fe} can contain the 1 LB of Alt partition table. (See below) (I would presume fb.) The others are presumably empty.
32 1b 10 98 e2 bb f2 4b 00001040 a0 6e 2b b3 3d 00 0c 20
DiskGUID
02 00 00 00 00 00 00 00
PartitionEntryLBA=2
00001050 08 00 00 00 80 00 00 00
NumberOfPartitionEntries=8 SizeofPartitionEntries=0x80
8*0x80 = 4K == 1 LB FirstUsable above is 6 So LBA's 3, 4, and 5 are free in this GPT structure. I presume this platform has firmware stuffed in there.
42 c6 95 4a
CRC of partition table
00 00 00 00> 00001060 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
reserved
----- Even Deeper Dive WRT EndingCHS in the MBR the spec says:
""" Set to the CHS address of the last logical block on the disk. Set to 0xFFFFFF if it is not possible to represent the value in this field """
The max disksize for 512 byte sectors in CHS is 7.8 GB. The CHS limit for 4K sectors should be 61 GB. However, assuming 63 sectors and 256 heads you can not represent the exact size of the disk. 392 cylinders is too small and 393 is too big. I believe that the ending head and ending sector are also used as max head and max cylinders for the whole disk. This means you can not represent a fractional cylinder.
(This assumption had escaped me until now. I never understood how fdisk would let me change the number of "heads" and "sectors" on a USB stick.)
Bill