Virtual Guru's Blog – Home of Virtualization Workshops

October 15, 2010

12minutes: Chromium OS Internals: Disk lauout of GPT partitions on USB and on DISK after install

Filed under: 12minutes, best_practices, ChromeOS — Tags: , — natiku @ 1:49 pm

12 Minutes: Chromium OS Chromium OS uses GPT with legacy bootloader (syslinux), see more in design doc Disk format and boot process

Here are outputs from modified freeBSD cGPT tool inside Chromum OS build chroot and gdisk / fdisk directly from Ubuntu host:

4GB USB disk with default 1802MB image

Note: cgpt complain about wrong gpt, becuase backup copy is not at the and of USB disk

sudo cgpt show /dev/sdc
     start      size    part  contents
         0         1          PMBR (Boot GUID: D2ACCE1D-B67D-0C4D-A791-A36900F3178A)
         1         1          Pri GPT header
         2        32          Pri GPT table
   1527808   2097152       1  Label: "STATE"
                              Type: Linux data
                              UUID: 717EF230-0AA3-A744-93CA-2212BA62ACF7
      4096     32768       2  Label: "KERN-A"
                              Type: ChromeOS kernel
                              UUID: 94CF1545-2BB0-F841-B2A1-56C89560C4C8
                              Attr: priority=15 tries=15 successful=1
     36864   1490944       3  Label: "ROOT-A"
                              Type: ChromeOS rootfs
                              UUID: 95E3D9F3-6BF1-C045-8F5F-5CA3DEBB4FD7
   3690496         1       4  Label: "KERN-B"
                              Type: ChromeOS kernel
                              UUID: 691D6955-7615-064F-96F2-01BD7A67EB2A
                              Attr: priority=0 tries=15 successful=0
   3690497         1       5  Label: "ROOT-B"
                              Type: ChromeOS rootfs
                              UUID: 32AFE02C-8EEC-4441-99CC-FC075B39C6E2
        34         1       6  Label: "KERN-C"
                              Type: ChromeOS kernel
                              UUID: 254AED55-595C-514B-A89B-6E250CC6DE2B
                              Attr: priority=0 tries=15 successful=0
        35         1       7  Label: "ROOT-C"
                              Type: ChromeOS rootfs
                              UUID: 336AF7DA-0299-424B-9BC0-A20BF8B3B16E
   3624960     32768       8  Label: "OEM"
                              Type: Linux data
                              UUID: FEA2E24B-1A8E-5741-B84D-3D42536EFDF5
        36         1       9  Label: "reserved"
                              Type: ChromeOS reserved
                              UUID: F32EE2ED-95B1-4F4D-B68D-0B7351C2B28C
        37         1      10  Label: "reserved"
                              Type: ChromeOS reserved
                              UUID: 46CFF8EF-B127-4440-9073-D30ECA8E5064
        38         1      11  Label: "reserved"
                              Type: ChromeOS reserved
                              UUID: 5FFA6676-EB0C-DC49-B5DE-4230AE959570
   3657728     32768      12  Label: "EFI-SYSTEM"
                              Type: EFI System Partition
                              UUID: D2ACCE1D-B67D-0C4D-A791-A36900F3178A
   7847903        32 INVALID  Sec GPT table
         1         1 INVALID  Sec GPT header

WARNING: one of the GPT header/entries is invalid, please run 'cgpt repair'
sudo gdisk -l /dev/sdc
GPT fdisk (gdisk) version 0.5.1

Partition table scan:
  MBR: protective
  BSD: not present
  APM: not present
  GPT: present

