AWS EBS Volmes - Create and attach the EBS volume with mounting


AWS EBS Volmes - Create and attach the EBS volume with mounting

AWS EBS Volmes - Create and attach the EBS volume with mounting

Create Volume from console

  • Login to AWS console
  • Goto menu Services -> Compute -> EC2 -> In Left Sidebar under Elastic Block Store -> click on Volume -> Create Volume
  • Fill the following parameter Create AWS EBS Volume

Attach a volume

  • Select the created volume, right click and select the “attach volume” option. Atach EBS Volume

Note: Volume and EC2 instance need to be in the same availability zone.

Mount to the folder

  • Now, login to your ec2 instance and list the available disks

    `lsblk’

    The above command will list the disk you attached to your instance

  • Check if the volume has any data

    sudo file -s /dev/xvdf or `sudo file -s /dev/nvme1n1’

    If the above command output shows “/dev/xvdf: data”, it means your volume is empty.

  • Format the volume to ext4 filesystem

    sudo mkfs -t ext4 /dev/xvdf or sudo mkfs -t ext4 /dev/nvme1n1

  • Create a directory of your choice to mount our new ext4 volume. I am using the name “/var/avolume”

    mkdir -p /var/avolume

  • Mount the volume to “/var/avolume” directory

    mount /dev/nvme1n1 /var/avolume

    cd into newvolume directory and check the disk space for confirming the volume mount.

     cd /var/avolume
     df -h .
    

    The above command would show the free space in the newvolume directory

  • To unmount the volume

    unmount /dev/nvme1n1

Related Post:

Why Python for Production Services

Vector Deployment Patterns

Vector Aggregator — Transform and Route

Vector Agent — Lightweight Log Collection

HashiCorp Vault — Centralized Secret Management

Vault Auth Methods — Token vs AppRole

Unit Tests for Business Logic

Test Coverage and CI Integration

Docker Swarm Deployment

Why Structured Logging Matters

structlog — JSON Logging with Context

Secret Workflow — Local to Production

Scheduled Security Scans

Production Operations Runbook

pytest — Fixtures, Conftest, and Async Testing

Pydantic — Request & Response Validation

Prometheus Metrics — RED Method

Project Structure with pyproject.toml

Pre-Commit Hooks for Security

Auto-Instrumentation for FastAPI

OpenTelemetry — Traces, Spans, and Context

Marathon/Mesos Deployment

Log Rotation and Disk Management

End-to-End Pipeline

Kubernetes Deployment

Kafka — Durable Log Transport

Jaeger — Visualizing Distributed Traces

Integration Tests for API Endpoints

Health Checks and Readiness Probes

Graceful Shutdown

GitHub Actions CI Pipeline

FastAPI — Async-First HTTP Framework

Error Handling & Response Models

Elasticsearch + Kibana — Search and Visualize

Dual Output — Stdout and File Logging

Docker — Containerize from Day One

Docker Compose Deployment

Dependency Updates and Maintenance

Dependency Auditing with pip-audit

Request-Scoped Logging with Correlation IDs

Container Security with Trivy

Environment-Based Config with pydantic-settings

Async Database Operations

API Versioning Strategies

RESTful Route Design with FastAPI Router

K8s Contributor Playground, Learning by Contributing

Git - Switch Remote URL

Git - Reset Commits

Git - Cheat Sheet

Git - Push with SSH

Git - Merge

Git - Init

Git - Project Lead/Manager

Git - Commit Files

Git - Create Branch

Git - Common Commands

Git - Branch Management

Adding Try in PWD button to README file

Docker Issues

Git - Basics for a Developer

Jenkins - Upgrade Jenkins

SED

Jenkins - Schedule

Elasticsearch - Dumping documents from multi-node to single node

CICD Jenkins - Send email with default content

Git - Intro

Linux - sed command

Arachni - VAPT Tool

VAPT - Vulnerability Assessment and Penetration Testing