[clug] How to make my server robust for booting

George at Clug Clug at goproject.info
Thu Sep 12 00:21:11 UTC 2019


Tony,

 When you implement your solution in the real world, will you be using
UEFI or BIOS?


Are you using hardware RAID or Software RAID ?   (I am guessing
Linux Software RAID from your comments)


What size disk drives will you be using as the boot drive?  

Will they be SSD or HDD?

This is how I did it once, a long time ago.  I had RAID1 for boot
drives (i.e. grub, /boot and OS) and RAID 6 for data (virtual
machines).
https://unix.stackexchange.com/questions/230349/how-to-correctly-install-grub-on-a-soft-raid-1
 If the two disks are /dev/sda and /dev/sdb, run both grub-install
/dev/sda and grub-install /dev/sdb. Then both drives will be able to
boot alone.


It is my belief that you can only [successfully] use RAID 1 for grub
boot drives.  I like Bob's point about using boot order for both
drives in BIOS.



I could be wrong but if I recall you could use RAID 5/6 but then you
would need grub copied to every drive in the RAID as there is no way
to know for sure with drive will be booted from after a failure. 



Sometimes I just have two non-raided drives (grub, /boot and OS), one
gets a bit old due to no security updates, but easy to manage.




/boot/_grub_/_device.map_




https://www.schmidp.com/2014/12/12/full-disk-encryption-with-grub-2-+-luks-+-lvm-+-swraid-on-debian/


(YOUR_HOSTNAME)root at grml:/# grub-install /dev/sda Installation
finished. No error reported. (YOUR_HOSTNAME)root at grml:/# grub-install
/dev/sdb Installation finished. No error reported.
(YOUR_HOSTNAME)root at grml:/# update-initramfs -k all -u
update-initramfs: Generating /boot/initrd.img-3.14-1-amd64 df:
Warning: cannot read table of mounted file systems
(YOUR_HOSTNAME)root at grml:~# update-grub Generating grub.cfg ... Found
linux image: /boot/vmlinuz-3.14-1-amd64 Found initrd image:
/boot/initrd.img-3.14-1-amd64 done

__

https://wiki.alpinelinux.org/wiki/Setting_up_a_software_RAID_array
Your /boot partition should either not be on RAID, or else be on a
RAID1 array, with no further layers of encryption or LVM. 
(Alpine's default bootloader extlinux can't handle either. Grub2 can
handle /boot being on LVM.) 
The usual practice is to create a small (32--100 MB) partition for
/boot. That can be a mirrored (RAID1) volume, however this is just for
post-init access. 
That way, when you write a new kernel or bootloader config file to
/boot, it gets written to multiple physical partitions. 
During the pre-init, bootloader phase, only one of those partitions
will be used (and it will be mounted read-only).


https://www.howtoforge.com/software-raid1-grub-boot-debian-etch
In the end I want to have the following situation:
    /dev/md0 (made up of /dev/sda1 and /dev/sdb1): /boot
partition, ext3;

https://raid.wiki.kernel.org/index.php/RAID_Boot

https://wiki.archlinux.org/index.php/Software_RAID_and_LVM#Boot_loader




On Wednesday, 11-09-2019 at 08:49 Tony Lewis via linux wrote:
> All,
> 
> I'm rebuilding my home server, and want to make it 'robust' for boot

> purposes.  For example, if a disk fails, the system can continue to

> function until I replace it.
> 
> I am testing my ideas in VirtualBox at the moment.
> 
> The stuff I think I've sorted are:
> 
>   * encrypted RAID1 for /
>   * RAID1 for /boot
> 
> What I'm stuck on is how to handle a failure of the drive where GRUB
is 
> installed.  I thought it might be as simple as doing grub-install 
> /dev/sd[bcd] (as well as on /dev/sda) and BIOS would just find *a*
copy 
> of GRUB and be able to continue the boot process.
> 
> It's not working in VirtualBox at least.  If I let it boot unaided,
it 
> cannot find a bootable medium (expected behaviour). If I interrupt
that 
> with F12 and choose the second hard drive to boot from, it locks
up.  It 
> might be a VirtualBox thing, and so the physical server would be
OK.  Or 
> more likely I don't understand what I'm doing.
> 
> What's the best way to architect things so that a failed hard drive 
> where GRUB is installed, is easily handled?
> 
> Tony
> 
> -- 
> linux mailing list
> linux at lists.samba.org
> https://lists.samba.org/mailman/listinfo/linux
>


More information about the linux mailing list