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?
Thanks. Happy for any information.
- Chris
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 |
In article <20130512205837.GA69605 at icarus.home.lan>, jdc at koitsu.org writes:>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".If you have set up your partitioning properly (read: following the clearly recommended best practice on the wiki), there should never, ever be any reason to do this. (That is why it's called a DEBUG flag.) The necessary and sufficient invocation is: # gpart bootcode -b /boot/pmbr -p /boot/gptzfsloader -i 1 [a]daX I have no idea how this works with MBR partitioning, but I would make one suggestion in that regard: DON'T. Whatever makes you think you want to do that, think harder and find another way. -GAWollman