# Old Linux Boot Files Won't Go Away



## Hood (Aug 12, 2018)

Last week I did one of my periodic forays into open source software, and tried a series of distros, hoping to find that linux could finally serve as a viable alternative to Windows, and had drivers available for all my hardware.  Mint, Arch Labs, Ubuntu, Fedora, and Zorin were all tried, and some were full installed on a spare 256GB M.2 drive.  My system is a UEFI installation of Windows 10, and uses an Intel 750 400GB PCIe card as it's boot drive, and also has 5 storage hard drives.  After 2 failed attempts to install the GRUB bootloader on My main Windows drive, I next tried to point GRUB at the M.2 SSD I was installing linux on, and that didn't work either. 
  I don't care about that, it's easy enough to hit F8 when restarting and bring up the boot menu to select linux, or let it default to Windows.  But during installation, there was never an option to skip the boot loader altogether, so some drive had to be selected.
  The various distros had varying degrees of success finding the drivers I needed, but the last one I tried, Zorin Lite, had it covered, except for some minor audio problems (no sound).  I decided to do a full install of Zorin on the empty M.2 SSD, and that's when the real trouble began.  I had already seen several new entries in my UEFI boot menu, from the previous installs, but the Zorin installer did things differently than all the others, tried to turn off Secure Boot in my BIOS (failed to turn it off), I selected the M.2 drive for GRUB and after it installed and asked for reboot, it never booted again, not linux or Windows, it would just hang on a grey BIOS screen forever.
  I couldn't see the BIOS, so I couldn't select a drive to boot from.  I tried clear CMOS, and removed the CMOS batt, and left the system unplugged for 10 minutes - nothing changed.  Finally I removed the M.2 drive and the Intel PCIe drive (Windows), and the regular BIOS screens finally came up, and allowed me to boot from a CD or USB thumb drive.  I could see a dozen new boot menu entries for every drive and several called ubuntu.  After some more fooling around with boot order, I re-installed the Windows drive and got it to boot into the advanced troubleshooting menu, where I imaged the drive with a 2-week-old image I had made.  All was well now, and it booted into Windows normally.  But I still have a few unusual boot options on the F8 boot menu - every hard drive is now listed, and if you click on one, it boots to a linux screen that says "error: unknown file system  entering rescue mode...  grub rescue> _
Obviously, there are still grub files on each drive, and I'd like to clear that out, but conventional methods aren't working.  I wiped the M.2 drive, it's an empty NTFS partition.
  Help, please!


----------



## Aquinus (Aug 12, 2018)

Hood said:


> Obviously, there are still grub files on each drive, and I'd like to clear that out, but conventional methods aren't working. I wiped the M.2 drive, it's an empty NTFS partition.


GRUB gets attached to the MBR, formatting partitions isn't going to get you anywhere, you need to start with a clean MBR. If the drive is empty, this can be achieved by zero'ing out the first 512 bytes of the drive and rebuilding the partition table, then formatting it. Otherwise the same MBR is going to get used and the GRUB bootstrap code will remain.

Edit: Removing the first 446 bytes might remove the bootstrap code but, keep the partition table itself intact but, attempt it at your own risk and assume it will kill the table.


----------

