1

I'm running a Linux live USB with ubuntu 14 on it. From there I try to prepair my SSD for dual boot Windows 10 and Ubuntu 14. From the beginning it did not work very well and I had to reboot after the installation process started because it got hung up in between. Now, it is impossible for me to partition the SSD. I entered gparted while in live mode and it also creates a new parition table (MSDOS/MBR). Now I tried to create the following partitions:

  1. ntfs, primary, no label 203.59 GiB #for Windows 10
  2. ext4, primary, label='/', 27.34 GiB #for Ubuntu 14
  3. linux-swap, no label, 1.95 GiB #intended swap area

I don't know where the weird GiB numbers come from, I typed in 200 000 MB, 28 000 MB, and 2 000 MB.

Now this is the error that gparted gave me:

Gparted Error

(sry no internet for the live mode atm)

Because tatsu asked for it, this is the install history of my ssd (not proud of it): In the very beginning I succesfully installed Win7 on it. Then I tried dual boot with Ubuntu14 which did not work, because it could not successfully create partitions on the unallocated space. Then, because I broke the boot loader or something in the process I managed to successfully install win10. Then the same thing happened again and now I am trying to fix the SSD before doing anything else.

EDIT :

Here are the outputs for the different commands:

sudo parted /dev/sda print

Model: ATA Samsung SSD 850 (scsi)
Disk /dev/sda: 250 GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number    Start     End     Size    Type     File system    Flags
1         1049kb    525MB   524MB   primary  ntfs           boot

sudo fdisk -l /dev/sda

Disk /dev/sda: 250.1 GB, 250059350016 bytes 222 heads, 30 sectors/track, 73332 cylinders, 
total 488397168 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes 
I/O size (minimum/optimal): 512 bytes /512 bytes Disk identifier: 0x06749486


Device        Boot   Start     End       Blocks    Id    System  
dev/sda       *      2048      1026047   512000    7     HPFS/NTFS/exFAT

sudo sgdisk -v /dev/sda:

********** 
Found invalid GPT and valid MBR; converting MBR to GPT format in memory.

**********

No problems found. 487373101 free sectors (232.4 GiB) available in 2 segments, the largest of which is 487371087 (232.4 GiB) in size.
8
  • Could you please edit your question include the output of sudo parted /dev/sda print? Thanks. May 10, 2017 at 11:59
  • It sounds like your partition table is damaged. The output of sudo fdisk -l /dev/sda, sudo parted /dev/sda print, and perhaps sudo sgdisk -v /dev/sda may be helpful in diagnosing the problem. Please edit your question to add that output.
    – Rod Smith
    May 10, 2017 at 19:38
  • @RodSmith thank you for your time, I've added the outputs.
    – Smyke
    May 11, 2017 at 21:02
  • @DavidFoerster thank you too, I've added the output
    – Smyke
    May 11, 2017 at 21:03
  • Could you please post text files, dialogue messages, and program output listings as text, not as images? To achieve the latter two you can either 1) select, copy & paste the dialogue text or terminal content or 2) save the program output to a file and use that. Longer listings (the editor will tell you what's too long) should be uploaded to a pastie service and linked to in the question. Thanks. May 11, 2017 at 22:23

2 Answers 2

0

C̶o̶n̶t̶e̶x̶t̶ ̶w̶o̶u̶l̶d̶ ̶h̶e̶l̶p̶ ̶m̶e̶ ̶o̶u̶t̶ ̶h̶e̶r̶e̶.̶ ̶ ̶F̶o̶r̶ ̶e̶x̶a̶m̶p̶l̶e̶ ̶a̶r̶e̶ ̶y̶o̶u̶ ̶r̶u̶n̶n̶i̶n̶g̶ ̶o̶f̶f̶ ̶a̶ ̶u̶b̶u̶n̶t̶u̶ ̶l̶i̶v̶e̶ ̶U̶S̶B̶ ̶t̶r̶y̶i̶n̶g̶ ̶t̶o̶ ̶f̶o̶r̶m̶a̶t̶ ̶y̶o̶u̶r̶ ̶o̶l̶d̶ ̶u̶b̶u̶n̶t̶u̶ ̶p̶a̶r̶t̶i̶t̶i̶o̶n̶?̶ ̶o̶r̶ ̶s̶o̶m̶e̶t̶h̶i̶n̶g̶ ̶l̶i̶k̶e̶ ̶t̶h̶a̶t̶?̶

in this case GPT - MBR is something to look out for. it reasonable to assume your MBR boot usb wouldn't have full access to a GPT partition scheme. (and you cannot dual boot a GTP windows with a MBR ubuntu or vice versa)

but really I'm placing all my money on hyberfil.sys once again.

if the partition you are trying to remake is the ntfs one (and from the screenshot BINGO) then we're in the typical hyberfil locked partition scenario.

I find the "How to Geek" article on this is by far the best and most inclusive quide to unlocking an ntfs partition on ubuntu (thought they did forget to mention the CMD trick I mention below) : https://www.howtogeek.com/236807/how-to-mount-your-windows-10-or-8-system-drive-on-linux/

the final section is for if you only have access to the ubuntu but doing it windows side if your windows is still bootable is prefered.

if you are reinstalling both windows and ubuntu to dual boot then do not create window's partition in linux.

and do not install ubuntu first. you're really in for a major hassle if you do.

If the reason is that : you want to use windows boot manager to choose between the two you actually can but the best (and possibly only way) is to install windows first install ubuntu on top then do the tricks to end up with a windows bootloader that is capable of pointing to your ubuntu when you boot up.

this is the cleanest fastest and simplest way.

pro tip : once windows is installed and you're ready to do the ubuntu install open an admin CMD (SHIFT-ENTER when it's the listed option in start or right click to slect "run as administrator") then type in powercfg -h off this turns off fake powerdown/reboot and turns the following reboot into a real one where the partition is unmounted and ready to be resized/manipulated by the ubuntu installer/gparted.

