You are not logged in.

#1 2024-08-22 08:33:52

LithoUser
Member
Registered: 2016-11-17
Posts: 173

[SOLVED] Grub update

Hello !

Since I installed Arch (in September 2020), I have never run “grub-install” again. However, I have run “grub-mkconfig” several times. Nevertheless, according to what I've read in several posts on this forum, it's sometimes necessary to run “grub-install” again after a major Grub update. Is this correct?

When I installed Grub, I used the following commands:

grub-install /dev/sda
grub-mkconfig -o /boot/grub/grub.cfg

I've just tried to update Grub, but the command :

grub-install /dev/sda

produces the following error messages:

grub-install : attention : le disque n'existe pas, donc repli vers le périphérique de partition /dev/sdb1.
grub-install : attention : le disque n'existe pas, donc repli vers le périphérique de partition /dev/sdb1.
grub-install : attention : le disque n'existe pas, donc repli vers le périphérique de partition /dev/sdb1.
grub-install : erreur : disque « hostdisk//dev/sdb1 » non disponible.

So in english, that would be something like :

grub-install: Warning: disk does not exist, so fall back to /dev/sdb1 partition device.
grub-install: error: disk “hostdisk//dev/sdb1” not available.

Why? What should I replace “/dev/sda” with?

Here's what's in my /etc/fstab file:

/dev/sda1           	/         	ext4      	rw,relatime	0 1
/dev/mapper/vgroup_new-lv_home_new	/home     	ext4      	rw,relatime,x-systemd.device-timeout=120	0 2
/dev/mapper/vgroup-lv_home   /mnt/old_HDD   ext4   defaults,nofail,x-systemd.device-timeout=120    0 2

Many thanks in advance for your help, and have a nice day!

Last edited by LithoUser (2024-08-23 14:48:11)

Offline

#2 2024-08-22 14:09:58

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,209

Re: [SOLVED] Grub update

The error message shows that you did in fact not pass /dev/sda -- but /dev/sdb. Also in terms of your fstab you can fail to boot the system should you have an USB stick connected depending on enumeration order of the actual /dev/sdX node, you should replace that with a persistent identifier.

If you think that should be correct, post the output of

lsblk -f
fdisk -l

Last edited by V1del (2024-08-22 14:11:53)

Offline

#3 2024-08-22 14:37:24

LithoUser
Member
Registered: 2016-11-17
Posts: 173

Re: [SOLVED] Grub update

V1del wrote:

Also in terms of your fstab you can fail to boot the system should you have an USB stick connected depending on enumeration order of the actual /dev/sdX node, you should replace that with a persistent identifier.

Silly me! Now that you say it, that seems obvious... So it should be something like this:

UUID=bla-bla-bla	/         	ext4      	rw,relatime	0 1
UUID=bla-bla-bla	/home     	ext4      	rw,relatime,x-systemd.device-timeout=120	0 2
UUID=bla-bla-bla   /mnt/old_HDD   ext4   defaults,nofail,x-systemd.device-timeout=120    0 2

Am I right?

$ lsblk -f
NAME               FSTYPE      FSVER    LABEL UUID                                   FSAVAIL FSUSE% MOUNTPOINTS
sda
└─sda1             crypto_LUKS 2              aff8603c-ffff-405c-9ee0-0ae83c118a07
  └─new_hdd        LVM2_member LVM2 001       PEBqC1-Fp8o-gfDW-yucg-OmtC-L5YZ-iOrXwO
    ├─vgroup_new-lv_swap_new
    │              swap        1              76bc9719-61ae-4b94-9695-ac852e7edc67
    └─vgroup_new-lv_home_new
                   ext4        1.0            d8cd8eda-f1b4-4521-9c09-7606c24f2186    743,9G    75% /home
sdb
└─sdb1             ext4        1.0            9e69dc04-0dce-48d4-8001-c6cb59e8446e     65,1G    11% /
sdc
└─sdc1             crypto_LUKS 1              051f2f0a-948a-4df0-bec3-82c5c15cbcb4
  └─old_hdd        LVM2_member LVM2 001       B6yEr7-uCkf-qagB-hwXg-k1JD-8gEu-zRvono
    ├─vgroup-lv_swap
    │              swap        1              7a270c63-a49e-4765-a508-e7ee8b8a0ed3
    └─vgroup-lv_home
                   ext4        1.0            54063790-c213-44df-92fb-84131bcd764d    432,1G    79% /home/sanfix/vidéos/
                                                                                                    /mnt/old_HDD
sdd
sde
sdf
sdg
$ LC_ALL=C sudo fdisk -l
Disk /dev/sda: 3.64 TiB, 4000787030016 bytes, 7814037168 sectors
Disk model: ST4000DX005-3GH1
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 3C2C2713-0029-4A9C-A011-F1DAC23D187A

