Welcome!
Important information
-- Information on torrent hosting changes
-- Information on MX15/16 GPG Keys
-- Spectre and Meltdown vulnerabilities

News
-- MX Linux on social media: here
-- Mepis support still here

Current releases
-- MX-18.1 Point Release release info here
-- Migration Information to MX-18 here
-- antiX-17.3.1 release info here

New users[/u
-- Please read this first, and don't forget to add system and hardware information to posts!
-- Here are the Forum Rules

How do I find where Grub is installed?

philotux
Forum Regular
Forum Regular
Posts: 394
Joined: Sun Apr 22, 2018 12:57 pm

How do I find where Grub is installed?

#1

Post by philotux » Mon Feb 11, 2019 5:10 am

This current system consists of three partitions: EFI, root and home. When installing, I pointed the installer to the EFI partition for the location of the installation of the Grub. However, when I look into the folder /boot/efi, it's empty. Am I looking at the wrong location?

I have also noticed that when running the system the EFI partition is not mounted. Only / and /home are mounted.
mx-test.png
You do not have the required permissions to view the files attached to this post.

User avatar
oops
Forum Regular
Forum Regular
Posts: 607
Joined: Tue Apr 10, 2018 5:07 pm

Re: How do I find where Grub is installed?

#2

Post by oops » Mon Feb 11, 2019 8:29 am

Hi,
FYI: You can run this script below, as root:

GRUB_where_is-grub_installed.sh
chmod +x GRUB_where_is-grub_installed.sh

Code: Select all

#!/bin/bash

# Show which disk GRUB is installed on?
# https://forum.mxlinux.org/viewtopic.php?f=104&t=47067
# GRUB_where_is-grub_installed.sh

 bold=$(echo -e "\e[1m")
 norm=$(echo -e "\e[0m")
  red=$(echo -e "\e[1;31m")
green=$(echo -e "\e[1;32m")

if [ "$(id -u)" != 0 ]; then
  echo "Please, start with:$bold sudo $(basename $0)$norm"
  exit 1
fi

fdisk -l | egrep -o "/dev/[[:alnum:]]+" | sort | uniq |
while read part; do
  egrep -q [[:digit:]] <<< $part || echo "----------------------------------"
  echo -en "$part\t"
#  dd if=$part bs=1 count=512 | grep -aq GRUB && echo -n "$green" || echo -n "${red}No "
  od -tx1z -Ax -N 512 $part  | grep -aq GRUB && echo -n "$green" || echo -n "${red}No "

  echo "GRUB found$norm"
done 2>/dev/null
echo "----------------------------------" 
exit 0
Sample result:

Code: Select all

./GRUB_where_is-grub_installed.sh 
----------------------------------
/dev/sda	GRUB found
/dev/sda1	No GRUB found
/dev/sda2	No GRUB found
/dev/sda3	No GRUB found
/dev/sda5	No GRUB found
/dev/sda6	GRUB found
/dev/sda7	No GRUB found
----------------------------------
$ inxi -Fxxxz : System: Host:XEON ... Distro: MX-18_x64 Continuum

philotux
Forum Regular
Forum Regular
Posts: 394
Joined: Sun Apr 22, 2018 12:57 pm

Re: How do I find where Grub is installed?

#3

Post by philotux » Mon Feb 11, 2019 8:36 am

It looks that I didn't search the forum properly :bagoverhead:
I'll run the script as suggested, thanks so much oops.

User avatar
Jerry3904
Forum Veteran
Forum Veteran
Posts: 23742
Joined: Wed Jul 19, 2006 6:13 am

Re: How do I find where Grub is installed?

#4

Post by Jerry3904 » Mon Feb 11, 2019 8:37 am

@oops: Nice!
Production: 4.15.0-1-amd64, MX-17.1, AMD FX-4130 Quad-Core, GeForce GT 630/PCIe/SSE2, 8 GB, SSD 120 GB, Data 1TB
Testing: AAO 722: 4.15.0-1-386. MX-17.1, AMD C-60 APU, 4 GB
Personal: XPS 13, 4.18.0-19.3-liquorix, 4 GB

User avatar
oops
Forum Regular
Forum Regular
Posts: 607
Joined: Tue Apr 10, 2018 5:07 pm

Re: How do I find where Grub is installed?

#5

Post by oops » Mon Feb 11, 2019 8:48 am

philotux wrote:
Mon Feb 11, 2019 8:36 am
It looks that I didn't search the forum properly :bagoverhead:
I'll run the script as suggested, thanks so much oops.
You 're welcome.
$ inxi -Fxxxz : System: Host:XEON ... Distro: MX-18_x64 Continuum

philotux
Forum Regular
Forum Regular
Posts: 394
Joined: Sun Apr 22, 2018 12:57 pm

Re: How do I find where Grub is installed?

#6

Post by philotux » Mon Feb 11, 2019 8:51 am

Code: Select all

sudo ./where-is-grub-installed.sh
----------------------------------
/dev/sda	No GRUB found
dev/sda7	No GRUB found
/dev/sda8	No GRUB found
/dev/sda9	No GRUB found
/dev/sda10	No GRUB found
/dev/sda11	GRUB found
/dev/sda12	No GRUB found


These are my two adjacent MX installations. I am certain that I choose /dev/sda7 (EFI) as the location for the grub. /dev/sda11 is actually the root of my second MX on this disk. Looks like I have messed up (big time) my Grub management(?)

User avatar
Paul..
Forum Guide
Forum Guide
Posts: 2458
Joined: Sun Mar 18, 2007 6:34 pm

Re: How do I find where Grub is installed?

#7

Post by Paul.. » Mon Feb 11, 2019 8:56 am

@oops, I second the motion! very cool

Asus Prime X470-Pro | AMD Ryzen 5 1400 (8 threads)
16 Gig DDR4 3000 | nVidia - GeForce GTX 750 Ti
Samsung 970 NVMe SSD | 860 500GB SSD

philotux
Forum Regular
Forum Regular
Posts: 394
Joined: Sun Apr 22, 2018 12:57 pm

Re: How do I find where Grub is installed?

#8

Post by philotux » Mon Feb 11, 2019 9:06 am

Code: Select all

#!/bin/bash
# Show which disk GRUB is installed on?
# https://forum.mxlinux.org/viewtopic.php?f=104&t=47067
The post/thread that the scripts refers to suggests that this will locate the grub for a MBR/Bios system. Mine is however a GPT/UEFI.
fehlix wrote:
Fri Nov 23, 2018 10:14 pm

Based on @male's post within the German forum : viewtopic.php?p=466247#p466247
here a slidely adapted version to show Grub installations in MBR/BIOS systems
--snip--

User avatar
oops
Forum Regular
Forum Regular
Posts: 607
Joined: Tue Apr 10, 2018 5:07 pm

Re: How do I find where Grub is installed?

#9

Post by oops » Mon Feb 11, 2019 9:37 am

... Yes, I have adapted the @male's script (see the link into the script), and modified the dd by od (less dangerous).
$ inxi -Fxxxz : System: Host:XEON ... Distro: MX-18_x64 Continuum

User avatar
Jerry3904
Forum Veteran
Forum Veteran
Posts: 23742
Joined: Wed Jul 19, 2006 6:13 am

Re: How do I find where Grub is installed?

#10

Post by Jerry3904 » Mon Feb 11, 2019 10:17 am

Jerry3904 wrote:
Mon Feb 11, 2019 8:37 am
@oops: Nice!
Should have said "nice" to Male and fehlix ::)
Production: 4.15.0-1-amd64, MX-17.1, AMD FX-4130 Quad-Core, GeForce GT 630/PCIe/SSE2, 8 GB, SSD 120 GB, Data 1TB
Testing: AAO 722: 4.15.0-1-386. MX-17.1, AMD C-60 APU, 4 GB
Personal: XPS 13, 4.18.0-19.3-liquorix, 4 GB

Post Reply

Return to “Installation”