have fun!

EDITED TO REPLY TO COMMENT :

all the above remains true :

The reason the live CD/USB might not detect windows (as I've said) is that windows was locking the partition with hyberfil.sys or it and windows are on seperate partitioning shemes they will not be ble to see each other in which case you must first match both partitioning shemes. (or both)

Since you're installing both and windows 7 can be GPT and GPT is better you should install windows as GPT then ubuntu as GPT as well. doing this (at least for ubuntu) is simple : if the usb key/CD is GPT then so is the os it installs.

I use https://rufus.akeo.ie/downloads/rufus-2.14.exe and create my ubuntu installer with it under windows. (as you can see once the iso is selected rufus has GPT as it's third option for partitioning type in it's first drop down menu). keep in mind you being able to do GPT at all is heavilly dependent on the motherboard.

Check that you have a UEFI-capable motherboard first and go into it's bios to turn on EFI/UEFI boot.

Lastly if windows still isn't detected after doing all this (but I 100% guarantee that it will be), select the option something else :

something else

which will open a menu like this (dumbed down gparted) :enter image description here

this thread has alot of the answers we're looking for : How do I install Ubuntu alongside UEFI enabled Windows 8?

I personally alsways used this menu because i didn't want swap especially not on my SSD! but now with ubuntu 17.04 canonical has finally removed that necessity and the "install allongside" no longer adds a swap patition. I digress.

just create two partitions with this tool. one 600 (or any size slightly over 500) megs in EFI one the size you want your ubuntu to be in ext4 with mountpoint / and the click "install now".

make sure to do the admin CMD powercfg -h off that I talked about above in between the windows and ubuntu install and it will work like a charm.

cheers! :)

2
  • thanks for the answer, I've added some context and I want to install win10 first. Then, would it all go away if I just install win10 then enter live usb mode with ubuntu and then install it alongside as @MeganFoxz suggested? I only did manual partitioning because Ubuntu wouldn't detect win in the first place, I always did it with creating unallocated space first though...
    – Smyke
    May 10, 2017 at 10:51
  • edited my post.
    – tatsu
    May 10, 2017 at 11:16
0

First, there's nothing to repair. Your disk has a single 524MB partition, which is too small to hold a full Windows installation. If that partition holds any important data, I recommend backing it up and being prepared to copy it elsewhere. If the disk used to hold more partitions, they're gone. You might be able to recover them with TestDisk or something similar; or you might, at much greater effort, be able to recover individual files with PhotoRec or something similar. If you need to recover data, I recommend you search this site (or Windows forums, if the data existed in Windows partitions) for data-recovery advice. For the rest of my answer, I'll assume that you're willing and able to start by wiping the disk completely clean and do a fresh install of both Windows and Ubuntu.

