Skip to main content

Install Windows 7 and Fedora 18 x64 dual-boot

NOTE:  Currently this post is easily my most disorganized to date.  There is a ton of information here, and unfortunately I'm not exactly sure what data is important, or not - and I can't explain how things work.  The significant positive point is that it does work. ;-)

I can't believe it is even necessary to document this.  After 30 years of PCs they continue to make things pointlessly difficult and challenging.

I have an Lenovo Thinkpad X1 Carbon with a 240 GB SSD.  Windows 7 is amusing and all, but I really prefer Linux.  Between UEFI, Secure Boot, GPT, etc... this has proved to be much more challenging than I had initially anticipated.  I guess the point that will exemplify my frustration - I don't know why I need all these stupid partitions, restore partitions.  I really did not have much of an issue with a BIOS and 4 partition drive to run my 2 OSes.

This method will rely on the Fedora Grub boot loader.  I am not sure if this will wreak havoc on patching the Windows installation... I... shall see.

Install Microsoft Windows 7

Boot the system and hit Enter when prompted to enter the BIOS.
Select UEFI only under startup. (may not be necessary/worthwhile)
Boot the system again and hit enter (again).  Then hit F12 and select the USB CDROM as your boot device.

Make sure you select GPT for your disk partition table.

(Why Windows would not default to GPT is a mystery to me)
Proceed with the Windows Installation until you get to the partitioning section.
Hit Shift-F10 (command prompt)
type diskpart <enter>
clean <enter>
new gpt <enter>
quit <enter>

Restart the install

At this point, you may or may not need to either restart the install, or pretend to quit and then proceed (to force it to reread the disk).  I believe I was able to click cancel (once) which took me back a few steps.
Create a New Partition using a size to host your Windows Installation (leave enough room for your Linux install - Otherwise, you can resize Windows 7 after the install is done).
-- If you create this single partition and attempt to proceed, the installer will create the other necessary partitions.  The exact number that would have made a Linux install impossible on a BIOS-based system (imagine that?)
Proceed with the Windows install

Install Fedora 18

Boot from the Fedora 18 x86_64 media.
Let the Fedora installer do it's thing - then select the disk layout utility
Use the existing Windows-created EFI System Partition - just mount it as /boot/efi

Now - I need to figure out how to get Grub to recognize Windows is installed.  Otherwise, I have to use the UEFI bootloader to select a different partition to boot from (and hope that works).

Install rEFInd - BootLoader Manager

The answer... rEFInd
This guy does some magic with EFI and the bootloader and I'm not sure what even took place.  I would... like to clean up the end result (which is a Windows and 3 linux boot options)  I'll be curious to see how it handles Linux kernel patches.
http://www.rodsbooks.com/refind/

Results

What my drive actually looks like


[root@neo fedora]# parted /dev/sda print
Model: ATA INTEL SSDSCMMW24 (scsi)
Disk /dev/sda: 240GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:

Number  Start   End    Size    File system  Name                          Flags
 1      1049kB  106MB  105MB   fat32        EFI system partition          boot
 2      106MB   240MB  134MB                Microsoft reserved partition  msftres
 3      240MB   147GB  147GB   ntfs         Basic data partition
 4      147GB   147GB  210MB   ext4
 5      147GB   240GB  93.0GB                                             lvm

[root@neo fedora]# blkid
/dev/sda1: UUID="7C09-562E" TYPE="vfat" PARTLABEL="EFI system partition" PARTUUID="13a969d6-8bc4-4cec-9144-33770117acec" 
/dev/sda2: PARTLABEL="Microsoft reserved partition" PARTUUID="ecb8342d-b43d-4f11-b567-7fc01e931dd6" 
/dev/sda3: LABEL="Windows 7" UUID="A6580D72580D4293" TYPE="ntfs" PARTLABEL="Basic data partition" PARTUUID="6626a4f0-ec44-4674-9a98-46c5ff1b26af" 
/dev/sda4: UUID="91cc27d1-30ee-4a10-875c-dc2fba07b302" TYPE="ext4" PARTUUID="43222132-defc-4510-9872-3ae53ea23715" 
/dev/sda5: UUID="MfEhIn-1Igb-J7sX-AZZf-1JlM-UvWh-fljkDV" TYPE="LVM2_member" PARTUUID="65e39e72-a59e-419a-b46d-62a7106beb8b" 
/dev/mmcblk0: PTTYPE="dos" 
/dev/mmcblk0p1: LABEL="X1CARBON" UUID="6417-6B2C" TYPE="vfat" 
/dev/mapper/vg_neo-swap: UUID="f8d08fe6-b311-4456-b447-84fb6f47de96" TYPE="swap" 
/dev/mapper/vg_neo-root: UUID="568cc30f-4441-4a6a-b063-5343279817a2" TYPE="ext4" 
/dev/mapper/vg_neo-home: UUID="f32c98ed-9b32-4d67-9295-ae00d8d983a5" TYPE="ext4"

