Minggu, 10 November 2013

Xathrya Sabertooth

Xathrya Sabertooth


Creating Dual Boot System with Windows 8 and Slackware64 on UEFI-based Machine

Posted: 09 Nov 2013 07:47 PM PST

This is short notes on how I create a dual boot machine with Windows 8 and Slackware64. Both are 64-bit operating system and will be installed on UEFI-based computer with GPT disk layout.

Actually I do this around in earlier year 2013, so this article might not up to date. However it should work because we use general method.

In this article, i use:

  1. Microsoft Windows 8 64-bit, installation disc
  2. Slackware64 14.0, installation disc
  3. Lenovo Ideapad Z480
  4. USB disk

Note that I do the scenario (would be) mentioned because my machine is fresh and I will do it from scratch.

About Machine

Lenovo Ideapad Z480 has following specification (main):

  1. Intel Core i7-3632QM
  2. RAM 4 GB
  3. HDD 1TB
  4. Video RAM NVidia GeForce GT640

However, I also give addition to RAM so in result I have 8GB RAM.

At default, it is not using UEFI so I activated UEFI capability.

I also convert the disk format from MBR to GPT, however I do this later.

General Overview

The problem arise before me is the fact that the Windows 8 installation DVD not support UEFI yet. Therefore I cannot boot the DVD in UEFI.And also, Windows 8 cannot be installed on GPT disk, yet. At that time Slackware also does not support UEFI, yet. But, it can be installed in GPT partition, good thing to know. Therefore I need a bootable USB disk to boot Slackware then create everything I need for installing Linux.

The scenario in this article:

  1. Create partition
  2. Install Windows 8 while the disk still use MBR layout.
  3. Install Slackware64 14.0 with GPT disk
  4. Finalizing, installing and configuring bootloader

Preparation

I use a companion Linux in bootable USB stick. I create a USB stick with UEFI capable. You can download it from here.

Make a partition for USB stick with FAT32 partition and boot flag enabled. You can use either gparted or gdisk (in Linux) to accomplish it.

Just extract what inside the archive to USB stick. Make sure there are two folders: EFI and Slackware64.

Step 1: Create Partition

Boot the machine from USB stick. I need to create a partition for MBR disk. In my case I create these primary partitions:

  1. boot partition, located on partition 1 with FAT32 file system, takes about 100MB.
  2. Reserved partition, used by Windows, create it for 350MB capacity.
  3. Windows partition, NTFS, I use 100GB
  4. Linux Partition, unallocated, I use 100GB

Those are the partition I need at the moment. The rest will be create at finalizing stage.

Restart and go to step 2.

Step 2: Installing Windows 8

I insert the Windows 8 installation DVD.

Installation of Windows 8 is done in normal way and install it to Windows partition (point 3).

Restart and go to step 3.

Step 3: Installing Slackware64

I need to do some preparation first. Therefore, there would be some subsections for this.

Convert MBR to GPT

Boot the USB stick.

Conversion is inherently risky. For safety, I backup the original configuration before converting the disk. The MBR itself is stored on the first sector of the disk and can be backed up with dd by:

dd if=/dev/sda of=backup.mbr bs=512 count=1

Then I run gdisk for disk on /dev/sda

gdisk /dev/sda

Follow the option menu for conversion MBR to GPT, and I done.

Prepare the Installation Environment

Mount the USB stick. I accomplish this by invoking following command:

mkdir /src  mount /dev/sdb1 /src

Invoke setup and adjust the setting like normal installation until you reach installation media stage.

Press ALT+F2 to switch to another screen (or another tty).

Install temporary system using USB stick. Invoke these commands:

cd /src/slackware64  installpkg -root /mnt [az]*/* cd

Installation

Now, back to our main setup and choose install from CD/DVD. Also, I won’t use LILO, instead I use ELILO. So I don’t install LILO.

After installation is finished, I don’t restart the machine immediately. Instead, I go to last step: Finalizing.

Step 4: Finalizing

First, make sure we are still boot the machine using USB stick, then load following command:

modprobe efivars

Also, I need to mount the boot partition

mount /dev/sda1 /mnt/boot/efi

Add Bootstrap to Slackware

I invoke following command. Note that these commands should be invoked as is, even a dot matters. If you remember, the Slackware is installed on 4th partition.

mount /dev/sda4 /mnt/root  cd /mnt/boot/efi  cp -rvf /src/EFI /mnt/boot/efi  cd /mnt/boot/efi/EFI  mv BOOT Slackware  cd Slackware  mv bootx64.efi elilo.efi  cp /mnt/root/boot/vmlinuz-huge-3.2.29 .  vi elilo.conf

And I configure the elilo.conf:

prompt  image = vmlinuz-huge-3.2.29  label = Slackware  root = /dev/sda4

And register boot so that machine can boot Slackware.

cd /mnt  usr/bin/efibootmgr -c -L "XathryaSlackBoot" -l "\\EFI\\Slackware\\elilo.efi"

Add Bootstrap to Windows

Eject the Slackware installation disc and insert Windows 8 installation disc. I need to copy all files needed to boot EFI from Windows 8 disc.

cd /mnt/boot/efi  mkdir /mnt/disc  mount /dev/sd1 /mnt/disc  cp -R /mnt/disc/efi/microsoft /mnt/boot/efi

That will copy “microsoft” folder and whole of it’s content to /mnt/boot/efi (which is my mounted efi boot partition).

Now, to create a bootstrap we first need to restart the machine and boot with Windows 8 installation DVD. What we will do is repair the Windows 8 EFI bootloader.

I do normal installation sequence method until I was prompted with list of volumes / partitions. Now press [Shift] + F10. A new command prompt appear.

Now invoke following command, which will bring me to diskpart (disk partition) program:

diskpart

My disk is only one, so I will use disk 0.

sel disk 0

Because the EFI partition is the very first partition (/dev/sda1), it should be registered as earlier volume. However, it doesn’t have drive letter, so I will give it one.

diskpart

sel vol 1  assign letter b:

The attempt is successful and I’m prompted by a message which tell me that the volume has been assign to letter B. Now leave the diskpart with exit command. Go to the EFI partition and add the EFI bootstrap.

cd /d b:\EFI\Microsoft\Boot\  bootrec /fixboot  ren BCD BCD.bak  bcdboot C:\Windows /l en-us /s B: /f ALL

bootrec (boot recover) will fix the UEFI bootloader.

bcdboot will be used to recreate BCD store. The C:\Windows is path where Windows is installed and B: is drive of my EFI partition. The “/f ALL” parameter updates the BIOS settings including UEFI firmware/NVRAM while /l en-us is to localize for US locale (US English).

Add More Partitions

I need more partitions so I create them. I use gdisk for this.

Tidak ada komentar:

Posting Komentar