I have an Ubuntu 14.04 x64 server with 2 500GB drives (sda
and sdb
) in a software RAID 1.
I just had to replace sdb
. Adding it back to the array with mdadm and resyncing was a snap. The problem I'm running into is making sure it can boot if sda
happens to fail in the future.
Note: all commands below were run as root
1st try
Most walkthroughs I've found told me to run:
grub-install /dev/sda /dev/sdb
Which is the exact same command I've seen the Ubuntu installer run a hundred times. However, when I ran that, I got:
grub-install: error: More than one install device?.
This has always worked for me. Maybe something changed with 14.04?
2nd try
Some walkthroughs recommended setting up grub for the new hard drive manually. The grub prompt scares me, but I was willing to try these steps:
# grub --device-map=/boot/grub/device.map
grub> root (hd0,0)
grub> setup (hd0)
grub> root (hd1,0)
grub> setup (hd1)
grub> quit
Only problem? After the first command, I get:
The program 'grub' is currently not installed. You can install it by typing:
apt-get install grub
???
So I tried installing grub.
# apt-get install grub
Reading package lists... Done
Building dependency tree
Reading state information... Done
Suggested packages:
grub-legacy-doc
The following packages will be REMOVED:
grub-gfxpayload-lists grub-pc grub2-common
The following NEW packages will be installed:
grub
0 upgraded, 1 newly installed, 3 to remove and 0 not upgraded.
Need to get 913 kB of archives.
After this operation, 438 kB of additional disk space will be used.
Do you want to continue? [Y/n]
Needless to say, I answered no.
3rd try
Getting desparate, I tried something I was pretty sure was wrong. The official server guide recommends (at the bottom of the "Raid Maintenance" section):
grub-install /dev/md0
This was the output:
# grub-install /dev/md0
Installing for i386-pc platform.
grub-install: warning: Couldn't find physical volume `(null)'. Some modules may be missing from core image..
grub-install: warning: Couldn't find physical volume `(null)'. Some modules may be missing from core image..
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.
Scary.
It looks like grub has been superceded somehow in 14.04, but I can't find any information about how things have changed. I do have a /boot/grub/
directory, so I know some form of grub is installed.
Update:
I was able to run the following commands independently:
grub-install /dev/sda
grub-install /dev/sdb
However, I'm unsure if sda
will boot after installing grub on sdb
and vice versa. Am I ok?