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

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

Install RHEL 7 on old HP DL380 g5

Someone at work had been running RHEL on an HP DL380 G5 and blew it up.  After several attempts at doing an installation that made me conclude the hardware was actually bad... I kept digging for the answer. Attempt install and Anaconda could not find any disks - try a Drivers Disk (dd.img) both cciss and hpsa.   -- once we did that, when the system would reboot it would say it could not find a disk. hmmm. Boot from your installation media and interrupt the startup at grub. Add hpsa.hpsa_allow_any=1 hpsa.hpsa_simple_mode=1 to the line starting with linuxefi press CTRL-X to boot. Once the system restarts after the install, you need to once again interrupt the startup and add the line from above. After the system starts, edit /etc/default/grub and add those 2 parameters to the end of the line starting with GRUB_CMDLINE_LINUX (which likely has quiet at the end of the line currently). then run # cp /boot/grub2/grub.cfg /boot/grub2/grub.cfg.orig # grub2-mkconfig -o /boot/grub2

MOTD with colors! (also applies to shell profiles)

I'm not sure why I had never looked into this before, but this evening I became obsessed with discovering how to present different colored text in the /etc/motd. A person had suggested creating a shell script (rather than using special editing modes in vi, or something) and I agree that is the simplest way of getting this accomplished quickly. This most noteworthy portion of this script is the following: RESET="\033[0m" that puts the users shell back to the original color. I typically like a green text on black background. Also - a great reference for the different colors and font-type (underscore, etc...) https://wiki.archlinux.org/index.php/Color_Bash_Prompt I found this example on the web and I wish I could recall where so that I could provide credit to that person. #!/bin/bash #define the filename to use as output motd="/etc/motd" # Collect useful information about your system # $USER is automatically defined HOSTNAME=`uname -n` KERNEL=`un