Install HA on old laptop without UEFI

I know this post is a little old. I’m new to HA and just now trying to get started. Using a PC without UEFI I was able to follow these instructions almost exactly except I used Ubuntu to get to a terminal window. I even opened a Mozilla window so I could copy and paste the code after I kept making typos. I can get HA running and it sees some devices already on my network. I will keep going to learn more.

My question now is this: With this method, I am unable to update HA to a newer version through the web interface. It says it is updating, but restarts with the same version. I tried loading 10.1 instead and tried to update to 10.5 with no luck. Will I just need to manually update by re-installing HA using this same method and restoring a backup database? Or am I missing something?

Thanks. Dale

Everything worked great until 11.2 update, don’t know what happend. I start the update, after rebooting the update notification is still on and no update has been installed. Any ideas?

@drhalleron and @fortunenick :
I had the same issue and had to quickly move the cursor at boot to use slot B in the grub menu to actually boot into the new version.
I found the changes to /mnt/EFI/BOOT/grub.cfg were gone and I had to add “--file (hd0,gpt1)/efi/boot/grubenv” again to load_env and save_env.
Maybe the file was overwritten by one of the updates.
Has someone found a more permanent solution?

2 Likes

So I just completed this task and thought I would share my experience in 2023 as the posts I got all seem outdated, mostly focussed on ver 9.3, the current version of HASSOS is 11.2.

Why I did this?

  • I have an old laptop, Acer ONE Intel Atom N450, it was probably built somewhere in 2010 way before UEFI was mainstream. Unfortunately it is a core part of the HASSOS installation.
  • I only have a 250GB drive, and the image file requires a 1TB drive (Disk application complains)
  • I have been running a “supervised” installation for the last 3 years and have fallen behind on the maintenance (monthly updates of OS, and supervisor and core and add-ins) to the point that everything was becoming a mess. I highly recommend you DO NOT follow this path…

Assumptions:
You have already installed a version of linux on the machine which is bootable - you can find this process all over. (There are other shortcuts here like only installing a boot partition and GRUB, you only need GRUB to boot the machine, you dont really need a full linux install)

Step 1:
Boot into a linux distro with flash drive. Any distro, they are very much the same (for this task - please dont hate me). I used Linux Mint 20 XFCE, the GUI runs better on older hardware. On the official X86 installation they explain how to use Ubuntu.
Note: May have to change your BIOS setup to allow flash drive to boot before hard drive.

Step 2:
Download the latest version of the disk image. It is available as point 5 under METHOD 1 on official website: X86 installation.

Step 4:
Unzip (xz) the image with: xz -d -c img_file_name.img.xz
You will be left with a disk image file. Note: the zipped file is around 400MB but after unzipping, it is about 7GB.
Note: Flashdrives are notoriously slow, you could mount your hard drive and extract there. Google it, in short create a directory under your /mnt folder, call it whatever you want. I used my drive partition, so mkdir /mnt/sda7 then mount /dev/sda7 /mnt/sda7.

Step 5:
Mount the img file: losetup --find --partscan img_file_name.img
This will now (hopefully) mount 8 partitions. First is the “boot” partition, the next 4 are kernel and OS “pairs” (an A & B version for fallback). The next is a “Bootstate” and then an “overlay” for configs and a “data” for add-ons and other storage. Partitions are detailed here. PS: Mine only mounted 4 partitions: kernel, OS, overlay and data.
Note: In the link above they state that the alternate 2 “boot” partitions are empty on a first install. I manually mounted partition 1 to get access to the EFI boot partition.

Step 6:
You now have to create partitions on your local drive to mirror the above. Running: “df -h” is helpful to see the required sizes of the partitions. I used the “Disk” tool in Mint (also available in most distros) which is a nice GUI interface to disk partitioning. I then resized my existing Linux partitions to open up space for the new partitions I need. I created a 25MB partition for my kernel(FAT), and a 250MB partition for my OS(FAT), a 500MB partition for overlay (NB to label this correctly as HASSOS-OVERLAY), and a 15GB partition for my data (NB to label this correctly as HASSOS-DATA).
Note: You will notice I did not create the “A & B” setup, perhaps I will in future need to come update this post…this is what I needed to get up and running. Technically, you should be creating the additional 2 partitions which will probably be an issue when I upgrade.

