# Boot problem HDD/SSD missing



## fnoyanisi (Jun 8, 2018)

Hi there,

A couple days ago, I rebooted my laptop and noticed some error messages while the system was rebooting. I did not pay close attention (this turned out to be a bad decision) as I thought I could diagnose the issue once the system is rebooted.

Since then, I am not able to boot my laptop and just after powering on my laptop I get an error message as the one given below.

```
Intel(R) Boot Agent CE v.1.3.66
Copyright (C) 1997-2010, Intel Corporation

PXE-E61: Media test failure, check cable
PXE-M0F : Exiting Intel Boot Agent.
Insert system disk in drive.
Press any key when ready....
```
The boot order in the BIOS prioritizes USB and HDD/SSD over LAN, so I would assume I am getting PXE-E61 due to the BIOS cannot detect any local drives.

I am able to boot my laptop with a FreeBSD or Ubuntu memstick. I tried to write the bootstrap code into MBR by

```
# gpart bootcode -b /boot/boot0 ada0
```
and had `bootcode written to ada0`, so I think gpart(8) did its job well. However, this did not fix my problem.

I copied my important files to another external storage by using a Ubuntu live USB, hence I assume my SSD/HDD connections are okay (?). However, pressing F12 to select the boot device after powering on the laptop does not show any local drives, just LAN and USB if a memstick is attached.

Is my BIOS failing to detect local drives or my local drives are dead (both at the same time? and I can mount and copy files from them). Any recommendations or workaround suggestions are welcome!

Thanks


----------



## k.jacker (Jun 8, 2018)

Could you boot into a live FreeBSD as you allready did, and post the output from `gpart show`, so we can see if the layout is still ok and what kind of bootcode/partcode you actually need...


----------



## ShelLuser (Jun 8, 2018)

Why use gpart to install boot0 though?  I suppose it might work, but I think it's much safer to use boot0cfg(8) for this. Because that will also allow you to specify which slice boot0 should actually use to boot from.

I could imagine that by merely installing boot0 without configuring it might start but then doesn't know what to do (note: that's my theory at least).

(edit)

Also note that if you want non-interactive booting it's suggested to use /boot/mbr instead.


----------



## fnoyanisi (Jun 8, 2018)

Appreciate all the answers guys...

k.jacker , below is `gpart show` output. da0 is the memstick I am booting from and da1 is the memstick I used as RW media (to transfer files etc.)

```
=>       34  234441581  ada0  GPT  (112G)
         34          6        - free -  (3.0K)
         40       1024     1  freebsd-boot  (512K)
       1064   10485760     2  freebsd-ufs  (5.0G)
   10486824    8388608     3  freebsd-swap  (4.0G)
   18875432    8388608     4  freebsd-ufs  (4.0G)
   27264040   20971520     5  freebsd-ufs  (10G)
   48235560   41943040     6  freebsd-ufs  (20G)
   90178600  144263014     7  freebsd-ufs  (69G)
  234441614          1        - free -  (512B)

=>       34  234441581  diskid/DISK-S1D5NSBF574220J  GPT  (112G)
         34          6                               - free -  (3.0K)
         40       1024                            1  freebsd-boot  (512K)
       1064   10485760                            2  freebsd-ufs  (5.0G)
   10486824    8388608                            3  freebsd-swap  (4.0G)
   18875432    8388608                            4  freebsd-ufs  (4.0G)
   27264040   20971520                            5  freebsd-ufs  (10G)
   48235560   41943040                            6  freebsd-ufs  (20G)
   90178600  144263014                            7  freebsd-ufs  (69G)
  234441614          1                               - free -  (512B)

=>       34  625142381  ada1  GPT  (298G)
         34       2014        - free -  (1.0M)
       2048  625139712     1  freebsd-ufs  (298G)
  625141760        655        - free -  (328K)

=>       34  625142381  diskid/DISK-W041FALR  GPT  (298G)
         34       2014                        - free -  (1.0M)
       2048  625139712                     1  freebsd-ufs  (298G)
  625141760        655                        - free -  (328K)

=>      3  7856122  da0  GPT  (3.7G)
        3     1600    1  efi  (800K)
     1603      118    2  freebsd-boot  (59K)
     1721  1504448    3  freebsd-ufs  (735M)
  1506169     2048    4  freebsd-swap  (1.0M)
  1508217  6347908       - free -  (3.0G)

=>      3  7856122  diskid/DISK-174103140BD36915  GPT  (3.7G)
        3     1600                             1  efi  (800K)
     1603      118                             2  freebsd-boot  (59K)
     1721  1504448                             3  freebsd-ufs  (735M)
  1506169     2048                             4  freebsd-swap  (1.0M)
  1508217  6347908                                - free -  (3.0G)

=>      1  7866367  da1  MBR  (3.8G)
        1        1       - free -  (512B)
        2  7866366    1  fat32  (3.8G)
```

Phishfry,


Phishfry said:


> I think it is a good idea to go into the BIOS and disable PXE.


It appears there is no option to disable PXE completely, but I can change the order of the boot devices and set LAN as the last option, which I have done already. I suspect PXE boot is tried as the last resort after failing all other available options (SSD, USB etc.)

ShelLuser ,


ShelLuser said:


> Why use gpart to install boot0 though? I suppose it might work, but I think it's much safer to use boot0cfg(8) for this. Because that will also allow you to specify which slice boot0 should actually use to boot from.


I referred boot0cfg(8) manual page and even it suggests using gpart(8) to restore bootstrap code, hence I used `gpart` instead. In addition to what I wrote in my original post, I have also tried

```
gpart bootcode -b /boot/mbr ada0
```
which is given in boot0cfg(8) and did not work for me.

I do not have much exposure to boot0cfg(8) and appreciate any advise if using this command would make any difference.


----------



## k.jacker (Jun 8, 2018)

What you have is GPT partitioning scheme and legacy bootcode (no UEFI), so that's not a regular mbr to be installed, but a protective mbr (pmbr).
To rewrite the protective mbr run `gpart bootcode -b /boot/pmbr`

You can also rewrite the second stage bootcode (legacy bootcode inside the freebsd-boot partition) as well with
`gpart bootcode -p /boot/gptboot -i 1 ada0`

...or both in one command: `gpart bootcode -b /boot/pmbr -p /boot/gptboot -i 1 ada0`

See gptboot(8)


From the size of your drive and since it's a laptop, I guess it's an older SSD, right?
I'd suggest installing /sysutils/smartmontools and check if the drive is still healthy.


----------



## fnoyanisi (Jun 9, 2018)

The BIOS was so true in saying "check cable"!

It turned out that ada1 is dead and, for some reason, this was preventing BIOS to detect all local drives.
After I disconnect my secondary storage (ada1 - hdd), I was able to boot FreeBSD from my primary SSD storage.

In fact, I am sending this message from my FreeBSD laptop 



k.jacker said:


> From the size of your drive and since it's a laptop, I guess it's an older SSD, right?


Around 6 years old.


----------



## k.jacker (Jun 9, 2018)

fnoyanisi said:


> The BIOS was so true in saying "check cable"!


Nice, you found out what the problem was


----------

