I am planning to divide the largest partition on the hard drive of a CentOS 7 server into four smaller partitions using parted.  Three of the new partitions will be 300 GB each, and the fourth partition will take the remainder.  I have shown the parted print report for the drive below, followed by the syntax of the commands that I imagine using.  How do I change the code below in order to properly partition the hard drive? Here is the result of the print report in parted:  [root@localhost ~]# partedGNU Parted 3.1Using /dev/sdaWelcome to GNU Parted! Type 'help' to view a list of commands.(parted) print                                                            Model: ATA WDC WD20EZRX-22D (scsi)Disk /dev/sda: 2000GBSector size (logical/physical): 512B/4096BPartition Table: gptDisk Flags: Number  Start   End     Size    File system     Name                  Flags 1      1049kB  211MB   210MB   fat16           EFI System Partition  boot 2      211MB   735MB   524MB   ext4 3      735MB   1938GB  1938GB  ext4 4      1938GB  1992GB  53.7GB  ext4 5      1992GB  2000GB  8187MB  linux-swap(v1)So I imagine that the terminal commands are as simple as:  rm 3mkpart    ext4    735MB    300GBmkpart    ext4    300GB    600GB  mkpart    ext4    600GB    900GB  mkpart    ext4    900GB    1938GB  How do I change the code above to correctly create the partitions? For reference, fdisk -l gives a slightly different picture of the drive as follows:  [root@localhost ~]# fdisk -lWARNING: fdisk GPT support is currently new, and therefore in an experimental phase. Use at your own discretion.Disk /dev/sda: 2000.4 GB, 2000398934016 bytes, 3907029168 sectorsUnits = sectors of 1 * 512 = 512 bytesSector size (logical/physical): 512 bytes / 4096 bytesI/O size (minimum/optimal): 4096 bytes / 4096 bytesDisk label type: gpt#         Start          End    Size  Type            Name 1         2048       411647    200M  EFI System      EFI System Partition 2       411648      1435647    500M  Microsoft basic  3      1435648   3786041343    1.8T  Microsoft basic  4   3786041344   3890898943     50G  Microsoft basic  5   3890898944   3906889727    7.6G  Linux swap   EDIT: I have been trying to use @Anthon's suggestions, but am getting different results.  The fdisk -l and parted ... print environment is slightly different now after re-installing CentOS, but the same basic concepts apply because this should be reproduceable.  When I type select /dev/dm-1 all the existing partitions seem to become invisible to parted, but when I skip select /dev/dm-1, I get an error.  Here is the actual terminal record:  [root@localhost ~]# fdisk -lWARNING: fdisk GPT support is currently new, and therefore in an experimental phase. Use at your own discretion.Disk /dev/sda: 2000.4 GB, 2000398934016 bytes, 3907029168 sectorsUnits = sectors of 1 * 512 = 512 bytesSector size (logical/physical): 512 bytes / 4096 bytesI/O size (minimum/optimal): 4096 bytes / 4096 bytesDisk label type: gpt#         Start          End    Size  Type            Name 1         2048       411647    200M  EFI System      EFI System Partition 2       411648      1435647    500M  Microsoft basic  3      1435648    105850879   49.8G  Microsoft basic  4    105850880    121841663    7.6G  Linux swap      Disk /dev/mapper/luks-fb2eda94-fcff-4624-8b04-a9786845504a: 53.5 GB, 53458501632 bytes, 104411136 sectorsUnits = sectors of 1 * 512 = 512 bytesSector size (logical/physical): 512 bytes / 4096 bytesI/O size (minimum/optimal): 4096 bytes / 4096 bytesDisk /dev/mapper/luks-08f8bdb9-85bf-45ef-9519-3f38906c489a: 1938.0 GB, 1938005426176 bytes, 3785166848 sectorsUnits = sectors of 1 * 512 = 512 bytesSector size (logical/physical): 512 bytes / 4096 bytesI/O size (minimum/optimal): 4096 bytes / 4096 bytes[root@localhost ~]# df -T -hFilesystem     Type      Size  Used Avail Use% Mounted on/dev/dm-0      ext4       49G  1.1G   46G   3% /devtmpfs       devtmpfs  3.8G     0  3.8G   0% /devtmpfs          tmpfs     3.8G     0  3.8G   0% /dev/shmtmpfs          tmpfs     3.8G  8.7M  3.8G   1% /runtmpfs          tmpfs     3.8G     0  3.8G   0% /sys/fs/cgroup/dev/sda2      ext4      477M  110M  338M  25% /boot/dev/sda1      vfat      200M  9.8M  191M   5% /boot/efi/dev/dm-1      ext4      1.8T   77M  1.7T   1% /home[root@localhost ~]# partedGNU Parted 3.1Using /dev/sdaWelcome to GNU Parted! Type 'help' to view a list of commands.(parted) print                                                            Model: ATA WDC WD20EZRX-00D (scsi)Disk /dev/sda: 2000GBSector size (logical/physical): 512B/4096BPartition Table: gptDisk Flags: Number  Start   End     Size    File system     Name                  Flags 1      1049kB  211MB   210MB   fat16           EFI System Partition  boot 2      211MB   735MB   524MB   ext4 3      735MB   54.2GB  53.5GB 4      54.2GB  62.4GB  8187MB  linux-swap(v1) 5      62.4GB  2000GB  1938GB(parted) unit compact(parted) select /dev/dmError: Could not stat device /dev/dm - No such file or directory.Retry/Cancel? cancel                                                      (parted) select /dev/dm-1                                                 Using /dev/dm-1(parted) rm 5Error: Partition doesn't exist.(parted) print                                                            Model: Linux device-mapper (crypt) (dm)Disk /dev/dm-1: 1938GBSector size (logical/physical): 512B/4096BPartition Table: loopDisk Flags: Number  Start  End     Size    File system  Flags 1      0.00B  1938GB  1938GB  ext4(parted) quit                                                             [root@localhost ~]# partedGNU Parted 3.1Using /dev/sdaWelcome to GNU Parted! Type 'help' to view a list of commands.(parted) print                                                            Model: ATA WDC WD20EZRX-00D (scsi)Disk /dev/sda: 2000GBSector size (logical/physical): 512B/4096BPartition Table: gptDisk Flags: Number  Start   End     Size    File system     Name                  Flags 1      1049kB  211MB   210MB   fat16           EFI System Partition  boot 2      211MB   735MB   524MB   ext4 3      735MB   54.2GB  53.5GB 4      54.2GB  62.4GB  8187MB  linux-swap(v1) 5      62.4GB  2000GB  1938GB(parted) unit compact                                                     (parted) rm 5                                                             Error: Partition(s) 5 on /dev/sda have been written, but we have been  unable to inform the kernel of the change, probably because it/they are  in use.  As a result, the old partition(s) will remain in use.  You  should reboot now before making further changes.Ignore/Cancel?  ancel                                                     (parted) quitInformation: You may need to update /etc/fstab.So how do I actually partition this drive?
how do I partition a CentOS 7 server using parted?
centos;terminal;partition;parted