Date: Thu, 1 Sep 2022 19:16:43 -0700 From: Dan Mahoney <freebsd@gushi.org> To: paul beard <paulbeard@gmail.com> Cc: FreeBSD-questions <freebsd-questions@freebsd.org> Subject: Re: making a disk/slice bootable Message-ID: <47C13690-BE4D-42E5-830F-33309F553676@gushi.org> In-Reply-To: <CAMtcK2rsnAJUTrLfmUJxKOwZJkOW1UXDs5U--8Kz=QHuM%2B-eog@mail.gmail.com> References: <CAMtcK2r4L3SCba4EZt73=F2=fnBnEPGvEL3GCM_38R8_e5meXg@mail.gmail.com> <07BE254D-7701-47F2-94E3-09ED7229FB2B@gushi.org> <A99C0412-FD34-46D6-AB9A-AFC45FB10C10@gushi.org> <CAMtcK2qd%2BKstLC1oKZm9OPaOYh=gSHxYV=ZjCud2AF5G4n=-Aw@mail.gmail.com> <03F3F917-CCF5-44BB-85F0-00AD3ADF9818@gushi.org> <CAMtcK2rsnAJUTrLfmUJxKOwZJkOW1UXDs5U--8Kz=QHuM%2B-eog@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
--Apple-Mail=_1FEFD667-DD7D-4CD7-A209-A82657ED7E0A Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Sep 1, 2022, at 19:10, paul beard <paulbeard@gmail.com> wrote: >=20 > Thanks! That worked just fine but the mirrored/cloned disk has issues. Which you didn't describe at all. > And with no way to get 11.x source,=20 Uh, what? = http://ftp-archive.freebsd.org/pub/FreeBSD-Archive/old-releases/amd64/11.2= -RELEASE/ = <http://ftp-archive.freebsd.org/pub/FreeBSD-Archive/old-releases/amd64/11.= 2-RELEASE/> Or use git: https://freebsdfoundation.org/updating-freebsd-from-git/ = <https://freebsdfoundation.org/updating-freebsd-from-git/> Or just try freebsd-update ids > I think I have some decisions to make about this system: upgrade and = somehow move all the services across or just quit pretending I = understand any of this stuff.=20 Without knowing how your system is damaged I can't help this, but if = you've been doing things in a mostly freebsd-stable way, most of what = you need should be in /etc, /usr/local/etc, and /var. -Dan >=20 > Thanks again for the help=E2=80=A6 >=20 > On Thu, Sep 1, 2022 at 5:52 PM Dan Mahoney <freebsd@gushi.org = <mailto:freebsd@gushi.org>> wrote: > I haven't used recoverdisk. If you're going to mirror, use one of the = other things I mentioned. gmirror is low-impact and easy enough to use = and supported by the various boot loaders. >=20 > If you're just cloning disk to similar disk with rsync, you should not = need to do this more than once, unless maybe if you upgrade your system. = Normal freebsd-update upgrades do not generally touch the boot blocks. = The best advice I can give is "test this BEFORE you need it". Rip your = primary drive out and see if you still boot. >=20 > For a lightweight system, even zfs mirroring is okay, but it does use = some ram for caching and the like, so I wouldn't try it with a tiny = embedded box. >=20 > -Dan >=20 >> On Sep 1, 2022, at 17:47, paul beard <paulbeard@gmail.com = <mailto:paulbeard@gmail.com>> wrote: >>=20 >> yeah, I was pretty sure I was using the wrong tool=E2=80=A6thanks for = this.=20 >>=20 >> So a further Q=E2=80=A6if I continue to use recoverdisk from ports to = mirror my boot disk to a copy, is it best practice to do this on the = mirror after the mirroring is completed? For all I know there is a far = better way to do that but this is a FreeBSD 11 system (!) that has just = been doing its thing for some years. So it worked (more or less) when it = was set up. A backup you can't use isn't much use, as I have learned = (again, I expect).=20 >>=20 >> On Thu, Sep 1, 2022 at 5:20 PM Dan Mahoney <freebsd@gushi.org = <mailto:freebsd@gushi.org>> wrote: >> > >> > Fdisk is for old-school partitions (where disks had only 1-4 = primary partitions, and then subdivided those partitions into "slices" = (bsdlabel). >> > >> > I'm pretty sure the command you're looking for is: >> > >> > gpart bootcode -b /boot/pmbr -p /boot/gptboot -i 1 ada1 >> > >> > In english, this says: >> > >> > * Stick the "protective master boot record" on the root of the disk = (/boot/pmbr) >> > * Write a partition boot label from the file specified... >> > * to this indexed partition (-i 1) >> > * ...on ada1 >> > >> > =46rom there, you may need to tell the stage 0 loader where to find = your next bootable partition on the next boot() prompt. >> > >> > -Dan >> > >> > >> > > On Sep 1, 2022, at 16:44, Dan Mahoney <freebsd@gushi.org = <mailto:freebsd@gushi.org>> wrote: >> > > >> > > >> > > >> > >> On Sep 1, 2022, at 16:41, paul beard <paulbeard@gmail.com = <mailto:paulbeard@gmail.com>> wrote: >> > >> >> > >> I have been mirroring the virtual disk in a FreeBSD vm for a = couple of years and the main disk got corrupted. The mirrored disk = doesn't boot, says it can't find a kernel, so I think I missed out on an = additional step, writing an MBR or boot sector, perhaps. >> > >> >> > >> The files are all there if I mount them from a VM with FreeBSD.I = assume there is a way to make a mountable disk bootable. fdisk and = gpart are available but it's been a long time since I messed around with = those. >> > > >> > > Let's start with the obvious: Can you post your disk layout? = Mirrored how? Gmirror/ZFS/Hardware raid/etc? MBR or Gpart? >> > > >> > > What commands have you tried thusfar? >> > > >> > > What does the boot so far look like (i.e. are you hitting the = stage 0 boot loader, and getting the loader prompt?) >> > > >> > > More info required, please, but this sounds very fixable. >> > > >> > > -Dan >> > >>=20 >>=20 >> -- >> Paul Beard / www.paulbeard.org/ <http://www.paulbeard.org/> >=20 >=20 > --=20 > Paul Beard / www.paulbeard.org/ <http://www.paulbeard.org/> --Apple-Mail=_1FEFD667-DD7D-4CD7-A209-A82657ED7E0A Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8 <html><head><meta http-equiv=3D"Content-Type" content=3D"text/html; = charset=3Dutf-8"></head><body style=3D"word-wrap: break-word; = -webkit-nbsp-mode: space; line-break: after-white-space;" class=3D""><br = class=3D""><div><br class=3D""><blockquote type=3D"cite" class=3D""><div = class=3D"">On Sep 1, 2022, at 19:10, paul beard <<a = href=3D"mailto:paulbeard@gmail.com" class=3D"">paulbeard@gmail.com</a>>= wrote:</div><br class=3D"Apple-interchange-newline"><div class=3D""><div = dir=3D"ltr" class=3D"">Thanks! That worked just fine but the = mirrored/cloned disk has issues.</div></div></blockquote><div><br = class=3D""></div><div>Which you didn't describe at all.</div><br = class=3D""><blockquote type=3D"cite" class=3D""><div class=3D""><div = dir=3D"ltr" class=3D"">And with no way to get 11.x source, <br = class=3D""></div></div></blockquote><div><br class=3D""></div><div>Uh, = what?</div><div><br class=3D""></div><div><a = href=3D"http://ftp-archive.freebsd.org/pub/FreeBSD-Archive/old-releases/am= d64/11.2-RELEASE/" = class=3D"">http://ftp-archive.freebsd.org/pub/FreeBSD-Archive/old-releases= /amd64/11.2-RELEASE/</a></div><div><br class=3D""></div><div>Or use = git:</div><div><br class=3D""></div><div><a = href=3D"https://freebsdfoundation.org/updating-freebsd-from-git/" = class=3D"">https://freebsdfoundation.org/updating-freebsd-from-git/</a></d= iv><div><br class=3D""></div><div>Or just try freebsd-update = ids</div><div><br class=3D""></div><div><blockquote type=3D"cite" = class=3D""><div dir=3D"ltr" class=3D"">I think I have some = decisions to make about this system: upgrade and somehow move = all the services across or just quit pretending I understand any of = this stuff. </div></blockquote><br class=3D""></div><div>Without = knowing how your system is damaged I can't help this, but if you've been = doing things in a mostly freebsd-stable way, most of what you need = should be in /etc, /usr/local/etc, and /var.</div><div><br = class=3D""></div><div>-Dan</div><div><br class=3D""></div><br = class=3D""><blockquote type=3D"cite" class=3D""><div class=3D""><div = dir=3D"ltr" class=3D""><div class=3D""><br class=3D""></div><div = class=3D"">Thanks again for the help=E2=80=A6</div></div><br = class=3D""><div class=3D"gmail_quote"><div dir=3D"ltr" = class=3D"gmail_attr">On Thu, Sep 1, 2022 at 5:52 PM Dan Mahoney <<a = href=3D"mailto:freebsd@gushi.org" class=3D"">freebsd@gushi.org</a>> = wrote:<br class=3D""></div><blockquote class=3D"gmail_quote" = style=3D"margin:0px 0px 0px = 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(= 204,204,204);padding-left:1ex"><div = style=3D"word-wrap:break-word;line-break:after-white-space" class=3D"">I = haven't used recoverdisk. If you're going to mirror, use one of = the other things I mentioned. gmirror is low-impact and easy = enough to use and supported by the various boot loaders.<div = class=3D""><br class=3D""></div><div class=3D"">If you're just cloning = disk to similar disk with rsync, you should not need to do this more = than once, unless maybe if you upgrade your system. Normal = freebsd-update upgrades do not generally touch the boot blocks. = The best advice I can give is "test this BEFORE you need it". Rip = your primary drive out and see if you still boot.<br class=3D""><div = class=3D""><br class=3D""></div><div class=3D"">For a lightweight = system, even zfs mirroring is okay, but it does use some ram for caching = and the like, so I wouldn't try it with a tiny embedded box.<br = class=3D""><div class=3D""><br class=3D""></div><div = class=3D"">-Dan</div><div class=3D""><br class=3D""><blockquote = type=3D"cite" class=3D""><div class=3D"">On Sep 1, 2022, at 17:47, paul = beard <<a href=3D"mailto:paulbeard@gmail.com" target=3D"_blank" = class=3D"">paulbeard@gmail.com</a>> wrote:</div><br class=3D""><div = class=3D""><div dir=3D"ltr" class=3D"">yeah, I was pretty sure I was = using the wrong tool=E2=80=A6thanks for this. <br class=3D""><br = class=3D"">So a further Q=E2=80=A6if I continue to use recoverdisk from = ports to mirror my boot disk to a copy, is it best practice to do this = on the mirror after the mirroring is completed? For all I know there is = a far better way to do that but this is a FreeBSD 11 system (!) that has = just been doing its thing for some years. So it worked (more or less) = when it was set up. A backup you can't use isn't much use, as I have = learned (again, I expect). <br class=3D""><br class=3D"">On Thu, Sep 1, = 2022 at 5:20 PM Dan Mahoney <<a href=3D"mailto:freebsd@gushi.org" = target=3D"_blank" class=3D"">freebsd@gushi.org</a>> wrote:<br = class=3D"">><br class=3D"">> Fdisk is for old-school partitions = (where disks had only 1-4 primary partitions, and then subdivided those = partitions into "slices" (bsdlabel).<br class=3D"">><br class=3D"">>= I'm pretty sure the command you're looking for is:<br class=3D"">><br = class=3D"">> gpart bootcode -b /boot/pmbr -p /boot/gptboot -i 1 = ada1<br class=3D"">><br class=3D"">> In english, this says:<br = class=3D"">><br class=3D"">> * Stick the "protective master boot = record" on the root of the disk (/boot/pmbr)<br class=3D"">> * Write = a partition boot label from the file specified...<br class=3D"">> * = to this indexed partition (-i 1)<br class=3D"">> * ...on ada1<br = class=3D"">><br class=3D"">> =46rom there, you may need to tell = the stage 0 loader where to find your next bootable partition on the = next boot() prompt.<br class=3D"">><br class=3D"">> -Dan<br = class=3D"">><br class=3D"">><br class=3D"">> > On Sep 1, = 2022, at 16:44, Dan Mahoney <<a href=3D"mailto:freebsd@gushi.org" = target=3D"_blank" class=3D"">freebsd@gushi.org</a>> wrote:<br = class=3D"">> ><br class=3D"">> ><br class=3D"">> ><br = class=3D"">> >> On Sep 1, 2022, at 16:41, paul beard <<a = href=3D"mailto:paulbeard@gmail.com" target=3D"_blank" = class=3D"">paulbeard@gmail.com</a>> wrote:<br class=3D"">> = >><br class=3D"">> >> I have been mirroring the virtual = disk in a FreeBSD vm for a couple of years and the main disk got = corrupted. The mirrored disk doesn't boot, says it can't find a kernel, = so I think I missed out on an additional step, writing an MBR or boot = sector, perhaps.<br class=3D"">> >><br class=3D"">> >> = The files are all there if I mount them from a VM with FreeBSD.I assume = there is a way to make a mountable disk bootable. fdisk and gpart = are available but it's been a long time since I messed around with = those.<br class=3D"">> ><br class=3D"">> > Let's start with = the obvious: Can you post your disk layout? Mirrored how? = Gmirror/ZFS/Hardware raid/etc? MBR or Gpart?<br class=3D"">> = ><br class=3D"">> > What commands have you tried thusfar?<br = class=3D"">> ><br class=3D"">> > What does the boot so far = look like (i.e. are you hitting the stage 0 boot loader, and getting the = loader prompt?)<br class=3D"">> ><br class=3D"">> > More = info required, please, but this sounds very fixable.<br class=3D"">> = ><br class=3D"">> > -Dan<br class=3D"">><br class=3D""><br = class=3D""><br class=3D"">--<br class=3D"">Paul Beard / <a = href=3D"http://www.paulbeard.org/" target=3D"_blank" = class=3D"">www.paulbeard.org/</a></div> </div></blockquote></div><br = class=3D""></div></div></div></blockquote></div><br clear=3D"all" = class=3D""><div class=3D""><br class=3D""></div>-- <br class=3D""><div = dir=3D"ltr" class=3D"gmail_signature">Paul Beard / <a = href=3D"http://www.paulbeard.org/" target=3D"_blank" = class=3D"">www.paulbeard.org/</a><br class=3D""></div> </div></blockquote></div><br class=3D""></body></html>= --Apple-Mail=_1FEFD667-DD7D-4CD7-A209-A82657ED7E0A--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?47C13690-BE4D-42E5-830F-33309F553676>