0

I'm trying to create a primary partition to install Win10 (on sda8) as i now need to use it for some things. I did not think i would be needing windows and the things i want to do are not working in a VM hence the install. I have found a few posts on different forums trying to change logical partitions to primary, but i'm not sure i can follow those given my logical partition is inside an extended partition.

Am i right in saying that sda1 is primary, sda2 is extended and contains sda 5-8 logical partitions. Gparted will not allow me to do this or resize sda2 to get unallocated space outside of it to use. sda 5-7 are my /, /home and a /storage which need to be left untouched.

Is it possible to get sda8 outside of the extended and as a primary partition to install Win10 on. Either using sfdisk or a free live usb.

I currently have this partition layout from fdisk:

Disk /dev/sda: 1.8 TiB, 2000398934016 bytes, 3907029168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: dos
Disk identifier: 0x2f009394

Device     Boot      Start        End    Sectors   Size Id Type
/dev/sda1             2048   46874623   46872576  22.4G 82 Linux swap / Solaris
/dev/sda2         46876670 3907028991 3860152322   1.8T  5 Extended
/dev/sda5         46876672  105467903   58591232    28G 83 Linux
/dev/sda6        105469952  979630079  874160128 416.9G 83 Linux
/dev/sda7       1082032128 3907028991 2824996864   1.3T 83 Linux
/dev/sda8        979632128 1082030079  102397952  48.8G  7 HPFS/NTFS/exFAT

Partition table entries are not in disk order.

and this from sfdisk:

label: dos
label-id: 0x2f009394
device: /dev/sda
unit: sectors

/dev/sda1 : start=        2048, size=    46872576, type=82
/dev/sda2 : start=    46876670, size=  3860152322, type=5
/dev/sda5 : start=    46876672, size=    58591232, type=83
/dev/sda6 : start=   105469952, size=   874160128, type=83
/dev/sda7 : start=  1082032128, size=  2824996864, type=83
/dev/sda8 : start=   979632128, size=   102397952, type=7

Thanks Liam

  • It looks like your sda8 is physically between sda6 and sda7. Is that what you see in gparted? – Emmanuel Rosa Apr 30 '18 at 1:04
  • Yeah that's how it shows up in gparted. – Liam Apr 30 '18 at 7:41
0

Given the position of sda8, the NTFS partition, you're going to have to perform some partition gymnastics to create an additional primary partition:

  1. Backup your NTFS partition to another drive. This is easy to do with a tool like partclone.
  2. Remove sda8.
  3. Using gparted, move sda7 (/storage) into the unallocated space freed up by removing sda8; Though retaining the same partition size, of course.
  4. Shrink the extended partition sda2 from the tail end (right side) to free up space outside of the extended partition.
  5. Create a new primary partition.
  6. Restore the NTFS partition from backup into the new primary partition.

In a nutshell, you'd be removing sda8 to free up space between sda6 and sda7, after which you'll move sda7 to move the free space to the tail-end of the extended partition. It is at that point that you should be able to shrink the extended partition.

Warning

Of course, before you do any of this I highly recommend you back up EVERYTHING that's important.

  • Hi Emmanuel, many thanks for your answer. That worked perfectly and i now have Win10 on the primary partition. I didn't realize it was that straightforward after getting lost with the posts on sfdisk etc. I didn't realize how long it would take to shift sda7 to the left!! Thanks again for your help – Liam May 1 '18 at 9:10

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.