Setting up an NVMe SSD on Ubuntu

I need a fast PC for some current work and decided that it’d be nice to use an NVMe SSD to speed up storage. I am using an Intel 750 PCIe 3.0 x4 add in card as it’s a simple way to go. Ubuntu has the NVMe driver built in so it came up straight away as /dev/nme0n1. One small issue is that gparted doesn’t seem to think this is a disk so it’s a case of reverting to old school command line stuff to get it set up for use.

First off is to create a partition:

sudo fdisk /dev/nvme0n1

Choose “n” to create a new partition, then “p” then “1” to create a new primary partition. Just use defaults for the sector numbers. Then “w” to write the data to the disk.

To create a file system on it:

sudo mkfs -t ext4 /dev/nvme0n1p1

Then create a mount point somewhere convenient:

sudo mkdir /media/nvme

Then mount the new partition on that mount point:

sudo mount /dev/nvme0n1p1 /media/nvme

At this point, the whole thing belongs to root which may not be what’s wanted. To change the ownership to a specific user (with the partition mounted):

sudo chown -R <user>:<user> /media/nvme

To get it to mount every time, add a line to /etc/fstab:

UUID=<nvme UUID> /media/nvme ext4 defaults 0 0

To find the UUID, enter:

sudo blkid

and then cut and paste the UUID for the NVMe drive.

To get some idea of performance, the hdparm command can be used.

%d bloggers like this: