-1
:~$ sudo gdisk -l /dev/sda  
GPT fdisk (gdisk) version 0.8.8

Partition table scan:
  MBR: protective
  BSD: not present
  APM: not present
  GPT: present

Found valid GPT with protective MBR; using GPT.
Disk /dev/sda: 976773168 sectors, 465.8 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): F41109D6-7663-46B8-BCC9-188563C07BC9
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 976773134
Partitions will be aligned on 2048-sector boundaries
Total free space is 5240 sectors (2.6 MiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1            2048         1050623   512.0 MiB   EF00  
   2         1050624        79500204   37.4 GiB    8300  
   3       968595456       976771071   3.9 GiB     8200  
   4        79501312       157626311   37.3 GiB    0700  
   5       157626368       968595455   386.7 GiB   0700  

I'm asking because I had a lot of issues when I tried to dual-boot Windows and Ubuntu my new laptop, even with secure boot disabled. I ended up formatting everything and installing Ubuntu fresh with GPT. It used to be far simpler in my previous laptop where there was no UEFI/Secure boot complication. I tried to get my head around it but couldn't.

Now, a few months after that, I've realized I need to install Windows 7, but I can't afford to screw up my current Ubuntu installation.

What would be the best way to dual-boot Ubuntu now? I can easily afford 50gigs or so for Windows out of the 386.7 GiB partition.

  • Windows requires several partitions, so better just to install it. But you must convert Windows 7 to UEFI install, otherwise it will install in BIOS mode and convert drive to MBR, erasing it. – oldfred Apr 1 '15 at 14:11
0

Consider running Windows under VirtualBox, QEMU, VMware, or whatever other virtualization software you like. That will keep it contained and eliminate any dual-boot hassles.

If running Windows in a virtualization environment is unacceptable, then you should read up on how to install Windows in EFI (aka UEFI) mode. The Windows 7 installation medium will often boot in BIOS/CSM/legacy mode by default and then complain about your use of GPT. Some people have jumped through hoops to convert GPT to MBR in response to this complaint, but that just creates new problems. You may need to copy the Windows install files to a USB flash drive or otherwise tweak things to get a clean EFI-mode boot, but that's the way to go. Unfortunately, I don't have a link handy to a good guide on this, but a Web search should turn something up.

Before installing, shrink the Linux partition(s) whose space you want to sacrifice, since the Windows installer can't do that. Also, back everything up; it's easy to go wrong with OS installations and accidentally trash your existing partitions.

I note from your gdisk output that you've got an existing type-8300 partition that presumably holds a Linux filesystem and two type-0700 partitions. The 0700 type code should be used exclusively by FAT and NTFS partitions, but previous generations of Linux (including Ubuntu) used that code inappropriately for Linux filesystems, so it's unclear if those are leftover Windows 8 partitions or Linux partitions. If the latter, I strongly recommend that you change the type codes to 8300 in gdisk. That will reduce the odds of Windows "helpfully" setting up these "blank" partitions with NTFS, which of course would trash them. If these partitions are your leftover Windows 8 partitions and if you don't need them, you could delete them or use mkntfs or GParted to wipe them clean and prepare them for hosting Windows 7.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.