Which drive can I safely partition?
Look before you write. On a machine with more than one drive, one holds the operating system and you must not touch it.
lsblk -e7 -o NAME,SIZE,TYPE,FSTYPE,PARTLABEL,MOUNTPOINTS findmnt -n -o SOURCE /
The second command prints the device behind the root filesystem. Any drive that shows partitions with mount points like /, /boot or /boot/efi is the system disk. A drive with no children and no filesystem is empty. On a model such as S9 with 2x 1 TB NVMe, expect one of the two to be in use and the other to be either empty or already partitioned by the installer. When in doubt, stop and check blkid on each.
Should I use GPT or MBR?
GPT. It supports drives over 2 TiB, more than four primary partitions and keeps a backup copy of the table at the end of the disk. MBR only makes sense for very old boot setups. Current server boards boot with UEFI, which expects GPT anyway.
How do I partition with parted?
sudo parted -s /dev/nvme1n1 mklabel gpt sudo parted -s -a optimal /dev/nvme1n1 mkpart data xfs 1MiB 100% sudo parted /dev/nvme1n1 print
Starting at 1 MiB aligns the partition to physical blocks on every SSD in use today, and -a optimal double checks it. 100% uses all remaining space. The name data is a GPT partition label; the xfs hint is only a type code and does not format anything. -s runs non interactively, so check the device name twice before you press Enter.
How do I split a drive into several partitions?
sudo parted -s /dev/nvme1n1 mklabel gpt \ mkpart pgdata ext4 1MiB 600GiB \ mkpart backups ext4 600GiB 100% sudo parted /dev/nvme1n1 unit GiB print
parted accepts several commands in one call. Sizes can be in MiB, GiB or percent. Think about whether you need partitions at all; one large filesystem with folders is simpler to manage, and LVM gives you flexible volumes you can resize later.
How do I do the same with fdisk?
fdisk is interactive and good when you want to see each step:
sudo fdisk /dev/nvme1n1 g # new GPT table n # new partition, accept number and first sector +500G # size, or Enter for the rest of the disk t # change type if needed, 20 = Linux filesystem, 30 = Linux LVM, 29 = Linux RAID p # print to check w # write and exit
Nothing is written until w. Press q to quit without changes if you are unsure.
Can I script it with sgdisk?
sudo sgdisk --zap-all /dev/nvme1n1 sudo sgdisk -n 1:0:0 -t 1:8300 -c 1:"archive" /dev/nvme1n1 sudo sgdisk -p /dev/nvme1n1
sgdisk from the gdisk package is ideal in provisioning scripts. -n 1:0:0 makes partition 1 from the first free aligned sector to the end, -t sets the type code and -c the name. --zap-all wipes old GPT and MBR structures first, which is destructive by design.
Which partition type should I set?
| Use | sgdisk code | parted flag |
|---|---|---|
| Plain filesystem | 8300 | none |
| LVM physical volume | 8E00 | set 1 lvm on |
| Software RAID member | FD00 | set 1 raid on |
| Swap | 8200 | set 1 swap on |
Type codes are hints that help tools and humans; Linux mounts a partition fine with the wrong code. Set them anyway for clarity.
What comes after creating the partition?
sudo partprobe /dev/nvme1n1 sudo mkfs.xfs -L archive /dev/nvme1n1p1 sudo mkdir -p /archive && sudo mount /dev/nvme1n1p1 /archive
partprobe makes the kernel reread the table if the new partition does not show up yet. Then format it, mount it and add it to fstab by UUID as explained in Linux mount command. Formatting choices are covered in Format a disk on Linux.
Can I partition the second drive as a mirror instead?
Yes, and on two drive models that is often the better use. Create a RAID partition on the empty drive and build a degraded mdadm mirror, or plan the layout with Two-drive mirror (RAID 1). We deliver drives as they are, without an array, so the layout is your choice.
Machines With Spare Drives to Partition
| Server | Processor | Cores / threads | Memory | Storage | Network | Per month | Smallest order |
|---|---|---|---|---|---|---|---|
| S3 | Intel Xeon E-2356G | 6 / 12 | 64 GB DDR4 | 2x 1 TB NVMe | 2x 10 Gbps | $80.38 | $80.38 (1 month) |
| S9 | Intel Xeon E-2356G | 6 / 12 | 128 GB DDR4 | 2x 1 TB NVMe | 2x 10 Gbps | $103.54 | $103.54 (1 month) |
| D5 | 2x Intel Xeon Gold 5315Y | 16 / 32 | 256 GB DDR4 | 2x 2 TB NVMe | 2x 25 Gbps | $305.34 | $305.34 (1 month) |
| D20 | 2x Intel Xeon Gold 6336Y | 48 / 96 | 256 GB DDR4 | 4x 4 TB NVMe | 2x 25 Gbps | $990.36 | $990.36 (1 month) |
Keep Reading
Format a disk on Linux
Turn the blank second NVMe drive into usable space: identify it, partition with GPT, choose ext4 or XFS, mount by UUID and keep TRIM on.
OpenLinux mount command
Mount drives, partitions and network shares on Linux, make them permanent in fstab with UUIDs, and unmount safely when something is busy.
OpenDelete a partition in Linux
Remove a partition from a Linux drive with parted, fdisk or sgdisk, clear old signatures with wipefs, and keep fstab and RAID config clean.
OpenTwo-drive mirror (RAID 1)
How RAID 1 keeps a full copy of your data on two drives, which machines have two drives and how to check it with mdadm.
OpenFAQ
Quick Answers
Writing a new partition table to a drive makes its old data unreachable. Only partition a drive you have confirmed is empty.
No. Run partprobe and the kernel sees the new partition.
It aligns with SSD erase blocks and is what modern tools pick by default.
Yes with parted resizepart, then grow the filesystem. LVM makes this easier.
Yes. Current fdisk fully supports GPT. Press g to create a new GPT table.