[root@neo fedora]# df -h
Filesystem               Size  Used Avail Use% Mounted on
devtmpfs                 3.8G     0  3.8G   0% /dev
tmpfs                    3.9G  2.3M  3.9G   1% /dev/shm
tmpfs                    3.9G  5.4M  3.9G   1% /run
tmpfs                    3.9G     0  3.9G   0% /sys/fs/cgroup
/dev/mapper/vg_neo-root   20G  5.6G   13G  31% /
tmpfs                    3.9G  172K  3.9G   1% /tmp
/dev/sda4                194M   37M  147M  20% /boot
/dev/sda1                 96M   30M   67M  31% /boot/efi
/dev/mapper/vg_neo-home   59G  541M   55G   1% /home
/dev/mmcblk0p1           120G   75G   45G  63% /run/media/jradtke/X1CARBON



what is interesting
/boot - ext4 (obviously not used by Windows)
/boot/efi - vfat
/boot/efi/EFI/fedora

/boot/efi/EFI/Microsoft
/boot/efi/EFI/refind


Create a GUID Partition Table Partition on a Raw Disk

To create a GPT partition on a raw disk by using the Diskpart utility:
  1. At a command prompt, type: diskpart to start the Diskpart utility: "Diskpart version 0.0" is displayed as well as a Diskpart prompt.
  2. At the prompt, type: list to list the mounted hard drive volumes.
  3. At the prompt, type: select x (where x is the number of the hard disk drive that you want to convert to GPT). The following information is displayed: "Selected Disk = x".
  4. At the prompt, type: new gpt to add the GPT information into the non-volatile RAM (NVRAM).

    NOTE: This step does not create the GPT partition information.
  5. At the prompt, type: create name="efi system partition" type=efisys Size=102 to create the Extensible Firmware Interface (EFI) partition.

    NOTE: The name can be anything you want, but if the name has spaces in it, the name must have quotes around it. The type must equal either Efisys, Msres, or Msdata. If a size is not specified, the partition uses the remaining unpartitioned space. To install Windows XP, the Msdata partition must contain at least 2 gigabytes (GB) of free space.
  6. At the prompt, type: create name="microsoft reserved" type=msres Size=31 to create the MSR partition.
  7. At the prompt, type: create name="basic data" type=msdata to create a partition for the remaining unpartitioned space.
  8. At the prompt, type: inspect to display the partition information.
  9. At the prompt, type: exit to quit the Diskpart utility.


Comments

  1. hmm nice dude but i followed this tutorial with live images... http://joshstaivin.blogspot.in/2013/09/install-fedora-with-windows-7-dual-boot.html

    ReplyDelete
  2. This comment has been removed by the author.

    ReplyDelete

Post a Comment

Popular posts from this blog

P2V using dd for KVM-QEMU guest

Preface: I have certainly not exhaustively tested this process.  I had a specific need and found a specific solution that worked. Situation:  I was issued a shiny new laptop running Red Hat Enterprise Linux 7 (with Corp VPN, certs, Authentication configuration, etc...)  The image was great, but I needed more flexibility on my bare metal.  So, my goal was to P2V the corporate image so I could just run it as a VM. * Remove corporate drive and install new SSD * install corp drive in external USB-3 case * Install RHEL 7 on new SSD * dd old drive to a disk-image file in a temp location which will be an image which is the same size as your actual drive (unless you have enough space in your destination to contain a temp and converted image) * convert the raw disk-image to a qcow file while pushing it to the final location - this step should reduce the disk size - however, I believe it will only reduce/collapse zero-byte blocks (not just free space - i.e. if you de...

Extending SNMP to run arbitrary shell script

Why are we here... This is not likely something I would have pursued under normal circumstances.  I happen to be working for a customer/client who is not afforded a lot of flexibility to accomplish their goals.  In this case, the rigor is justified.  They have to sometimes be fairly creative with how they solve problems. In this case they would like to utilize an existing snmp implementation to execute a command (or shell script) on a remote system.  They came to me with the idea of using Net-SNMP extend. https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Deployment_Guide/sect-System_Monitoring_Tools-Net-SNMP-Extending.html NOTE:  This is NOT a good implementation strategy in the "real world"  it will simply allow you to test the functionality.  There are a TON of security implications which would need to be taken in to consideration. Implementation Steps: [root@rh7tst01 ~]# yum -y install net-snmp net-snmp-utils ...

RHN Satellite Server (spacewalk) repomd.xml not found

"repomd.xml not found" If you add a channel, or if your RHN cache gets corrupted, and one of your guests complains that it cannot find repomd.xml for jb-ews-2-x86_64-server-5-rpm (for example) - you need to rebuild your repodata cache. Normally this is an automated job - which is exemplified by the fact that you have obviously built out your entire Satellite environment and never had to do any of the steps you are about to do. So - some prep work: Open 3 terminals to your Satellite Server and run: # Term 1 cd /var/cache/rhn watch "ls -l | wc -l" # Term 2 pwd cd /var/log/rhn tail -f rhn_taskomatic_daemon.log # Term 3 satellite-sync --channel=jb-ews-2-x86_64-server-5-rpm Once the satellite-sync has completed, you >should< see the count increment by one.  If you are unlucky (like me) you will not. You then need to login to the Satellite WebUI as the satellite admin user. Click on the Admin tab (at the top) Task Schedules (on the left) fin...