0

Grub can boot(I have tried) from a zfs "degraded" raid1, is simple: create two zfs pools, one is boot, one is root, each one is raid1...and grub load Linux, with two disk, or with only one active, one or two. I want to try a similar thing with btrfs root raid1 + mdadm raid1 on ext4 for boot. As I known the latest grub on Slackware current can recognize md raid on boot(metadata 0.90). I configure my system on this way

fdisk -l /dev/vda
Disk /dev/vda: 50 GiB, 53687091200 bytes, 104857600 sectors
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: gpt
Disk identifier: 7715105B-51CD-9A45-9D05-E2C8161E51E9

Device        Start       End  Sectors  Size Type
/dev/vda1      2048   1050623  1048576  512M EFI System
/dev/vda2   1050624   9439231  8388608    4G Linux swap
/dev/vda3   9439232  11536383  2097152    1G Linux RAID
/dev/vda4  11536384 104857566 93321183 44.5G Linux filesystem


fdisk -l /dev/vdb
Disk /dev/vdb: 50 GiB, 53687091200 bytes, 104857600 sectors
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: gpt
Disk identifier: 7715105B-51CD-9A45-9D05-E2C8161E51E9

Device        Start       End  Sectors  Size Type
/dev/vdb1      2048   1050623  1048576  512M EFI System
/dev/vdb2   1050624   9439231  8388608    4G Linux swap
/dev/vdb3   9439232  11536383  2097152    1G Linux RAID
/dev/vdb4  11536384 104857566 93321183 44.5G Linux filesystem 

this is the fstab

LABEL=SWAP       swap             swap        defaults            0   0
LABEL=ROOT       /                btrfs       defaults,degraded   1   1
LABEL=BOOT       /boot            ext4        defaults            1   2
/dev/vda1        /boot/efi        vfat        defaults            1   2
devpts           /dev/pts         devpts      gid=5,mode=620      0   0
proc             /proc            proc        defaults            0   0
tmpfs            /dev/shm         tmpfs       nosuid,nodev,noexec 0   0

this is the /etc/default/grub

GRUB_DEFAULT=0
GRUB_HIDDEN_TIMEOUT_QUIET=false
GRUB_TIMEOUT=10
GRUB_DISTRIBUTOR=$( sed 's/Slackware /Slackware-/' /etc/slackware-version )
GRUB_ENABLE_CRYPTODISK=y
GRUB_CMDLINE_LINUX_DEFAULT=""
GRUB_CMDLINE_LINUX="console=tty1 console=ttyS0,115200 rootflags=degraded"
GRUB_TERMINAL="console serial"

finally the mkinitrd.conf

SOURCE_TREE="/boot/initrd-tree"
CLEAR_TREE="1"
OUTPUT_IMAGE="/boot/initrd.gz"
KERNEL_VERSION="$(ls /var/log/packages/kernel-generic-*-x86_64-* |cut -d - -f 3)"
KEYMAP="it"
MODULE_LIST="btrfs:ext4:vfat:xhci-hcd:hid:usbhid:ochi-hcd:uhci-hcd:uhci-hcd:ehci-hcd:virtio-net:virtio-ring:virtio-blk:virtio-pci"
LUKSDEV="/dev/disk/by-uuid/b97cbe7d-c5e5-432e-adc4-659ed80dd65f:/dev/disk/by-uuid/ec4fd069-0bd2-4b53-90e2-e493c50070f1"
ROOTDEV="/dev/vda4"
ROOTFS="btrfs"
RESUMEDEV="/dev/disk/by-label/SWAP"
RAID="1"
LVM="0"
UDEV="1"

I update initrd and grub

mkinitrd -B -F
grub-mkconfig -o /boot/grub/grub.cfg

i reboot and work: It ask me two password for two encrypted luks devices and go directly on login. I tried to boot from the second disk and...

enter image description here

As you can see the second efi partition is recognize, but not the md raid1 degraded partition, if I attach the first disk works fine. Of course I had installed grub on boot disks

grub-install --target=x86_64-efi --recheck --efi-dir=/boot/efi /dev/vda
grub-install --target=x86_64-efi --recheck --efi-dir=/boot/efi /dev/vdb

Any solution?

1 Answer 1

0

Solution found: was not a problem of grub but of EFI! Booting with the classic method(no efi + biosboot partition) grub can recognize mdadm and boot fine from the second disk.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .