[Bug 229977] geom/gpart does not care about GPT size, silently creates partitions that won't be persisted after reboot

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Mon Jul 23 12:03:04 UTC 2018


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=229977

            Bug ID: 229977
           Summary: geom/gpart does not care about GPT size, silently
                    creates partitions that won't be persisted after
                    reboot
           Product: Base System
           Version: CURRENT
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: kern
          Assignee: bugs at FreeBSD.org
          Reporter: greg at unrelenting.technology

So I've been trying to depenguinate a VPS that doesn't allow additional drives
to be mounted. pivot_root into a tmpfs on Linux, dd the FreeBSD memstick image
onto the disk, reboot into the installer, partition using shell, gpart recover
(to move backup GPT to the end), gpart add, zpool create, etc. etc., install,
reboot. Oops, no ZFS pools found. Booting into the installer again, and that
third GPT partition I created simply does not exist!

Turns out the partition table size is limited to 2 entries.

Linux's gdisk utility is smart: trying to create a partition results in an
error: "No table partition entries left".

While geom/gpart did not check the size and just created a partition that
actually silently was not saved!!

Using expert mode in gdisk, I resized the partition table from 2 entries to 4
(using 128 results in "Main partition table overlaps the first partition by 31
blocks! Try reducing the partition table size by 124 entries.", but hey, 4 is
enough for the VPS.) And everything worked fine.

Other people have stumbled upon this before:
https://lists.freebsd.org/pipermail/freebsd-questions/2018-January/280562.html

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-bugs mailing list