I have a system that consistently forgets hard drive boot order. I specify it in the BIOS, and after the next reboot, it's gone. My primary boot drive is on an addon card (SAS HBA). The motherboard BIOS setup utility picks up drives on that card just fine. But, however I arrange them in the BIOS's HD boot order is reset on the next power cycle. The drive that actually has my OS on it is never at the top, so the system never boots.

One thing I can count on is that my amnesiac server will always try to boot from optical and USB media before trying any hard drives. Also, the ordering of hard drives that it resets itself to is always the same (unless I rearrange cabling).

What I've Tried:

I've tried updating/resetting the BIOS to fix the root problem, to no avail. I've updated/reset/reconfigured the firmware on my SAS HBA. I've tried contacting the motherboard manufacturer re: the apparent bug, and have been told that there are no free support options available to me. The SAS HBA manufacturer's support line told me to get a different motherboard. I've tried writing a chain-loading bootloader to the beginning of the drive that is always at the top of the list, which broke my RAID setup. I've tried plugging the SAS HBA into different PCIe slots and mucking about with the connection order of drives on the native motherboard SATA links, and on the HBA itself. Unless I physically disconnect all of the motherboard SATA links, the problem persists, and I need those links connected.


I've pretty much given up on solving the root of the problem (the BIOS forgetting HD boot order). Given that I can count on the system trying to boot from USB or optical media first, and that the hard drive I want to boot from is always in the same place in the BIOS order (and presumably device enumeration in most operating systems), is there a boot CD I can configure to make the system boot from an arbitrarily-numbered hard drive automatically?

My ideal solution would go something like this:

  1. I download an auto-boot CD/USB image.
  2. I configure its parameters (something like "after a 5 second timeout, autoboot from HDD 04"). This has to be able to select a hard drive other than the BIOS' default boot drive.
  3. I put the image on USB or optical media, and plug it into the system.
  4. Every subsequent time I reboot the system, the new loader is run, and automatically tells the system to boot from the correct drive.

I'm technically competent, but have no experience manually configuring GRUB or similar. Where should I start?

  • First off, there's a little battery on the motherboard designed to keep the BIOS settings between boots/times without power. I would first replace that battery then redo all of your BIOS settings. – Kruug Feb 20 '13 at 16:25
  • I've already tried a powerless reset, a powered reset, a "Load to default settings" reset, and all of the above after updating the BIOS to the latest version. – Zac B Feb 20 '13 at 16:26
  • 1
    Let's try replacing the battery. support.dell.com/support/topics/global.aspx/support/kcs/… – Kruug Feb 20 '13 at 16:30
  • 1
    Have you tried installing GRUB and using UUID to select the apropiate disk? (UUID is unique for every HDD and doesn't change) – Peter Feb 20 '13 at 16:33
  • @Zac B: Do other changes in the BIOS also reset themselves? If they do not skip the rest. If they do: Does the motherboard have a BIOS-reset jumper? Is it accidentally set? If not [set], then consider replacing the battery as per Kruugs suggestion. – Hennes Feb 20 '13 at 16:48

You can install GRUB and use UUID as identifier for each hard disk partition to ensure the PC will start always the correct partition despite the HDDs chaning its boot order in BIOS.

First of all, just grab a LiveCD (anyone should do, I usually use SystemRescueCd. Once booted in console mode (default option), run the following command to get the UUID:

ls -l /dev/disk/by-uuid/

That will give you something like the following:

localhost ~ # ls -l /dev/disk/by-uuid/
total 0
lrwxrwxrwx 1 root root 10 Feb 22 09:25 0adb57d3-e475-4825-8ff9-32bd82fbd210 -> ../../sda3
lrwxrwxrwx 1 root root 10 Feb 22 09:25 9fb9d595-77b3-458a-b082-80a77d1d2b50 -> ../../sda1
lrwxrwxrwx 1 root root 10 Feb 22 09:25 d1a2c45f-b8dc-4312-a195-853e9364b398 -> ../../sda2

-> ../../sdaX equals to /dev/sdaX. This way you can get all the UUIDs of your HDDs partition. The example above are Linux partitions, Windows partitions might display a different UUID, but they're always unique.

Now you should insert the USB pendrive you want to start the OS from and mount it: mount /dev/sdd1 /mnt/pendrive

Then you can install GRUB to your pendrive with the following command:

grub-install --no-floppy --root-directory=/mnt/pendrive /dev/sdd1

To get the device the USB key is located in you can run fdisk -l.

Once installed, you should edit the grub.conf file and use UUID to select the right partition:

root (hd0,0)
kernel /<kernel_file> root=UUID=4a2464b4-c865-4681-b9d9-5d8aef1e2215 

Another easier method could be to use SuperGrubDisk and let it find the boot partitions and let you select which one to boot.

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.