Step 7:
Copying data to your partitions: I tried using dd command to write the partitions using the mounted volumes as input but that did not work well, and I had 2 corrupted drives (squashFS issues). I therefore just recursively copied (with permissions) the data from the mounted partitions (above) to the new partitions. using: cp -pdRx /media/mint/DISK/* /media/mint/KERNEL/. - just an example, my kernel drive (with the bzImage file was mounted as DISK, the OS was mounted as DISK1, overlay and data as per above by label mounted as HASOS-OVERLAY and HASSOS-DATA).

If you have gotten this far, you are well on your way :slight_smile:

Step 8:
Configuring the boot file: Technically, you just need to hand the BIOS the kernel image, and the rest should just run. I opened the grub.cfg file from the HASSOS image mounted BOOT partition located in EFI/boot/grub/grub.cfg and copied everything after the first 2 lines (which were setting default and timeout) into my existing grub.cfg file located in /boot/grub/grub.cfg at the end of the file.

Step 9:
Making it boot: This was the most complex bit that took me time to figure out. The way drives are labelled and named depends on the architecture and bootloader version being used. The boot config in step 8 is pretty straight forward. There is an “A” and a “B” option, and then 2 “recovery” versions of same. The trick was in selecting the right drive and partition for the kernel (bzImage) and then identifying the root partition correctly so the kernel can handover to the OS. What worked in the end was to reboot, then hit “c” for command line when the GRUB menu came up. There I could run “ls” to see how my drives are being labelled. I had to change (HD0, GPT1) to (AHCI0,msdos7). The “root=” is defined by UUID (unique hardware reference to the partition) but this gave me a “Waiting on root” message and hanged for hours even after updating the UUID to the one matching the new partition. I replaced it with “root=/dev/hda7” (7th partition on the first hard drive), which worked!

Step 10 (extra):
If you had started like me with a previous basically unusable install, and had made backups using Google drive, you will find your backups on your Google drive. They are basically zipped files of the configs of apps and even the full homeassistant config. You can restore these files if you feel comfortable…I unzipped them and took out the files I needed to config my new installation as clean as possible.

2 Likes

This worked like a dream. There appears to be one issue, though. On OS update, it appears that the EFI/BOOT/grub.cfg is overwritten.
My BOOT_ORDER was set to B A. I applied this fix, and it worked, booting to Slot B. After an OS update, it started booting to Slot A. I thought that everything was working as it should. Then, in the next update, it kept booting to Slot A. I inspected the EFI/BOOT/grub.cfg and the updates were gone.

1 Like

Yeah, that’s because the image contains the grub.cfg file. So it will overwrite it each update. To avoid this you can point your grub to use a different file like “grub_custom.cfg”. Of course copy the grub.cfg contents there and modify them. I am using this and it works. The downside is that if anything changes in the grub.cfg your custom one will not reflect that, but it shouldn’t change too much anyway.

1 Like

Makes sense.
My understanding of Grub isn’t extensive, but looking at the config, I’m unsure why manually specifying the env locations works. They’re not in “custom” locations.
Since we are pointing boot/grub/grub.cfg to the efi grub.cfg… is the load/save_env looking at the env in /boot/grub? If so, why isn’t that being updated accordingly?


As I’m thinking about it. I manually edited the /boot/grub/ env files and the changes were not recognized. So it’s almost like the env isn’t loaded unless directly pointed to. And since it doesn’t load it… it will always use the default BOOT_ORDER of A B

I take it that it’s not possible to do this from within HA using the terminal interface?

I’m trying to do this remotely and have limited tools and even more limited knowledge of how to use these tools.

hello. we don’t have that much technical knowledge. can you please explain in a video?

Just a friendly suggestion that may help you in the future… It is generally considered bad form to respond to a post that is older than a year old (essentially resurrecting a post) without something specific to add to the subject at large (asking for a video doesn’t add) and you’ve basically just asked someone to do research for you. Those two things generally dont attract responses.

Instead, you’ll get better responses if you try to do it yourself - and then if you run into issues open a new thread, explain as much as you can about your condition and see if someone can help.

3 Likes

@ dbrand666

You just saved an old laptop. And youve saved me TONS of money. Thanks so much for taking the time to help the community writing this post!!

1 Like

grazie!! guida perfetta :smiley:

I just tried this on an IBM / Lenovo Thinkcentre M92P SFF i5-3550 deskop PC and it worked. Thank you @carloshurtadom

Looks like some Lenovo and IBM machines always look for a windows installation and if it doesn’t detect one it always gives Error 1962, see https://gist.github.com/vees/b3fb1e5b62da155a006831c16eaac8e8

Error 1962: No Operating System Found

So the only way to get Home Assistant OS to work is to install grub on the boot partition of the drive (in my case the SSD drive that I had flashed the HAOS image to using another PC using an SSD to USB adaptor and then physically installing the flashed SSD to the Thinkcentre M92P PC).

In the BIOS you’ll also have to configure the startup options with CSM (Compatibility Support Module) enabled and with “Legacy” boot mode (Ie. Non-UEFI). In the Devices / ATA Drive Setup section of the BIOS also made sure that “Configure SATA as” was set to “IDE” and “Native Mode Operation” was set to “Enabled”.

I used a Live USB version of Parrot OS Home and had pre-flashed Home Assistant OS image to an SSD drive. So booted up the PC with the Parrot OS Live USB, opened up the terminal and followed the instructions by @carloshurtadom:

Mounted sda1

sudo mount /dev/sda1 /mnt

Installed grub2

sudo apt install grub2
sudo grub-install --compress=xz --root-directory=/mnt /dev/sda --force

Configured the grub.cfg file

cat <<! | sudo dd of=/mnt/boot/grub/grub.cfg
set root=(hd0,gpt1)
configfile (hd0,gpt1)/efi/boot/grub.cfg
!

Note you can also create the grub.cfg file using nano:

sudo nano /mnt/boot/grub/grub.cfg

and input the following text in the cfg file:

set root=(hd0,gpt1)
configfile (hd0,gpt1)/efi/boot/grub.cfg

then CTRL-X to save and exit.

Unmount sda1

sudo umount /dev/sda1

Closed the terminal

exit

Shutdown pc, removed Live boot usb and then booted up into the HAOS setup.

1 Like

A huge thanks to you! It works perfectly on a Toshiba Satellite A200 which does not have UEFI in the bios (@carloshurtadom) :star_struck:

THX!)
works for lenovo thinkcentre e73

1 Like

Hi, i’m triying to install HAOS in a old MSI CUBI B120. I’ve followed instruction and finally get grub at boot but i can’t lauch HAOS … with slot A i get error : cannot load image.
and with slot B error : unknown file system

Can you help me please ?

any one can help ?

Hi @jscongdon was wonding if you were able to find a solution to this issue. I’m getting a similar issue with the boot slots and HAOS booting to the older OS version in Boot Slot A instead of the updated version 14 in Boot Slot B.

Similar issue:

I have not found a permanent solution for this. I end up just manually booting to the proper slot. The machine rarely loses power so it hasn’t been an issue if have to manually select it again.

1 Like

This soulution from Patrice3122 worked: Cannot upgrade from 12.4 · Issue #3566 · home-assistant/operating-system · GitHub

1. Downgrade Slot B: On the localhost, I first downgraded Slot B 
to an earlier version using the command: ha os update --version 13.1.
NB: Any attempt to update directly to version 13.2 returned 
the message: Version already installed.

2. Manual Boot Selection: During the startup process, I manually selected 
Slot B from the boot menu. Note that the boot menu appears briefly during startup. 
To select Slot B, you must press the down arrow key, and once highlighted, 
press the Enter key to confirm.

3. Update Slot A: With the system booted from Slot B, I ran the CLI 
command: ha os update --version 14.0. Since the system was 
running on Slot B, the update process applied to Slot A.

4. Final Verification: After a host reboot, Home Assistant OS 14.0 
was successfully running, booted from Slot A.

I needed to plug in a monitor to change the boot to Slot B