Install on RAID1 + RAID10 on EFI system and GPT (4HDDs)

General support questions
Post Reply
tidusuper91
Posts: 10
Joined: 2013/10/06 14:44:21

Install on RAID1 + RAID10 on EFI system and GPT (4HDDs)

Post by tidusuper91 » 2016/02/17 12:18:49

Hello,

I've been struggling with that for a week now without succeeding, I'm testing on VirtualBox.
The thing is that even preparing the RAID arrays before installing is not working:

Pre-preparing partitions


Disks

Code: Select all

/dev/sda
/dev/sdb
/dev/sdc
/dev/sdd
GPT Table

Code: Select all

/dev/sda1  200MiB ef00 FAT # EFI Partition
/dev/sda2  500MiB fd00
/dev/sda3  3.3GiB fd00
/dev/sda4  4GiB   fd00 

sgdsik --backup=table /dev/sda
sgdisk --load-backup=table /dev/sd[bcd]
sgdisk -G /dev/sd[bcd]

RAID Creation

Code: Select all

mdadm --create /dev/md0 --metadata=1.0 --level=1 --raid-devices=4 /dev/sda2 /dev/sdb2 /dev/sdc2 /dev/sdd2 #/boot
mdadm --create /dev/md1 --level=1 --raid-devices=4 /dev/sda3 /dev/sdb3 /dev/sdc3 /dev/sdd3 #/root - swap
mdadm --create /dev/md2 --level=10 --raid-devices=4 /dev/sda4 /dev/sdb4 /dev/sdc4 /dev/sdd4 # /home, /var
LVM

Code: Select all

pvcreate /dev/md1
pvcreate /dev/md2

vgcreate vgrootswap /dev/md1
vgcreate vghomevar /dev/md2

lvcreate -L 1G -n lvswap vgrootswap
lvcreate -l 100%FREE -n lvroot vgrootswap
lvcreate -l 60%FREE -n lvhome vghomevar
lvcreate -l 100%FREE -n lvvar vghomevar
Formatting

Code: Select all

mkfs.xfs /dev/md0
mkfs.ext4 /dev/mapper/lv[root home var]
mkswap /dev/mapper/lvswap
This strategy leads to CentOs install wizard to not detect correctly the volumes or partitions (see this thread)

So I changed strategy installing first to /dev/sda then Booting from the LiveCD in rescue mode and migrating the files on degraded arrays, then booting from the degraded array and adding /dev/sda back to the arrays:

Booting Rescue Mode from LiveCD

GPT Table

Code: Select all

/dev/sdb1  200MiB ef00 FAT # EFI Partition
/dev/sdb2  500MiB fd00
/dev/sdb3  3.3GiB fd00
/dev/sdb4  4GiB   fd00 

sgdsik --backup=table /dev/sdb
sgdisk --load-backup=table /dev/sd[cd]
sgdisk -G /dev/sd[cd]
RAID Creation

Code: Select all

mdadm --create /dev/md0 --metadata=1.0 --level=1 --raid-devices=4 missing /dev/sdb2 /dev/sdc2 /dev/sdd2 #/boot
mdadm --create /dev/md1 --level=1 --raid-devices=4 missing /dev/sdb3 /dev/sdc3 /dev/sdd3 #/root - swap
mdadm --create /dev/md2 --level=10 --raid-devices=4 missing /dev/sdb4 /dev/sdc4 /dev/sdd4 # /home, /var
Clone EFI

Code: Select all

dd if=/dev/sda1 of=/dev/sd[bcd]1 bs=1M
LVM

Code: Select all

pvcreate /dev/md1
pvcreate /dev/md2

vgcreate vgrootswap /dev/md1
vgcreate vghomevar /dev/md2

lvcreate -L 1G -n lvswap vgrootswap
lvcreate -l 100%FREE -n lvroot vgrootswap
lvcreate -l 60%FREE -n lvhome vghomevar
lvcreate -l 100%FREE -n lvvar vghomevar
Formatting

Code: Select all

mkfs.xfs /dev/md0
mkfs.ext4 /dev/mapper/lv[root home var]
mkswap /dev/mapper/lvswap
DATA MIGRATION

Code: Select all

mkdir /mnt/root.old
mount /dev/mapper/centos-root /mnt/root.old
mkdir /mnt/root.new
mount /dev/mapper/vgrootswap-lvroot /mnt/root.new

