11

I am going to reinstall Windows on my computer so that I can flash the UEFI/ BIOS (the computer manufacturer only supplies a .exe file). I would like to efficiently reinstall Ubuntu after that. Can you explain a time efficient way to do that?

Edit: Really, I am looking for the safest way to do this with a reasonable degree of efficiency.

  • 2
    I would just make a +minimum size partition on hard drive for a Windows install. Have ubuntu install disk handy if grub needs fixing after. Leave ubuntu install alone. – crip659 Aug 13 '19 at 20:12
  • Windows installation does not always leave Ubuntu alone. It's getting less worse, but still I can't rely on it not corrupting Ubuntu. – K7AAY Aug 13 '19 at 21:48
  • 1
    Some with .exe files also offer a DOS file, so you can create a DOS bootable flash drive to run update.Most better systems now let you run update directly from UEFI with update on a FAT32 partition. And a few new UEFI systems will update directly from Linux with https://fwupd.org/lvfs/devicelist & https://fwupd.org/vendorlist – oldfred Aug 13 '19 at 22:00
  • You mean something like freeDOS? I am concerned that the method is not that safe (as far as the flashing process not working) – whitelightning Aug 13 '19 at 22:40
  • Also, even though it's a .exe file, the BIOS flash programmer may (more likely than not these days) still read it. Dell machines, for example, allow you to load any flash onto a FAT32 USB key and the BIOS will find it and load it using the built-in flashloader. (F12 menu) – tudor -Reinstate Monica- Aug 14 '19 at 05:05
  • 1
    Do you have a spare hard drive available that you can use in this project? – Eric Towers Aug 14 '19 at 16:58
  • 1
    @tudor I already flashed the uefi but could be useful info. – whitelightning Aug 14 '19 at 17:39
  • 1
    @Eric Towers yes, I have a spare drive. – whitelightning Aug 14 '19 at 17:39
  • I get by with my AMD HP Ryzen 5 x360 and HP's insistence on Windows for BIOS upgrades, using Clonezilla as THE backup tool. I did a CZ when I first got the machine with windows only on it. In windows I made the bootable USB Stick BIOS Firmware upgrade that HP supplies. After I had that stick , I can now, in another machine with windows installed, (alternatively you could reinstall that 'virgin' Windows machine with CZ and then go back to the backed up hybrid.Ubuntu setup) extract the bin files from the exes into the NEW folder on the stick – pierrely Aug 17 '19 at 05:47
  • the stick was not bootable in the boot menu, but windows key + b OR holding down all 4 arrows gets there on boot got there. also the continue button required a mandatory touch screen, mine was out of order (cracked), and I guessed right with a single touch to the power button, it then went on to write the BIOS ok. not for the feint hearted, I assure you. – pierrely Aug 17 '19 at 05:49

4 Answers4

17

The most efficient way is to find a Live Windows image and boot from it.

You will be able to flash BIOS from it.

But beware that in some cases it is not a good idea to flash a new BIOS. About a week ago I flashed a new BIOS to an Asus laptop using a BIOS utility (built in into BIOS called EasyFlash).

After that I lost touchpad in Ubuntu and had other problems. I couldn't downgrade BIOS using the same utility because it didn't allow to flash older BIOS.

So I had to use a Live Windows image where I successfuly downgraded BIOS using /nodate switch.

So if you don't have a very strong reason, and everything works fine, don't upgrade BIOS. Ubuntu will take care of CPU microcode.

Pilot6
  • 90,100
  • 91
  • 213
  • 324
  • I can't seem to find any information about /nodate. Very curious about that. – whitelightning Aug 13 '19 at 22:27
  • 2
    It may be Asus specific. – Pilot6 Aug 14 '19 at 04:47
  • 1
    Recommending against updating your BIOS is somewhat dodgy. It can leave you open to big vulnerabilities. – MechMK1 Aug 14 '19 at 09:59
  • 5
    Can you give an example of "big" vulnerabilities in BIOS? – Pilot6 Aug 14 '19 at 11:32
  • @Pilot6: Spectre mitigations often require bios updates to function. – Joshua Aug 14 '19 at 13:46
  • @MechMK1 Yes. On Sunday Morning Linux Review (probably episode around early 2019), they said that users often neglect updating firmware. They say it's important. At least a couple of the guys on there work in IT security. – whitelightning Aug 14 '19 at 17:41
  • OK. But you are warned. It is not always possible to revert BIOS upgrade. Regarding security I don't see anything that can affect it in BIOS. But you can have another opinion. – Pilot6 Aug 14 '19 at 17:48
  • 2
    @Joshua, unless you're a target for a three-letter agency or doing something similarly valuable, you don't need to worry about Spectre. Yes, it's a powerful attack, but it's also really tricky to pull off outside a lab environment. – Mark Aug 14 '19 at 22:13
13

Disconnect your Ubuntu system drive, connect an old spare or used drive, install Windows on it, and do the BIOS update (if, as Pilot6 explained above, if you absolutely, positively, have to update the BIOS). Then, disconnect the old drive, put your Ubuntu OS drive back on, and you're ready to know, secure in the knowledge that Windows did not corrupt Linux.

K7AAY
  • 17,202
  • 1
    This is really the only right answer. With the Ubuntu drive disconnected, the Windows installer can't screw it up. – Monty Harder Aug 14 '19 at 22:34
  • A user with 12,000 posts here says that you need to actually run an installation (not just plug in old drive) for grub repair. https://forums.linuxmint.com/viewtopic.php?f=90&t=286126&hilit=bios – whitelightning Aug 15 '19 at 07:46
  • But, grub repair is not the intent. The OP wants to flash a BIOS/firmware update, which is a Windows-centric task. My answer is intended to allow them to do that without complicating their Ubuntu situation. Any grub repair would be a separate issue and therefore out of scope here. – K7AAY Aug 15 '19 at 15:25
  • @whitelightning : The post you cite assumes you have only one hard drive and that you let Windows installer modify the boot data on that drive. This answer avoids that complication by preventing that installer any access to your drive with your current Ubuntu install. – Eric Towers Aug 15 '19 at 16:18
  • @Eric Towers When I have a bootable Ubuntu disc (live installation media not included), the UEFI adds "ubuntu" as a boot device. So, I was thinking that having Windows connected and flashing would erase that. But, I am thinking now that it will automatically get recreated when hooking the Ubuntu drive back up. – whitelightning Aug 15 '19 at 18:07
2

The most time efficient method of putting an existing Ubuntu installation back on your system is to boot from a thumb drive, do a complete image backup of the entire drive to another (large enough) storage device, then restore that image backup after you're done with Windows.

I'll link an article on how to do this (be careful; you can erase everything as easily as backing it up), but dd is the core command for these operations.

Zeiss Ikon
  • 5,128
  • My understanding is that when I install a new UEFI, there are some things that need to change, regarding other parts of the system. I believe the bootloader is one of them. So don't we need a way to naturally create some of the "install" files? – whitelightning Aug 13 '19 at 22:31
  • Considering that full disc backups take several hours, this is hardly "most time efficient". Even opening the laptop and changing the drive would be faster. – jpa Aug 14 '19 at 06:15
  • @whitelightning Boot configuration is stored on the disk on a EFI System Partition, so restoring disk image will revert those changes as well. But if you want to do it fast, use Clonezilla for imaging, not dd. Clonezilla will only backup used space. – gronostaj Aug 14 '19 at 06:19
  • @gronostaj When I install Ubuntu, there is an EFI system partition, uses fat32 file system. The Ubuntu installation automatically creates that. You are saying that we don't want that moved over, right? – whitelightning Aug 14 '19 at 17:51
  • @whitelightning I am saying that this partition contains complete boot configuration for installed OSes. As long as you have a full disk backup, including ESP, restoring it will also restore previous boot configuration. Updating UEFI doesn't affect those files, so it's a sound plan to 1) full backup, 2) wipe and install Windows, 3) update UEFI, 4) restore backup. – gronostaj Aug 15 '19 at 09:47
  • @gronostaj what does ESP stand for? – whitelightning Aug 18 '19 at 19:24
  • @whitelightning EFI System Partition – gronostaj Aug 18 '19 at 19:37
2

If your .exe flasher tool does not need installation, then you may be able to do this from the Windows installer disc.

Download a Windows 10 installer iso image from Microsoft of the appropriate bitness (32-bit or 64-bit). If you visit the site from Windows, then Microsoft wants you to download their "Media creation tool", which can either download an iso or create a bootable USB drive. I believe the site simply offers the iso file if you visit from Linux, but I haven't tried. This is a free download, and you don't need a license since you won't be installing.

Boot the computer with the installer disc. Progress through the installer until you come to the "Install Now" screen, don't click that button, and press Shift + F10 to open a Command Prompt window. From there you can do many things, for example: Plug in a USB drive with your flasher .exe on it, navigate there (you may have to try a few drive letters to find the correct one), and execute it.