Tuesday, May 7, 2024
 Popular · Latest · Hot · Upcoming
2
rated 0 times [  2] [ 0]  / answers: 1 / hits: 5325  / 1 Year ago, wed, may 3, 2023, 9:23:28

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?


More From » boot

 Answers
2

I found the answer. The way to make sure GRUB is properly installed on and recognizes both drives from each is to run:



sudo dpkg-reconfigure grub-pc


When prompted which drives to install on, make sure all boot drives are selected. In my case, this was /dev/sda and /dev/sdb. Do not select /dev/md0 or any of the other md devices.


[#23701] Wednesday, May 3, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
izeeas

Total Points: 412
Total Questions: 105
Total Answers: 118

Location: Trinidad and Tobago
Member since Fri, May 8, 2020
4 Years ago
izeeas questions
;