Created
July 4, 2018 10:36
-
-
Save yarapavan/19adaf8d5c6eea7286c627e01a5a034c to your computer and use it in GitHub Desktop.
nvme-ec2.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AWS new instance type which are full HVM, utilizes NVMe interface for accessing the EBS volume, instead of paravirtual driver on HVM AMI. | |
With the following instances, EBS volumes are exposed as NVMe block devices: C5, C5d, i3.metal, M5, and M5d. The device names are /dev/nvme0n1, /dev/nvme1n1, and so on. The device names that you specify in a block device mapping are renamed using NVMe device names (/dev/nvme[0-26]n1). | |
Please type sudo lsblk to get the device listing e.g. when I have created another volume and attached as /dev/sdb, it is being shown as nvme1n1. | |
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT | |
nvme0n1 259:1 0 30G 0 disk | |
nvme0n1p1 259:2 0 1M 0 part | |
nvme0n1p2 259:3 0 30G 0 part / | |
nvme1n1 259:0 0 30G 0 disk | |
Now create a filesystem on it e.g. to create xfs filesytem | |
sudo mkfs -t xfs /dev/nvme1n1 | |
To verify the file system created, use command | |
sudo file -s /dev/nvme1n1 | |
/dev/nvme1n1: SGI XFS filesystem data (blksz 4096, inosz 512, v2 dirs) | |
Now get the UUID for the above device using command — sudo blkid. e.g | |
/dev/nvme1n1: UUID=”580892f3–345e-47e4-b054–07b677c2a277" TYPE=”xfs” | |
/dev/nvme0n1p2: UUID=”50a9826b-3a50–44d0-ad12–28f2056e9927" TYPE=”xfs” PARTUUID=”cc8f8c5a-3a04–4a6a-aa62-ed173ee9aede” | |
/dev/nvme0n1: PTTYPE=”gpt” | |
/dev/nvme0n1p1: PARTUUID=”c907a1e1-acff-46f8-a441-e67e98945e91" | |
Now append the /etc/fstab with the value like below | |
UUID=580892f3–345e-47e4-b054–07b677c2a277 /data xfs defaults 0 0 | |
To verify the mount is done correctly use command — mount -a | |
The following command can also be used to mount temporarily (without persistence on reboot) - | |
sudo mount -t xfs /dev/nvme1n1 /data | |
where /data is the mount directory. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment