Thursday, August 31, 2017

UEFI EFI BIOS and FAT32 NTFS A Record of a PITS experience setting up dual boot on an UEFI machine extra pain for running without a DVD drive

UEFI EFI BIOS and FAT32 NTFS A Record of a PITS experience setting up dual boot on an UEFI machine extra pain for running without a DVD drive


So, I was playing around with my Laptop last night and I ruined everything by attempting to reinstall the Ubuntu 14.04 on my dual booting laptop.

The reason? I have tried to make Chromes Chinese font looks better on my Ubuntu setup, I chose the wrong way to do it - I installed the Ubuntu Chinese language package to install and it essentially made all of the Chinese fonts in Chrome to show as ??? - that is just weird.

If this is an English setup, it would almost like replacing all fonts with Comic Sans... thats no eye candy at all.

Also, after I remove the Chinese language package from my Ubuntu, Chrome started acting weirdly like showing messed up encoded Chinese characters instead of... normal scripts.

So I had to do it.

Everything went well at the beginning, I loaded up a pendrive with Ubuntu 14.04 x64 from the official ISO, I meant to install it on the partition I used for Ubuntu, but somehow it erased everything on my Laptop, which is running on a 128GB SSD, wiping everything out including my up-and-running normal Windows 8.1 setup.

Thats where the mess started last night...

I quickly accepted the fact that I erased my Windows 8.1 but I felt just fine, thanks to Dropbox, I think everything I needed, that is important are already on the cloud, so I went straight ahead to get on with my Ubuntu new setup while preparing a Windows 8.1 bootable pendrive - only if it is that simple...

After I set up pretty much everything on my Ubuntu desktop, I reboot the computer and try to boot into the Windows 8.1 drive I got at hand.

Well, I had to say everytime I want to boot into the BIOS, I have to test every function key before I got the right one - Del, F1 - F12 and Esc.

On my laptop, function keys had to be pressed while the fn key is down. or it will be a function instead of a function key (thanks Apple). Note to self - F12 = select bootable media, F2 = BIOS.

I forgot to say, I used the Windows 7 USB/DVD download tool provided by Microsoft to format my pendrive, as suggested by the first link on Google.

When I finally get into the bootable media selection screen after my 14th tries (yes, I tried every function key and f12 is the last one, fuck me, right?), there are only the Ubuntu partitions on the screen. I thought to myself, no way my pendrive is already broken, I got them like, 2 months ago!

So I booted into Ubuntu, and see the drive working normally as it should be.

I inserted it into my Windows Desktop, it shows that it is an NTFS drive, bootable. Everything sounded normal, so I guess it must be Microsofts bootable drive makers problem. I seek for an alternative online and came across something called Rufus, seemed like a very promising bootable drive maker, so I used that to format my pendrive again.

Half an hour later, I got a formatted pendrive, in FAT32, it should work, I said to myself.

Luckily, this time my computer recognize my bootable drive, then I started installing it, everything was just fine and I got my Windows running, but somehow, it wiped my Ubuntu.

Fuck this shit, right? I was still OK with it since I got another computer running and it was just like a side task for me while I work on my Desktop and installing the systems. But still, thats half an hour of work on the Ubuntu setup is now gone.

When the Windows is done installing, I realize my Windows licence that comes along with my Laptop is now gone - I dont keep the stickers and Windows doesnt recognize my Laptops licence - well, thats alright though, I can always activate it, with some other ways...

So I went on and set up my Windows 8.1 installation, some of the drivers does come back automatically, but the trackpad driver isnt, and it works weirdly until I have the official one installed again.

When everything is done, I thought to myself, lets not waste that much of time to play with dual boot, just install VMware player and use Ubuntu within my Windows 8.1 installation, so I went through the installation process again in the VM, in the middle, VMware player told me that it doesnt work since the ISO I was using was for x64 system and my computer only works with x32 - I thought, fuck this shit, I ran Ubuntu x64 just fine back then - but turned out thats something to do with the Hyper V setting or so - some Intel technology that enhance virtualization performance embedded in the motherboard.

I went into the BIOS and turned that on, entered Windows and try installing Ubuntu x64 again, this time, it worked.

But its laggy  - since I have to leave some RAM and processing power for the Windows 8.1, I can only allocate half of the available resources on my laptop for the guest OS, thats 4 cores and 4GB of RAM, but still, it is not as smooth as it was as it is in a dual boot setup where both system gets the full power of my laptop. Also, VMware player kind of sucks on a smaller screen, it triggered some hot corner reaction when I move my cursor to the upper right corner - which will log me off from the guest system.

I grew tired of that and decided to try setting up dual boot again.

Thats where the real nightmare begins.

So I make a Ubuntu bootable drive with Rufus again, and this time, my computer cannot recognize the drive. Then I started researching.

Turned out this is something to do with the UEFI and BIOS - my computer runs on UEFI by default and doesnt recognize boot media that is prepared for BIOS setup.

