#590742 grub-pc: savedefault doesn't work on mdraid

Package:
grub-pc
Source:
grub2
Description:
GRand Unified Bootloader, version 2 (PC/BIOS version)
Submitter:
"Mario 'BitKoenig' Holbe"
Date:
2010-11-14 15:45:03 UTC
Severity:
normal
#590742#5
Date:
2010-07-28 22:47:36 UTC
From:
To:
Package: grub-pc
Version: 1.98+20100710-1

Hello,

savedefault doesn't work on Linux Software-RAID raid1. Well, at least I
guess it's because of the RAID.
The system in question has /boot on ext2 on md raid1 (degraded) on GPT
disk partitions.

I don't know whether write to raid1 is supposed to work. However, what
really takes me aback is that save_env doesn't give an error - I think
it should do that at least when it doesn't save.
Actually, I'm a little bit nervous due to the missing error message
because there it a chance that it does in fact write - somewhere.

$ grep boot /proc/mounts
/dev/md0 /boot ext2 rw,nosuid,nodev,noexec,relatime 0 0
$ grep -A2 ^md0 /proc/mdstat
md0 : active raid1 sda2[0] sdb2[1]
      240832 blocks [3/2] [UU_]

$

savedefault works on another system with the same package version,
without raid1, with a MBR disk and /boot on the rootfs. I created the
grubenv file the same way on both systems via grub-editenv create, both
systems have GRUB_SAVEDEFAULT=true, GRUB_DEFAULT=saved, and an uptodate
grub.cfg with savedefault in the menuentries.

The system in question *reads* grubenv - when I set it to another
menuentry with grub-set-default grub respects this on boot and selects
the other menuentry.

The differences I see (despite different CPU, RAM, ...) are GPT, raid1,
and /boot on a separate filesystem. I suspect raid1 to be the most
relevant difference here :)

On both systems I tried
grub> cat /grub/grubenv		(/boot/grub/grubenv on the working one)
...
grub> saved_entry=foo
grub> save_env saved_entry
grub> cat /grub/grubenv
...

On the working system the second cat reflects the change. On the system
in question, grubenv's content didn't change.


regards
   Mario

#590742#10
Date:
2010-11-14 15:42:06 UTC
From:
To:
severity 590742 low
thanks
Savedefault doesn't work on RAID, LVM or ZFS. It's on purpose to avoid
potential damage like desynchronisation of an array. It may be changed
in the future but safety is mostly important, so until we're confident
that the writing functions can do no harm. I've documented it upstream
No damage has come to any of your disks. No write was attempted.