- Use a
memstick.img
file to write a FreeBSD installer to a memory stick - boot from the stick in single user mode
/bin/csh
- use gpart(8) to resize things
growfs /
mount -uw /
- assuming vt(4)
setenv TERM xterm-clear
bsdconfig vt_keymap
- select, and continue with, a keymap that matches your keyboard layout
reboot -r
- live system
- login as root, no password
mount -uw /
bsdconfig networking
- get an Internet connection – for example, enable DHCP for a network interface
- assuming root-on-ZFS
zpool import
- note the name of the pool that you want to import – for example, damp
zpool import -R /tmp/altroot damp
zpool get bootfs damp
- note the value – for example, damp/ROOT/test
zfs mount damp/ROOT/test
pkg bootstrap
- add a minimal FreeBSD-base repository configuration to
/etc/pkg/FreeBSD.conf
– urlhttps://pkg.freebsd.org/FreeBSD:14:amd64/base_release_3
pkg --rootdir /tmp/altroot install --repository FreeBSD-base FreeBSD-certctl FreeBSD-pkg-bootstrap FreeBSD-utilities
chroot /tmp/altroot
cd /root
fetch https://tinyurl.com/pkgbasify-foundation -o ./pkgbasify.lua
chmod +x ./pkgbasify.lua
mkdir -p /var/db/etcupdate/current
./pkgbasify.lua
Last active
September 14, 2025 14:34
-
-
Save grahamperrin/9570092c127bd43777961b6f016e75ba to your computer and use it in GitHub Desktop.
Using pkgbasify to repair a broken installation of FreeBSD 14.3-RELEASE
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Backlinks: