pages tagged windowsENETDOWNhttp://enetdown.org//tag/windows/ENETDOWNikiwiki2016-06-13T07:17:08Zfixing my laptop's bootloader after a Windows 8 upgradehttp://enetdown.org//outgoing/posts/2014/01/25/fixing_my_laptops_bootloader_after_windows_8_upgrade/zaki2016-06-13T07:17:08Z2014-01-25T18:25:33Z
<p>I recently updated my Windows 8 install to Windows 8.1 because Windows started
nagging me that there was an update. I don't boot up into Windows often, so I
thought that I might as well. I found it really cool that the update was
distributed through the same Windows store that you can get the Metro apps.</p>
<p>I went ahead and installed it, but when I rebooted to go back to work in Linux,
my GRUB bootloader wasn't able to find the information in <code>/boot</code>. Luckily, I
had a Debian installer disk with me and could figure out what was happening
through there.</p>
<p>I tried different ways of installing the bootloader, but I was really puzzled
about why my GRUB install wouldn't work as it did before.</p>
<p>I looked at the contents of the parition table using <code>parted</code></p>
<pre><code>(rescue)# parted /dev/sdb print
</code></pre>
<p>and this is what I got:</p>
<pre><code>Model: ATA ST750LM022 HN-M7 (scsi)
Disk /dev/sdb: 750GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Number Start End Size File system Name Flags
1 1049kB 1050MB 1049MB ntfs Basic data partition hidden, diag
2 1050MB 1322MB 273MB fat32 EFI system partition hidden, msftdata
3 1322MB 2371MB 1049MB fat32 Basic data partition hidden
4 2371MB 2505MB 134MB Microsoft reserved partition msftres
5 2505MB 102GB 99.6GB ntfs Basic data partition msftdata
6 102GB 103GB 367MB ntfs hidden, diag
7 103GB 153GB 50.0GB ext4 msftdata
8 153GB 693GB 540GB ext4 msftdata
9 693GB 702GB 9032MB linux-swap(v1)
10 702GB 729GB 26.8GB ntfs Basic data partition msftdata
11 729GB 750GB 21.5GB ntfs Basic data partition hidden, diag
</code></pre>
<p>After running the <code>grub-install</code> command, I was getting odd errors that I had never seen before</p>
<pre><code>warning : this GPT partition label contains no BIOS boot Partition; embedding won't be possible
</code></pre>
<p>I didn't know quite what this meant, so that left me frustrated for quite a
while until I read some docs that mentioned that I needed a new partition. This
was a bit odd because I never needed that before. That is because I was
previously using the pre-UEFI method of an MBR (<a href="https://en.wikipedia.org/wiki/Master_boot_record">Master Boot
Record</a>) partition table.
With UEFI, many computers use a GPT (<a href="https://en.wikipedia.org/wiki/GUID_Partition_Table">GUID Partition
Table</a>) partition table
which is how my computer came installed. This new partition layout requires a
<a href="https://en.wikipedia.org/wiki/BIOS_Boot_partition">BIOS boot partition</a>.</p>
<p>To address this, I took the FAT32 EFI system partition (partition #2) and resized it
down by 22 MB (an arbitrary size) in order to have room for another partition
that I could designate as the BIOS boot partition. I did this using the Debian
installer's partition tool and got a new partition (partition #12). Then I used
<code>parted</code> to set the <code>bios_grub</code> flag to indicate that the partition was to be
used as a BIOS boot partition:</p>
<pre><code>(rescue)# parted /dev/sdb set 12 bios_grub on
</code></pre>
<p>The final partition layout was</p>
<pre><code>Model: ATA ST750LM022 HN-M7 (scsi)
Disk /dev/sdb: 750GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Number Start End Size File system Name Flags
1 1049kB 1050MB 1049MB ntfs Basic data partition hidden, diag
2 1050MB 1300MB 251MB fat16 EFI system partition hidden, msftdata
12 1300MB 1322MB 22.0MB bios_grub bios_grub
3 1322MB 2371MB 1049MB fat32 Basic data partition hidden
4 2371MB 2505MB 134MB Microsoft reserved partition msftres
5 2505MB 102GB 99.6GB ntfs Basic data partition msftdata
6 102GB 103GB 367MB ntfs hidden, diag
7 103GB 153GB 50.0GB ext4 msftdata
8 153GB 693GB 540GB ext4 msftdata
9 693GB 702GB 9032MB linux-swap(v1)
10 702GB 729GB 26.8GB ntfs Basic data partition msftdata
11 729GB 750GB 21.5GB ntfs Basic data partition hidden, diag
</code></pre>
<p>and all I had to do was install the GRUB bootloader to <code>/dev/sdb</code> and
everything worked!</p>