Found valid GPT with protective MBR; using GPT.
Disk /dev/sdc: 7847936 sectors, 3.7 GiB
Disk identifier (GUID): DAE73798-16FE-FD4D-9E54-10E2B59627FF
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 3690498
Total free space is 4058 sectors (2.0 MiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1         1527808         3624959   1024.0 MiB  0700  STATE
   2            4096           36863   16.0 MiB    FFFF  KERN-A
   3           36864         1527807   728.0 MiB   FFFF  ROOT-A
   4         3690496         3690496   512 bytes   FFFF  KERN-B
   5         3690497         3690497   512 bytes   FFFF  ROOT-B
   6              34              34   512 bytes   FFFF  KERN-C
   7              35              35   512 bytes   FFFF  ROOT-C
   8         3624960         3657727   16.0 MiB    0700  OEM
   9              36              36   512 bytes   FFFF  reserved
  10              37              37   512 bytes   FFFF  reserved
  11              38              38   512 bytes   FFFF  reserved
  12         3657728         3690495   16.0 MiB    EF00  EFI-SYSTEM
sudo gdisk /dev/sdc 
GPT fdisk (gdisk) version 0.5.1

Partition table scan:
  MBR: protective
  BSD: not present
  APM: not present
  GPT: present

Found valid GPT with protective MBR; using GPT.

Command (? for help): v

Problem: The secondary header's self-pointer indicates that it doesn't reside
at the end of the disk. If you've added a disk to a RAID array, use the 'e'
option on the experts' menu to adjust the secondary header's and partition
table's locations.

Identified 1 problems!
sudo fdisk -l /dev/sdc

WARNING: GPT (GUID Partition Table) detected on '/dev/sdc'! The util fdisk doesn't support GPT. Use GNU Parted.


Disk /dev/sdc: 4018 MB, 4018143232 bytes
256 heads, 63 sectors/track, 486 cylinders
Units = cylinders of 16128 * 512 = 8257536 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1               1         229     1845265+  ee  GPT
Partition 1 has different physical/logical endings:
     phys=(1023, 255, 63) logical=(228, 211, 55)

16GB SSD disk after installation

sudo cgpt show /dev/sda
     start      size    part  contents
         0         1          PMBR (Boot GUID: E4E10E72-0F22-7F4B-91BA-B2986B8A5115)
         1         1          Pri GPT header
         2        32          Pri GPT table
    266240  26812416       1  Label: "STATE"
                              Type: Linux data
                              UUID: 6B3AF6BD-C6CD-8146-8993-D8A4633EEC03
      4096     32768       2  Label: "KERN-A"
                              Type: ChromeOS kernel
                              UUID: CE957611-F675-D044-9D34-52B8F0A6E760
                              Attr: priority=15 tries=15 successful=0
  29175808   2097152       3  Label: "ROOT-A"
                              Type: ChromeOS rootfs
                              UUID: B7B39D41-D6B6-7042-B215-1450FBB782D2
     36864     32768       4  Label: "KERN-B"
                              Type: ChromeOS kernel
                              UUID: 8F13A57F-3F12-D748-A94C-27CAC4F9BBE2
                              Attr: priority=15 tries=15 successful=0
  27078656   2097152       5  Label: "ROOT-B"
                              Type: ChromeOS rootfs
                              UUID: FF6DF5B6-084F-6D4D-8338-84B6E9780FA8
        34         1       6  Label: "KERN-C"
                              Type: ChromeOS kernel
                              UUID: 0BB23871-F9B6-594A-9DCF-4FFC508B14E5
                              Attr: priority=0 tries=15 successful=0
        35         1       7  Label: "ROOT-C"
                              Type: ChromeOS rootfs
                              UUID: D84EDB3C-38D4-4747-8C57-BA83E4C4D2C2
     69632     32768       8  Label: "OEM"
                              Type: Linux data
                              UUID: DB724FE4-B022-A048-9D5F-5C8E47944EBA
        36         1       9  Label: "reserved"
                              Type: ChromeOS reserved
                              UUID: A02BDE18-01CB-824E-9EEC-B051C4F93F42
        37         1      10  Label: "reserved"
                              Type: ChromeOS reserved
                              UUID: C2AF51BC-DD09-C64B-8EE0-92950CB435DF
        38         1      11  Label: "reserved"
                              Type: ChromeOS reserved
                              UUID: F66D09B4-6394-0A43-B7D6-05ED8317BA4E
    233472     32768      12  Label: "EFI-SYSTEM"
                              Type: EFI System Partition
                              UUID: E4E10E72-0F22-7F4B-91BA-B2986B8A5115
  31277023        32          Sec GPT table
  31277055         1          Sec GPT header
sudo gdisk -l /dev/sda
GPT fdisk (gdisk) version 0.5.1

Partition table scan:
  MBR: protective
  BSD: not present
  APM: not present
  GPT: present

Found valid GPT with protective MBR; using GPT.
Disk /dev/sda: 31277056 sectors, 14.9 GiB
Disk identifier (GUID): 401C0339-533B-4040-A89F-BDCA4C531268
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 31277022
Total free space is 139192 sectors (68.0 MiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1          266240        27078655   12.8 GiB    0700  STATE
   2            4096           36863   16.0 MiB    FFFF  KERN-A
   3        29175808        31272959   1024.0 MiB  FFFF  ROOT-A
   4           36864           69631   16.0 MiB    FFFF  KERN-B
   5        27078656        29175807   1024.0 MiB  FFFF  ROOT-B
   6              34              34   512 bytes   FFFF  KERN-C
   7              35              35   512 bytes   FFFF  ROOT-C
   8           69632          102399   16.0 MiB    0700  OEM
   9              36              36   512 bytes   FFFF  reserved
  10              37              37   512 bytes   FFFF  reserved
  11              38              38   512 bytes   FFFF  reserved
  12          233472          266239   16.0 MiB    EF00  EFI-SYSTEM
sudo fdisk -l /dev/sda

WARNING: GPT (GUID Partition Table) detected on '/dev/sda'! The util fdisk doesn't support GPT. Use GNU Parted.


Disk /dev/sda: 16.0 GB, 16013852672 bytes
256 heads, 63 sectors/track, 1939 cylinders
Units = cylinders of 16128 * 512 = 8257536 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1        1940    15638527+  ee  GPT
Advertisements

Leave a Comment »

No comments yet.

RSS feed for comments on this post.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Create a free website or blog at WordPress.com.

%d bloggers like this: