I followed instructions in another post that basically said to create the RAID and install after selecting the RAID partitions to which to install. I've done this a number of times but find myself stymied this time.
I had a system running on a pair of 512GB SSDs that had two RAID0 partitions. One was for system (about 40GB) and most of the rest is allocated to /home. This was running on a 17.x version of Linux Mint. Following an unclean shutdown the system was borked. It appeared that some files were missing or corrupted. I decided that it was a good time to update so I downloaded the current Linux Mint (Cinnamon) .iso and copied it to a USB drive. I booted the USB, assembled the RAIDs and proceeded with the installation. I selected /dev/md1 for the system, EXT4 format and reformat the drive. I selected /dev/md2 for /home without a reformat. The install seemed to go well with the installer even recognizing that my $HOME is encrypted. When it got to the point where it needed to install GRUB, it reported an error and gave me three choices. Regardless of the choice I made, the dialog did not proceed.
Next I downloaded and tried to install Xubuntu 16.04 LTS and had exactly the same result. At present I've booted the USB drive, assembled the RAIDs and tried to install GRUB to both /dev/sda and /dev/md0 with the following results.
xubuntu@xubuntu:~$ sudo grub-install --boot-directory=/media/xubuntu/c31e9230-d979-4c7d-81ee-34dda0bac330 /dev/md0
Installing for i386-pc platform.
grub-install: warning: File system `ext2' doesn't support embedding.
grub-install: warning: Embedding is not possible. GRUB can only be installed in this setup by using blocklists. However, blocklists are UNRELIABLE and their use is discouraged..
grub-install: error: will not proceed with blocklists.
xubuntu@xubuntu:~$
xubuntu@xubuntu:~$ sudo grub-install --boot-directory=/media/xubuntu/c31e9230-d979-4c7d-81ee-34dda0bac330 /dev/sda
Installing for i386-pc platform.
grub-install: warning: this GPT partition label contains no BIOS Boot Partition; embedding won't be possible.
grub-install: error: embedding is not possible, but this is required for RAID and LVM install.
xubuntu@xubuntu:~$
Here is how /dev/sda is partitioned.
xubuntu@xubuntu:~$ sudo parted -l /dev/sda
Model: ATA Samsung SSD 850 (scsi)
Disk /dev/sda: 500GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
4 17.4kB 1049kB 1031kB BIOS boot partition boot, esp
3 1049kB 1074MB 1073MB ext4 boot, esp
1 1074MB 21.5GB 20.4GB ext4 raid
2 21.5GB 500GB 479GB raid
And the RAIDs
xubuntu@xubuntu:~$ cat /proc/mdstat
Personalities : [raid0] [raid1]
md0 : active raid1 sde2[0] sdg2[1]
186839936 blocks super 1.2 [2/2] [UU]
md3 : active raid1 sda3[0] sdb3[1]
1047488 blocks [2/2] [UU]
md2 : active raid0 sda2[0] sdb2[1]
934827008 blocks super 1.2 512k chunks
md1 : active raid0 sdb1[0] sda1[1]
39846912 blocks super 1.2 512k chunks
unused devices: <none>
xubuntu@xubuntu:~$
I did some searching and found https://blog.hostonnet.com/grub-install-warning-this-gpt-partition-label-contains-no-bios-boot-partition-embedding-wont-be-possible Based on the suggestion to mark the drive 'bios_grub on' I executed the following commands:
xubuntu@xubuntu:~$ sudo parted /dev/sda set 1 bios_grub on
Information: You may need to update /etc/fstab.
xubuntu@xubuntu:~$ sudo grub-install --boot-directory=/media/xubuntu/c31e9230-d979-4c7d-81ee-34dda0bac330 /dev/sda
Installing for i386-pc platform.
Installation finished. No error reported.
xubuntu@xubuntu:~$
Thrilled to see "Installation finished. No error reported." I rebooted and found myself facing a "grub>" prompt. :(
Worse yet, this operation seems to have corrupted /dev/md0 and it no longer assembles when I boot the thumb drive.
I'd really like to know what to do differently to get this to work. Thanks for any help.
Edit: I recall seeing options to 'boot other drive' form some install media. As a stopgap I would be happy to be able to use something like that (which would require the ability to boot an image on RAID) until I can figure out what needs to happen to get GRUB installed properly
I mostly resolved this problem. I believe the problem revolves around the need to 'manage' the partitioning. For reasons not obvious to me the original partitioning was not suitable for grub installation. (It did work on a version of Mint based on 14.04 LTS but I guess times change.) I'm sure the partitioning requirements are documented somewhere but I did not find that during my searches.
It was also very frustrating that when you 'try the OS' (needed to install mdadm and assemble the RAIDs) if the grub installation fails, the popup intended to allow an option to recover or otherwise proceed locks up. This is 100% reproducible with recent Ubuntu versions (16.04, 16.10 including Xubuntu.)
I had a third SSD in the PC. I tried installing to that but wound up with the same error. This resulted because I had to perform manual partitioning and what I produced was not adequate.
What finally worked was to disconnect the two RAIDed drives and install to the third, allowing the partitioner to reformat the drive and install. In that way the partitioner could produce the required partition layout. I was even able to configure this to mount my RAID0 $HOME directory with the drives reconnected. (UUIDs FTW since the boot drive moved from /dev/sda to /dev/sdc.)
I then reproduced the directory structure on one of the raided drives (/dev/sda) and proceeded with yet another install of 16.04 LTS. When it got to the grub installation it failed again (AAARRRGGGHH!!!) This time with a different message:
At least it did not hang at this point. The next dialog cheerfully reported
At this point the installer once again reached a "stable state" and the dialog remained until I rebooted the system.
Undaunted I rebooted the alternate the drive and ran
update-grub
which identified both installs. Unfortunately the install involving RAID still does not boot because mdadm is not installed in the initrd. I think that can be fixed. (It least it used to work.) Once I get that sorted, I will again have a fully working system. Maybe some day the installer will be smart enough to include RAID support in the initrd when the system is installed on RAID. I guess I should search for or file a couple bug reports.