Device     Start        End    Sectors  Size Type
/dev/sda1   2048 7814035455 7814033408  3.6T Linux LVM


Disk /dev/sdb: 119.24 GiB, 128035676160 bytes, 250069680 sectors
Disk model: Samsung SSD 840
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xb1b7c175

Device     Boot Start       End   Sectors  Size Id Type
/dev/sdb1  *     2048 166014975 166012928 79.2G 83 Linux


Disk /dev/sdc: 2.73 TiB, 3000592982016 bytes, 5860533168 sectors
Disk model: WDC WD30EFRX-68E
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 0B323398-2EF4-4468-92E0-9DB05D6B8133

Device     Start        End    Sectors  Size Type
/dev/sdc1   2048 5860533134 5860531087  2.7T Linux LVM


Disk /dev/mapper/new_hdd: 3.64 TiB, 4000768327680 bytes, 976750080 sectors
Units: sectors of 1 * 4096 = 4096 bytes
Sector size (logical/physical): 4096 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/mapper/vgroup_new-lv_swap_new: 4 GiB, 4294967296 bytes, 1048576 sectors
Units: sectors of 1 * 4096 = 4096 bytes
Sector size (logical/physical): 4096 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/mapper/vgroup_new-lv_home_new: 3.63 TiB, 3996471263232 bytes, 975700992 sectors
Units: sectors of 1 * 4096 = 4096 bytes
Sector size (logical/physical): 4096 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/mapper/old_hdd: 2.73 TiB, 3000589819392 bytes, 5860526991 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/mapper/vgroup-lv_swap: 4 GiB, 4294967296 bytes, 8388608 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/mapper/vgroup-lv_home: 2.73 TiB, 2996293337088 bytes, 5852135424 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes

Thank you very much for your help!

Last edited by LithoUser (2024-08-22 16:45:06)

Offline

#4 2024-08-22 15:35:02

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 9,003
Website

Re: [SOLVED] Grub update

LithoUser wrote:

according to what I've read in several posts on this forum, it's sometimes necessary to run “grub-install” again after a major Grub update. Is this correct?

Yes, that's right. The modules and core.img need to be updated, which will only happen if `grub-install` is run again.

LithoUser wrote:
sudo fdisk -l

/dev/sda is a GPT disk with no BIOS boot partition so the bootloader must be on /dev/sdb.

What happens if you run

grub-install /dev/sdb

If you see the error message again then please post the output of

xxd -l 512 /dev/sdb

And in future please prepend commands with LC_ALL=C to make them speak English. The French output is completely charming though, I might change mine to do that...


Jin, Jîyan, Azadî

Offline

#5 2024-08-22 16:43:36

LithoUser
Member
Registered: 2016-11-17
Posts: 173

Re: [SOLVED] Grub update

Thank you for your help!

Head_on_a_Stick wrote:

And in future please prepend commands with LC_ALL=C to make them speak English.

Great idea, I hadn't thought about that! I'm going to edit my previous post.

