If create small "freebsd-boot" => 40 30712240 da0 GPT (15G) 40 1600 1 efi (800K) 1640 32 2 freebsd-boot (16K) gptzfsboot too big for created partition # gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 2 da0 gpart: /dev/da0p2: No error: 0
A commit references this bug: Author: ae Date: Tue Jul 21 06:18:43 UTC 2015 New revision: 285735 URL: https://svnweb.freebsd.org/changeset/base/285735 Log: lseek() allows an offset to be set beyond the end of file. Using it to check that partition has enough space to write bootcode doesn't work. Use the known size of provider instead. PR: 201504 MFC after: 1 week Changes: head/sbin/geom/class/part/geom_part.c
Thanks, works perfectly # gpart show md0 => 40 204720 md0 GPT (100M) 40 204720 - free - (100M) # gpart add -t freebsd-boot -s 16K md0 md0p1 added # gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 md0 gpart: /dev/md0p1: not enough space
A commit references this bug: Author: ae Date: Tue Jul 28 08:22:51 UTC 2015 New revision: 285936 URL: https://svnweb.freebsd.org/changeset/base/285936 Log: MFC r285735: lseek() allows an offset to be set beyond the end of file. Using it to check that partition has enough space to write bootcode doesn't work. Use the known size of provider instead. PR: 201504 Changes: _U stable/10/ stable/10/sbin/geom/class/part/geom_part.c
A commit references this bug: Author: ae Date: Tue Jul 28 08:25:50 UTC 2015 New revision: 285937 URL: https://svnweb.freebsd.org/changeset/base/285937 Log: MFC r285735: lseek() allows an offset to be set beyond the end of file. Using it to check that partition has enough space to write bootcode doesn't work. Use the known size of provider instead. PR: 201504 Changes: _U stable/9/sbin/geom/class/part/ stable/9/sbin/geom/class/part/geom_part.c
Fixed in head/, stable/10 and stable/9. Thanks!