Two vintage headless/keyboardless systems were running ubuntu-server 16.04LTS (Alpha and Beta);

Access is only via ssh for both machines.

Alpha system was corrupted apparently during an update.

Booting by CD/DVD/UEFI is not an option. USB is turned off at the kernel due to incompatibilities that cause cpu to race at 100%.

Alpha's drive with unbootable system is now mounted as second drive in Beta's system.

All user files have been backed up to Beta's drive.

How to install ubuntu-server on Beta's second (Alpha) hard drive so that the second drive can be reinstalled as primary bootable drive in Alpha system?

kind regards, Ben

update 2017-01-25:

debootstrap and this url ( https://help.ubuntu.com/lts/installation-guide/i386/apds04.html ) get through most of the hurdles of the process by adding Alpha's drive to Beta as follows:

Alpha's drive is installed at /dev/hdb in Beta's system. Beta's drive is /dev/hda.

Remaining hurdle:

How to get grub-install/grub-probe/grub-mkconfig to ignore /dev/hda when looking for bootable kernel on /dev/hdb?

After removing Alpha's drive into Alpha system and rebooting, system doesn't boot. There are no obvious error logs in Alpha's drive (after re-installing/mounting in Beta). After a few cycles of this, I found:

grub-install's grub-probe detects Beta's kernel and associates the UUIDs from those (/dev/hda) instead of Alpha's installed ones at /dev/hdb

--even though user is chrooted into Alpha's drive ( /dev/sdb ) per instructions at help.ubuntu.com/lts/installation-guide/i386/apds04.html

I've run out of ideas on how to invoke grub-install/grub-probe/grub-mkconfig parameters to ignore /dev/hda.

For now, I will manually edit the grub file with bad referenced HD UUIDs: grub.cfg iirc. Let me know if there's a standard, less risky way to do this.

  • 1
    Look into debootstrap. – fkraiem Jan 3 '17 at 18:24
  • @fkraiem Excellent! Thank you. Just what I was looking for: help.ubuntu.com/lts/installation-guide/i386/apds04.html – BenjaminBrink Jan 3 '17 at 18:30
  • You could also copy the iso file to the beta drive and add a menuentry for it (for example using the 40_custom method). See this link, help.ubuntu.com/community/Grub2/ISOBoot – sudodus Jan 3 '17 at 18:48
  • Thank you @sudodus . AFAICT, the only useful changes to grub is to change boot defaults in a running OS --not to second HD-- since sudo update-grub is required after edit. However, I will add this to stack of tricks. Thank you again. – BenjaminBrink Jan 3 '17 at 19:00
  • Hi again @fkraiem & sudodus. I'm stuck; Almost works. After removing 2nd hd into own system and rebooting, system doesn't boot. Finally figured out: grub-install's grub-probe detects primary system's HD and kernel and associates the UUIDs from those (/dev/hda) instead of /dev/hdb --even though I chrooted into /dev/sdb per instructions at help.ubuntu.com/lts/installation-guide/i386/apds04.html How to get grub-install/grub-probe/grub-mkconfig to ignore /dev/hda when looking for bootable kernel? – BenjaminBrink Jan 25 '17 at 9:12

Your Answer

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

Browse other questions tagged or ask your own question.