Second, I recommend you figure out whether you want to boot your OSes in EFI/UEFI mode (the native mode for most computers sold since late 2011) or in BIOS/CSM/legacy mode (the native mode for most computers sold before late 2011, and a potentially problem-inducing option on most later computers). See this page of mine on the Compatibility Support Module (CSM), which provides the BIOS-compatibility mode in modern computers, for more on why it can cause problems. Generally speaking, I recommend doing native-boot-mode installations, which means EFI-mode on most post-2011 hardware and BIOS-mode on most earlier computers. See this page of mine for tips on determining your hardware's capabilities.

With your desired boot mode determined, you can begin preparing your disk. For Windows, EFI-mode booting requires using the GUID Partition Table (GPT), whereas BIOS-mode booting requires using the Master Boot Record (MBR). Ubuntu is more flexible, but it works fine with Windows' requirements, so you'll have to go with them.

Whether you'll be going down the EFI/GPT or the BIOS/MBR path, I recommend you begin by wiping all the partition table data on the disk. This is easily done with sgdisk, which is a standard Ubuntu tool:

sudo sgdisk -Z /dev/sda

This command will erase the partition table, rendering the disk blank for your purposes! Thus, you should issue this command only after you recover any data you want to preserve from the disk. (This command doesn't actually erase everything, though; it just erases the partition table. It's not a secure erase option, but it deletes enough to greatly complicate data recovery.)

Finally, with that done, you can install Windows and Ubuntu, keeping some tips in mind:

  • Control the boot mode -- If you have an EFI-based computer, it's imperative that you understand how to control the boot mode. This is covered on my page on the CSM, referenced earlier. If the CSM is enabled, it's easy to accidentally boot one OS's installer in EFI mode and the other in BIOS mode, which will lead to confusion and unnecessary problems. Unfortunately, details vary from one computer to another. The easiest approach is usually to disable the CSM -- but even the details of how to do this are non-standardized.
  • Install Windows first -- Windows tends to assume that it's the only OS on the computer, so when it sets up its boot loader, it will become difficult to boot Ubuntu. Ubuntu is friendlier to dual-boot configurations, so installing it second is preferable.
  • Leave space for Ubuntu -- When you install Windows, leave unpartitioned space for Ubuntu. Especially if you install in BIOS mode, do not create partitions for Ubuntu. This is because Windows, particularly on MBR disks, tends to convert from a "basic" MBR configuration to a Logical Disk Manager (LDM) configuration (aka "dynamic disks"), which Ubuntu can't easily use.
  • Be prepared to use the "Something Else" installation option in Ubuntu -- Sometimes, particularly on EFI-based systems, the automatic partitioning options in the Ubuntu installer don't work. (People often post saying that "Ubuntu doesn't recognize Windows." That's not really accurate, but it's how novices see the problem.) This question and its answers cover how to use the poorly-named "Something Else" installation option, which enables manual partitioning.
  • Read up -- Particularly if you're familiar with BIOS-mode dual-boot configurations, EFI-mode setups can be a bit odd, and your BIOS-mode instincts may lead to problems. The following pages may be helpful. (I don't expect you'll read them all, but reading one or two of them should help you to avoid common pitfalls.) Of course, if you've got an older computer that boots only in BIOS mode, this isn't an issue.
2
  • I took a look at the sources but the sudo sgdisk -Z /dev/sda command did not work. Afterwards I still got the unrecognized disk label error. I also tried the sudo dd if=/dev/zero of=/dev/sda count=1 command but still no worky @DavidFoerster
    – Smyke
    May 15, 2017 at 19:19
  • The unrecognized disk label message is not a problem and it's not an error; it's just the way fdisk has of telling you that the disk is completely unpartitioned, without even the most basic data structures. fdisk (and other partitioning tools, like GParted, parted, and gdisk) can all write 100% fresh partition table data. The point of wiping the data with sgdisk -Z is to get to this state, so that you won't have old partitions with stale data structures in them.
    – Rod Smith
    May 15, 2017 at 22:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .