Reinstalling boot blocks on a ZFS-only system

Jeremy Chadwick jdc at koitsu.org
Sun May 12 20:58:39 UTC 2013


On Sun, May 12, 2013 at 04:50:46PM -0400, Chris Ross wrote:
> 
>   So, I've long known and it makes sense that when you're booted from a ZFS volume, you can't mess with the boot-loader.  And, I know a few months ago I had a set of commands I would use when booted from a CD that would initialize the network and copy the "release/boot" from somewhere else so that I could install bootblocks and boot-loaders from more recent code.  Sadly, I didn't _record_ those commands I was using.
> 
>   What do "people in the know" do when they want to update the bootblocks of a ZFS-boot system?  Or, have too few people followed this path so far that they can boot UFS and do it with less difficulty?

The command is "gpart bootcode", however I cannot be bothered to
remember the syntax; I imagine it greatly depends on if you're using GPT
vs. MBR, in addition to what your partition layout look like.  Meaning:
there is no "universal standard", it depends entirely on how you set
your stuff up.  But the command is definitely "gpart bootcode".

Next, AFAIK there is no need to boot alternate media (CD etc.) to
accomplish this.

You may also need to set kern.geom.debugflags=0x10 to inhibit GEOM's
"safety measure" / to permit writing to LBA 0; see GEOM(4) and search
for the word "foot".

-- 
| Jeremy Chadwick                                   jdc at koitsu.org |
| UNIX Systems Administrator                http://jdc.koitsu.org/ |
| Mountain View, CA, US                                            |
| Making life hard for others since 1977.             PGP 4BD6C0CB |


More information about the freebsd-stable mailing list