11 September 2019

Recovery a freebsd after whatever problem

If you had any trouble with your install (ndis module someone), there's an easy way to fix it.
  1. Boot your pendrive/cdrom/dvd/whatever with the freebsd install
  2. Enter the shell or start the LiveCD option (livecd is root without any password)
  3. Create a directory where you can import your zfs pool: mkdir /tmp/zroot
  4. Import your zpool there: zpool import -fR /tmp/zroot zroot 
  5. Need access to /? No problem: mkdir /tmp/root && mount -t zfs zroot/ROOT/default /tmp/root
  6. When you're done, unmount everything: zpool export zroot 
  7. Reboot
Messed up your bootloader? No problem (this is for EFI boot):
  1. Check your partition table to see what number is your EFI partition: gpart show
  2. Re-setup your EFI partition: gpart bootcode -p /boot/boot1.efifat -i 1 ada0
  3. Check if ada0p1 is FAT just to be sure: file -s /dev/ada0p1
  4. Setup bootcode (-i3 if your zfs is ada0p3): gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 2 ada0


No comments:

Post a Comment