caedes' Notes

2014-01-02

How to boot Linux and Windows (7) via UEFI

Filed under: Linux — caedes @ 03:55
Tags: , , , , , , , , , , ,

Don’t.
It’s a fucking pain in the ass.
Buy a <=2TB hard disk for Windows installations (additional Windows partitions can be on larger HDDs using GPT, it’s only painful for the system partitions).
However, if you want to use a hard drive with >2TB for your Windows installation, you have to use GPT partitions (instead of the old MBR style which only supports <= 2TB disks – there you can only use the space >2TB with ugly hacks and can’t have a continuous partition from 2TB) – and Windows can only boot from GPT partitions in UEFI mode.
To make things more challenging, Windows doesn’t offer creating a GPT partition table and partitions in the graphical installer (at least for Win7), so one has to use cmd.exe.
But don’t worry, the Linux part also sucks :-)
I’ll describe how I got Windows to install using GPT partitions on a 3TB harddisk, how to make an existing Linux (Debian Wheezy) installation boot via EFI (using grub-efi) and how I got my Mainboard (ASUS Z87-A) to boot this and GRUB to chainload (UEFI) Windows.
(more…)

Advertisements

2013-12-31

(Re)installing GRUB to the MBR

Filed under: Linux — caedes @ 04:13
Tags: , , , , ,

This is just a very short roundup of the relevant commands needed to reinstall grub, e.g. when migrating a Linux installation to a new hard drive.

  • boot live Linux system (from CD/DVD or USB key, I use grml, any other live Linux should do)
  • mount root-fs of your installation (e.g. /dev/sda2) to /mnt/
  • if they’re in separate partitions, mount the /boot/, /usr/, … partitions of your installation to /mnt/boot, /mnt/usr/, …
  • mount --bind /dev/ and /sys/ to /mnt/dev and /mnt/sys (maybe also /proc for older versions of grub?), grub will need those
  • chroot /mnt
  • execute grub-install $device (e.g. /dev/sda) to install grub to the MBR of $device
  • update-grub to upgrade the grub menu entries
  • If names of partitions changed, don’t forget to adjust /etc/fstab
  • configure your BIOS to boot from that harddisk
  • reboot, remove live linux you should be greeted by a fresh grub that lets you boot your Linux, BSD, Windows, .. installations

Blog at WordPress.com.