zfsonlinux / grub

GRUB enhancements for ZFS on Linux
16 stars 18 forks source link

update-grub gets confused when other pools are created before rpool #20

Open beren12 opened 9 years ago

beren12 commented 9 years ago

debian 7.8 stable zfs & tools from debian repo

grub 2.01-22debian1+zfs3-0.6.3-2~wheezy zfs 0.6.3-1~wheezy

I created a zfs mirror pool, mounted on /home I then partitioned a drive with 6gb swap and remaining space as zfs root pool, with a mount point at / temp mounted under /mnt copied root partition to zfs root, chrooted into it, and ran grub install & update-grub update-grub ran but only found linux images on the /home zpool and current boot drive

exported both pools, then imported rpool, then home pool. chroot into rpool and update-grub found the correct images. lz4 was enabled at pool creation, grub booted into it without issue bios mode used, not EFI

beren12 commented 9 years ago

The first time I did not enable the boot bit on /dev/sdc2 (the rpool) but enabled it the 2nd try.

beren12 commented 9 years ago

this is cirdan on irc, btw 👍

FransUrbo commented 9 years ago

From earlier conversation on IRC:

/dev/mapper/lothlorien-root on / type xfs (rw,relatime,attr2,delaylog,noquota)
/dev/sdb1 on /boot type ext2 (rw,relatime,errors=continue)

mir-300gb/ROOT/home-1 on /home type zfs (rw,relatime,xattr,noacl)
mir-300gb on /mnt/mir-300gb type zfs (rw,relatime,xattr,noacl)
mir-300gb/ROOT on /mnt/mir-300gb/ROOT type zfs (rw,relatime,xattr,noacl)

lothlorien/ROOT/debian-1 on /mnt/lorien type zfs (rw,relatime,xattr,noacl)
lothlorien on /mnt/lorien/lothlorien type zfs (rw,relatime,xattr,noacl)
lothlorien/ROOT on /mnt/lorien/lothlorien/ROOT type zfs (rw,relatime,xattr,noacl)
sudo zpool status
  pool: lothlorien
 state: ONLINE
  scan: none requested
config:

        NAME                                    STATE     READ WRITE CKSUM
        lothlorien                              ONLINE       0     0     0
          scsi-SATA_ST3200827AS_5ND5LK04-part2  ONLINE       0     0     0

errors: No known data errors

  pool: mir-300gb
 state: ONLINE
  scan: resilvered 160G in 0h54m with 0 errors on Wed Mar 18 22:13:54 2015
config:

        NAME                                   STATE     READ WRITE CKSUM
        mir-300gb                              ONLINE       0     0     0
          mirror-0                             ONLINE       0     0     0
            scsi-SATA_Maxtor_7L300S0_L60BSESG  ONLINE       0     0     0
            scsi-SATA_Maxtor_7L300S0_L604H9XG  ONLINE       0     0     0

errors: No known data errors
linux   /ROOT/home-1@/boot/vmlinuz-3.2.0-4-amd64 root=ZFS=mir-300gb/ROOT/home-1 ro boot=zfs $bootfs   quiet
beren12 commented 9 years ago

Oh, it was recommended to rename mir-300gb/ROOT/home-1 to mir-300gb/home, so that was done just before the export

FransUrbo commented 9 years ago

Note to self: The issue is most likely with the fact that the root pool needs to be first for grub-mkconfig to work correctly.

beren12 commented 9 years ago

this was the output of the first update-grub, when it was not finding the rpool. /home/rootfs had a backup of the boot drive and that was getting discovered:

Generating grub.cfg ... Found linux image: /boot/vmlinuz-3.2.0-4-amd64 Found initrd image: /boot/initrd.img-3.2.0-4-amd64 Found memtest86 image: /ROOT/home-1@/boot/memtest86.bin Found memtest86+ image: /ROOT/home-1@/boot/memtest86+.bin Found memtest86+ multiboot image: /ROOT/home-1@/boot/memtest86+_multiboot.bin done