/ 2]-Repair-a-broken-system.md
2]-Repair-a-broken-system.md
1 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. 2 3 1. Download the [HardenedBSD installation media](https://mirror.laylo.io/pub/hardenedbsd/). 4 1. Boot on this and select "Live CD" (the username is "root" without password). 5 1. If you want to choice other keybord, use `kbdmap` command. 6 7 1. You probably need to enable DHCP on your network card via the command: `dhclient em0` 8 9 1. You may need to know your partitions: `gpart show` 10 11 1. Run zpool import to get name of zpool (probably zroot): `zpool import` 12 13 1. Create a mountpoint for zpool: `mkdir -p /tmp/zroot` 14 15 1. Import zpool: `zpool import -fR /tmp/zroot zroot` 16 17 1. Create a mountpoint for zfs /: `mkdir /tmp/root` 18 19 1. Mount / (the directories will now be available in /tmp/root): `mount -t zfs zroot/ROOT/default /tmp/root` 20 21 1. Repair HardenedBSD ([hash link for hbsd-update](http://updates.hardenedbsd.org/pub/HardenedBSD/updates/hardened/)): 22 ``` 23 chroot /tmp/root /bin/sh 24 hbsd-update -d -V -U -v hbsd-v1x0000x-UPDATE-HASH 25 exit 26 ``` 27 28 Make changes or save your stuff as needed export zpool: `zpool export zroot` 29 30 Boot normally. 31 32 Source: [forums.freebsd.org](https://forums.freebsd.org/threads/how-to-mount-a-zfs-partition.61112/post-351941)