1

I am considering a failover boot setup which can tolerate any single drive loss. The primary system partitions (/, /home, /usr etc.) shall reside on a flash drive. /var and /tmp partitions shall be mounted from a hard drive. Additionally hard drive contains shadow copies of all partitions from flash drive; these should be rather static and can be kept up to date with RSYNC (?) plus it has boot preset to start using these partitions.

In case flash drive fails, system simply boots off the hard drive (should be set up in BIOS). In case of hard drive failure system should still be operable to allow hard drive replacement.

My questions are:

  1. Do I miss something essential in such configuration (e.g. security)?

  2. If hard drive is lost, the system shall boot with no /var and /tmp mountable; will it start up at all? Of course this is a recovery operation mode which should minimally allow another drive to be set up and mounted properly, but it should at least boot and start all services including ssh.

The distribution I am looking at is Debian, but this is not a final decision.

  • You may get some useful ideas if you look at the way Puppy Linux is set up. In particular, its use of aufs, and also how it stores the main directory hierarchy in a file. The linked info is somewhat dated, but it's a good intro (IMHO) and has helpful diagrams. :) – PM 2Ring Dec 7 '14 at 9:41
1

You should be able to pull this off, but there are a few things to keep in mind:

  • Not having /tmp on your flash drive is a good thing, but you might consider living without a permanent on at all, mine is a tmpfs. If you cannot mount /tmp during boot, things will go on the flashdrive in /tmp
  • If you copy mount /var from the harddrive for reasons of wear&tear on your flashdrive, you might just consider having the files in /var on your flashdrive as well. It is only 281Mb on Jessie and a degraded system should find anything it needs if the harddrive fails.
  • With grub2 you should be able to just use rsync. As you probably setup a script to do the different steps of the 'syncing', you might have to include a chroot-ed run of grub-install/grub-update for the harddrive partitions.
  • Consider what you need to do if your flash drive (temporarily) fails and you have automatically booted from the harddrive (i.e. can you just rsync backwards to the now more up to date harddrive based data to the flash-drive).

I used to have a 'fail-safe' system for my server similar to this (with the first two harddrives being bootable). It took some time to get it right, but it worked, as I tested it by pulling the first drive. It's functionality was never necessary in real life.

  • Yeah, hopefully this won't be ever used, but hardware fails, especially drives. This is also why I want it hybridized (HDD/Flash), or minimally there should be two drives from different manufacturers. Yes, I wanted to have /var on hard drive only mainly because of /var/log and having both boot options use the /var on hard drive. – port443 Dec 7 '14 at 21:31
  • @port443 In that case just mounting the HDD /var over a relatively complete /var on your flash, as described should just work and give 0 problems when the HDD is not there (just make sure you don't run it for too long that way. – Anthon Dec 7 '14 at 21:42
  • I'll try that and post here my results. That won't be too quick though. Thanks. – port443 Dec 7 '14 at 21:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.