As far as I understand, BIOS and UEFI does pretty much the same thing - it runs something essential on the computer before booting into the OS we normally uses, it is the firmware for our computers. BIOS being the old standard and UEFI is an advanced version of something named EFI (U stands for Unified).

I wasnt aware of the problem and I thought I saw something called UEFI in my BIOS menu, so I entered my BIOS(actually, my computer runs on UEFI with BIOS legacy support, but I will still call it BIOS for easy understanding) and switched on the legacy support. Well, then my computer was able to recognize the pendrive as bootable media, but when I tried to install the system, it cannot see the partition I made in Windows - all it can see is a 128GB of unallocated space.

That means if I am to install Ubuntu on that space, I will wipe out my mint Windows 8.1 setup again.

After hours of frustration, with no luck on the internet - I didnt know what is the difference of UEFI and BIOS by then, so the discussions online means nothing to me... I decide to go bold and install the Ubuntu there, knowing that there is some differences between UEFI and BIOS. Anyway, I wiped out my Windows 8.1 setup by installing the Ubuntu on the Unallocated space, then I got a new Ubuntu setup, at least thats something good.

I repartitioned my SSD, leaving only 20GB for Ubuntu, and tried to install Windows. This time, things fucked up again - my computer cannot recognize the Windows 8.1 bootable pendrive this time - it was so shocking - I just installed Windows with that, how can it not recognizing it now?

Then I went on to change the UEFI settings in my UEFI again, then it recognize my Windows 8.1 pendrive, but it doesnt recognize my Ubuntu setup. I installed Windows 8.1 again, then Ubuntu is gone.

After several tries, I started again with UEFI Ubuntu installed and a UEFI Windows 8.1 Bootable Pendrive made with Rufus.

Everything should work, and it worked fine until the Windows 8.1 installation reaches 89%.

An error tells me the installation failed.

My instinct tells me thats something wrong with the Windows setup, and turns out, it is Rufus that is the problem - it has a bug while making UEFI Windows 8.1 bootable pendrive...


Thats where I started to research more about UEFI and BIOS, in order to know exactly whats happening.

Well, its time to explain clearly what just happened on my computer in the last 24 hours:

I reinstalled Ubuntu, but selected the wrong partition - Ubuntu select the entire sda1 (the first disk on your computer) if you chose Something else on the installation screen. So, it wiped out everything on my computer.

At this point, since I havent changed anything in my UEFI(BIOS) settings, my system setup is pure UEFI. UEFI, as a newer system, doesnt work with NTFS drives! That is why it cannot recognize my pendrive formatted by the Microsoft tool as it would automatically format it into NTFS.

Then, when I switch the settings in UEFI to make it support my pendrive, I installed a Windows 8.1 as BIOS setup. My computer is therefore wiped, and the Ubuntu setup is gone.

Then, when I install Ubuntu again, since it is a UEFI setup, in my BIOS setting, it doesnt recognize my pendrive, so I had to switch back to UEFI. However, when my computer is set to work with UEFI, it doesnt recognize the Windows 8.1 installation that is set to work with BIOS environment...

When I installed the Ubuntu using UEFI, it wiped out the BIOS Windows 8.1. Then when I sense the problem, the UEFI pendrive I made with Rufus is buggy because it cannot make a functioning UEFI windows 8.1 bootable pendrive...

I cannot believe how much time I wasted just because I picked a buggy tool!

The takeaways :

UEFI & BIOS are both firmware, but only one can exist at a time in one physical disk.

Rufus cannot make UEFI bootable Windows 8.1 media, dont waste your time on that - yes, it has the option, but it will not work. In other words, Rufus sucks.

Windows USB/DVD download tool works well but it can only make NTFS format bootable drive, so its useless when your computer is based on UEFI. In other words, this sucks.

UEFI cannot work with NTFS, which is a newer and better standard for storage media, but it is a more advanced alternative to BIOS. Well, in other words, UEFI kind of sucks.

Dont play with BIOS/UEFI without knowing what youre doing.

Summary:

To dual boot Windows and Ubuntu on a UEFI setup, make sure both installation media is formatted to work with UEFI (a.k.a FAT32).

Dont use Rufus and Windows USB/DVD download tool to make UEFI setup, the first one cannot complete the installation, the second one - its always formatted as NTFS, so, its a no for UEFI.

To make a Windows 8.1 bootable pendrive for UEFI, simply formatted your pendrive into FAT32, then mount the Windows 8.1 ISO, copy everything there onto your Pendrive - dada, its done.

Note that its different for Windows 7 since Windows 7 do not have the UEFI boot files by default, extra steps are needed to do it. (Or just use another bootable drive maker other than Rufus)



P.Ss

Ubuntu need the swap area to hibernate, it may be a good idea to let Ubuntu set itself up, it will automatically make a swap partition of the same size of the amount of your RAM. It might not be a good idea though, on an Ultrabook, since storage is scarce.

download file now