0

Some time ago I made a kubuntu 16.04 live USB. I booted from this and installed kubuntu to a hard drive (flash) in the system. When the system booted I needed to select an option to boot the specific hard drive from the menu. After a couple of months I went to start the system again and this boot option is no longer there. I seem to remember it being off an "advanced options sub menu", something like "boot hda2". If I boot the live system the hard disk is shown and I can see all of the files. I have backed up my work but I would still like to boot hard drive. I have spent hours looking for a solution including disk-repair but can't seem to get anything to work.

The disk in question comes up as disk /dev/sda, partition 1 is EFI and 2 is the main root disk with the boot directory containing all the kernel boot files.

Any ideas much appreciated.

vmhb
  • 1
  • 1
  • http://paste.ubuntu.com/p/h3pMKX8nw3/ Here is the disk-repair link it seems there is an installation on sda2 and another on sda4. Really just need to boot sda2 and don't know what sda4 is. – vmhb Mar 11 '21 at 11:55
  • You have two installs of 16.04. And the /EFI/ubuntu/grub.cfg refers to one that does not exist. You can run a full reinstall of grub using Boot-Repair's advanced options. Choose install either sda2 or sda4 which ever you want and full reinstall of grub. – oldfred Mar 11 '21 at 13:32
  • Are you trying to boot the hard drive from the USB or from the hard drive's own grub? If from USB how did you make the USB, what program? And do you prefer booting from the USB? – C.S.Cameron Mar 11 '21 at 13:57
  • I would love to be able to boot directly from the hard drive but I guess the BIOS does not recognize the UEFI partition. So I had been using the usb created with a kbuntu iso and Universal-USB-Installer. For some reason that no longer seems to have the option to boot the hard drive, so I have no way to boot it. Going to try the full install with boot-repair – vmhb Mar 11 '21 at 14:26
  • @vmhb I boot one of my computers using a full install USB, I just had to boot it and update grub. Kind of a hassle though. Don't forget to backup your hard drive, good luck. – C.S.Cameron Mar 11 '21 at 14:43
  • Had a go with the advance repair and still the boot device is not recognized by the BIOS and if I boot the live USB there is still no option to boot the hard drive http://paste.ubuntu.com/p/DVkcQSW3Hb/ – vmhb Mar 11 '21 at 14:51
  • II have been playing around in grub command line. ls only seems to list the live USB as a device. The only ls that seems to work is ls (hd0,1) which it says is a 4GB FAT partition. I was hoping to find the SSD somewhere and try and manually instruct it to boot from that. Should I be able to see it here and is that my issue? Do I need a different grub? – vmhb Mar 11 '21 at 15:04
  • Looking at the link provided regarding EOL, what I think I am trying to boot is 16.04.7 LTS. – vmhb Mar 11 '21 at 15:12
  • @vmhb: if you have a blank 16GB or larger pendrive, install Full Ubuntu on it, (see https://askubuntu.com/questions/1300454/easy-full-install-usb-that-boots-both-bios-and-uefi), Boot from it and run sudo update-grub. This should add the hard drive to it's boot menu, allowing you to boot the hard drive as before. you may be able to copy this menuentry to the hard drive's /boot/grub/grub.cfg on partition 2. – C.S.Cameron Mar 12 '21 at 02:52

1 Answers1

0

Booting Hard Drive from Universal USB Installer Boot Drive

Recent versions of UUI do not seem to have an option to boot the hard drive.

Following is how I modified a Universal-USB-Installer-2.0.0.0 Lubuntu 16.04 install to use Syslinux to boot to the HDD in BIOS mode.

  • Open /uui/syslinux.cfg in Notepad.

syslinux.cfg enter image description here

  • Directly after the first menu label add:

    # Boot from HDD
    LABEL Boot from Hard Drive
    MENU LABEL Boot from  Hard Disk
    KERNEL chain.c32
    APPEND hd1
    MENU DEFAULT
    
  • Save and close Notepad.

  • Copy chain.c32 from the isolinux folder to the uui folder.

The option to boot from Hard Disk should now be on the start menu.

enter image description here

Some versions of UUI locate syslinux in the root folder, in that case copy chain.c32 to the root folder.

C.S.Cameron
  • 19,519
  • Thank you for trying to help syslinux on the usb live disk looks like this – vmhb Mar 12 '21 at 08:36
  • This file was automatically populated by Universal USB Installer - http://www.pendrivelinux.com

    prompt 0

    LABEL append CONFIG //syslinux.cfg APPEND /

    – vmhb Mar 12 '21 at 08:37
  • Sorry I dont know how to work this – vmhb Mar 12 '21 at 08:38
  • I have tried to add the lines you suggested at different places but the menu presented does not change. I will try ans post a picture. – vmhb Mar 12 '21 at 08:41
  • @vmhb: What version of Universal are you using? I have shown the full syslinux.cfg above – C.S.Cameron Mar 12 '21 at 08:56
  • 1.9.8.8, Trying with same version as you. – vmhb Mar 12 '21 at 09:02
  • Ok can get up the added boot hard disk option but when I attempt to use it I get "Cannot get disk parameters" then the "boot:" prompt. – vmhb Mar 12 '21 at 10:03
  • @vmhb: When you get to the boot screen shown above press Tab to edit. It will say chain.c32 hd1. Try changing that to say chain.c32 hd0 or ``chain.c32 hd2`, etc. – C.S.Cameron Mar 12 '21 at 10:45
  • I did actually try 0 but now tried 0-5 and get the same error message. Really appreciate your suggestions, any more ideas? I did notice that when the machine boots it provides 2 options to boot from the usb stick. One is UEFI Part 0 OS Boot loader. This one is chosen by the BIOS as default and is not the boot menu we are changing. To get that to appear I have to select something marked USB Part 0 boot drive. If I remove the usb stick no boot device is found. I also tried recreating the usb stick and formatting it first. I though this was the menu in isolinux but appears to be different. – vmhb Mar 12 '21 at 11:00
  • @vmhb: It would be nice to see what your HDD looks like in GParted. Lets try reinstalling GRUB. Booting from the USB, in Terminal run sudo mount /dev/sdxy /mnt where sdx is the HDD and y is the root partition number. Then run sudo grub-install --boot-directory=/mnt/boot /dev/sdx If HDD does not then boot without help from the USB, have a look at sdxy/boot/grub/grub.cfg to confirm that UUID's etc match what is shown in Disks – C.S.Cameron Mar 12 '21 at 11:35
  • The command gives an warning. grub-install : warning: this GPT partition label contains no BIOS boot partition; embedding won't be possible. There is a /mnt/boot/grub/grub.cfg is that worth looking at? fdisk /dev/sda shows sda1 512M EFI, sda2 linux 55G, sda3 swap 4G, sda4 linux 20G, sda5 linux 4G. – vmhb Mar 12 '21 at 11:58
  • Reboot USB and try sudo mount /dev/sda1 /mnt, then sudo grub-install --boot-directory=/mnt/boot /dev/sda. If that doesn't work, copy the boot folder from the USB to the sda partition and try installing grub again – C.S.Cameron Mar 12 '21 at 12:12
  • /dev/sda1 is EFI so when I mount it there is an EFI directory which contains the Boot and ubuntu directories. There is no /mnt/boot. So do I copy /boot (usb drive) to /mnt/boot which is the EFI partition? Copied the /boot and attempted grub-install. Still says there is no BIOS boot partition. – vmhb Mar 12 '21 at 12:35
  • Create a 1MB partition. at the front of disk Use GParted to format it "unformatted" then flag it bios_grub. Confirm sda1 has boot and esp flags. try installing grub again to sda1. – C.S.Cameron Mar 12 '21 at 13:09
  • Since creating the boot partition it seems now the root disk has moved to sdb2 and the EFI partition to sdb1. I have tried to run the grub-install command on sdb2 when mounted and sdb1 with the boot directory copied from the live usb stick. When I try and boot from the new hard disk menu option I still get "Cannot get disk parameters" for hd0-5. – vmhb Mar 12 '21 at 16:49