grml / grml-debootstrap

wrapper around debootstrap
61 stars 27 forks source link

multiple disks support? #152

Open anarcat opened 4 years ago

anarcat commented 4 years ago

one thing i keep doing after grml-debootstrap is remount the target to install grub on other primary disks... is that something that could be added on the commandline or should i just do that as a hook?

thanks!

mika commented 4 years ago

@anarcat what do you mean with other primary disks? I'm not sure about the use case yet. :)

anarcat commented 4 years ago

I have a server with two disks, in RAID-1. I want to install grub on both in case one disk entirely fails.

"Primary disks" in this case, would be "disks that are configured in the BIOS boot order", but maybe it could also simply be "all non-removable physical disks".

mika commented 4 years ago

Ah I see, makes sense. We have some code regarding SW-RAID in grml-debootstrap, but it's been a long time since I last used that (and am not sure how well that works and if it's enough, probably not :)), and at $orkplace we're using custom scripts to handle SW-RAID.

Do you have some command line interface in mind to handle this?

anarcat commented 4 years ago

Ah I see, makes sense. We have some code regarding SW-RAID in grml-debootstrap, but it's been a long time since I last used that (and am not sure how well that works and if it's enough, probably not :)), and at $orkplace we're using custom scripts to handle SW-RAID.

that's what i suspected. :) i imagine that everyone has their own little implementation of what i did here, my thinking is it should be shipped with grml...

Do you have some command line interface in mind to handle this?

i don't have a great / clear interface just yet. maybe something like [ --boot-disks device [...] ] or something like that?

for now i wrote a post-script that:

  1. bind mounts "everything" (/sys, /dev, /proc, /run, etc)
  2. regenerates the mdadm.conf (because somehow that was wrong too)
  3. rebuild the initramfs and grub config
  4. installs grub on the second (hardcoded) disk device

what does your hack look like? :)

mika commented 4 years ago

my thinking is it should be shipped with grml...

The hard part usually is to make it work in general and ensure it has a usable interface. :-/

what does your hack look like? :)

One script that's in production usage is e.g. https://github.com/sipwise/deployment-iso/blob/1b1e54b822b8af6b6c691993eae9d6589ed8b483/templates/scripts/includes/deployment.sh#L2175

anarcat commented 4 years ago

One script that's in production usage is...

looks like you're doing a hack similar to ours... surely there must be a better way! :)