LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Ubuntu (https://www.linuxquestions.org/questions/ubuntu-63/)
-   -   Dual boot Windows8 + Ubuntu 12.04.2 gone wrong (https://www.linuxquestions.org/questions/ubuntu-63/dual-boot-windows8-ubuntu-12-04-2-gone-wrong-4175471274/)

jot 07-28-2013 11:59 PM

Dual boot Windows8 + Ubuntu 12.04.2 gone wrong
 
Bought a new box with Windows 8 pre-installed (64 Bit).

What I tried to achieve: Setting up dual-boot for Ubuntu 12.04.2 and the existing Windows - both as EFI boot. I have successfully resized the big data partition from within Windows to make space for Ubuntu.

The problem when starting the installation: the Ubuntu installer claims there is no other OS present, which is worrying as it might destroy Windows if I proceed. Normally, I remember, they give you the option "Install Ubuntu alongside with Windows", or soemthing like that. So, I didn't go on installing Ubuntu but tried to take measures making the installer see Windows. Long story cut short - I screwed up along the way and killed my partition table.

Now I have run "TestDisk" recovery tool to revive Windows, and got stuck with interpreting the results correctly. Where one partition ends the next should start. But it is not so clear. Selected results (out of 60) below:

Code:

                        Start        End      Size in Sectors

/dev/sda1 not found. Where to start/end for this one? Should be the MSR Partition

Two /dev/sda2 candidates:
MS Data                264192    1888248    1624057 [Windows RE tools]
NTFS, blocksize=4096, 831 MB / 792 MiB
   
MS Data                264199    1888255    1624057
NTFS found using backup sector, blocksize=4096, 831 MB / 792 MiB

Two /dev/sda3 candidates (EFI System Partition):
MS Data                1888256    2420735    532480 [SYSTEM]
FAT32, blocksize=4096, 272 MB / 260 MiB

MS Data                1888262    2420741    532480 [NO NAME]
FAT32, blocksize=4096, 272 MB / 260 MiB

Two /dev/sda4 candidates (Windows):
MS Data                2420736  316991480  314570745 [Windows]
NTFS, blocksize=4096, 161 GB / 149 GiB

MS Data                2420743  316991487  314570745
NTFS found using backup sector, blocksize=4096, 161 GB / 149 GiB

Correct /dev/sda5 (because no second candidate):
MS Data              316991488  526706687  209715200 [Data]
NTFS, blocksize=4096, 107 GB / 100 GiB

Unallocated space here (gained by resizing Windows' data partition)

Correct /dev/sda6 (because no second candidate):
MS Data            3844106248 3875567616  31461369
NTFS found using backup sector, blocksize=4096, 16 GB / 15 GiB

(QUESTION 1)
As you can see, whichever "candidate" I choose, there is no perfect sequence of partitions without some gaps, making me uncertain in terms of which are the correct ones then? Also, some have labels, some don't. Any significance? Are those with labels more likely to be the correct ones?

(QUESTION 2)
Assuming I get Windows 8 up and running again - how to proceed with getting Ubuntu 12.04.2 installed as dual-boot without killing Windows?

Anyone?
THANKS!

jot 07-29-2013 08:27 AM

(Question 1: answered)
Alright, I have (probably) figured out how to pick the correct partitions found by Testdisk. It has an option (key "P") that lets you explore the filesysten of the selected partition. The wrong ones will be described as corrupted filesystem or something similar. So, I recovered all partitions that seemed to be the correct ones. However, Windows still didn't work upon booting. And Windows recovery (pressing F9) was stuck at some blue screen.

Fortunately, I had a Win8 recovery image on an external harddrive. That alone is not enough. On top of that, one must create a Win8 Recovery Drive to be able to use that image for recovery. I just created it (on a thumbdrive) on another computer's Win8. Success, I got Windows restored.

Moral of the story: before you attempt to install dual-boot with Linux + Windows 8, create a Windows-7-type recovery image on a serparate drive (make sure you include Windows and partition information in that image). Windows 8 had this option somewhere. On top of that, create a Win8 Revovery Drive on a thumbdrive.

(Question 2)
That leaves my second question: how to safely install Ubuntu 12.04.2 without erasing Windows 8?

yancek 07-29-2013 08:48 PM

Quote:

That leaves my second question: how to safely install Ubuntu 12.04.2 without erasing Windows 8?
Pay attention during the installation and read everything. When you boot your CD/DVD/flash drive with Ubuntu, you should get an option to Try without installing. Select that and boot to the Desktop. Open a terminal (hold down the Ctrl+Alt+t keys simultaneously) and enter: sudo fdisk -l(Lower case Letter L in the command). Look at the output. It will show all attached drives/partitions. Any partition which has HPFS/NTFS under the System column is a windows partition. Under the Device column, you will see the partitions named; /dev/sda1, etc. so that during the installation you do not use the partitions that were shown as windows.

jot 07-30-2013 10:46 AM

Hi Yancek, thanks for your reply! Will try what you suggested.

So, in other words, Ubuntu cannot be made seeing Windows (anymore) - which gave us the mentioned third installation option in past?

yancek 07-30-2013 01:33 PM

There should be an option "Something Else" when you start the installer. This is always a better option as you learn more and have more control. The partitioner should see the windows and any other partitions as well as free space. If it doesn't, well that's a problem. Do you have Secure Boot with your windows 8?

jot 07-31-2013 12:05 PM

The installer did see all partitions belonging to Windows (it always did, it just didn't interpret it as another OS). So, yes I went for the "Something Else" option (feels like back to old school :] ).

Answer to your question: yes, "Secure Boot" was enabled.

Good news: it worked! Am typing this on my fresh Ubuntu on the new box. :)

One last issue to resolve - how to get a grub-like boot menu? Currently, everytime I start up I pick the partition to be booted manually from the BIOS menu (pressing F8). In this context, during the installation, I had answered "where to install the bootloader" with Ubuntu's EFI partition. Was that wrong? My main motivation was not to touch (and break again) Windows.

yancek 07-31-2013 02:32 PM

With EFI and Secure Boot, I don't know if there is another way to do it. I don't have any computers using uefi and I've only used windows 8 in VirtualBox so I have no way to check/test this. You might start a new thread with this particular problem and someone more familiar with Secure Boot might be able to help.

jot 08-01-2013 11:49 AM

Summary of Steps
 
1 Attachment(s)
Ok. Thanks anyway, Yancek. After giving it some more thought, and having achieved Ubuntu being the default boot choice (tweaked BIOS configuration), I can live with this. Am 95% of the time Linux user anyway.

I thought, providing a summary and some extra information for ppl who are facing the same, would be a good idea:

Applies to: ppl with pre-installed Windows 8, UEFI boot, who want to add Ubuntu while keeping that Windows, and are going to use either one OS most of the time. The following steps worked for me, but are not the only way of achieving things.
  1. Important! Created a backup of Windows on an external harddrive: used Win8's inbuild "Windows 7 File Recovery" to "Create a system image" [made sure Windows itself and partition info was included] on a NTFS-partition (100GB enough if just Win). Also, created a Win8 "Recovery Drive" on a 1GB thumbdrive - would be needed for booting up and restoring the backed up image in a recovery situation
  2. Created unallocated disk space by shrinked Windows' data partition to 100GB (I don't need more) using Win8's inbuild partitioning tool
  3. Downloaded Ubuntu 12.04.2lts ISO image (this one or newer Ubuntu comes with EFI support), created a bootable thumbdrive from it, using Universal-USB-Installer (free tool that works very smooth)
  4. Booted the Ubuntu thumbdrive (pressed F8 to select it, other BIOS might differ)
  5. Optional step: selected "Try Ubuntu without installing" to do what it says, plus to take note of Win8's original partition layout
  6. Booted again, selected "Install Ubuntu", when it asked for the Installation Type I picked "Something else" (bcoz there was no "Install Ubuntu alongside .." option)
  7. Partitioned disk as seen in the attached screen-shot, (sda7) FAT32/EFI partition: size=100MB, (sda8) Ext4 Linux main partition "/": size=<remaining_space> minus my RAM size, (sda9) Linux Swap: size=my RAM size
  8. Continued and answered "where to put the bootloader" with Ubuntu's EFI partition (not sure if this choice is correct - but at least it didn't do any harm), Done! :D
  9. Tweaked my BIOS to make Ubuntu the default EFI boot (also turned off Secure Boot); if once in a while Windows needs to run - I will just press [F8] when booting up

Enjoy Ubuntu!

Grep4it 12-26-2013 10:17 AM

jot,
My brother has a similar situation which I am woking on remotely - dual boot 12.04 + Win7 but not UEFI. Win7 was installed on the box and 12.04 was added after, run Win7's disk defrag then gparted. Roughly split the 750GB disk in two then added \, \home and \boot partitions followed by the 12.04 install all of which went smoothly. Can boot into linux ok but booting into W7 gives Win splash screen, then runs repair then blue screens out- BSOD. Running testdisk gives the following table:
testdisk -analyze
Disk /dev/sda - 750 GB / 698 GiB - CHS 91202 255 63
Partition Start End Size in sectors
>D FAT16 >32M 0 1 1 12 254 62 208781 [DellUtility]
D HPFS - NTFS 13 0 52 1925 59 54 30720000 [RECOVERY]
D Linux 1925 59 53 1986 11 7 976896
D Linux 1925 59 55 1986 11 9 976896
D Linux Swap 1986 43 42 2350 196 6 5857264
D Linux 2350 228 55 5998 8 26 58591232
D Linux 4146 253 12 7794 32 46 58591232
D Linux 4149 235 55 7797 15 26 58591232
D Linux 4150 208 27 7797 242 61 58591232
D Linux 4153 191 7 7800 225 41 58591232
D Linux 5998 40 59 13292 189 57 117187496
D Linux 9622 219 6 16917 113 4 117187496
D Linux 9628 216 61 16923 110 59 117187496
D HPFS - NTFS 88906 102 29 91073 184 55 34818048
D FAT32 LBA 91073 184 56 91201 20 19 2045952 [GM6C]
Testdisk asks to replace D's with Ps, Ls and a * as appropriate. Ok, on paper can line up first 2 as P and * with Linux being Extended with Ls for each linux part. That leaves one P as can only have 4 and I am not sure which of the remaining 2: HPFS-NTFS OR FAT32-LBA to label as a P. I do realize that these last two MS parts were only seen under the full testdisk analysis - hence I would assume are considered as "removed" due to gparted but are recoverabe as nothing has been added to this disk.
Now that your system is up and running dual boot, could you post the results of testdisk which will show how your partitions are labled as P's, L's or * for each of you MS/Linux parts?
I will post my results if successful one way or the other.


All times are GMT -5. The time now is 02:55 PM.