Skip to content

Instantly share code, notes, and snippets.

@josephgoksu
Last active December 28, 2024 20:09
Show Gist options
  • Save josephgoksu/1e3dc688c68d4a933085806c3b9e7c71 to your computer and use it in GitHub Desktop.
Save josephgoksu/1e3dc688c68d4a933085806c3b9e7c71 to your computer and use it in GitHub Desktop.

If you just create a volume, you can attach it to the ec2

List available devices to find your new volume

lsblk
  1. Format the new volume with xfs:
sudo mkfs -t xfs /dev/nvme1n1 (make sure the name is correct)
  1. Create a mount point
sudo mkdir /data
  1. Mount the volume
sudo mount /dev/nvme1n1 /data
  1. Make it permanent by adding to fstab
echo "/dev/nvme1n1  /data  xfs  defaults,nofail  0  2" | sudo tee -a /etc/fstab

Check disk usage

df -h

Docker's disk usage

docker system df

Update the system

sudo yum update -y

Install Docker

sudo yum install docker -y

Start Docker service

sudo service docker start

Add your user to the docker group (replace 'ec2-user' if you're using a different user)

sudo usermod -a -G docker ec2-user

Enable Docker to start on boot

sudo systemctl enable docker

Verify Docker installation

docker --version
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment