Wednesday, August 14, 2013

Dual boot Debian 7 Wheezy on existing Win8 UEFI machine


I don't want to bother giving a lengthy background or info... So I'll just try to make this post a short mash up of what you need to know.

Prelude: Dual-booting a laptop/machine wherein there is an existing Windows 8 installed in a UEFI boot-up environment

First off, you'll probably need to do some shrinking of existing partitions. In my case, I just shrank my Windows8 drive C: using the disk manager build-in under the "Computer Management".

Afterwards, you'll need to use a UEFI-bootable linux image. For me, I used a PXE bootable Debian 7 Wheezy-stable image and created a root, swap, and home partition from the unused space. Do take note that you need to use the new GPT partitioning (for those with fresh hard drives); this option is usually asked or selected when using the "advanced mode" when installing.

Now here is the tricky part... after you proceed to install GRUB, that grub instance will not work later after finishing the installation. You will need to use an external USB linux image or disk that can boot as UEFI. This is not necessarily need to be a Debian USB image as I used a Kubuntu 13.04 image and placed it in a USB stick.

Use the USB stick to boot the machine up and use its GRUB rescue to manually boot the already installed Debian. For those a bit lost on using the GRUB rescue command line, below are the lines I used.

set prefix="(hdX,gptX)/boot/grub"
set root="(hdX,gptX)"
insmod normal
normal


Note that the prefix is just to denote the location of the grub installation folder, so the value might change depending on your partition layout. On the example I gave, I only have a root partition so I had to specify the "boot" folder. If your case is that you created a separate "/boot" partition, the prefix would probably look like...

set prefix="(hdX,gptX)/grub"


Once you have managed to boot-up to your installed Debian partition, log-in to your root (or use sudo if that's your preference) and install the following packages:

# apt-get install grub-efi-amd64 efibootmgr

We then have to mount temporarily the partition containing the already existing EFI loader of Windows. This is usually around 250-300MB in partition size and contains files and folders with names like "Boot" and "EFI". I'll leave it up to you which or what partition number that may be.

# mkdir /boot/efi
# mount /dev/sdaX /boot/efi

Next is loading the driver/module for the EFI support, which will then aid with the re-install and detection of GRUB of the existing EFI Windows 8 partition and creating a Debian EFI entry.

# modprobe efivars
# grub-install /dev/sda
# update-grub

Kindly check if there is a new EFI entry present on the output displayed upon executing the "update-grub". Also, check inside /boot/efi if there is a new folder or entry that matches in terms of the name of the EFI entry listed a while back.

If all goes well, you will see a new UEFI boot priority inside your BIOS apart from the UEFI Windows Boot Manager.

Hope this helps!


Other resources that you might find useful:



Sunday, July 21, 2013

GAM: basic scripting for Google Apps Admins

Hi everyone! It has been a while since I posted something useful in this blog site of mine...

I'm currently kept busy by one of my on-the-side projects recently, in particular deploying Google Apps for Education. One thing that I noticed is a need by some admins to automate some bulk task in managing and keeping up-to-date user accounts management in their respective domains. Since time is usually at the essence, and also a luxury, for most IT administrators... they don't have too much time to develop their own robust apps to deal with this kind of work.

One solution that I suggest that you guys can try out is using something called the "Google Apps Manager" (or GAM). It similarly works like the provisioning API of Google Apps but already ready for CLI usage (in my case, it works like a charm in linux).

To sum what GAM is, it is a python based library/command that you can use to connect to your Google Apps Admin Console and make the necessary administrative or user management work. Now the good thing with this is if you combine this with some basic scripting magic, you can now automate some bulk tasks like massive user creation or moving a huge amount of people to a mailing list.

For more info or to check what the Google Apps Manager can really do, check this link out.