parted  /dev/sda
Number Start End Size Type File system Flags
1 1049kB 50.1GB 50.1GB primary ntfs boot
2 50.1GB 100GB 50.0GB primary ext4
3 150GB 200GB 50.1GB primary ext4
4 200GB 230GB 30.0GB extended
5 200GB 205GB 4999MB logical linux-swap(v1)
6 205GB 225GB 20.0GB logical fat32
7 225GB 230GB 4999MB logical ntfs

There are some spaces from 100gb till 150gb unused,located between partition number 2 and number3, it's wasted.
It is more clear to see the unused space with gparted in graphical format.

enter image description here

I want to create a new partition on it.

(parted) mkpart primary ext4 100g 150g
parted: invalid token: primary
Partition type? [logical]?
(parted) mkpart logical fat32 100g 150g
Error: Unable to satisfy all constraints on the partition.

sudo  fdisk -l

Disk /dev/sda: 232.9 GiB, 250059350016 bytes, 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
Disklabel type: dos
Disk identifier: 0x3b2662b1

Device     Boot     Start       End  Sectors  Size Id Type
/dev/sda1  *         2048  97851391 97849344 46.7G  7 HPFS/NTFS/exFAT
/dev/sda2        97851392 195508223 97656832 46.6G 83 Linux
/dev/sda3       292970496 390819839 97849344 46.7G 83 Linux
/dev/sda4       390821886 449411071 58589186   28G  5 Extended
/dev/sda5       390821888 400584703  9762816  4.7G 82 Linux swap / Solaris
/dev/sda6       400586752 439646207 39059456 18.6G  b W95 FAT32
/dev/sda7       439648256 449411071  9762816  4.7G  7 HPFS/NTFS/exFAT

How to write the partition command on the disk space?
The debian os is installed sda3,it can't be delete and then to create new one.

  • you can use fdisk. what is your fdisk -l output? – FargolK Aug 5 '17 at 8:45

You have a MBR labled disk, which only allows 4 primary partitions or 3 primary partitions and 1 extended partition which can be used to extend the 4 partition limit on a MBR labeld disk.

You are trying to create a 5th primary partition which is not allowed. So you would rather have to grow your extended partition and create a logical partition. There are various how tos out there. Just one can be found here: How to extend logical & extended partition with fdisk.

  • 1
    yep. the best option here (aside from backing up and starting over) is to move sda3 to the start of the unallocated 46.47 (which may require shrinking sda3 to matc first), then moving sda4 to just after the new end of sda3, extend sda4 to remainder of disk. it would then be possible to create new extended partitions after sda7. all of this should be done after making a backup, and from a rescue cd/dvd/usb/etc (the gparted ISO would make a good choice), not while the system is up and running. – cas Aug 5 '17 at 10:04

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.