View Single Post
  #2   (View Single Post)  
Old 29th September 2016
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,975
Default

Yes.

You can either move the disk drive between systems, or boot install media on the broken system.

The amd64 architecture uses a two-stage bootloader. The first stage is biosboot(8), which loads the second stage bootloader boot(8) -- the file you accidentally deleted.

The biosboot(8) first stage bootloader must know where on the disk the second stage bootloader is located. Whenever you move, change, or recover the secondstage bootloader, biosboot(8) will need to be reinstalled -- it is stored in the partition boot record, and is booted by the master boot record.

We install biosboot(8) and boot(8) with the installboot(8) program. Review the installboot(8) man page before proceeding with either "HowTo" below. They are both from memory, and I may have made a mistake.

If you move the drive to your running system

In this example, the drive to be repaired is sd5. Replace this disk drive with the actual drive type and number.

  1. # mount /dev/sd5a /mnt
  2. # cd /usr/mdec
  3. # installboot -v -r /mnt sd5 biosboot boot
If you boot install media on the broken system

In this example, the drive to be repaired is wd2. Replace this disk drive with the actual drive type and number.
  1. Select (S)hell after booting the install media.
  2. # mount /dev/wd2a /mnt
  3. # cd /mnt/usr/mdec
  4. # installboot -v -r /mnt wd2 biosboot boot
----

The difference between the two sets of instructions are to ensure you use the fully populated /mnt/usr/mdec directory on the broken system -- the installation media does not have the bootloader files in its /usr/mdec directory.

Last edited by jggimi; 29th September 2016 at 09:27 PM. Reason: typos, clarity
Reply With Quote