How-to

Format and Mount a Second Drive on Linux

Two-drive machines arrive with the system on one NVMe drive and the other blank. Ten minutes turns that blank drive into a mounted, persistent file system.

Which drive is the empty one?

Check before touching anything. Formatting the wrong drive erases the operating system, and without an out-of-band console the only way back is a reinstall from the panel:

lsblk -o NAME,TYPE,SIZE,FSTYPE,MOUNTPOINTS,SERIAL

The system drive shows partitions with mount points such as / and /boot/efi. The blank drive shows only the disk line, for example nvme1n1 1.8T disk, with no children. NVMe numbering can change between boots, so confirm by serial with ls -l /dev/disk/by-id/ | grep nvme1n1 and use that stable name in scripts.

Should you mirror the two drives instead? For databases and anything you cannot lose, often yes; the Two-drive mirror (RAID 1) entry shows how to build RAID 1 yourself, since RAID is never set up at delivery. This guide covers using the second drive as separate space: for backups, build caches, VM images or a scratch area.

How do I clear old signatures?

Drives normally arrive clean, but a quick wipe of leftover partition tables or file system labels avoids confusing tools later:

wipefs -n /dev/nvme1n1      # preview what would be removed
wipefs -a /dev/nvme1n1

Read the device name twice before pressing Enter.

How do I partition it?

Use a GPT label and one partition spanning the drive. parted aligns partitions correctly by default:

parted -s /dev/nvme1n1 mklabel gpt
parted -s -a optimal /dev/nvme1n1 mkpart data 1MiB 100%
lsblk /dev/nvme1n1

You now have /dev/nvme1n1p1. A partition is not strictly required, since a file system can live on the whole disk, but a partition table tells every tool the drive is in use and protects against accidental re-formatting.

ext4 or XFS?

File systemStrengthsDefault on
ext4Can shrink, mature tools, good all-roundUbuntu, Debian
XFSExcellent with large files and parallel I/O, cannot shrinkThe Enterprise Linux images
ZFSChecksums, snapshots, compression, mirrorsFreeBSD 14; available on Linux
mkfs.ext4 -L data -m 1 /dev/nvme1n1p1      # -m 1 reserves 1% for root instead of 5%
mkfs.xfs -L data /dev/nvme1n1p1

Pick one. Both handle multi-terabyte NVMe drives well; matching the distribution's default keeps tools and guides consistent.

How do I mount it so it survives reboots?

mkdir -p /data
blkid -s UUID -o value /dev/nvme1n1p1
echo 'UUID=put-the-uuid-here  /data  ext4  defaults,noatime,nofail  0 2' >> /etc/fstab
systemctl daemon-reload
mount -a && df -h /data

Use the UUID rather than /dev/nvme1n1p1, since device names can move. nofail lets the machine boot even if this drive is missing or broken, which matters when there is no console to fix a stuck boot. noatime skips a write on every read. Test with mount -a before any reboot; an fstab typo found now is harmless, one found during boot is not.

Is TRIM enabled?

NVMe drives stay fast when the file system tells them which blocks are free. Ubuntu, Debian and the Enterprise Linux images run a weekly fstrim.timer; check with systemctl status fstrim.timer and enable it if needed. Weekly trimming is preferred over the discard mount option for most workloads.

Who should own the new space?

Root, until you decide otherwise. For an application, create a folder and hand it over: install -d -o postgres -g postgres -m 700 /data/pg. On Enterprise Linux images, label it for the service, for example semanage fcontext -a -t postgresql_db_t '/data/pg(/.*)?' and restorecon -R /data/pg. Watch drive wear over time with nvme smart-log; the NVMe endurance (TBW and DWPD) entry explains the numbers.

Popular Two-Drive Machines

ServerProcessorCores / threadsMemoryStorageNetworkPer monthSmallest order
S3Intel Xeon E-2356G6 / 1264 GB DDR42x 1 TB NVMe2x 10 Gbps$80.38$80.38 (1 month)
S6Intel Xeon E-2288G8 / 1664 GB DDR42x 1 TB NVMe2x 10 Gbps$89.92$89.92 (1 month)
D52x Intel Xeon Gold 5315Y16 / 32256 GB DDR42x 2 TB NVMe2x 25 Gbps$305.34$305.34 (1 month)

Keep Reading

Two-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.

Open

NVMe endurance (TBW and DWPD)

How much data a flash drive can absorb before it wears out, and how to watch wear on your own machine.

Open

Back up data with rsync

Build dated, space-saving snapshot backups with rsync and hard links, pull them from a second machine and test restores.

Open

Storage servers

From 8 TB mirrors to a six-drive NVMe array of more than 90 TB raw, with ZFS or mdadm laid out by you.

Open

FAQ

Quick Answers

Run lsblk; the blank drive has no partitions or mount points under it.

Either works well. ext4 can shrink and is the Debian-family default; XFS is the Enterprise Linux default and excels with large files.

NVMe device names can change between boots; UUIDs stay the same.

It lets the system boot even if that drive cannot be mounted.

No. It arrives blank. Format it as separate space or build a mirror yourself.