Re: Using a recovery partition to repair a broken installation of FreeBSD

From: Tomoaki AOKI <junchoon_at_dec.sakura.ne.jp>
Date: Wed, 03 Sep 2025 09:30:16 UTC
On Tue, 2 Sep 2025 13:26:53 -0600
Warner Losh <imp@bsdimp.com> wrote:

> On Tue, Sep 2, 2025 at 12:53 PM Graham Perrin <grahamperrin@gmail.com>
> wrote:
> 
> > On 01/09/2025 02:58, Graham Perrin wrote:
> > > An enhancement to bsdinstall could, before creation of the partition
> > > table, allow the user to specify an amount of space to be left free at
> > > the end of a device …
> >
> >
> > For now, short term, is the (simple) free space idea attractive?
> >
> > Longer term: I'm not averse to more complex enhancements around e.g.
> > /rescue/, however I _do_ like the idea of free space.
> >
> > Freedom for the user to do whatever they want. They might, or might not,
> > want to use the space for the content of
> > FreeBSD-15.0-RELEASE-amd64-memstick.img … and so on. Maybe this overlaps
> > with ZFS-specific bsdinstall report
> > <https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=242983>.
> >
> 
> Things are small enough, I'd rather just create it in the ESP directly.
> Special reserved space on disks are nothing but a pain.
> 
> Warner

What I imagine with this specific use-case (example):

  1. Create 250MB ESP as, i.e., nda0p1
  2. Create freebsd-zfs for all remained amount after 3., as nda0p2
  3. Create 64GB freebsd-swap as nda0-3 at the end of the drive

In this case, I need to calculate the (aligned) size of 2. manually,
which is a bit pain.

Something like
  gpart add -a 1M -t freebsd-zfs -l zfsNVMe001 -i 2 -s fill nda0
then create -i 3 and later, and finally
  gpart commit
actually create second and later partitions would be helpful.

-- 
Tomoaki AOKI    <junchoon@dec.sakura.ne.jp>