How To Dual Boot Windows & Ubuntu 12.04 In Sony Vaio/ HP dv6 Laptops With GPT-EFI Partition or Dynamic Partition
Description
How To Dual Boot Windows & Ubuntu 12.04 In Sony Vaio/ HP dv6 Laptops With GPT-EFI Partition or Dynamic Partitioncommandlinewani.blogspot.in
Document Sample


Nehal J. Wani's Blog: How To Dual Boot Windows & Ubu... http://commandlinewani.blogspot.in/2012/09/how-to-insta...
Share 1 More Next Blog»
Nehal J. Wani's Blog
WEDNESDAY, SEPTEMBER 12, 2012
How To Dual Boot Windows & Ubuntu 12.04 In Sony Vaio/ HP dv6 Laptops With GPT-EFI Partition or Dynamic Partition
How To Dual Boot Windows & Ubuntu 12.04 In Sony Vaio/ HP dv6 Laptops With GPT-EFI Partition or Dynamic Partition
How To Convert Dynamic to Basic Partition Without Loss Of Data
This is a common issue in most of the latest HP and Vaio Laptops. These guys have the following issue:
(i) Vaio guys have used GPT-EFI configuration for their hard drives whereas the old and friendly used to be MBR-BIOS configuration.
(ii) HP guys already have enough number of primary partitions and Linux can't be installed easily (as long as you don't want wubi). So naturally, while
shrinking your hard disk in Windows 7, you generally get an option to change to Dynamic Configuration. There you go! Once clicked, it is very difficult to
revert back. But this is where the important use of two awesome tools gdisk and testdisk chips in.
I'll be focusing on correcting or rather 'suitableizing' your hard disk configuration for easy Linux installations and get rid of crappy partitions of which there is
no need at all. I'll provide the links for the rest of the steps as we go.
The process:
Part 1: Converting GPT-EFI to MBR-BIOS. For this method, you can perform the required set of operations in windows itself. But changing hex-values of a
partition while it is mounted, puff! Therefore, I'll use the live-mode of Ubuntu.
(i) Creating Live Mode USB: To use Live Mode of Ubuntu, all you need is a USB Drive having enough space to hold a 700MB file. Go through
this: http://www.ubuntu.com/download/help/create-a-usb-stick-on-windows Now, that you have a bootable USB, reboot your system (Yeah, by reboot I mean
shutdown and then boot, not hibernate and boot!)
(ii) Booting From USB: Now usually, one can boot from USB in Laptops easily. In Vaio Laptops, you'll have to go to the BIOS options by pressing F2. Then,
you have to switch from UEFI Mode to Legacy Mode and Enable Booting From External Drives. In HP, one can boot from USB just by pressing F9 and
going to Boot Menu.
(iii) Installing gdisk: Note, you should have a working internet connection in order to perform this, otherwise, you can download the required packages
before-hand and store them somewhere.
Open pkgs.org
Search for gdisk
1 of 17 09/15/2012 02:06 PM
Nehal J. Wani's Blog: How To Dual Boot Windows & Ubu... http://commandlinewani.blogspot.in/2012/09/how-to-insta...
Click on Ubuntu 12.04.1 LTS
Now, if you have a 32-bit image of Ubuntu, then click on the i386 file but if you have the 64-bit image of Ubuntu, then click on select mirror.
2 of 17 09/15/2012 02:06 PM
Nehal J. Wani's Blog: How To Dual Boot Windows & Ubu... http://commandlinewani.blogspot.in/2012/09/how-to-insta...
Download the binary package.
(iv) Installing testdisk:
Google testdisk :)
Open the download page of CGISecurity
3 of 17 09/15/2012 02:06 PM
Nehal J. Wani's Blog: How To Dual Boot Windows & Ubu... http://commandlinewani.blogspot.in/2012/09/how-to-insta...
Click on Linux, kernel 2.6.18 or later (again, 32-bit=i386 and 64-bit=x86_64) Let the download complete!
Alternatively, one can download gdisk from https://docs.google.com/open?id=0B8d4Lb_KJbfdd1Yxd25ObWxub0E
and testdisk from https://docs.google.com/open?id=0B8d4Lb_KJbfdTkczOTg3RENndTA
(v) Time to open a terminal: Press the Windows Key and type terminal
4 of 17 09/15/2012 02:06 PM
Nehal J. Wani's Blog: How To Dual Boot Windows & Ubu... http://commandlinewani.blogspot.in/2012/09/how-to-insta...
(vi) Time to write some commands:
We'll basically open gdisk, go into expert mode and delete GPT partition tables and write MBR.
Data provided by Pastebin.com - Download Raw - See Original
1. ubuntu@ubuntu:~$ sudo su
2. root@ubuntu:/home/ubuntu# cd /home/ubuntu/Downloads/
3. root@ubuntu:/home/ubuntu/Downloads# ls
4. gdisk_0.8.1-1build1_amd64.deb
5. root@ubuntu:/home/ubuntu/Downloads# dpkg -i gdisk_0.8.1-1build1_amd64.deb
6. Selecting previously unselected package gdisk.
7. (Reading database ... 147516 files and directories currently installed.)
8. Unpacking gdisk (from gdisk_0.8.1-1build1_amd64.deb) ...
9. Setting up gdisk (0.8.1-1build1) ...
10. Processing triggers for man-db ...
11. root@ubuntu:/home/ubuntu/Downloads#
12. root@ubuntu:/home/ubuntu/Downloads# gdisk
13. GPT fdisk (gdisk) version 0.8.1
14.
15. Type device filename, or press <Enter> to exit: /dev/sda
16. Partition table scan:
17. MBR: protective
18. BSD: not present
19. APM: not present
20. GPT: present
21.
22. Found valid GPT with protective MBR; using GPT.
23.
24. Command (? for help): x
25.
26. Expert command (? for help): r
27.
28. Recovery/transformation command (? for help): ?
29. b use backup GPT header (rebuilding main)
30. c load backup partition table from disk (rebuilding main)
31. d use main GPT header (rebuilding backup)
32. e load main partition table from disk (rebuilding backup)
33. f load MBR and build fresh GPT from it
34. g convert GPT into MBR and exit
35. h make hybrid MBR
36. i show detailed information on a partition
37. l load partition data from a backup file
38. m return to main menu
5 of 17 09/15/2012 02:06 PM
Nehal J. Wani's Blog: How To Dual Boot Windows & Ubu... http://commandlinewani.blogspot.in/2012/09/how-to-insta...
39. o print protective MBR data
40. p print the partition table
41. q quit without saving changes
42. t transform BSD disklabel partition
43. v verify disk
44. w write table to disk and exit
45. x extra functionality (experts only)
46. ? print this menu
47.
48. Recovery/transformation command (? for help): g
49.
50. MBR command (? for help): ?
51. a toggle the active/boot flag
52. c recompute all CHS values
53. l set partition as logical
54. o omit partition
55. p print the MBR partition table
56. q quit without saving changes
57. r set partition as primary
58. s sort MBR partitions
59. t change partition type code
60. w write the MBR partition table to disk and exit
61.
62. MBR command (? for help): w
63.
64. Converted 4 partitions. Finalize and exit? (Y/N): y
65. GPT data structures destroyed! You may now partition the disk using fdisk or
66. other utilities.
67. root@ubuntu:/home/ubuntu/Downloads#
(vii)Now that the disk has been converted to MBR, one needs to recover any partitions that have been lost and mark them as primary. For which, we'll use
testdisk.
Data provided by Pastebin.com - Download Raw - See Original
1. root@ubuntu:/home/ubuntu/Downloads# tar -xf testdisk-6.14-WIP.linux26-x86_64.tar.bz2
2. root@ubuntu:/home/ubuntu/Downloads# ls
3. gdisk_0.8.1-1build1_amd64.deb testdisk-6.14-WIP testdisk-6.14-WIP.linux26-x86_64.tar.bz2
4. root@ubuntu:/home/ubuntu/Downloads# cd testdisk-6.14-WIP
5. root@ubuntu:/home/ubuntu/Downloads/testdisk-6.14-WIP# ls
6. AUTHORS COPYING fidentify.8 ico l photorec.8 README testdisk.8 THANKS
7. ChangeLog documentation.html fidentify_static INFO NEWS photorec_static readme.txt testdisk_static VERSION
8. root@ubuntu:/home/ubuntu/Downloads/testdisk-6.14-WIP# ./testdisk_static
Select Create & Press Enter
6 of 17 09/15/2012 02:06 PM
Nehal J. Wani's Blog: How To Dual Boot Windows & Ubu... http://commandlinewani.blogspot.in/2012/09/how-to-insta...
Select the hard disk in which your Windows, Recovery, etc partitions are present. In most cases it will be /dev/sda. Select proceed and press Enter
Whatever the by-default option is, select it. (TestDisk automatically detects the Hard Disk and makes the appropriate option as default-highlighted). Since
the EFI-GPT Combo data-structures have been deleted by gdisk, Intel is the by default highlighted option in this case.
Select Analyze and press Enter
7 of 17 09/15/2012 02:06 PM
Nehal J. Wani's Blog: How To Dual Boot Windows & Ubu... http://commandlinewani.blogspot.in/2012/09/how-to-insta...
OK, so in the case of Vaio (after using gdisk), Partition 1 and Partition 3 are no longer needed. Because these contain info about booting from GPT-EFI
partitions. Select Quick Search and press Enter
Hit Stop when all the required partitions have been displayed.
8 of 17 09/15/2012 02:06 PM
Nehal J. Wani's Blog: How To Dual Boot Windows & Ubu... http://commandlinewani.blogspot.in/2012/09/how-to-insta...
Now select the Recovery Partition & press the side arrow key until * appears. Do the same for your C: Drive. But for the D: Drive (If you have any) choose P.
This will show the list of partitions that you actually want at last. Select write and press Enter.
9 of 17 09/15/2012 02:06 PM
Nehal J. Wani's Blog: How To Dual Boot Windows & Ubu... http://commandlinewani.blogspot.in/2012/09/how-to-insta...
Everything seems to be done. The partition Structure has been written into the hard disk.
Part 2: Moving/Re-Sizing Hard Disk Partitions: This is required so that error like "This partition does not start at any physical boundary" don't occur while
installing Linux.
(i) Download the GParted Live iso file: http://gparted.sourceforge.net/download.php
(ii) Download and install LinuxLive USB Creator http://www.linuxliveusb.com/ on your MS Windows computer.
(iii) From Windows, install then run the LinuxLive USB Creator program and follow the instructions in the GUI to install GParted Live on your USB flash drive
(iv) Boot From USB and follow the instructions:
Keep pressing enter until a screen similar to this appears. Now re-size the first partition and add the space before and after it. You'll get a warning message
like this one, but its normal.
10 of 17 09/15/2012 02:06 PM
Nehal J. Wani's Blog: How To Dual Boot Windows & Ubu... http://commandlinewani.blogspot.in/2012/09/how-to-insta...
The layout should look like this. Then click on edit and then on "apply all actions".
Intermediary Process: First, The partition is expanded
11 of 17 09/15/2012 02:06 PM
Nehal J. Wani's Blog: How To Dual Boot Windows & Ubu... http://commandlinewani.blogspot.in/2012/09/how-to-insta...
Intermediary Process: Second, data is copied from later sectors to previous ones.
Intermediary Process: Still Copying
12 of 17 09/15/2012 02:06 PM
Nehal J. Wani's Blog: How To Dual Boot Windows & Ubu... http://commandlinewani.blogspot.in/2012/09/how-to-insta...
Intermediary Process: Almost finished copying files.
Copying finished! Hurray!
13 of 17 09/15/2012 02:06 PM
Nehal J. Wani's Blog: How To Dual Boot Windows & Ubu... http://commandlinewani.blogspot.in/2012/09/how-to-insta...
The final layout will look something like this.
Part 3: Recovering Master Boot Record of Windows. This is essential to boot Windows. The destruction of GPT-Partition tables destroys the boot info and
hence it needs to be restored. In order to do this, there are many techniques available. But we'll follow the one mostly used and which is the safest. i.e. let
Microsoft repair it's own product!
(i) Download the iso of the Windows 7 Version you have from :
http://forums.mydigitallife.info/threads/18769-Download-Windows-7-ISO-(Official-32-bit-and-64-bit-Direct-Download-Links)
(ii) Download and Install Windows 7 USB/DVD download tool from : http://images2.store.microsoft.com/prod/clustera/framework/w7udt/1.0/en-us/Windows7-
USB-DVD-tool.exe
Run the program. Click browse to select the image file that you have downloaded.
14 of 17 09/15/2012 02:06 PM
Nehal J. Wani's Blog: How To Dual Boot Windows & Ubu... http://commandlinewani.blogspot.in/2012/09/how-to-insta...
Click on USB Device
Select Which USB Device you want to copy files to.
If there is not enough space on your USB Device, backup its data and click Erase USB Device
Wait for the process to finish.
15 of 17 09/15/2012 02:06 PM
Nehal J. Wani's Blog: How To Dual Boot Windows & Ubu... http://commandlinewani.blogspot.in/2012/09/how-to-insta...
Boot From USB. Select Install Now
Select your language & click next.
Click the button for "Use Recovery Tools"
Click on StartUp Repair
16 of 17 09/15/2012 02:06 PM
Nehal J. Wani's Blog: How To Dual Boot Windows & Ubu... http://commandlinewani.blogspot.in/2012/09/how-to-insta...
The system will automatically restart. If required, you'll have to repeat the process 2 times.
If that doesn't help, use: http://www.sevenforums.com/tutorials/20864-mbr-restore-windows-7-master-boot-record.html
Now you'll be able to log in to windows.
Part 4: Installing Linux:
Use the method on http://www.linuxbsdos.com/2012/05/17/how-to-dual-boot-ubuntu-12-04-and-windows-7/ to safely install Ubuntu. You may have to select
/dev/sda3 instead of /dev/sda2 in case you have a D: Drive
Thanks you for your patient reading. If any questions, put a comment below!
Posted by Nehal Wani at 10:27 PM
No comments:
Post a Comment
Home Older Post
Subscribe to: Post Comments (Atom)
SEARCH THIS BLOG BLOG ARCHIVE
▼ 2012 (3)
Search
▼ September (2)
How To Dual Boot Windows & Ubuntu 12.04 In Sony Va...
Algorithm: Closest Pair Of Points
► April (1)
Picture Window template. Powered by Blogger.
17 of 17 09/15/2012 02:06 PM
Get documents about "