0 2] Repair a broken system
Loic edited this page 2022-11-08 17:33:36 +00:00

This presents a way to repair a damaged HardenedBSD system with the installation media (Live-CD). In the example, the ZFS file system is used.

  1. Download the HardenedBSD installation media.

  2. Boot on this and select "Live CD" (the username is "root" without password).

  3. If you want to choice other keybord, use kbdmap command.

  4. You probably need to enable DHCP on your network card via the command: dhclient em0

  5. You may need to know your partitions: gpart show

  6. Run zpool import to get name of zpool (probably zroot): zpool import

  7. Create a mountpoint for zpool: mkdir -p /tmp/zroot

  8. Import zpool: zpool import -fR /tmp/zroot zroot

  9. Create a mountpoint for zfs /: mkdir /tmp/root

  10. Mount / (the directories will now be available in /tmp/root): mount -t zfs zroot/ROOT/default /tmp/root

  11. Repair HardenedBSD (hash link for hbsd-update):

chroot /tmp/root /bin/sh
hbsd-update -d -V -U -v hbsd-v1x0000x-UPDATE-HASH
exit

Make changes or save your stuff as needed export zpool: zpool export zroot

Boot normally.

Source: forums.freebsd.org