$ LC_ALL=C grub-install /dev/sdb
Installing for i386-pc platform.
grub-install: warning: disk does not exist, so falling back to partition device /dev/sdb1.
grub-install: warning: disk does not exist, so falling back to partition device /dev/sdb1.
grub-install: warning: disk does not exist, so falling back to partition device /dev/sdb1.
grub-install: error: disk `hostdisk//dev/sdb1' not found.
Head_on_a_Stick wrote:

If you see the error message again then please post the output of
xxd -l 512 /dev/sdb

I don't have xxd (I've read that it comes with vim; is that right? But I use neovim). Should I use xxh instead?

Offline

#6 2024-08-22 17:00:08

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 9,003
Website

Re: [SOLVED] Grub update

LithoUser wrote:

I don't have xxd (I've read that it comes with vim; is that right? But I use neovim). Should I use xxh instead?

There is also a tinyxxd package. I've not heard of xxh.

But it's not needed because I've missed something obvious: the grub-install command needs to be run as root wink


Jin, Jîyan, Azadî

Offline

#7 2024-08-22 19:11:13

LithoUser
Member
Registered: 2016-11-17
Posts: 173

Re: [SOLVED] Grub update

Just in case:

$ sudo tinyxxd -l 512 /dev/sdb
00000000: eb63 9010 8ed0 bc00 b0b8 0000 8ed8 8ec0  .c..............
00000010: fbbe 007c bf00 06b9 0002 f3a4 ea21 0600  ...|.........!..
00000020: 00be be07 3804 750b 83c6 1081 fefe 0775  ....8.u........u
00000030: f3eb 16b4 02b0 01bb 007c b280 8a74 018b  .........|...t..
00000040: 4c02 cd13 ea00 7c00 00eb fe00 0000 0000  L.....|.........
00000050: 0000 0000 0000 0000 0000 0080 0100 0000  ................
00000060: 0000 0000 fffa 9090 f6c2 8074 05f6 c270  ...........t...p
00000070: 7402 b280 ea79 7c00 0031 c08e d88e d0bc  t....y|..1......
00000080: 0020 fba0 647c 3cff 7402 88c2 52be 807d  . ..d|<.t...R..}
00000090: e817 01be 057c b441 bbaa 55cd 135a 5272  .....|.A..U..ZRr
000000a0: 3d81 fb55 aa75 3783 e101 7432 31c0 8944  =..U.u7...t21..D
000000b0: 0440 8844 ff89 4402 c704 1000 668b 1e5c  .@.D..D.....f..\
000000c0: 7c66 895c 0866 8b1e 607c 6689 5c0c c744  |f.\.f..`|f.\..D
000000d0: 0600 70b4 42cd 1372 05bb 0070 eb76 b408  ..p.B..r...p.v..
000000e0: cd13 730d 5a84 d20f 83d8 00be 8b7d e982  ..s.Z........}..
000000f0: 0066 0fb6 c688 64ff 4066 8944 040f b6d1  .f....d.@f.D....
00000100: c1e2 0288 e888 f440 8944 080f b6c2 c0e8  .......@.D......
00000110: 0266 8904 66a1 607c 6609 c075 4e66 a15c  .f..f.`|f..uNf.\
00000120: 7c66 31d2 66f7 3488 d131 d266 f774 043b  |f1.f.4..1.f.t.;
00000130: 4408 7d37 fec1 88c5 30c0 c1e8 0208 c188  D.}7....0.......
00000140: d05a 88c6 bb00 708e c331 dbb8 0102 cd13  .Z....p..1......
00000150: 721e 8cc3 601e b900 018e db31 f6bf 0080  r...`......1....
00000160: 8ec6 fcf3 a51f 61ff 265a 7cbe 867d eb03  ......a.&Z|..}..
00000170: be95 7de8 3400 be9a 7de8 2e00 cd18 ebfe  ..}.4...}.......
00000180: 4752 5542 2000 4765 6f6d 0048 6172 6420  GRUB .Geom.Hard
00000190: 4469 736b 0052 6561 6400 2045 7272 6f72  Disk.Read. Error
000001a0: 0d0a 00bb 0100 b40e cd10 ac3c 0075 f4c3  ...........<.u..
000001b0: 0000 0000 0000 0000 75c1 b7b1 0000 8004  ........u.......
000001c0: 0104 83fe c2ff 0008 0000 0028 e509 0000  ...........(....
000001d0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
000001e0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
000001f0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
Head_on_a_Stick wrote:

I've missed something obvious: the grub-install command needs to be run as root

So... should I use "sudo grub-install /dev/sda" or "sudo grub-install /dev/sdb"? I'm a little afraid of the possible damage...

Offline

#8 2024-08-22 19:43:20

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 9,003
Website

Re: [SOLVED] Grub update

The command will error out if you run it on /dev/sda so don't worry about that.

We can see GRUB is already present in the MBR of /dev/sdb so use that as the target device. Do not add a partition number, just use "/dev/sdb", nothing else.


Jin, Jîyan, Azadî

Offline

#9 2024-08-23 07:02:59

LithoUser
Member
Registered: 2016-11-17
Posts: 173

Re: [SOLVED] Grub update

Head_on_a_Stick wrote:

We can see GRUB is already present in the MBR of /dev/sdb

Where can I see this?

Last edited by LithoUser (2024-08-23 08:16:36)

Offline

#10 2024-08-23 13:30:06

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 9,003
Website

Re: [SOLVED] Grub update

LithoUser wrote:
00000180: 4752 5542 2000 4765 6f6d 0048 6172 6420  GRUB .Geom.Hard

Jin, Jîyan, Azadî

Offline

#11 2024-08-23 13:52:10

LithoUser
Member
Registered: 2016-11-17
Posts: 173

Re: [SOLVED] Grub update

OK, I've done it and it worked fine! Thank you very much V1del and Head_on_a_Stick for your help!

One last thing before I mark the post as "Solved", if you may:

$ sudo tinyxxd -l 512 /dev/sdb
...
00000190: 4469 736b 0052 6561 6400 2045 7272 6f72  Disk.Read. Error
...

Should I be worried?

Last edited by LithoUser (2024-08-23 14:02:48)

Offline

#12 2024-08-23 14:07:54

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 9,003
Website

Re: [SOLVED] Grub update

No, it's fine. They all do that mate tongue


Jin, Jîyan, Azadî

Offline

#13 2024-08-23 14:47:58

LithoUser
Member
Registered: 2016-11-17
Posts: 173

Re: [SOLVED] Grub update

Thank you very much! Problem solved!

Offline

Board footer

Powered by FluxBB