Score:0

Installing and creating a configuration for GRUB (Ubuntu 18, RAID1, LVM). Problems

pe flag

There is my config (VirtualBox):

    sda                   8:0    0   10G  0 disk
├─sda1                8:1    0  512M  0 part  /boot/efi
└─sda2                8:2    0  8.5G  0 part
  └─vg0-lv0         253:0    0  8.5G  0 lvm   /
sdb                   8:16   0   15G  0 disk
├─sdb1                8:17   0  512M  0 part
└─sdb2                8:18   0 14.5G  0 part
  └─md0               9:0    0 14.5G  0 raid1
    └─datavg-datalv 253:1    0 14.5G  0 lvm
sdc                   8:32   0   15G  0 disk
├─sdc1                8:33   0  512M  0 part
└─sdc2                8:34   0 14.5G  0 part
  └─md0               9:0    0 14.5G  0 raid1
    └─datavg-datalv 253:1    0 14.5G  0 lvm
sr0                  11:0    1 50.5M  0 rom

Now my system boots successfully, I see GRUB menu. I'm doing a system disk transfer from lv0 to datalv. After that I ran into a problem installing GRUB and creating a config file for it.

How I did:

sudo mount /dev/datavg/datalv /mnt 
sudo mount /dev/sdb1 /mnt/boot/efi

sudo mount --bind /dev /mnt/dev &&
sudo mount --bind /dev/pts /mnt/dev/pts &&
sudo mount --bind /proc /mnt/proc &&
sudo mount --bind /sys /mnt/sys

sudo chroot /mnt

grub-install --target=x86_64-efi /dev/sdb

grub-install --recheck /dev/sdb

exit &&
sudo umount /mnt/sys &&
sudo umount /mnt/proc &&
sudo umount /mnt/dev/pts &&
sudo umount /mnt/dev &&
sudo umount /mnt

After that, I disconnect the system disk (sda) and try to boot from sdb. Unfortunately I get a broken GRUB. I see the just grub> console (not resque).

I want to install GRUB on 2 disks sdb1 and sdc1 and specify in grub.cfg that my system is on LVM (datavg/datalv).

Please point out my mistakes to me. What am I doing wrong? Am I going to have to clone sda1 and manually edit that awful file grub.cfg?

Thanks!

oldfred avatar
cn flag
Grub normally installs to ESP - efi system partition on first drive. Check your fstab. I prefer to have an ESP on every drive, but not required. You also cannot have duplicate UUIDs. But if RAID, I assume then duplicates are allowed?
Maxy avatar
pe flag
``` fdisk /dev/sdb или sdc for 1 partition: ``` Device: /dev/sdb1 Start: 2048 End: 1050623 Sectors: 1048576 Size: 512M Type: EFI System ``` However, on ``` grub-install /dev/sdb ``` i get installation to sda disk. The only thing I want to do is to make new the config file for a specific disk like /dev/sdb, sdc ``` grub-mkconfig -o /boot/grub/grub.cfg ``` But it doesn't work even when I do a chroot.
oldfred avatar
cn flag
If you are getting grub install to sda, then your fdisk has the UUID of an ESP on sda. Change fstab to have UUID of ESP you want, then run `sudo grub-install` and it will use ESP in fstab.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.