LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Bootloader not installing on Zorin OS bootloader partition (https://www.linuxquestions.org/questions/linux-newbie-8/bootloader-not-installing-on-zorin-os-bootloader-partition-4175701700/)

BubbaGTX 10-08-2021 09:11 AM

Bootloader not installing on Zorin OS bootloader partition
 
Hello,
couple of days ago I installed Zorin OS on an external hard drive. The problem I have is that I can't boot Zorin from any pc but only from my pc where bootloader for Zorin is on. During the installation of Zorin I created a 550 MB partition for the bootloader, then I selected it so the bootloader can be installed on it. After the installation was done the bootloader was installed on my SSD where Windows is on. This doesn't make any sense since I didn't touch SSD when I was creating partitions for Zorin.
Is there any way I can install new bootloader on unused EFI partition on Zorin disk or move it from SSD to external hard drive somehow?

hazel 10-08-2021 09:23 AM

You should be able to copy it over from the SSD using standard filesystem commands. The whole point of UEFI is that your boot code resides in normal files that you can manipulate from inside the OS. Look at the EFI system partition on the SSD and copy the GRUB file over to the ESP on the hard drive. It will probably be called something like EFI/boot/grub64.efi.

BubbaGTX 10-08-2021 09:36 AM

Quote:

Originally Posted by hazel (Post 6290202)
You should be able to copy it over from the SSD using standard filesystem commands. The whole point of UEFI is that your boot code resides in normal files that you can manipulate from inside the OS. Look at the EFI system partition on the SSD and copy the GRUB file over to the ESP on the hard drive. It will probably be called something like EFI/boot/grub64.efi.

Thanks for the reply but I don't know how to do it. That's why I posted it in "Linux-Newbie" section.

pan64 10-08-2021 09:51 AM

you can even use windows to copy files from here to there. From the other hand you can start over your installation and try to install bootloader on the required device.

BubbaGTX 10-08-2021 09:53 AM

Quote:

Originally Posted by pan64 (Post 6290210)
From the other hand you can start over your installation and try to install bootloader on the required device.

That is exactly what I did, it is said in the text I made on the top. It doesn't matter if I select the right device, bootloader will install on SSD, also tried it 2 times.

colorpurple21859 10-08-2021 10:19 AM

Boot into Zorin, open a terminal and post the output of the following;
Code:

cat /etc/fstab
cat /sys/firmware/efi
ls /boot/grub
sudo parted -l
lsblk -f


yancek 10-08-2021 03:31 PM

If Zorin uses the same or similar installer that its daddy (Ubuntu) uses, it will install the EFI files for Zorin to the first EFI partition it finds which will be the EFI partition already existing on your windows drive. Two options:

Disconnect the windows drive and only have the drive to which you wish to install Zorin connected and it should install the Zorin EFI files to the correct drive. Most users see this as a buy in the Ubuntu installer while the Ubuntu developers see it as a feature and have been aware of it for years and will not change it.

Second option is suggested above. Mount the EFI partition on the wwindows drive and mount the EFI partition on the Zorin drive and copy all the files from the zorin (or possibly ubuntu) directory on the EFI partition on the windows drive to the EFI partition on the Zorin drive. Many Ubuntu derivatives name the directory in the EFI partition ubuntu so that may be it or it may be zorin but it should be one or the other. You should be able to see which it is by simply mounting the EFI partition on the windows drive. Doing an online search for how to mount an efi partition from linux should show over half a million options, pick one.

hazel 10-09-2021 05:18 AM

Just a small point: I don't use GRUB myself (Hallelujah!) but would there be any problems in GRUB finding its modules after such a transfer?

BubbaGTX 10-09-2021 06:03 AM

Quote:

Originally Posted by colorpurple21859 (Post 6290226)
Boot into Zorin, open a terminal and post the output of the following;
Code:

cat /etc/fstab
cat /sys/firmware/efi
ls /boot/grub
sudo parted -l
lsblk -f



# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
# / was on /dev/sdd2 during installation
UUID=7b362afd-e98b-42ca-b573-72a78fe13499 / ext4 errors=remount-ro 0 1
# /boot/efi was on /dev/sda1 during installation
UUID=4253-2D26 /boot/efi vfat umask=0077 0 1
# /home was on /dev/sdd4 during installation
UUID=052edb8a-e220-4a0e-a2c3-1dfacf07cd17 /home ext4 defaults 0 2
# swap was on /dev/sdb2 during installation
UUID=1332ccc0-15ee-4f62-8e06-080a07c2f845 none swap sw 0 0
# swap was on /dev/sdd3 during installation
UUID=037c46f8-4e05-4fdc-9b4d-be6d6c18bdb2 none swap sw 0 0
fonts
gfxblacklist.txt
grub.cfg
grubenv
unicode.pf2
x86_64-efi
Model: ATA ADATA SP900 (scsi)
Disk /dev/sda: 128GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:

Number Start End Size File system Name Flags
1 1049kB 106MB 105MB fat32 EFI system partition boot, esp
2 106MB 123MB 16,8MB Microsoft reserved partition msftres
3 123MB 128GB 127GB ntfs Basic data partition msftdata
4 128GB 128GB 530MB ntfs hidden, diag


Model: ATA INTEL SSDSC2KW12 (scsi)
Disk /dev/sdb: 128GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:

Number Start End Size File system Name Flags
1 1049kB 500MB 499MB fat32 EFI System Partition boot, esp
2 500MB 16,5GB 16,0GB linux-swap(v1) swap swap
3 16,5GB 71,5GB 55,0GB ext4 root
4 71,5GB 128GB 56,5GB ext4 storage


Model: ATA WDC WD10EZRX-00D (scsi)
Disk /dev/sdc: 1000GB
Sector size (logical/physical): 512B/4096B
Partition Table: msdos
Disk Flags:

Number Start End Size Type File system Flags
1 1049kB 1000GB 1000GB primary ntfs


Model: TOSHIBA External USB 3.0 (scsi)
Disk /dev/sdd: 500GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:

Number Start End Size Type File system Flags
1 1049kB 551MB 549MB primary fat32 boot, esp
2 551MB 80,6GB 80,0GB primary ext4
4 80,6GB 492GB 412GB primary ext4
3 492GB 500GB 7999MB primary linux-swap(v1)


NAME FSTYPE LABEL UUID FSAVAIL FSUSE% MOUNTPOINT
loop0 squashfs 0 100% /snap/bare/5
loop1 squashfs 0 100% /snap/core/11743
loop2 squashfs 0 100% /snap/core18/2128
loop3 squashfs 0 100% /snap/pycharm-community/252
loop4 squashfs 0 100% /snap/gnome-3-28-1804/161
loop5 squashfs 0 100% /snap/snapd/13170
loop6 squashfs 0 100% /snap/gtk-common-themes/1519
loop7 squashfs 0 100% /snap/discord/130
loop8 squashfs 0 100% /snap/vlc/2344
sda
├─sda1 vfat 4253-2D26 65,7M 32% /boot/efi
├─sda2
├─sda3 ntfs 1A1E66561E662B49
└─sda4 ntfs 92907C31907C1DC3
sdb
├─sdb1 vfat 2D3F-15D1
├─sdb2 swap 1332ccc0-15ee-4f62-8e06-080a07c2f845 [SWAP]
├─sdb3 ext4 20e6ebe9-eb6f-4d9b-b575-70e6cc7460fc
└─sdb4 ext4 3a1e4fbb-3834-48f8-b15d-1b94cd1d3c6a
sdc
└─sdc1 ntfs HDD 7A50C92A50C8EDC7
sdd
├─sdd1 vfat DF16-85D6
├─sdd2 ext4 7b362afd-e98b-42ca-b573-72a78fe13499 57G 17% /
├─sdd3 swap 037c46f8-4e05-4fdc-9b4d-be6d6c18bdb2 [SWAP]
└─sdd4 ext4 052edb8a-e220-4a0e-a2c3-1dfacf07cd17 354,9G 1% /home

colorpurple21859 10-09-2021 10:06 AM

Boot into zorin on the external drive
open a terminal
Code:

sudo nano /etc/fstab
change these lines:
Code:

# /boot/efi was on /dev/sda1 during installation
UUID=4253-2D26 /boot/efi vfat umask=0077 0 1

to this
Code:

# /boot/efi was on /dev/sdd1 during installation
UUID=DF16-85D6 /boot/efi vfat umask=0077 0 1

and delete these two lines
Code:

# swap was on /dev/sdb2 during installation
UUID=1332ccc0-15ee-4f62-8e06-080a07c2f845 none swap sw 0 0

open a terminal, run these commands:
Code:

sudo umount —all
sudo mount —all
sudo mount /dev/sdd1 /boot/efi
sudo grub-install --target=x86_64-efi —no-nvram
sudo grub-install --target=i386-pci /dev/sdd


hazel 10-09-2021 10:19 AM

To elucidate this excellent advice a bit:

You are replacing the installer program's (wrong) advice to routinely mount your SSD's EFI system partition on /boot/efi with an instruction to mount the hard drive's ESP there instead. So this is where the system will look for boot files in future.

Unmounting and remounting all devices puts this new instruction into operation.

You then install GRUB to the hard drive, which is what the installer should have done.

BubbaGTX 10-09-2021 02:14 PM

Quote:

Originally Posted by colorpurple21859 (Post 6290481)
open a terminal, run these commands:
Code:

sudo umount —all
sudo mount —all
sudo mount /dev/sdd1 /boot/efi
sudo grub-install --target=x86_64-efi —no-nvram
sudo grub-install --target=i386-pci /dev/sdd


I get this error when trying to mount /dev/sdd1 /boot/efi:

mount: /boot/efi: mount failed: Operation not permitted

I also did this as root.

yancek 10-09-2021 03:06 PM

I'm not sure why you got that error but, did you change the lines in fstab as suggested before running the mount commands?
Do you have a /boot/efi directory in Zorin?
You should post the actual command you used, copy/paste is best as there may be typos such as errors, spaces where there should be none that you did not notice.

Quote:

you then install GRUB to the hard drive, which is what the installer should have done.
Grub boot files are installed to the system partition but the Grub efi files aren't on the drive on which Zorin exists. New Ubuntu users have been complaining about this for years, that the installer puts the EFI files for Ubuntu/Zorin on the first EFI partition it finds which is almost always a windows EFI partition. If the Ubuntu developers wanted to change this, they have had years to do it. Although Grub files are on the system partition, the OP will still need to reinstall Grub so it points to the correct partition in addition to making the changes suggested by colorpurple21859..

colorpurple21859 10-09-2021 03:54 PM

If the error is “already mounted to /boot/efi” you can ignore,
otherwise reboot into zorin and repost
Code:

lsblk -f

colorpurple21859 10-09-2021 08:09 PM

try this:
Code:

sudo mount /dev/sdd1 /mnt
sudo grub-install --target=x86_64-efi --efi-directory=/mnt --no-nvram



All times are GMT -5. The time now is 03:37 PM.