Skip to content

Latest commit

 

History

History
67 lines (47 loc) · 1.17 KB

attach-volume.md

File metadata and controls

67 lines (47 loc) · 1.17 KB

ATTACH VOLUME

Commands

List block devices:

$ lsblk

The new disk will appear associated with , , etc.

Check if the volume has any data using the following command:

$ sudo file -s /dev/<nvme0n1>

Format the volume to ext4 filesystem using the following command:

$ sudo mkfs -t ext4 /dev/<nvme0n1>

Create a directory of your choice to mount our new ext4 volume:

$ sudo mkdir /<custom>/<attach>

Mount:

$ sudo mount /dev/<nvme0n1> /<custom>/<attach>

To add permantly ssd to ec2

Steps:

  • Restart instances after mount volume.
$ sudo blkid
$ sudo vim /etc/fstab
UUID=<UUIDcode> /<pathmount> <type> defaults,nofail 0 2

Final:

$ sudo umount /<pathmount>
$ sudo mount -a

Restart and check

  • Restart system.
$ lsblk

Resize

Use a file system-specific command to resize each file system to the new volume capacity. For a file system other than the examples shown here, refer to the documentation for the file system for instructions.

Use the resize2fs command to extend the file system on each volume:

$ sudo resize2fs /dev/<nvme0n1>