You are not logged in.

#1 2022-09-01 15:44:10

quiqueck
Member
Registered: 2013-04-15
Posts: 64

[Solved] Where has been grub installed?

Since the update of grub needs manual intervention i am unsure where i had installed grub… My system is running since 2013 on a non UEFI system so had installed grub to a MBR, but which harddrive?

$:> LC_ALL=C lsblk
NAME   LABEL         FSTYPE   SIZE FSAVAIL MOUNTPOINT       UUID
sda                         232.9G                          
|-sda1 Windows       ntfs    39.1G                          D4104CE9104CD460
|-sda2                          1K                          
|-sda5 VMs           ext3    94.2G   30.5G /run/media/VMs   43baff62-585e-4802-b71b-3598be0bb2fb
|-sda6               swap     2.5G                          a6691214-03d7-4792-a31e-e6f49d7d35ab
`-sda7 Daten         ntfs      97G   67.1G /run/media/Daten 4688B73734B455D1
sdb                         119.2G                          
|-sdb1 arch_root_new ext4    19.6G                          f4633465-f70c-4b86-9e95-88ab9cac5773
`-sdb2 arch_home_new ext4    58.6G                          cc75b52d-0ac0-4240-b459-80cc905ae795
sdc                         447.1G                          
|-sdc1 arch_root     ext4      40G   19.1G /                dfb61aac-71a9-412e-9528-730c63750354
|-sdc2 arch_swap     swap       4G         [SWAP]           676f657f-55cc-4423-a2ae-6d6b2bda8f62
|-sdc3 arch_home     ext4     100G   40.7G /home            e46de322-93a7-43d2-adeb-49031a288e28
`-sdc4 daten_neu     ext4   303.1G                          1bbf4bfb-d079-438f-a9fa-7ba935123c9f
sr0                          1024M                          
sr1                          1024M

As you can see there are three hard-drives where sdc is a SSD containing my main system. sdb is currently not in use.

How  do i find out on which MBR of the harddrives i installed grub long years ago to get grub reinstalled on the same MBR when executing

grub-install --target=i386-pc /dev/sdX

?

Last edited by quiqueck (2022-09-02 05:56:03)

Offline

#2 2022-09-01 15:52:14

mpan
Member
Registered: 2012-08-01
Posts: 904
Website

Re: [Solved] Where has been grub installed?

The MBR will contain bootstrap code, which should contain GRUB-related texts. So see the output of:

sudo head -c 512 /dev/sdX | strings

If only one of the disks contains “GRUB”, you know which one is it.


Sometimes I seem a bit harsh — don’t get offended too easily! PGP: 7C848198AE93D3BB

Offline

#3 2022-09-01 20:21:35

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 17,032

Re: [Solved] Where has been grub installed?

You can also check your BIOS which drive it is booting by default. It's likely that will be the GRUB drive. Just from a "that would make the most sense" perspective it would be /dev/sdc as that is apparently where your install lives, but yes the flexibility of GRUB would technically allow you to have the GRUB MBR bootstrap somewhere else (I think, not sure whether the bootstrap code can contain enough logic to search out a completely distinct drive for loading the rest of the config but who knows)

Offline

#4 2022-09-01 22:32:35

amish
Member
Registered: 2014-05-10
Posts: 447

Re: [Solved] Where has been grub installed?

Try if this helps in anyway.

file -s /dev/sdX


Forum signature: I discuss. I put my thoughts strongly. But I definitely respect all developers and time they put in.

Offline

#5 2022-09-02 05:55:41

quiqueck
Member
Registered: 2013-04-15
Posts: 64

Re: [Solved] Where has been grub installed?

Many thanks!

mpan wrote:

The MBR will contain bootstrap code, which should contain GRUB-related texts. So see the output of:

sudo head -c 512 /dev/sdX | strings

If only one of the disks contains “GRUB”, you know which one is it.

I used

sudo head -c 512 /dev/sdX | strings | grep -i grub

and this showed me that sdc is the harddrive where GRUB was installed.

V1del wrote:

You can also check your BIOS which drive it is booting by default. It's likely that will be the GRUB drive. Just from a "that would make the most sense" perspective it would be /dev/sdc as that is apparently where your install lives, but yes the flexibility of GRUB would technically allow you to have the GRUB MBR bootstrap somewhere else (I think, not sure whether the bootstrap code can contain enough logic to search out a completely distinct drive for loading the rest of the config but who knows)

Oh yes, probably. But rebooting the system to get into bios was to much waiting time wink

amish wrote:

Try if this helps in anyway.

file -s /dev/sdX

This did not work, it showed for sdb and sdc the same output:

$:> sudo file -s /dev/sdc
/dev/sdc: DOS/MBR boot sector

Offline

#6 2022-09-02 14:08:08

amish
Member
Registered: 2014-05-10
Posts: 447

Re: [Solved] Where has been grub installed?

For me it gives more detailed answer:

> file -s /dev/sda
/dev/sda: DOS/MBR boot sector; GRand Unified Bootloader, stage1 version 0x3, boot drive 0x80, 1st sector stage2 0xa002d15

May be you had old grub. Check again after doing grub-install.


Forum signature: I discuss. I put my thoughts strongly. But I definitely respect all developers and time they put in.

Offline

#7 2022-09-02 15:52:39

quiqueck
Member
Registered: 2013-04-15
Posts: 64

Re: [Solved] Where has been grub installed?

I did the update of grub and ran

grub-install …

and regenerated grub.cfg, restart, all seems to be fine. Thanks again :-)

amish wrote:

For me it gives more detailed answer:

> file -s /dev/sda
/dev/sda: DOS/MBR boot sector; GRand Unified Bootloader, stage1 version 0x3, boot drive 0x80, 1st sector stage2 0xa002d15

I do not have such an output, it's still the same:

$:> sudo file -s /dev/sda
/dev/sda: DOS/MBR boot sector MS-MBR Windows 7 english at offset 0x163 "Invalid partition table" at offset 0x17b "Error loading operating system" at offset 0x19a "Missing operating system", disk signature 0x2fb82fb7; partition 1 : ID=0x7, active, start-CHS (0x0,32,33), end-CHS (0x3ff,254,63), startsector 2048, 81920000 sectors; partition 2 : ID=0x5, start-CHS (0x3ff,254,63), end-CHS (0x3ff,254,63), startsector 81931561, 406460504 sectors

$:> sudo file -s /dev/sdb
/dev/sdb: DOS/MBR boot sector

$:> sudo file -s /dev/sdc
/dev/sdc: DOS/MBR boot sector

Grub version:

$:> LC_ALL=C pacman -Qi grub
Name            : grub
Version         : 2:2.06.r322.gd9b4638c5-3

Offline

Board footer

Powered by FluxBB