Date: Sun, 12 May 2013 19:09:15 -0500 From: Larry Rosenman <ler@lerctr.org> To: freebsd-stable@freebsd.org Subject: Re: Reinstalling boot blocks on a ZFS-only system Message-ID: <f8c0516e9dc1ec3ad2ca3d86c0cb4176@webmail.lerctr.org> In-Reply-To: <20130512205837.GA69605@icarus.home.lan> References: <A6940C2F-17B4-4ECF-85B6-BA8CB335486E@distal.com> <20130512205837.GA69605@icarus.home.lan>
next in thread | previous in thread | raw e-mail | index | archive | help
On 2013-05-12 15:58, Jeremy Chadwick wrote: > 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". Assuming a freebsd-boot type partition, and GPT type partition scheme, this is what I use on my ZFS boot system: $ cat bin/update_boot.sh #!/bin/sh for i in `seq 0 5` do echo Disk ${i} gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 ada${i} done $ -- Larry Rosenman http://www.lerctr.org/~ler Phone: +1 214-642-9640 (c) E-Mail: ler@lerctr.org US Mail: 430 Valona Loop, Round Rock, TX 78681-3893
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?f8c0516e9dc1ec3ad2ca3d86c0cb4176>