mkdir /mnt/boot.old
mount /dev/sda2 /mnt/boot.old
mkdir /mnt/boot.new
mount /dev/md0 /mnt/boot.new

rsync -auxHAXSv --exclude=/mnt/root.old/var/*  /mnt/root.old /mnt/root.new
rsync -auxHAXSv  /mnt/boot.old /mnt/boot.new

# Same for home and var (swap not needed).

Now what I miss is how to install GRUB and make the system booting from the RAID. All the articles I read were about Centos 6 and MBR systems.

What do you think about this strategy? Is it the way to go or there are better paths?

Thanks for helping,

User avatar
igorek24
Posts: 90
Joined: 2013/11/13 06:11:37

Re: Install on RAID1 + RAID10 on EFI system and GPT (4HDDs)

Post by igorek24 » 2016/02/26 07:12:55

I was in the same boat with Arch Linux. here are the steps I took, it may or may not help you. You dint have to use grub with EFI firmware, but I'm not sure, I newer setup centos that way. I always used Anaconda to setup raid and lvm.
Attachments
Arch_Raid_luks_lvm.txt
(2.1 KiB) Downloaded 266 times

tidusuper91
Posts: 10
Joined: 2013/10/06 14:44:21

Re: Install on RAID1 + RAID10 on EFI system and GPT (4HDDs)

Post by tidusuper91 » 2016/02/26 10:12:48

igorek24 wrote:I was in the same boat with Arch Linux. here are the steps I took, it may or may not help you. You dint have to use grub with EFI firmware, but I'm not sure, I newer setup centos that way. I always used Anaconda to setup raid and lvm.
Thanks for your post. In any case I cannot use Anaconda since it seems that it can't handle RAID10 devices it can handle RAID10 but it does not create EFI partitions on all the disks so I need to pass to manual configuration in any case. I will check on Arch notes you posted.
The most closer article I found is this but it's a bit outdated, I think that the patch to GRUB2 is not needed anymore, and in addition the GRUB2 configuration must be rebuilt.

I miss just this last step, reconfigure GRUB2 configuration and set up EFI boot order.
Last edited by tidusuper91 on 2016/02/27 14:34:57, edited 1 time in total.

atmh
Posts: 4
Joined: 2016/02/24 19:54:29

Re: Install on RAID1 + RAID10 on EFI system and GPT (4HDDs)

Post by atmh » 2016/02/27 14:32:58

@tidusuper91,

To add the EFI boot options, you can run the following command:

Code: Select all

for i in b c d; do
efibootmgr --create --disk /dev/sd$i --label "CentOS Backup - /dev/sd$i" --load "\\EFI\\redhat\\grub.efi";
done
Now you can configure Grub2 menu entries like so:

Code: Select all

sudo grub2-mkconfig -o /boot/efi/EFI/redhat/grub.cfg
Make sure your initramfs has the raid components necessary to avoid boot issues.
Refer to the following two posts for further reading:
viewtopic.php?f=47&t=56591
viewtopic.php?f=13&t=46952

Hope this helps,
Regards,

tidusuper91
Posts: 10
Joined: 2013/10/06 14:44:21

Re: Install on RAID1 + RAID10 on EFI system and GPT (4HDDs)

Post by tidusuper91 » 2016/02/27 15:39:49

atmh wrote:@tidusuper91,

To add the EFI boot options, you can run the following command:

Code: Select all

for i in b c d; do
efibootmgr --create --disk /dev/sd$i --label "CentOS Backup - /dev/sd$i" --load "\\EFI\\redhat\\grub.efi";
done
Now you can configure Grub2 menu entries like so:

Code: Select all

sudo grub2-mkconfig -o /boot/efi/EFI/redhat/grub.cfg
Make sure your initramfs has the raid components necessary to avoid boot issues.
Refer to the following two posts for further reading:
viewtopic.php?f=47&t=56591
viewtopic.php?f=13&t=46952

Hope this helps,
Regards,
Ok, thank you.

PS: Shouldn't it be centos and not redhat?

Code: Select all

for i in b c d; do
efibootmgr --create --disk /dev/sd$i --label "CentOS Backup - /dev/sd$i" --load "\\EFI\\centos\\grub.efi";
done

tidusuper91
Posts: 10
Joined: 2013/10/06 14:44:21

Re: Install on RAID1 + RAID10 on EFI system and GPT (4HDDs)

Post by tidusuper91 » 2016/02/28 11:54:36

No luck. I cannot really understand what I'm missing.

To recap briefly (The commands are given from the system installed on /dev/sda):

- I'm testing the procedure on a VirtualBox VM. 4 HDDs. I installed the system only on the first hard disk /dev/sda.

Code: Select all

lsblk
NAME              MAJ:MIN RM  SIZE RO TYPE   MOUNTPOINT
sda                 8:0    0    8G  0 disk   
├─sda1              8:1    0  200M  0 part   /boot/efi
├─sda2              8:2    0  500M  0 part   /boot
└─sda3              8:3    0  7,3G  0 part   
  ├─centos-root   253:0    0  6,5G  0 lvm    /
  └─centos-swap   253:1    0  820M  0 lvm    [SWAP]
sdb                 8:16   0    8G  0 disk   
├─sdb1              8:17   0  200M  0 part   
├─sdb2              8:18   0  500M  0 part   
│ └─md125           9:125  0  500M  0 raid1  
├─sdb3              8:19   0  3,2G  0 part   
│ └─md126           9:126  0  3,2G  0 raid1  
│   ├─vgroot-swap 253:3    0    1G  0 lvm    
│   └─vgroot-root 253:4    0  2,2G  0 lvm    /mnt/raidsys
└─sdb4              8:20   0  4,1G  0 part   
  └─md127           9:127  0  8,2G  0 raid10 
    └─vghome-home 253:2    0  8,2G  0 lvm    
sdc                 8:32   0    8G  0 disk   
├─sdc1              8:33   0  200M  0 part   
├─sdc2              8:34   0  500M  0 part   
│ └─md125           9:125  0  500M  0 raid1  
├─sdc3              8:35   0  3,2G  0 part   
│ └─md126           9:126  0  3,2G  0 raid1  
│   ├─vgroot-swap 253:3    0    1G  0 lvm    
│   └─vgroot-root 253:4    0  2,2G  0 lvm    /mnt/raidsys
└─sdc4              8:36   0  4,1G  0 part   
  └─md127           9:127  0  8,2G  0 raid10 
    └─vghome-home 253:2    0  8,2G  0 lvm    
sdd                 8:48   0    8G  0 disk   
├─sdd1              8:49   0  200M  0 part   
├─sdd2              8:50   0  500M  0 part   
│ └─md125           9:125  0  500M  0 raid1  
├─sdd3              8:51   0  3,2G  0 part   
│ └─md126           9:126  0  3,2G  0 raid1  
│   ├─vgroot-swap 253:3    0    1G  0 lvm    
│   └─vgroot-root 253:4    0  2,2G  0 lvm    /mnt/raidsys
└─sdd4              8:52   0  4,1G  0 part   
  └─md127           9:127  0  8,2G  0 raid10 
    └─vghome-home 253:2    0  8,2G  0 lvm    
sr0                11:0    1 56,3M  0 rom    
-Then I created three RAID arrays, two RAID1 one RAID10, on the other three hard disks.

Code: Select all

mdadm --examine --scan --verbose

ARRAY /dev/md/boot  level=raid1 metadata=1.0 num-devices=4 UUID=1f726cc3:387c49c3:3cee8230:f11a4640 name=localhost:boot
   devices=/dev/sdd2,/dev/sdc2,/dev/sdb2
ARRAY /dev/md/root  level=raid1 metadata=1.2 num-devices=4 UUID=fea6baab:29711848:997387aa:295ec48f name=localhost:root
   devices=/dev/sdd3,/dev/sdc3,/dev/sdb3
ARRAY /dev/md/home  level=raid10 metadata=1.2 num-devices=4 UUID=edf6287a:ba1236a6:2a3471d2:edac85cb name=localhost:home
   devices=/dev/sdd4,/dev/sdc4,/dev/sdb4
- I created two lvm volumes group on the two RAIDs /dev/md/root; /dev/md/boot

Code: Select all

vgs
  VG     #PV #LV #SN Attr   VSize VFree 
  centos   1   2   0 wz--n- 7,31g 40,00m
  vghome   1   1   0 wz--n- 8,18g     0 
  vgroot   1   2   0 wz--n- 3,22g     0 
lvs
  LV   VG     Attr       LSize   Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  root centos -wi-ao----   6,47g                                                    
  swap centos -wi-ao---- 820,00m                                                    
  home vghome -wi-a-----   8,18g                                                    
  root vgroot -wi-a-----   2,22g                                                    
  swap vgroot -wi-a-----   1,00g                                                    
- I mounted all the partitions and copied the files from /dev/sda to the right partitions on dev/md/[boot root home]
- blkid

Code: Select all

/dev/block/8:3: UUID="PrdgtS-318r-Fr5f-y184-hglH-OZZm-bTcr05" TYPE="LVM2_member" PARTUUID="20c49ba3-4554-4b84-81ce-73dc475772c8" 
/dev/block/253:0: UUID="3e9ce32e-8b26-4053-ad4e-1b75fda46260" TYPE="xfs" 
/dev/block/8:2: UUID="1c8085bb-a226-4435-8e6f-0953025f6f1a" TYPE="xfs" PARTUUID="ec149263-e6fb-4173-90e8-ead6bcc7d7ec" 
/dev/block/8:1: SEC_TYPE="msdos" UUID="1E4D-DBA3" TYPE="vfat" PARTLABEL="EFI System Partition" PARTUUID="b5c88e63-06fa-4f20-8cb9-9bad8b5c79fc" 
/dev/block/253:1: UUID="b9c3c080-76d4-44e2-a0b6-3260193d6345" TYPE="swap" 
/dev/sr0: UUID="2016-01-19-16-46-09-00" LABEL="VBOXADDITIONS_5.0.14_105127" TYPE="iso9660" 
/dev/sdb1: SEC_TYPE="msdos" UUID="CEE8-7E69" TYPE="vfat" PARTLABEL="EFI System Partition" PARTUUID="2a458d61-6959-4ec3-a283-1c4d1f76f69d" 
/dev/sdb2: UUID="1f726cc3-387c-49c3-3cee-8230f11a4640" UUID_SUB="349956d0-e1e9-dcb4-1054-ab700cc64004" LABEL="localhost:boot" TYPE="linux_raid_member" PARTUUID="5cca664e-0cad-44c6-8165-d7a77745f45a" 
/dev/sdb3: UUID="fea6baab-2971-1848-9973-87aa295ec48f" UUID_SUB="07be5c6b-3d27-daad-85ea-a6c6e78fd22a" LABEL="localhost:root" TYPE="linux_raid_member" PARTLABEL="Linux RAID" PARTUUID="ae26fa90-9493-4984-a44e-2892ef11604a" 
/dev/sdb4: UUID="edf6287a-ba12-36a6-2a34-71d2edac85cb" UUID_SUB="d04ed8bb-c427-ad9e-3b0f-3186cf38c17e" LABEL="localhost:home" TYPE="linux_raid_member" PARTLABEL="Linux RAID" PARTUUID="a4ddae48-2c8e-427d-80ec-3c856e80c752" 
/dev/sdc1: SEC_TYPE="msdos" UUID="EE8B-2290" TYPE="vfat" PARTLABEL="EFI System Partition" PARTUUID="bd520660-8448-4bda-9a10-0f03d90468eb" 
/dev/sdc2: UUID="1f726cc3-387c-49c3-3cee-8230f11a4640" UUID_SUB="4ea6709b-1c30-8476-063a-147c8230fa5c" LABEL="localhost:boot" TYPE="linux_raid_member" PARTUUID="1c5f95bb-e4a3-4438-a538-824b6a85176f" 
/dev/sdc3: UUID="fea6baab-2971-1848-9973-87aa295ec48f" UUID_SUB="18d60a38-6306-6f0b-2aad-f5b2fe3dfba1" LABEL="localhost:root" TYPE="linux_raid_member" PARTLABEL="Linux RAID" PARTUUID="1d775697-113c-4bf4-bfec-6f5768b6a0fb" 
/dev/sdc4: UUID="edf6287a-ba12-36a6-2a34-71d2edac85cb" UUID_SUB="7454fefb-3217-16ad-9334-f36db6ab2038" LABEL="localhost:home" TYPE="linux_raid_member" PARTLABEL="Linux RAID" PARTUUID="5f0f489b-60ff-4958-a24c-ad05e9c8e840" 
/dev/sdd1: SEC_TYPE="msdos" UUID="EFF5-FDC4" TYPE="vfat" PARTLABEL="EFI System Partition" PARTUUID="a0670bb3-8dc4-4af9-b5d2-51609caf999a" 
/dev/sdd2: UUID="1f726cc3-387c-49c3-3cee-8230f11a4640" UUID_SUB="9508d1ed-237a-d782-ddaa-87099b90a08d" LABEL="localhost:boot" TYPE="linux_raid_member" PARTUUID="9a4abae3-0ccc-460d-9bd9-814ca391cf69" 
/dev/sdd3: UUID="fea6baab-2971-1848-9973-87aa295ec48f" UUID_SUB="dca1324c-f034-939d-923a-b3255d535781" LABEL="localhost:root" TYPE="linux_raid_member" PARTLABEL="Linux RAID" PARTUUID="21a4d5f4-cbd3-4397-9fab-cf0e1c3e77e4" 
/dev/sdd4: UUID="edf6287a-ba12-36a6-2a34-71d2edac85cb" UUID_SUB="4296c7d1-620e-cfb1-1c37-220022a7f01f" LABEL="localhost:home" TYPE="linux_raid_member" PARTLABEL="Linux RAID" PARTUUID="fbd7b585-bf9e-43fa-8d54-4fcb6749dfc2" 
/dev/md127: UUID="KV9voE-ps3q-BAD5-rKYS-ZZRX-0Edq-WMkR5G" TYPE="LVM2_member" 
/dev/md126: UUID="viiJV2-Uah7-DX82-oiGJ-jBDz-wCOl-TLvDK2" TYPE="LVM2_member" 
/dev/mapper/vghome-home: LABEL="Home" UUID="9e7437a7-1f40-48fd-a544-a70f4be0e52c" TYPE="xfs" 
/dev/mapper/vgroot-swap: LABEL="Swap" UUID="37cc3754-411e-4f4c-9044-e3c76d965968" TYPE="swap" 
/dev/mapper/vgroot-root: LABEL="Root" UUID="82ff7a16-6e1d-4c29-930d-055db267aaa8" TYPE="xfs" 
/dev/md125: LABEL="Boot" UUID="25fc17e0-29bb-4e5b-b1b7-06216cd7e0a1" TYPE="xfs" 
- Edited /etc/fstab

Code: Select all

mount /dev/vgroot/root /mnt/raidsys
cat /mnt/raidsys/etc/fstab

#
# /etc/fstab
# Created by anaconda on Sat Feb 27 23:23:36 2016
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
#/dev/mapper/centos-root /                       xfs     defaults        0 0
#UUID=1c8085bb-a226-4435-8e6f-0953025f6f1a /boot                   xfs     defaults        0 0
#UUID=1E4D-DBA3          /boot/efi               vfat    umask=0077,shortname=winnt 0 0
#/dev/mapper/centos-swap swap                    swap    defaults        0 0
########################
/dev/mapper/vgroot-root /			xfs	defaults	0 0
UUID=25fc17e0-29bb-4e5b-b1b7-06216cd7e0a1 /boot			xfs	0 0
UUID=CEE8-7E69		/boot/efi		vfat	umask=0077,shortname=winnt 0 0
/dev/mapper/vgroot-swap swap			swap	defaults	0 0
/etc/default/grub

Code: Select all

cat /mnt/raidsys/etc/default/grub
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
GRUB_DEFAULT=saved
GRUB_DISABLE_SUBMENU=true
GRUB_TERMINAL_OUTPUT="console"
GRUB_CMDLINE_LINUX="crashkernel=auto rd.auto=1 rd.lvm.lv=vgroot/root rd.md.uuid=fea6baab:29711848:997387aa:295ec48f rd.md.uuid=1f726cc3:387c49c3:3cee8230:f11a4640 rd.lvm.lv=vgroot/swap rhgb quiet"
GRUB_DISABLE_RECOVERY="true"
- I recreated the initramfs and checked also that the initramfs had the right kernel modules and dracut modules

Code: Select all

mount /dev/md125 /mnt/raidboot
lsinitrd /mnt/raidboot/initramfs-3.10.0-327.el7.x86_64.img | grep raid* | xclip -selection clipboard
Image: /mnt/raidboot/initramfs-3.10.0-327.el7.x86_64.img: 19M
mdraid
-r-xr-xr-x   1 root     root        11264 Feb 28 01:00 usr/lib64/device-mapper/libdevmapper-event-lvm2raid.so
lrwxrwxrwx   1 root     root           44 Feb 28 01:00 usr/lib64/libdevmapper-event-lvm2raid.so -> device-mapper/libdevmapper-event-lvm2raid.so
-rwxr-xr-x   1 root     root          265 Sep 12  2013 usr/lib/dracut/hooks/cleanup/99-mdraid-needshutdown.sh
-rwxr-xr-x   1 root     root          910 Sep 12  2013 usr/lib/dracut/hooks/pre-mount/10-mdraid-waitclean.sh
-rw-r--r--   1 root     root        15037 Nov 19 23:51 usr/lib/modules/3.10.0-327.el7.x86_64/kernel/crypto/async_tx/async_raid6_recov.ko
-rw-r--r--   1 root     root        26061 Nov 19 23:52 usr/lib/modules/3.10.0-327.el7.x86_64/kernel/drivers/md/raid0.ko
-rw-r--r--   1 root     root        79765 Nov 19 23:52 usr/lib/modules/3.10.0-327.el7.x86_64/kernel/drivers/md/raid10.ko
-rw-r--r--   1 root     root        62645 Nov 19 23:52 usr/lib/modules/3.10.0-327.el7.x86_64/kernel/drivers/md/raid1.ko
-rw-r--r--   1 root     root       168581 Nov 19 23:52 usr/lib/modules/3.10.0-327.el7.x86_64/kernel/drivers/md/raid456.ko
drwxr-xr-x   2 root     root            0 Feb 28 01:00 usr/lib/modules/3.10.0-327.el7.x86_64/kernel/lib/raid6
-rw-r--r--   1 root     root       101965 Nov 19 23:53 usr/lib/modules/3.10.0-327.el7.x86_64/kernel/lib/raid6/raid6_pq.ko
-rw-r--r--   1 root     root         2138 Nov 20 21:14 usr/lib/udev/rules.d/63-md-raid-arrays.rules
-rwxr-xr-x   1 root     root          708 Sep 12  2013 usr/sbin/mdraid-cleanup
-rwxr-xr-x   1 root     root         1074 Sep 12  2013 usr/sbin/mdraid_start
- Here the grub.cfg created by grub2-mkconfig -o /boot/efi/EFI/centos/grub.cfg (obviously the command was given within a chrooted environment from the rescue mode on the install cd).

Code: Select all

mount /dev/sdb1 /mnt/raidboot/efi
ls -al /mnt/raidboot/efi/EFI/centos
totale 5792
drwxr-xr-x. 3 root root    4096 28 feb 01.00 .
drwxr-xr-x. 4 root root    4096 27 feb 23.28 ..
-rwxr-xr-x. 1 root root     128  7 dic 14.19 BOOT.CSV
drwxr-xr-x. 2 root root    4096 28 feb 00.54 fonts
-rwxr-xr-x. 1 root root 1009536 24 nov 16.49 gcdx64.efi
-rwxr-xr-x. 1 root root    7038 28 feb 01.00 grub.cfg
-rwxr-xr-x. 1 root root    1024 27 feb 23.34 grubenv
-rwxr-xr-x. 1 root root 1009536 24 nov 16.49 grubx64.efi
-rwxr-xr-x. 1 root root 1283952  7 dic 14.19 MokManager.efi
-rwxr-xr-x. 1 root root 1291512  7 dic 14.19 shim-centos.efi
-rwxr-xr-x. 1 root root 1296176  7 dic 14.19 shim.efi

cat /mnt/raidboot/efi/EFI/centos/grub.cfg
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub2-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
set pager=1

if [ -s $prefix/grubenv ]; then
  load_env
fi
if [ "${next_entry}" ] ; then
   set default="${next_entry}"
   set next_entry=
   save_env next_entry
   set boot_once=true
else
   set default="${saved_entry}"
fi

if [ x"${feature_menuentry_id}" = xy ]; then
  menuentry_id_option="--id"
else
  menuentry_id_option=""
fi

export menuentry_id_option

if [ "${prev_saved_entry}" ]; then
  set saved_entry="${prev_saved_entry}"
  save_env saved_entry
  set prev_saved_entry=
  save_env prev_saved_entry
  set boot_once=true
fi

function savedefault {
  if [ -z "${boot_once}" ]; then
    saved_entry="${chosen}"
    save_env saved_entry
  fi
}

function load_video {
  if [ x$feature_all_video_module = xy ]; then
    insmod all_video
  else
    insmod efi_gop
    insmod efi_uga
    insmod ieee1275_fb
    insmod vbe
    insmod vga
    insmod video_bochs
    insmod video_cirrus
  fi
}

terminal_output console
if [ x$feature_timeout_style = xy ] ; then
  set timeout_style=menu
  set timeout=5
# Fallback normal timeout code in case the timeout_style feature is
# unavailable.
else
  set timeout=5
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/00_tuned ###
set tuned_params=""
### END /etc/grub.d/00_tuned ###

### BEGIN /etc/grub.d/01_users ###
if [ -f ${prefix}/user.cfg ]; then
  source ${prefix}/user.cfg
  if [ -n ${GRUB2_PASSWORD} ]; then
    set superusers="root"
    export superusers
    password_pbkdf2 root ${GRUB2_PASSWORD}
  fi
fi
### END /etc/grub.d/01_users ###

### BEGIN /etc/grub.d/10_linux ###
menuentry 'CentOS Linux (3.10.0-327.el7.x86_64) 7 (Core)' --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-3.10.0-327.el7.x86_64-advanced-82ff7a16-6e1d-4c29-930d-055db267aaa8' {
	load_video
	set gfxpayload=keep
	insmod gzio
	insmod part_gpt
	insmod part_gpt
	insmod part_gpt
	insmod diskfilter
	insmod mdraid1x
	insmod xfs
	set root='mduuid/1f726cc3387c49c33cee8230f11a4640'
	if [ x$feature_platform_search_hint = xy ]; then
	  search --no-floppy --fs-uuid --set=root --hint='mduuid/1f726cc3387c49c33cee8230f11a4640'  25fc17e0-29bb-4e5b-b1b7-06216cd7e0a1
	else
	  search --no-floppy --fs-uuid --set=root 25fc17e0-29bb-4e5b-b1b7-06216cd7e0a1
	fi
	linuxefi /vmlinuz-3.10.0-327.el7.x86_64 root=/dev/mapper/vgroot-root ro crashkernel=auto rd.auto=1 rd.lvm.lv=vgroot/root rd.md.uuid=fea6baab:29711848:997387aa:295ec48f rd.md.uuid=1f726cc3:387c49c3:3cee8230:f11a4640 rd.lvm.lv=vgroot/swap rhgb quiet 
	initrdefi /initramfs-3.10.0-327.el7.x86_64.img
}
menuentry 'CentOS Linux (0-rescue-26d51bbb9d054b0a8566525e1d8f3937) 7 (Core)' --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-0-rescue-26d51bbb9d054b0a8566525e1d8f3937-advanced-82ff7a16-6e1d-4c29-930d-055db267aaa8' {
	load_video
	insmod gzio
	insmod part_gpt
	insmod part_gpt
	insmod part_gpt
	insmod diskfilter
	insmod mdraid1x
	insmod xfs
	set root='mduuid/1f726cc3387c49c33cee8230f11a4640'
	if [ x$feature_platform_search_hint = xy ]; then
	  search --no-floppy --fs-uuid --set=root --hint='mduuid/1f726cc3387c49c33cee8230f11a4640'  25fc17e0-29bb-4e5b-b1b7-06216cd7e0a1
	else
	  search --no-floppy --fs-uuid --set=root 25fc17e0-29bb-4e5b-b1b7-06216cd7e0a1
	fi
	linuxefi /vmlinuz-0-rescue-26d51bbb9d054b0a8566525e1d8f3937 root=/dev/mapper/vgroot-root ro crashkernel=auto rd.auto=1 rd.lvm.lv=vgroot/root rd.md.uuid=fea6baab:29711848:997387aa:295ec48f rd.md.uuid=1f726cc3:387c49c3:3cee8230:f11a4640 rd.lvm.lv=vgroot/swap rhgb quiet 
	initrdefi /initramfs-0-rescue-26d51bbb9d054b0a8566525e1d8f3937.img
}
if [ "x$default" = 'CentOS Linux (3.10.0-327.el7.x86_64) 7 (Core)' ]; then default='Advanced options for CentOS Linux>CentOS Linux (3.10.0-327.el7.x86_64) 7 (Core)'; fi;
### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###

### BEGIN /etc/grub.d/20_ppc_terminfo ###
### END /etc/grub.d/20_ppc_terminfo ###

### BEGIN /etc/grub.d/30_os-prober ###
menuentry 'CentOS Linux release 7.2.1511 (Core)  (on /dev/mapper/centos-root)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-simple-3e9ce32e-8b26-4053-ad4e-1b75fda46260' {
	insmod part_gpt
	insmod xfs
	set root='hd0,gpt2'
	if [ x$feature_platform_search_hint = xy ]; then
	  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2  1c8085bb-a226-4435-8e6f-0953025f6f1a
	else
	  search --no-floppy --fs-uuid --set=root 1c8085bb-a226-4435-8e6f-0953025f6f1a
	fi
	linux /vmlinuz-0-rescue-26d51bbb9d054b0a8566525e1d8f3937 root=/dev/dm-5
	initrd /initramfs-0-rescue-26d51bbb9d054b0a8566525e1d8f3937.img
}
submenu 'Advanced options for CentOS Linux release 7.2.1511 (Core)  (on /dev/mapper/centos-root)' $menuentry_id_option 'osprober-gnulinux-advanced-3e9ce32e-8b26-4053-ad4e-1b75fda46260' {
	menuentry 'CentOS Linux release 7.2.1511 (Core)  (on /dev/mapper/centos-root)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/vmlinuz-0-rescue-26d51bbb9d054b0a8566525e1d8f3937--3e9ce32e-8b26-4053-ad4e-1b75fda46260' {
		insmod part_gpt
		insmod xfs
		set root='hd0,gpt2'
		if [ x$feature_platform_search_hint = xy ]; then
		  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2  1c8085bb-a226-4435-8e6f-0953025f6f1a
		else
		  search --no-floppy --fs-uuid --set=root 1c8085bb-a226-4435-8e6f-0953025f6f1a
		fi
		linux /vmlinuz-0-rescue-26d51bbb9d054b0a8566525e1d8f3937 root=/dev/dm-5
		initrd /initramfs-0-rescue-26d51bbb9d054b0a8566525e1d8f3937.img
	}
	menuentry 'CentOS Linux release 7.2.1511 (Core)  (on /dev/mapper/centos-root)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/vmlinuz-3.10.0-327.el7.x86_64--3e9ce32e-8b26-4053-ad4e-1b75fda46260' {
		insmod part_gpt
		insmod xfs
		set root='hd0,gpt2'
		if [ x$feature_platform_search_hint = xy ]; then
		  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2  1c8085bb-a226-4435-8e6f-0953025f6f1a
		else
		  search --no-floppy --fs-uuid --set=root 1c8085bb-a226-4435-8e6f-0953025f6f1a
		fi
		linux /vmlinuz-3.10.0-327.el7.x86_64 root=/dev/dm-5
		initrd /initramfs-3.10.0-327.el7.x86_64.img
	}
}

### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###

### BEGIN /etc/grub.d/41_custom ###
if [ -f  ${config_directory}/custom.cfg ]; then
  source ${config_directory}/custom.cfg
elif [ -z "${config_directory}" -a -f  $prefix/custom.cfg ]; then
  source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###
- And this is the efi entry I'm trying:
efibootmgr -c -d /dev/sdb -p 1 -L "CentOS RAID" --load "\\EFI\\centos\\shim.efi"

Code: Select all

efibootmgr -v
BootCurrent: 0001
BootOrder: 0004,0003,0000,0001,0002
Boot0000* EFI DVD/CDROM	ACPI(a0341d0,0)PCI(d,0)SATA(0,0,0)
Boot0001* EFI Hard Drive	ACPI(a0341d0,0)PCI(d,0)SATA(1,0,0)
Boot0002* EFI Internal Shell	MM(b,3fc4f000,3ffbefff)FvFile(7c04a583-9e3e-4f1c-ad65-e05268d0b4d1)
Boot0003* CentOS Linux	HD(1,800,64000,b5c88e63-06fa-4f20-8cb9-9bad8b5c79fc)File(\EFI\centos\shim.efi)
Boot0004* CentOS Raid	HD(1,800,64000,2a458d61-6959-4ec3-a283-1c4d1f76f69d)File(\EFI\centos\shim.efi)
If I reboot I get Boot failed.CentOS Raid just for few instants and then the booting procedure goes on with the 0003 boot entry.
I can't really figure out what's missing.

Post Reply