Update: I eventually found this page:
http://www.howtoforge.com/how-to-set...n-ubuntu-10.04
It talks specifically about installing Grub2 on RAID1 - namely, it seems like it's ok to do the grub-install on each of /dev/sda and /dev/sdb.
Then, separately I found that for GPT, you need to have a small partition that is not used for anything else, but is simply marked as "bios_grub". Using parted, I was able to confirm that this already exists on my system:
Code:
kitten:~# parted
GNU Parted 2.3
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) p
Model: ATA ST33000650NS (scsi)
Disk /dev/sda: 3001GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Number Start End Size File system Name Flags
5 1049kB 2097kB 1049kB bios_grub
1 2097kB 34.4GB 34.4GB raid
2 34.4GB 34.9GB 537MB raid
3 34.9GB 1134GB 1100GB raid
4 1134GB 3001GB 1866GB raid
(parted)
So that was the other piece of the puzzle, which was already there so I didn't need to set bios_grub explicitly. One thing to be careful of here, apparently, is not to set bios_grub on your boot partition - it has to be a small, unused partition (can be anywhere, doesn't have to be at the beginning). The funny thing is that just today there was an update for grub2 which gave me an error on my other (main) server, which has Adaptec RAID. I just installed Wheezy on this machine. I didn't have any spare space (I had taken it all up with /boot, swap and root). So I had to create this bios_grub partition, what to do? Well, I did the following:
1. Use swapoff to disable swap partition, and comment it out of /etc/fstab
2. Use parted to delete the swap partition
3. Create a new small partition (I gave it 100MB)
4. Use parted to set bios_grub to "on" on the new partition (e.g. if the new partition number is 4, then you would put 'set 4 bios_grub on' in parted command line - make sure you have the partition number right!)
5. Create new swap partition with remaining space
6. mkswap on new swap partition
7. Add uuid of new swap partition back to /etc/fstab
Then I was able to do grub-install without error. Phew!
I got the info on how to use parted to enable bios_grub from here:
http://velenux.wordpress.com/2012/07...pt-partitions/
I don't know why this has to be so complicated, lots of people use RAID and GPT is common now with larger drives. I really had to hunt around to find this stuff. I'm just noting it down here in case it might be useful to anyone else (and also as a note to my future self).
Neil