grub installation

Questions about Grub, UEFI,the liveCD and the installer
Forum rules
Before you post please read how to get help
Post Reply
warehouse
Level 1
Level 1
Posts: 8
Joined: Thu Jun 21, 2018 6:03 am

grub installation

Post by warehouse »

How can I perform a grub installation from the Live Session dvd ?
I want to install grub on /dev/sda

User avatar
kukamuumuka
Level 16
Level 16
Posts: 6689
Joined: Tue Sep 03, 2013 4:51 am
Location: Finland
Contact:

Re: grub installation

Post by kukamuumuka »

Code: Select all

sudo mount /dev/sdXY /mnt  ## where X=disk and Y=partition
sudo grub-install --boot-directory=/mnt/boot /dev/sda
sudo umount /mnt
If you have separate /boot partition, it needs to mount under /mnt

Code: Select all

sudo mount /dev/sdXY /mnt  ## where X=disk and Y=partition
sudo mount /dev/sdXY /mnt/boot
sudo grub-install --boot-directory=/mnt/boot /dev/sda
sudo umount /mnt/boot
sudo umount /mnt

warehouse
Level 1
Level 1
Posts: 8
Joined: Thu Jun 21, 2018 6:03 am

Re: grub installation

Post by warehouse »

Thanks for your immediate response !
What exactly should I type in '--boot-directory=' ?

User avatar
kukamuumuka
Level 16
Level 16
Posts: 6689
Joined: Tue Sep 03, 2013 4:51 am
Location: Finland
Contact:

Re: grub installation

Post by kukamuumuka »

warehouse wrote:
Wed Oct 31, 2018 3:14 am
Thanks for your immediate response !
What exactly should I type in '--boot-directory=' ?
/mnt/boot if you are installing from liveDVD or USB.

warehouse
Level 1
Level 1
Posts: 8
Joined: Thu Jun 21, 2018 6:03 am

Re: grub installation

Post by warehouse »

I tried to install grub from the LiveDVD (Linux Mint 18.3) but the installation failed.
Here's what I typed:
> sudo mount /dev/sda /mnt
mount: /dev/sda is already mounted or /mnt busy
> sudo grub-install /mnt/boot /dev/sda
grub-probe: error: failed to get canonical path of `aufs'
grub-install.real: error: More than one install device?

User avatar
kukamuumuka
Level 16
Level 16
Posts: 6689
Joined: Tue Sep 03, 2013 4:51 am
Location: Finland
Contact:

Re: grub installation

Post by kukamuumuka »

warehouse wrote:
Fri Nov 02, 2018 3:48 am
I tried to install grub from the LiveDVD (Linux Mint 18.3) but the installation failed.
Here's what I typed:
> sudo mount /dev/sda /mnt
mount: /dev/sda is already mounted or /mnt busy
> sudo grub-install /mnt/boot /dev/sda
grub-probe: error: failed to get canonical path of `aufs'
grub-install.real: error: More than one install device?
You have not mount / partition. An example:

Code: Select all

sudo parted -l ## tells drives and partitions
.... if my / partition is /dev/sda1, and I have no separate /boot partition, it goes

Code: Select all

sudo mount /dev/sda1 /mnt
sudo grub-install --boot-directory=/mnt/boot /dev/sda
sudo umount /mnt

srq2625
Level 4
Level 4
Posts: 420
Joined: Tue Jan 08, 2013 11:35 am
Location: State: Constant Confusion, Country: D'oh

Re: grub installation

Post by srq2625 »

The OP doesn't mention whether his install is BIOS or UEFI.

Does this work with UEFI systems? I seem to recall reading somewhere that it does not - but I'm getting old and my memory isn't what it used to be.

JeremyB
Level 20
Level 20
Posts: 11657
Joined: Fri Feb 21, 2014 8:17 am

Re: grub installation

Post by JeremyB »

administrollaattori wrote:
Wed Oct 31, 2018 8:46 am
warehouse wrote:
Wed Oct 31, 2018 3:14 am
Thanks for your immediate response !
What exactly should I type in '--boot-directory=' ?
/mnt/boot if you are installing from liveDVD or USB.
I think you forgot the sudo chroot command

User avatar
kukamuumuka
Level 16
Level 16
Posts: 6689
Joined: Tue Sep 03, 2013 4:51 am
Location: Finland
Contact:

Re: grub installation

Post by kukamuumuka »

JeremyB wrote:
Fri Nov 02, 2018 10:32 am
I think you forgot the sudo chroot command
chroot is not needed if installing bare grub from liveDVD or USB.

User avatar
kukamuumuka
Level 16
Level 16
Posts: 6689
Joined: Tue Sep 03, 2013 4:51 am
Location: Finland
Contact:

Re: grub installation

Post by kukamuumuka »

srq2625 wrote:
Fri Nov 02, 2018 8:50 am
The OP doesn't mention whether his install is BIOS or UEFI.

Does this work with UEFI systems? I seem to recall reading somewhere that it does not - but I'm getting old and my memory isn't what it used to be.
Original question is
How can I perform a grub installation from the Live Session dvd ?
I want to install grub on /dev/sda
It indicates that it is BIOS installation. UEFI installation goes like

Code: Select all

sudo blkid ### tells the partitions
sudo mount /dev/sda7 /mnt ## if your linux is on /dev/sda7
sudo mount /dev/sda2 /mnt/boot ## if the EFI-partition is /dev/sda2
sudo mount --bind /dev /mnt/dev
sudo mount --bind /sys /mnt/sys
sudo mount --bind /proc /mnt/proc
sudo chroot /mnt
nano /etc/resolv.conf
... the contents

Code: Select all

nameserver 8.8.8.8
.... save and quit
Ctrl o
Ctrl x

Code: Select all

apt-get update
apt-get install grub-efi-amd64 grub-efi
mount /dev/sda2 /boot/efi ### if the efi partition is /dev/sda2
apt-get install --reinstall grub-efi grub-efi-amd64
update-grub

Code: Select all

exit
sudo umount /mnt/dev
sudo umount /mnt/sys
sudo umount /mnt/proc
sudo umount /mnt/boot
sudo umount /mnt

warehouse
Level 1
Level 1
Posts: 8
Joined: Thu Jun 21, 2018 6:03 am

Re: grub installation

Post by warehouse »

I tried every way possible but it did not work. My System is a UEFI Desktop Computer HP.
The computer has an NVIDIA graphics card and Secure Boot enabled.
My Linux Mint 18.3 partition is /dev/sda3 and the EFI System partition is on /dev/nvme0n1p1.
In conclusion, I decided to re-install LM18.3 on another partition in order to gain access to /dev/sda3
and of course it worked. Anyhow, I still wonder how to install the grub2 package from the LiveDVD 18.3.
Another thing that's worth mentioning is that during installation, I DID NOT turn-off Secure Boot to force the
use of xserver-xorg-video-nouveau (open-source driver). The System runs smoothly with that driver and Secure
Boot protects the computer from malicious attacks.
I'd like to thank all the people that answered my question and hope that in the future I'll make better use of
the LiveDVD with the appropriate help of course :-)

Post Reply

Return to “Installation & Boot”