New issue
Advanced search Search tips

Issue 702185 link

Starred by 1 user

Issue metadata

Status: Untriaged
Owner: ----
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 2
Type: Bug



Sign in to add a comment

cgpt does not work. WARNING: Secondary GPT header is invalid

Reported by user.spa...@gmail.com, Mar 16 2017

Issue description

UserAgent: Mozilla/5.0 (X11; CrOS armv7l 9000.91.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.110 Safari/537.36
Platform: 9000.91.0 (Official Build) stable-channel daisy

Steps to reproduce the problem:
1. Insert USB drive (/dev/sda)
2. cgpt create /dev/sda
3. Remove USB, re-insert, run "cgpt show /dev/sda"

What is the expected behavior?
I expect to be able to create a GUID Partition Table.

What went wrong?
I was not able to create a GUID Partition Table.

The initial operation results in a warning:

localhost / # cgpt create /dev/sda
WARNING: Primary GPT header is invalid
WARNING: Secondary GPT header is invalid

But if I look at the table I just created, it appears to be fine:

localhost / # cgpt show /dev/sda
       start        size    part  contents
           0           1          PMBR
           1           1          Pri GPT header
           2          32          Pri GPT table
    16383967          32          Sec GPT table
    16383999           1          Sec GPT header

Then if I remove the USB drive, and re-insert it, and then check the GUID Partition Table, it is bad:

localhost / # cgpt show /dev/sda
WARNING: Secondary GPT header is invalid
       start        size    part  contents
           0           1          PMBR
           1           1          Pri GPT header
           2          32          Pri GPT table
           0           0          Sec GPT table
           1           1 INVALID  Sec GPT header
WARNING: One of the GPT headers/entries is invalid

Did this work before? No 

Chrome version: 56.0.2924.110  Channel: n/a
OS Version: 9000.91.0
Flash Version: Shockwave Flash 24.0 r0

I am trying to create a GPT that will allow me to boot from USB or SD Card on my Chromebook. I was following directions from https://archlinuxarm.org/platforms/armv7/samsung/samsung-chromebook

I understand the method there may not be supported, but I can't even create a stable GPT. I have reproduced this on 2 different USB drives, using both USB Ports, and also on an SD Card.

I have a crouton chroot with Ubuntu 12.04, and I used gdisk to create a GPT, but I experience the same problems. I don't know if the issue is with cgpt, or underlying software.

From a different computer, I used one of my USB drives to successfully create a Chrome OS Recovery drive, using the Linux method. Therefore I know that that USB drive is capable of holding a valid GPT with Chrome attributes.
 
I just tested this again, with the 2GB drive that I know works.

I carefully ran "sync" after every cgpt operation, removed the drive, and plugged it back in, and clicked "eject" from the file manager window before the next operation. I didn't get the same results.

I set up the following partition scheme:
localhost local # cgpt show /dev/sda
       start        size    part  contents
           0           1          PMBR
           1           1          Pri GPT header
           2          32          Pri GPT table
        8192       32768       1  Label: "Kernel"
                                  Type: ChromeOS kernel
                                  UUID: C6815573-9813-1842-BE7D-C953B705F9BB
                                  Attr: priority=10 tries=5 successful=1 
       40960     3891167       2  Label: "Root"
                                  Type: Linux data
                                  UUID: 8B04C831-D857-394D-9DE1-96ADD3F97961
     3932127          32          Sec GPT table
     3932159           1          Sec GPT header

And I ran "mkfs.ext4 /dev/sda2", which apparently completed without error. Then I went through the process of running "sync", etc.

But then when I tried to mount /dev/sda2, it would not mount:

localhost local # mount /dev/sda2 test
mount: wrong fs type, bad option, bad superblock on /dev/sda2,
       missing codepage or helper program, or other error

       In some cases useful info is found in syslog - try
       dmesg | tail or so.


"dmesg | tail" provides no new messages after this error.

So I don't know if I have a good or bad ext4 filesystem, but I certainly can't mount it.
I created a new partition table, like in Comment 1, but this time the "Root" partition size is 3887104 sectors, so that it aligns to the 2MB sector specification outlined in https://www.chromium.org/chromium-os/chromiumos-design-docs/disk-format

However, there is no change in the mounting error. In fact, after running "mkfs.ext4 /dev/sda2" (to format the "Root" partition), my partition table becomes corrupted:

localhost local # cgpt show /dev/sda
WARNING: Secondary GPT header is invalid
       start        size    part  contents
           0           1          PMBR
           1           1          Pri GPT header
           2          32          Pri GPT table
        8192       32768       1  Label: "Kernel"
                                  Type: ChromeOS kernel
                                  UUID: 326891F3-0B05-454D-AA1B-F7FF0DA926FD
                                  Attr: priority=10 tries=5 successful=1 
       40960     3887104       2  Label: "Root"
                                  Type: Linux data
                                  UUID: BBA60309-7CEE-9C49-8E78-609EBC85CF81
           0           0 INVALID  Sec GPT table
           1           1 INVALID  Sec GPT header
WARNING: One of the GPT headers/entries is invalid

localhost local #

So this backs the problem up. Before I thought I could write a filesystem, but just couldn't mount it. Now I realize I can't write a filesystem.
Components: OS>Kernel
Status: Untriaged (was: Unconfirmed)

Sign in to add a comment