# "Operating System Not Found" on ThinkPad G40



## yha (Nov 3, 2020)

Hello,

      I have an old IBM ThinkPad G40 with an mSATA to IDE adapter so I could use an SSD in the machine. The installation went just fine. However, when I boot the machine (from the drive), it says "Operating System Not Found". I'm not sure if this is related, but the BIOS does not have any option to change between AHCI and compatibility mode. Do I have to align the SSD on a certain boundary or something like that for the BIOS to be able to boot the operating system? What about the partitioning scheme? Being an old machine, I chose MBR, but perhaps I can use GPT?

Thanks.


----------



## a6h (Nov 3, 2020)

Most BIOS support GPT. More info at gpart(8), read BOOTSTRAPPING and pmbr part. Quote:


> First, a protective MBR is embedded into the first disk sector from the /boot/pmbr image. It searches through the GPT for a freebsd-boot partition and runs the next bootstrap stage from it.


[EDIT]: Just keep in mind that FreeBSD GPT uses three partitions: freebsd-boot, freebsd-ufs and freebsd-swap.


----------



## Emrion (Nov 3, 2020)

I think that the installer asked you if you want to put the FreeBSD MBR in the disk and you answered "No". Do you have any other OS on your ssd? If no, you can restart the installation and answer "yes" this time.

That said, I advise you to choose GPT. From the BIOS point of view, there is no difference between MBR and GPT. And GPT offers more features.


----------



## SirDice (Nov 3, 2020)

No need to restart the whole installation from the start. Just boot the install media, drop to the shell and run gpart(8) to install the MBR (look at the examples at the end of the man page).


----------



## Emrion (Nov 3, 2020)

SirDice said:


> No need to restart the whole installation from the start. Just boot the install media, drop to the shell and run gpart(8) to install the MBR (look at the examples at the end of the man page).


I think it's simpler for someone who doesn't know gpart. Also, it's needed if you want to change the scheme to GPT.


----------



## SirDice (Nov 3, 2020)

Emrion said:


> I think it's simpler for someone who doesn't know gpart


Might as well start learning how to deal with issues without reverting to the age old "just reinstall everything". 


Emrion said:


> Also, it's needed if you want to change the scheme to GPT.


Then, yes. But there's no pressing need for GPT, MBR will work just fine.


----------



## yha (Nov 3, 2020)

The installer never asked me a "Yes/No" question of whether I want to install the MBR or not, it only asked me to select a partitioning scheme (MBR, GPT, Apple, etc). I chose MBR. I re-installed using GPT (hadn't seen the other replies by then) and it's the same thing. It's worth noting that if I boot the memstick, drop to the loader prompt and do `lsdev`, my SSD is not listed. It only sees the floppy drive and the USB stick.


----------



## Emrion (Nov 4, 2020)

You should boot on the FreeBSD installer and go to the shell. Then, show us the output of `gpart show`.


----------



## yha (Nov 4, 2020)

Right. So I tried installing Windows XP to see if there would be any difference, but after a successful installation the BIOS is still unable to boot (see) the drive. I'm starting to think this is a quirk of the mSATA-to-IDE adapter I'm using. Here's the output of `gpart show` after installing XP (copied by hand, so formatting is not accurate):


```
=>        63  937703025  ada0  MBR  (447G)
         63  307194867     1  ntfs  [active]  (146G)
  307194930  630486990     2  ebr  (301G)
  937681920      21168        - free -  (10M)

=>        0  630486990  ada0s2  EBR  (301G)
          0   61432560       1  !14  (29G)
   61432560  569054430          - free -  (271G)

=>       63  937703025  diskid/DISK-50026B77832BD20A  MBR  (447G)
         63  307194867                            1  ntfs  [active]  (146G)
  307194930  630486990                             2  ebr  (301G)
  937681920      21168                             - free -  (10M)

=>        0  630486990  diskid/DISK-50026B77832BD20As2  EBR  (301G)
          0   61432560                               1  !14  (29G)
   61432560  569054430                                  - free -  (271G)

=>       1  7581695  da0  MBR  (3.6G)
        1  1640592    1  freebsd  [active]  (801M)
  1640593  5941103       - free -  (2.8G)

=>      0  1640592  da0s1  BSD  (801M)
        0       16         - free -  (8.0K)
       16  1640576      1  freebsd-ufs  (801M)

=>      1  7581695  diskid/DISK-900099C18667F837  MBR  (3.6G)
        1  1640592                             1  freebsd  [active]  (801M)
  1640593  5941103                                - free -  (2.8G)

=>      0  1640592  diskid/DISK-900099C18667F837s1  BSD  (801M)
        0       16                                  - free -  (8.0K)
       16  1640576                               1  freebsd-ufs  (801M)
```


----------



## SirDice (Nov 4, 2020)

yha said:


> but after a successful installation the BIOS is still unable to boot (see) the drive.


Does the BIOS actually detect the drive?


----------



## yha (Nov 4, 2020)

I hadn't noticed this earlier, but initially the boot order config in BIOS showed "Hard Drive" as an item. This time around, I entered BIOS while the memstick was inserted, and now "Hard Drive" became "+Hard Drive" with the USB stick as a sub-item, so it looks like the BIOS isn't seeing the SSD at all...


----------



## yha (Nov 4, 2020)

Minor additional detail that doesn't change much, but just to clarify: the "Operating System Not Found" message comes from PXE, not the storage drive boot.


----------



## SirDice (Nov 5, 2020)

yha said:


> I hadn't noticed this earlier, but initially the boot order config in BIOS showed "Hard Drive" as an item. This time around, I entered BIOS while the memstick was inserted, and now "Hard Drive" became "+Hard Drive" with the USB stick as a sub-item, so it looks like the BIOS isn't seeing the SSD at all...


You should solve that issue first. If the BIOS can't detect the drive it would never be able to boot from it. It's odd that the FreeBSD (and Windows) installers do detect it though. The converter should just present a plain old IDE drive to the machine and the machine wouldn't even be able to detect it's actually a mSATA device.


----------

