Help With Creating Bootable Recovery Partition


Results 1 to 6 of 6

Thread: Help With Creating Bootable Recovery Partition

  1. #1
    Join Date
    Feb 2018
    Posts
    2

    Help With Creating Bootable Recovery Partition

    Hello all,

    I am a complete newbie when it comes to Linux, but I was tasked with a very Linux-heavy project that I'm hoping someone may be able to provide guidance on:

    Essentially, bootable-Linux USB's were created a few years ago by people who no longer work here - one creates a backup image of our Windows 10 installation and places it on a partition on the hard drive (creates files called restore, restore.000, restore.001, etc). The other USB bring up a menu where users can select to re-image their workstation (part of that script is pasted below).

    What I want to do is take the functionality of that 2nd USB drive and place it on a new partition, and add a boot entry for that partition, so that if Windows crashes, the user can load up the script below and re-image their machine. The problem I'm running into is the USB was created with Grub, and it will boot up even if the USB drive is 2nd in the boot order after the Windows hard drive (when I copy it to the partition on the hard drive it boots up to it immediately every time, even without creating a Boot entry for it).

    My (long-winded), 2-part question is:

    1) Is there a way to change the settings of a GRUB-bootable USB so that it won't "override" the boot order and force itself to be booted to every time?

    2) If that's not possible, is there another Linux boot option I can use with this script that will allow it to only boot when selected?

    Below is the first part of the script to give some insight, I didn't want to post the whole thing as it's pretty long and I wrote too much already. Please let me know if any additional information would be helpful, and thank you in advance!


    Code:
    # Script to create menus and take action according to that selected menu item.
    #
    #
    while :
      do
      clear
      echo "----------------------------------------------"
      echo " * * * * * * * Main Menu * * * * * * * * * * "
      echo "----------------------------------------------"
      echo "[1] Fix the MBR"
      echo "[2] Reimage the Workstation"
      echo "[3] Eject the CD and Reboot"
      echo "----------------------------------------------"
      echo -n "Enter your menu choice [1-3]:"
      read yourch
      case $yourch in
        1) echo "The MBR will now be fixed"
    
    #!/bin/bash
    
    echo "";
    echo "";
    echo "Started";
    echo “Performing the MBR Repair.”;
    #echo "Writing partitions.txt to disk.";
    sfdisk -l > partitions.txt;
    
    #echo "Parsing partitions.txt";
    
    FILE="partitions.txt";
    
    exec 3<&0
    exec 0<$FILE
    
    inDevices=0;
    deviceName='';
    dashes='==========================';
    
    CONST_ntfs='NTFS';
    CONST_id='7';
    #the two lines below let me use other constants for testing
    #CONST_ntfs='ded';
    #CONST_id='5';

  2. #2
    Join Date
    Feb 2014
    Location
    Riviera Beach, Maryland, USA
    Posts
    172

  3. #3
    Join Date
    Feb 2018
    Posts
    2
    Yes, I have modified the boot order so that the Hard Drive is first - there are no optical drives, so I have Hard Drive first and USB 2nd, yet the USB still boots to the GRUB menu immediately after the HP screen flashes on boot. Let me know if there is anything else I should check, and thank you for the quick reply!

  4. #4
    Join Date
    Feb 2014
    Location
    Riviera Beach, Maryland, USA
    Posts
    172
    In order for the computer to be able to do *anything*, (other than view and alter the on-board BIOS/UEFI), it needs an Operating System.

    So, if there is no bootable partition on the hard drive, it is going to check the next device specified in the BIOS to see if it has a bootable Operating System to boot into.

    If it does, it boots up into it. If not, the computer has no choice but to throw an error up on the screen about not finding anything to boot into and then just stop.

    In other words, in order to actually use a computer it must be running an Operating System. Without one, it is pretty much useless.

  5. #5
    Join Date
    May 2002
    Posts
    1,254
    when I copy it to the partition on the hard drive it boots up to it immediately every time, even without creating a Boot entry for it
    What is it? How do you copy it to the partition?

    The script has nothing to do with how the computer boots. Without the USB drive inserted I assume the computer boots windows normally and you do not see any grub menu?

  6. #6
    Join Date
    Feb 2014
    Location
    Riviera Beach, Maryland, USA
    Posts
    172

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •